• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..25-Dec-2018-

COPYINGH A D25-Dec-201818 KiB354289

CREDITSH A D25-Dec-2018102 52

ChangeLogH A D25-Dec-201811.4 KiB282208

MakefileH A D25-Dec-2018435 2315

Makefile.24H A D25-Dec-20182 KiB8258

README.biosH A D25-Dec-20188.4 KiB245181

ToDoH A D25-Dec-20181.1 KiB3428

bios.hH A D25-Dec-20181.2 KiB397

bios_core.cH A D25-Dec-20184.5 KiB199111

comp.cH A D25-Dec-2018953 4834

filesystem.cH A D25-Dec-20187.3 KiB301199

flashchips.cH A D25-Dec-201813.8 KiB314249

flashchips.hH A D25-Dec-20182.4 KiB8238

pcisets.cH A D25-Dec-201816.5 KiB631431

pcisets.hH A D25-Dec-20181.4 KiB4615

procfs.cH A D25-Dec-20184.1 KiB163105

programming.cH A D25-Dec-201813.5 KiB540381

programming.hH A D25-Dec-20182.6 KiB7433

README.bios

1NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE!
2
3/dev/bios is obsolete and no longer under development.
4Please use the flashrom utility instead: https://www.flashrom.org/
5
6NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE!
7
8
9/dev/bios documentation						  2002/02/19
10
11Table of contents
12------------------
13
14  1. What is /dev/bios?
15  2. What hardware/software do I need to run /dev/bios?
16  3. Where to get the latest release of /dev/bios
17  4. How to get /dev/bios work
18  5. Writing to the devices
19  6. About PCI chipsets (ix86 only)
20  7. About APM Powermanagement (ix86 only)
21  8. About different flashchips.
22  9. Hints for BIOS flashing
23
24If you want better information on this driver, read the ChangeLog,
25mail me or read the source, Luke :-)
26
271. What is /dev/bios?
28----------------------
29
30This is a kernel driver for different kinds of (Flash)BIOSs that are
31available in today's hardware.
32
33There are well known BIOSs for
34 - System BIOS (resides at 0xe0000 on Intel PCs)
35 - graphics hardware
36 - SCSI host adapters
37 - networking interfaces with 'BOOT ROM'
38 - ...
39
40While in former times these BIOSs were implemented by using ROM or
41EPROM (both can't be updated without opening your computer) today's
42PC hardware is often delivered with so called FLASH ROMs. These
43can simply be updated by software. This driver has the approach to
44make Linux read and write flash roms.
45
46One word before you read ahead: This is still alpha software and
47writing to your flash roms may destroy them. So if you notice anything
48strange, don't even think about going on, but write some mail to:
49
50		Stefan Reinauer <stefan.reinauer@coreboot.org>
51
52Please note that I am not responsible in any way for what you
53do with this code or for what this code does with your computer.
54
552. What hardware/software do I need to run /dev/bios?
56------------------------------------------------------
57
58Currently this driver supports ix86 (mainly Pentium,
59PPro, PII/III, Athlon, but some 486s), Itanium and Alpha
60architecture.
61It supports all flash chips from 32k to 2M (theoretically).
62Minimum kernel version is v2.2.x, but it's wise to use a
632.4.x kernel.
64
653. Where to get the latest release of /dev/bios?
66-------------------------------------------------
67
68/dev/bios was recently integrated into the OpenBIOS CVS
69tree for easier maintainance. General information can be
70found on the /dev/bios status page:
71http://www.freiburg.linux.de/OpenBIOS/status/devbios.html
72Latest releases of /dev/bios can be found at the download page:
73http://www.freiburg.linux.de/OpenBIOS/dev/download.html
74Latest development trees of /dev/bios can be found in the
75OpenBIOS CVS. For information how to access it, go to
76http://www.freiburg.linux.de/OpenBIOS/dev/cvs.html
77
784. How do I get /dev/bios work
79-------------------------------
80
81Create the system bios device with
82
83	mknod /dev/bios c 104 0
84
85Now you can add devices for the other BIOSs (often known as option
86roms) in your Computer, i.e. like this:
87
88	mknod /dev/gfxbios c 104 1
89	mknod /dev/hddbios c 104 2
90	mknod /dev/netbios c 104 3
91
92The order of the devices may vary on your computer, maybe you even don't
93have a flash bios on your network card or on your scsi host adapter. You will
94have to decide this after playing  around a bit.
95
96Now you have to compile and insert the kernel driver module:
97
98	cd devbios
99	make clean && make
100	insmod bios.o
101
102Now you have a new device, /dev/bios and, if you have
103your kernel configured to have the /proc/ interface,
104you have a status file /proc/bios.
105
106Since this driver is in an early state, you should have
107a look at dmesg very often.
108
1095. Writing to the devices
110--------------------------
111
112If you insert bios.o without any options, you are not able
113to write any of the devices. To enable writing, you should
114use
115	insmod bios.o write=1
116
117Writing is now possible with i.e.
118   dd if=yourbios.bin of=/dev/bios bs=128k count=1
119or
120   dd if=yourbios.bin of=/dev/bios bs=256k count=1
121
122depending on the size of your flash chip.
123
124You can use 'cat' for flashing as well. Note: Many flashchips are
125sectored and the whole sector has to be rewritten, the 4k clusters
126of cat may be very slow (and an 112 kb sector has to be written 28
127times completely instead of 1 time with dd)
128
129Make sure that your file "yourbios.bin" is a valid bios image for
130your motherboard and that it is not pkzipped or exe-pkzipped.
131(Usually, a 128kb bios images consist of 112kb lha-compressed data,
1322*4kb ESCD and DMI (PnP) Data and an 8 kb emergency boot block.)
133
134Writing to /dev/bios does not work for many chips right now. Write
135accesses are ignored in this case. If you want an unsupported flash
136rom supported, please mail me.
137WARNING: Setting an unsupported chip to "supported" without changing
138the rest of the code will *very likely* destroy the contents of your
139chip.
140
141On machines with an AWARD bios you can test whether writing works
142safely by only deleting the ESCD/DMI memory on the flash chip.
143This data is rewritten by the bios when empty, corrupted or when
144you put in a new expansion device. In that case you should see a
145message stating "Updating ESCD" during the next boot.
146
147Please have a close look at the size of your flash chip. For 128k
148flash chips, try
149
150	dd if=/dev/zero of=/dev/bios bs=4096 seek=28 count=2
151
152For 256k flash chips, you _MUST_ use the following line instead,
153or your system bios is going byebye:
154
155	dd if=/dev/zero of=/dev/bios bs=4096 seek=56 count=2
156
157Attention: I found other machines with their ESCD memory in the
158first sectors of the flash chip. These are afaics 512k+ chips
159often connected via a firmware hub.
160Behaviour of other BIOSs may be similar, but I can't give you
161any warranty it works.
162
163NOTE: If you listen to music from your soundcard while flashing,
164you may get errors like this:
165	Sound: DMA (output) timed out - IRQ/DRQ config error?
166
167Second, sound switches off while flashing. This is because all
168IRQs are blocked while the write procedure to ensure it doesn't
169get disturbed by any other hardware.
170
1716. About PCI chipsets
172----------------------
173
174Because this driver uses direct PCI accesses to switch shadowing
175and write protection of the bios off on PC architecture, each PCI
176chipset (or at least chipset group) has to be implemented and
177tested seperately. Successfully tested PCI chipsets are
178
179	* Intel 430HX/TX, 440BX/ZX, 460, 8x0
180	* UMC 486 (8881F/8886A)
181	* VIA (M)VP3
182	* AMD Irongate and others
183	* ServerWorks chipsets
184	* NSC CS5530 (geode companion)
185
186Any success/error reports are highly welcome. If you need a certain
187system type supported, contact me.
188
189
1907. About APM Power Management (ix86 only)
191------------------------------------------
192
193This driver is known to cause kernel oopses with some of the chipset
194drivers when APM is enabled. Reason is that the flash chip is mapped
195to the low bios address space which makes the unpacked bios image vanish
196so all pointers to APM functions are invalid.
197Nowadays most of the chipset drivers only map the high bios area, so
198this problem should not occur on any but old UMC/SiS chipsets. If you
199encounter oopses while reading/probing flash devices, disable power
200management before any write attempts. To achieve so, please pass "apm=off"
201as a kernel option, if your kernel is compiled with APM support.
202
203
204
2058. About different flashchips
206------------------------------
207
208Flash chips, /dev/bios has been successfully tested (writing) on:
209
210	* Winbond 29EE011
211        * Intel 28F008(SA)
212	* Atmel AT29C512
213	* SST 29EE010, 39SF020
214
215It *should* work, if you see a "Supported: yes"  in /proc/bios, but
216I am not responsible in any way for what you do.. Please be careful.
217Please report any working flash chips so that this list can be completed.
218Currently many more flash chips than mentioned here will work.
219If you need a certain flash device supported, contact me.
220
2219. Hints for BIOS-Flashing
222---------------------------
223
224* Always try to write to the ESCD/DMI Memory before you overwrite the rest
225  of a bios (ix86) If you get ANY errors in dmesg output, DO NOT CONTINUE!
226* Always "diff" the new bios with the written image before rebooting
227* You may use comp, a little utility in the devbios source tree instead
228  of diff. It has a nicer output for binary files.
229* on Intel, only write the first 120k of an image to the System ROM, this keeps
230  the emergency bootblock working.
231
232************** FINAL NOTE *****************************
233
234If you want to help this project, send me
235
236 * /proc/bios-output
237 * dmesg-output (after insmodding the driver)
238 * your system-configuration
239   (e.g. output of lspci or /proc/bus/pci/devices)
240 * any comments
241 * any ideas
242
243			Stefan Reinauer <stefan.reinauer@coreboot.org>
244
245