diff options
author | Robert de Bath <rdebath@poboxes.com> | 2004-01-24 16:27:32 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:48:49 +0200 |
commit | beba34dc223aa0dcf3e5f696966c5e8408b022c3 (patch) | |
tree | ea0523ac242bd3e877338e9a771b975d4cd3839a /bootblocks | |
parent | b5dac1e3bdd01a2ce105df747a9073ff0d6a94e2 (diff) | |
download | dev86-beba34dc223aa0dcf3e5f696966c5e8408b022c3.tar.gz |
Import Dev86src-0.16.15.tar.gzv0.16.15
Diffstat (limited to 'bootblocks')
-rw-r--r-- | bootblocks/Makefile | 3 | ||||
-rw-r--r-- | bootblocks/boot_win.c | 20 |
2 files changed, 21 insertions, 2 deletions
diff --git a/bootblocks/Makefile b/bootblocks/Makefile index 9622817..60d8b8f 100644 --- a/bootblocks/Makefile +++ b/bootblocks/Makefile @@ -37,7 +37,8 @@ BOOTBLOCKS=sysboot.v noboot.v skip.v msdos.v msdos16.v \ EXTRAS=minix.h zimage.s minix_elks.c lsys.c boot_win.c -install: +install: makeboot + install -m 755 -s makeboot $(DIST)$(PREFIX)/bin/makeboot monitor.com: $(MOBJ) $(CC) $(CFLAGS) $(LDFLAGS) $(MONDEFS) -d $(MOBJ) -o monitor.com -M > monitor.sym diff --git a/bootblocks/boot_win.c b/bootblocks/boot_win.c index 5ee7180..e38eebb 100644 --- a/bootblocks/boot_win.c +++ b/bootblocks/boot_win.c @@ -35,6 +35,7 @@ main() { int i, rv; int floppy_only = 0; + int c,h,s,os; reset_screen(); cprintf("...\n"); @@ -52,8 +53,15 @@ main() if (!floppy_only) { for(rv=-1, i=0x1BE; i<0x1FE; i+= 16) { - if (bs_buf[i] == (char)0x80) + if (bs_buf[i] == (char)0x80) { rv = 0; + s = (bs_buf[i+2] & 63) ; + h = (bs_buf[i+1] & 255) ; + c = (bs_buf[i+3] & 255) + ((bs_buf[i+2] & 0xC0) << 2); + + os = (bs_buf[i+4] & 255) ; + break; + } } if (rv) { @@ -62,6 +70,16 @@ main() } } + if (!floppy_only && (os==4 || os==6 || os==11 || os==12 || os==13)) { + for(i=0; i<6; i++) + if (!(rv = _bios_disk_read(0x80, c, h, s, 1, bs_buf))) break; + + if (rv != 0 || bs_buf[510] != 0x55 || bs_buf[511] != (char)0xAA) { + cprintf("DOS Partition not bootable.\n"); + floppy_only = 1; + } + } + if (floppy_only) cprintf("Press return to wipe MBR: "); else |