Move $PnP string from boot.c to romlayout.S.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 6 Jul 2008 13:30:47 +0000 (09:30 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 6 Jul 2008 13:30:47 +0000 (09:30 -0400)
The string is special, so it's better to define it in assembler.

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

index 687be346dc5d2c6be9ca26ee8fcee70cdd01c771..850fb2554c42ebcfbe36ee9348d026eed657135e 100644 (file)
 #include "disk.h" // cdrom_boot
 #include "bregs.h" // struct bregs
 
-// We need a copy of this string, but we are not actually a PnP BIOS,
-// so make sure it is *not* aligned, so OSes will not see it if they
-// scan.
-char pnp_string[] VISIBLE16 __attribute__((aligned (2))) = " $PnP";
-
 //--------------------------------------------------------------------------
 // print_boot_device
 //   displays the boot device
index 5198a86e62855bc506d26b59b1f988916bec2b2a..0a64f179320f8e2fb91f7aad19a1d105aa8e2cab 100644 (file)
@@ -211,7 +211,7 @@ callrom(u16 seg, u16 offset)
     br.es = SEG_BIOS;
     // starts 1 past for alignment
     extern char pnp_string[];
-    br.di = (u32)pnp_string - BUILD_BIOS_ADDR + 1;
+    br.di = (u32)pnp_string - BUILD_BIOS_ADDR;
     br.cs = seg;
     br.ip = offset;
     call16(&br);
index 637fca7b9ef0537b17bf668dcd4702575bdcdb89..cd1de84f8ebe609014b3aaadffb3339f6a993bff 100644 (file)
@@ -364,6 +364,15 @@ rombios32_gdt:
         // 16 bit data segment base=0x0 limit=0xffff (REAL_MODE_DS)
         .word 0xffff, 0, 0x9300, 0x0000
 
+// We need a copy of this string in the 0xf000 segment, but we are not
+// actually a PnP BIOS, so make sure it is *not* aligned, so OSes will
+// not see it if they scan.
+        .global pnp_string
+        .balign 2
+        .byte 0
+pnp_string:
+        .ascii "$PnP"
+
 
 /****************************************************************
  * Interrupt entry points