Minor cleanups.
Several minor comment improvements.
Rearrange some definitions to make them more clear.
diff --git a/TODO b/TODO
index c19b5a8..5d6be5c 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,13 @@
+Split rombios32.c up into multiple files.
+
+Review changes committed to coreboot, virtualbox, qemu, kvm, and bochs
+cvs tip.
+
+Alter ISRs so that they do not enable irqs. Only call out to other
+bios functions after minimizing stack usage.
+
+Try to write a script to analyze stack usage of 16bit code.
+
Audit all sti/cli calls. Audit all call16 calls to make sure flags is
setup properly with respect to irqs.
@@ -17,12 +27,7 @@
Cleanup setting of ES on GET/SET_BDA
-Make sure inline assembly isn't preventing inlining of calling
-functions.
-
-Convert remaining parts of rombios.c to new code.
-
-Convert rombios32 and apm bios stuff to new code.
+Possibly implement 32bit pcibios support.
Allow one to select adding 32 bit code to 0xf000 or in a separate
location.
diff --git a/src/apm.c b/src/apm.c
index 1cb054c..1d8ceef 100644
--- a/src/apm.c
+++ b/src/apm.c
@@ -19,7 +19,7 @@
u8 c = GET_VAR(CS, *s);
if (!c)
break;
- outb(c, 0x8900);
+ outb(c, PORT_BIOS_APM);
s++;
}
}
diff --git a/src/cmos.h b/src/cmos.h
index 3bc4bef..8a588e9 100644
--- a/src/cmos.h
+++ b/src/cmos.h
@@ -26,8 +26,6 @@
#define CMOS_FLOPPY_DRIVE_TYPE 0x10
#define CMOS_DISK_DATA 0x12
#define CMOS_EQUIPMENT_INFO 0x14
-#define CMOS_MEM_BASE_LOW 0x17
-#define CMOS_MEM_BASE_HIGH 0x18
#define CMOS_DISK_DRIVE1_TYPE 0x19
#define CMOS_DISK_DRIVE2_TYPE 0x1a
#define CMOS_DISK_DRIVE1_CYL 0x1b
diff --git a/src/ioport.h b/src/ioport.h
index 2392adf..fe0d7ce 100644
--- a/src/ioport.h
+++ b/src/ioport.h
@@ -38,6 +38,9 @@
#define PORT_FD_STATUS 0x03f4
#define PORT_FD_DATA 0x03f5
#define PORT_HD_DATA 0x03f6
+#define PORT_FD_DIR 0x03f7
+#define PORT_BIOS_DEBUG 0x0403
+#define PORT_BIOS_APM 0x8900
// PORT_PIC1 bitdefs
#define PIC1_IRQ5 (1<<5)
diff --git a/src/output.c b/src/output.c
index 3d53613..fc77c21 100644
--- a/src/output.c
+++ b/src/output.c
@@ -20,14 +20,11 @@
call16_int(0x10, &br);
}
-// XXX - move PORT_DEBUG to standard place?
-#define PORT_DEBUG 0x403
-
// Write a charcter to the framebuffer.
static void
putc(u16 action, char c)
{
- outb(c, PORT_DEBUG);
+ outb(c, PORT_BIOS_DEBUG);
if (action) {
if (c == '\n')
screenc('\r');
diff --git a/src/post.c b/src/post.c
index 1b9fc5b..64f42bb 100644
--- a/src/post.c
+++ b/src/post.c
@@ -11,7 +11,7 @@
#include "cmos.h" // CMOS_*
#include "util.h" // memset
#include "biosvar.h" // struct bios_data_area_s
-#include "ata.h" // ata_detect
+#include "ata.h" // hard_drive_setup
#include "kbd.h" // kbd_setup
#include "disk.h" // floppy_drive_setup
@@ -33,11 +33,7 @@
// mov CMOS Equipment Byte to BDA Equipment Word
SET_BDA(equipment_list_flags, inb_cmos(CMOS_EQUIPMENT_INFO));
-}
-static void
-init_handlers()
-{
// set vector 0x79 to zero
// this is used by 'gardian angel' protection system
SET_BDA(ivecs[0x79].seg, 0);
@@ -183,7 +179,6 @@
BX_INFO("Start bios\n");
init_bda();
- init_handlers();
init_ebda();
timer_setup();
diff --git a/src/rombios32.c b/src/rombios32.c
index 3751257..e0d595b 100644
--- a/src/rombios32.c
+++ b/src/rombios32.c
@@ -1652,7 +1652,7 @@
start = (void *)(bios_table_cur_addr);
#endif
- p = (char *)start + sizeof(struct smbios_entry_point);
+ p = (char *)start + sizeof(struct smbios_entry_point);
#define add_struct(fn) { \
q = (fn); \
diff --git a/src/system.c b/src/system.c
index 1db679b..89d68f1 100644
--- a/src/system.c
+++ b/src/system.c
@@ -6,7 +6,7 @@
// This file may be distributed under the terms of the GNU GPLv3 license.
#include "util.h" // irq_restore
-#include "biosvar.h" // CONFIG_BIOS_TABLE
+#include "biosvar.h" // BIOS_CONFIG_TABLE
#include "ioport.h" // inb
#include "cmos.h" // inb_cmos