The string is special, so it's better to define it in assembler.
#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
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);
// 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