Misc minor improvements.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 17 Aug 2008 15:26:42 +0000 (11:26 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 17 Aug 2008 15:26:42 +0000 (11:26 -0400)
Update TODO list.
Improve comments in boot.c.
Use debug port 0x0402 instead of 0x0403 (bochs prefers the latter).
Fix formatting of debug messages in kbd.c.
Use proper return check for kbd and mouse init.

TODO
src/boot.c
src/ioport.h
src/kbd.c
src/mouse.c

diff --git a/TODO b/TODO
index 5ad04282c5e389ac4d1ce2ccade76f841df5899b..fa3d8a3a43a6f0a7c9000ae893214d4a3fa75b28 100644 (file)
--- a/TODO
+++ b/TODO
@@ -10,6 +10,11 @@ machine.
 
 Fix keyboard LEDs.
 
+Improve option rom handling.  A real bios can copy the option roms
+from PCI space.  Also, there is no handling for BCVs today.
+
+Clean up and clarify usage/scope of .bss and .data variables.
+
 Review changes committed to coreboot, virtualbox, qemu, kvm, and bochs
 cvs tip.
   * bochs cvs (1.209)         -- all changes synched
@@ -51,6 +56,9 @@ location.
 
 See if it is possible to handle interrupts while in 32bit mode.
 
+Add a kconfig style configuration program instead of requiring users
+to modify config.h.
+
 Look at integrating the lgpl vgabios into tree.
 
 Look at usb booting specs.  Look at possibly supporting usb
index 3efa9b6e5a347d6a7f109bba4caab5ebee5e865b..1b5c3d8a9dcbe6bf8ef03857d47c2ae1b14cdab9 100644 (file)
@@ -1,4 +1,4 @@
-// 16bit code to load disk image and start system boot.
+// Code to load disk image and start system boot.
 //
 // Copyright (C) 2008  Kevin O'Connor <kevin@koconnor.net>
 // Copyright (C) 2002  MandrakeSoft S.A.
@@ -107,8 +107,8 @@ try_boot(u16 seq_nr)
     u8 bootdrv = 0;
     struct bregs cr;
     switch(type) {
-    case IPL_TYPE_FLOPPY: /* FDD */
-    case IPL_TYPE_HARDDISK: /* HDD */
+    case IPL_TYPE_FLOPPY:
+    case IPL_TYPE_HARDDISK:
 
         bootdrv = (type == IPL_TYPE_HARDDISK) ? 0x80 : 0x00;
         bootseg = 0x07c0;
@@ -213,5 +213,5 @@ handle_19()
 }
 
 // Ughh - some older gcc compilers have a bug which causes VISIBLE32
-// functions to not be exported as global variables.
+// functions to not be exported as global variables.
 asm(".global handle_18, handle_19");
index 2ac8602daffd4ad7e4380ba90306863518ae1e62..0db987ce8f843f35dfaba017aa5e195a818eb6ea 100644 (file)
@@ -41,7 +41,7 @@
 #define PORT_FD_DIR            0x03f7
 #define PORT_PCI_CMD           0x0cf8
 #define PORT_PCI_DATA          0x0cfc
-#define PORT_BIOS_DEBUG        0x0403
+#define PORT_BIOS_DEBUG        0x0402
 #define PORT_BIOS_APM          0x8900
 
 // PORT_KBD_CTRLB bitdefs
index 11d11d3aa0da853ca70925bf081a2906d9b28c20..5d7d76aedcd6ce58c5b29c1490ea3bba7c2f4cac 100644 (file)
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -30,7 +30,7 @@ keyboard_init()
     if (ret)
         return;
     if (param[0] != 0x55) {
-        dprintf(1, "i8042 self test failed (got %x not 0x55\n", param[0]);
+        dprintf(1, "i8042 self test failed (got %x not 0x55)\n", param[0]);
         return;
     }
 
@@ -39,7 +39,7 @@ keyboard_init()
     if (ret)
         return;
     if (param[0] != 0x00) {
-        dprintf(1, "i8042 keyboard test failed (got %x not 0x00\n", param[0]);
+        dprintf(1, "i8042 keyboard test failed (got %x not 0x00)\n", param[0]);
         return;
     }
 
@@ -55,10 +55,10 @@ keyboard_init()
     /* ------------------- keyboard side ------------------------*/
     /* reset keyboard and self test  (keyboard side) */
     ret = kbd_command(ATKBD_CMD_RESET_BAT, param);
-    if (ret < 0)
+    if (ret != 0 && ret != 2)
         return;
     if (param[0] != 0xaa) {
-        dprintf(1, "keyboard self test failed (got %x not 0xaa\n", param[0]);
+        dprintf(1, "keyboard self test failed (got %x not 0xaa)\n", param[0]);
         return;
     }
 
index 7a74ebad262e360690e60feaf0c0abb8db308b88..1435c92fe7a4bd3f302010c3423650dd79c985c9 100644 (file)
@@ -97,7 +97,7 @@ mouse_15c201(struct bregs *regs)
 {
     u8 param[2];
     int ret = aux_command(PSMOUSE_CMD_RESET_BAT, param);
-    if (ret < 0) {
+    if (ret != 0 && ret != 2) {
         set_code_fail(regs, RET_ENEEDRESEND);
         return;
     }