Minor cleanups.
authorKevin O'Connor <kevin@koconnor.net>
Tue, 6 May 2008 23:49:01 +0000 (19:49 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 6 May 2008 23:49:01 +0000 (19:49 -0400)
Several minor comment improvements.
Rearrange some definitions to make them more clear.

TODO
src/apm.c
src/cmos.h
src/ioport.h
src/output.c
src/post.c
src/rombios32.c
src/system.c

diff --git a/TODO b/TODO
index c19b5a853de983056c90d029b06f8cc9feff9c06..5d6be5c850f777bd555a260482cdd7dc54b9adb9 100644 (file)
--- 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 @@ Fix makefiles so that they rebuild the required files automatically.
 
 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.
index 1cb054ce8f5dc38c236822c401ae569241d02c0e..1d8ceef0c99017179cd1b1cc7ff6e50b2583756a 100644 (file)
--- a/src/apm.c
+++ b/src/apm.c
@@ -19,7 +19,7 @@ out_str(const char *str_cs)
         u8 c = GET_VAR(CS, *s);
         if (!c)
             break;
-        outb(c, 0x8900);
+        outb(c, PORT_BIOS_APM);
         s++;
     }
 }
index 3bc4bef3055bc67f77ba00bc4d59a9d6b858eda1..8a588e9d86da8d73f861f0a8c399264289a6af55 100644 (file)
@@ -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
index 2392adffdff2284af45f6ffb0f54139f083febe8..fe0d7ce80b165dfb7b9f2e2dad847bd656cbaf34 100644 (file)
@@ -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)
index 3d5361366ef69fcee78ea99a4af89c1508ff08c8..fc77c214899c91e7e39f0c58ab2515ceb9591a31 100644 (file)
@@ -20,14 +20,11 @@ screenc(u8 c)
     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');
index 1b9fc5bfe1b46f2d51bb232b353d8d809181594e..64f42bb213228561ef53288395bf7112ab329712 100644 (file)
@@ -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 @@ init_bda()
 
     // 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 @@ post()
     BX_INFO("Start bios\n");
 
     init_bda();
-    init_handlers();
     init_ebda();
 
     timer_setup();
index 3751257117ee7815d2cb0cd5bab8f77714156cff..e0d595bcafc933e0d9d7976162c575d5e878624c 100644 (file)
@@ -1652,7 +1652,7 @@ void smbios_init(void)
     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); \
index 1db679b229ad023479cb557605568f2e6d01a043..89d68f13a66e8aa9c499a6ff0665d45ccb4be510 100644 (file)
@@ -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