Convert bootup code (int18/int19) to 32bit mode.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 6 Jul 2008 14:14:49 +0000 (10:14 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 6 Jul 2008 14:14:49 +0000 (10:14 -0400)
The boot entry points should not require 16bit mode, so use 32bit mode
    instead.

Makefile
src/boot.c
src/romlayout.S

index caf3fcc4269a9900c8ca1cddc0fcb41d7528bf63..30a394365a6c44f17bfd9d3457a3a1e1bffc7014 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,10 +8,10 @@
 OUT=out/
 
 # Source files
-SRCBOTH=output.c util.c floppy.c ata.c system.c mouse.c kbd.c pci.c boot.c \
-        serial.c clock.c pic.c
-SRC16=$(SRCBOTH) disk.c cdrom.c apm.c pcibios.c
-SRC32=$(SRCBOTH) post.c shadow.c post_menu.c memmap.c coreboot.c \
+SRCBOTH=output.c util.c floppy.c ata.c system.c mouse.c kbd.c pci.c \
+        serial.c clock.c pic.c cdrom.c
+SRC16=$(SRCBOTH) disk.c apm.c pcibios.c
+SRC32=$(SRCBOTH) post.c shadow.c post_menu.c memmap.c coreboot.c boot.c \
       acpi.c pirtable.c smm.c smpdetect.c mptable.c smbios.c pciinit.c
 TABLESRC=font.c cbt.c floppy_dbt.c
 
index 850fb2554c42ebcfbe36ee9348d026eed657135e..9bbbf07f9d00931489640a3407ad8efbaaefce2e 100644 (file)
@@ -77,8 +77,6 @@ print_boot_failure(u16 type, u8 reason)
 static void
 try_boot(u16 seq_nr)
 {
-    irq_enable();
-
     SET_EBDA(ipl.sequence, seq_nr);
 
     u32 bootdev = GET_EBDA(ipl.bootorder);
@@ -193,7 +191,7 @@ do_boot(u16 seq_nr)
 }
 
 // Boot Failure recovery: try the next device.
-void VISIBLE16
+void VISIBLE32
 handle_18()
 {
     debug_serial_setup();
@@ -203,7 +201,7 @@ handle_18()
 }
 
 // INT 19h Boot Load Service Entry Point
-void VISIBLE16
+void VISIBLE32
 handle_19()
 {
     debug_serial_setup();
index cd1de84f8ebe609014b3aaadffb3339f6a993bff..6eda03681874de5b0906854b051e2f5a49de9f90 100644 (file)
         xorw %ax, %ax
         movw %ax, %ss
         movl $ BUILD_STACK_ADDR , %esp
+        cld
         .endm
 
         // Specify a location in the fixed part of bios area.
@@ -130,8 +131,6 @@ post16:
 
         pushl $_code32__start
 
-        cld
-
         // Fall through to transition32 function below
 
 
@@ -432,12 +431,14 @@ pnp_string:
         .global entry_19
 entry_19:
         RESET_STACK
-        ENTRY handle_19
+        pushl $_code32_handle_19
+        jmp transition32
 
         .global entry_18
 entry_18:
         RESET_STACK
-        ENTRY handle_18
+        pushl $_code32_handle_18
+        jmp transition32
 
         // IRQ trampolines
         .macro IRQ_TRAMPOLINE num