1 |
|
---|
2 | Notes on BIOS usage
|
---|
3 | -------------------
|
---|
4 |
|
---|
5 | - DOS (including 6.22/7.1) does not need INT 15h or INT 1Ah. Most other
|
---|
6 | operating systems require INT 15h to detect installed memory.
|
---|
7 |
|
---|
8 | - OS/2 (WSeB/MCP/ACP) and Windows 98 SE are some of the very few operating
|
---|
9 | systems which use the El Torito floppy emulation.
|
---|
10 |
|
---|
11 | - Keystroke check (INT 16h, fn 01h/10h) always enables interrupts on return.
|
---|
12 | DOS POWER.EXE depends on that in some situations.
|
---|
13 |
|
---|
14 | - MS-DOS 6.2/V is a rare user of the INT 15h keyboard intercept routines.
|
---|
15 |
|
---|
16 | - Some software uses the model byte at F000:FFFE to determine the system
|
---|
17 | type (PC-DOS 3.0, Norton Utilities 8). Other software first tries INT 15h,
|
---|
18 | fn C0h instead (PC-DOS 3.1, MSD).
|
---|
19 |
|
---|
20 | - DOS 4.01 (both IBM and Microsoft) calls INT 13h to read from disk with less
|
---|
21 | than 100 bytes of stack space early in the boot sequence.
|
---|
22 |
|
---|
23 | - Very few guests use the 32-bit BIOS interface. One is OS/2 (but falls back),
|
---|
24 | another is Etherboot.
|
---|
25 |
|
---|
26 | - OS/2 is the only known guest which can run the 16-bit PCI BIOS in protected
|
---|
27 | mode (but only if the 32-bit PCI BIOS is unavailable).
|
---|
28 |
|
---|
29 | - Any disk reads which use bus-master DMA (AHCI, IDE BM) must use VDS
|
---|
30 | (Virtual DMA Services) when present. Otherwise any reads/writes when the
|
---|
31 | real mode addresses don't map directly to physical addresses will fail
|
---|
32 | horribly. DOS 6.x with EMM386 is a good testcase (esp. loading drivers
|
---|
33 | into UMBs).
|
---|
34 |
|
---|
35 | - Many older OSes (especially UNIX based) require the FDPT to contain
|
---|
36 | physical ATA disk geometry; for that reason, disks smaller than ~500MB are
|
---|
37 | easiest to use. Otherwise a "large" BIOS disk option would be required.
|
---|
38 |
|
---|
39 | - Some really old OSes (Xenix circa 1986-7) do not understand the EBDA idea
|
---|
40 | and clear the memory. For those, the FDPT must be in the BIOS ROM area, or
|
---|
41 | the OS will destroy it (even when it's at 0:300 in the IVT).
|
---|
42 |
|
---|
43 | - Windows 98 SE boot CD uses 32-bit registers in real mode and will fail in
|
---|
44 | mysterious ways if BIOS trashes high bits of EAX (and likely others).
|
---|
45 |
|
---|
46 | - PC DOS 6.x/7.x QCONFIG is a rare user of INT 16h fn 0Ah (read keyboard ID).
|
---|
47 |
|
---|
48 |
|
---|
49 | Notes on BIOS implementation
|
---|
50 | ----------------------------
|
---|
51 |
|
---|
52 | - To return values from functions not declared as __interrupt, the arguments
|
---|
53 | may need to be declared volatile (not ideal, but does the job).
|
---|
54 |
|
---|
55 | - The way the POST code selectively clears or doesn't clear memory
|
---|
56 | is extremely suspect and will need reworking.
|
---|
57 |
|
---|
58 | - Need to review string routines wrt direction flag (should be OK now).
|
---|
59 |
|
---|
60 | - Need to review CMOS access wrt interrupts (possible index reg change by
|
---|
61 | an interrupt handler).
|
---|
62 |
|
---|
63 | - The POST code zeroes the entire BDA, and then various bits zero specific
|
---|
64 | parts of the BDA again. That's a waste of time.
|
---|
65 |
|
---|
66 | - After a reset, all interrupts are unmasked. Not sure if that's OK.
|
---|
67 |
|
---|
68 | - BCC mishandles the following (where buf is an uint8_t array):
|
---|
69 | lba=buf[0x2B]*0x1000000+buf[0x2A]*0x10000+buf[0x29]*0x100+buf[0x28];
|
---|
70 | The buf[x]*100 expression should end up being of type signed int, which
|
---|
71 | causes the sign to be incorrectly propagated. BCC incorrectly keeps
|
---|
72 | the type unsigned.
|
---|
73 |
|
---|
74 |
|
---|
75 |
|
---|
76 | Code size notes (code as of 7/6/2011):
|
---|
77 |
|
---|
78 | The following values are the size of the _TEXT segment, i.e. only C code;
|
---|
79 | data defined in C is not included, neither are assembly modules.
|
---|
80 |
|
---|
81 | Options: Size (hex):
|
---|
82 | -------- -----------
|
---|
83 | -0 -zu -s -oas -ecc 631A
|
---|
84 | -3 -zu -s -oas -ecc 5C1E
|
---|
85 | -0 -zu -s -oas 578A
|
---|
86 | -3 -zu -s -oas 5452
|
---|
87 |
|
---|
88 | Both generating 386 code and using register-based calling convention for
|
---|
89 | internal functions brings significant size savings (15% when combined).
|
---|