Minor cleanups.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 9 Mar 2008 04:25:16 +0000 (23:25 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 9 Mar 2008 04:25:16 +0000 (23:25 -0500)
Improve some debugging messages.
Minor code clean ups.
Improve apmbios entry points (still untested).

src/boot.c
src/disk.c
src/post.c
src/romlayout.S
src/system.c

index 944eb21e556a6d82d2c95d0e856e9fc59c5421f5..76a501fbdee4aaae03843072357886261393bef4 100644 (file)
@@ -164,6 +164,9 @@ try_boot(u16 seq_nr)
         return;
     }
 
+    /* Debugging info */
+    BX_INFO("Booting from %x:%x\n", bootseg, bootip);
+
     memset(&cr, 0, sizeof(cr));
     cr.ip = bootip;
     cr.cs = bootseg;
index 129b058ab3224908d941b4fb03f26ae6d6d4abb7..b7d004d08f06daa1449d9060fa13727f30bc3a4d 100644 (file)
@@ -349,7 +349,7 @@ disk_1315(struct bregs *regs, u8 device)
     regs->cx = lba >> 16;
     regs->dx = lba & 0xffff;
 
-    disk_ret(regs, 0);
+    disk_ret(regs, DISK_RET_SUCCESS);
     regs->ah = 3; // hard disk accessible
 }
 
index eeb96e7c4abc8041888050a804956578c327e9c8..851dbaeeaaf4859d8f1879a082f2a736e9ccc740 100644 (file)
@@ -131,7 +131,6 @@ kbd_waitdata(u8 code)
 // keyboard_init
 //--------------------------------------------------------------------------
 // this file is based on LinuxBIOS implementation of keyboard.c
-// could convert to #asm to gain space
 static void
 keyboard_init()
 {
index 1bfb66bf1b368b239c3241a72c650e79246bd485..1aa0bbfcf9fde835bdf595365b9e5e55a29bff7c 100644 (file)
@@ -269,18 +269,28 @@ rombios32_gdt:
         // APM trampolines
         .globl apm16protected_entry
 apm16protected_entry:
+        pushfw          // save flags
+        pushl %eax      // dummy
         ENTRY handle_1553
+        addw $4, %sp    // pop dummy
+        popfw           // restore flags
         lretw
 
         .code32
         .globl apm32protected_entry
 apm32protected_entry:
-        pushw %cs
+        pushfw          // save flags
+        pushw %cs       // Setup for long jump to 16bitmode
         incw (%esp)
-        pushw apm16protected_entry
+        pushw 1f
         lcallw *(%esp)
+        addl $4, %esp   // pop call address
+        popfw
         lretl
         .code16gcc
+1:                      // 16bit entry point for apm32 code.
+        ENTRY handle_1553
+        lretw
 
         .org 0xe2c3
         IRQ_ENTRY nmi
index 70f9bcd42d307720ac355a147b2a113c1373bfe4..b1e4fe89c1ccc6a86810534f4757057c6e9a29ad 100644 (file)
@@ -419,7 +419,7 @@ handle_15(struct bregs *regs)
     case 0xe8: handle_15e8(regs); break;
     default:   handle_15XX(regs); break;
     }
-    debug_exit(regs);
+    //debug_exit(regs);
 }
 
 // INT 12h Memory Size Service Entry Point