diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1998-06-11 02:30:58 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1998-06-11 02:30:58 +0000 |
commit | a824a6c7f79162ccf68e6c798e8ce643adf33032 (patch) | |
tree | 02d99c72ffcec57609735a4be55031c51314c966 /sys | |
parent | 51fd26726d0141217d776a55a8c3fae410db6527 (diff) |
put missed changes that support booting from floppy (;
i applodgize for any inconvinience this memory hole caused to people.
ps. i would like to know the snapshots schedule to issue extra testing
cycles to ensure i did not forget anything.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/stand/libsa/biosdev.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c index 899a7dc50e0..84bbf84a81c 100644 --- a/sys/arch/i386/stand/libsa/biosdev.c +++ b/sys/arch/i386/stand/libsa/biosdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: biosdev.c,v 1.51 1998/04/18 07:39:42 deraadt Exp $ */ +/* $OpenBSD: biosdev.c,v 1.52 1998/06/11 02:30:57 mickey Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -307,30 +307,36 @@ bios_getdisklabel(bd, label) if(bd->bios_heads == 0 || bd->bios_sectors == 0) return("failed to read disklabel"); - /* Read MBR */ - btochs(DOSBBSECTOR, cyl, head, sect, bd->bios_heads, bd->bios_sectors); + /* MBR is a hard thing */ + if (bd->bios_number & 0x80) { + /* Read MBR */ + btochs(DOSBBSECTOR, cyl, head, sect, + bd->bios_heads, bd->bios_sectors); - error = biosd_io(F_READ, bd->bios_number, cyl, head, sect, 1, &mbr); - if(error) - return(biosdisk_err(error)); - - /* check mbr signature */ - if (mbr.dmbr_sign != DOSMBR_SIGNATURE) - return("bad MBR signature\n"); + error = biosd_io(F_READ, bd->bios_number, + cyl, head, sect, 1, &mbr); + if(error) + return(biosdisk_err(error)); - /* Search for OpenBSD partition */ - for (off = 0, i = 0; off == 0 && i < NDOSPART; i++) - if (mbr.dmbr_parts[i].dp_typ == DOSPTYP_OPENBSD) - off = mbr.dmbr_parts[i].dp_start + LABELSECTOR; + /* check mbr signature */ + if (mbr.dmbr_sign != DOSMBR_SIGNATURE) + return("bad MBR signature\n"); - /* just in case */ - if (off == 0) + /* Search for OpenBSD partition */ for (off = 0, i = 0; off == 0 && i < NDOSPART; i++) - if (mbr.dmbr_parts[i].dp_typ == DOSPTYP_NETBSD) + if (mbr.dmbr_parts[i].dp_typ == DOSPTYP_OPENBSD) off = mbr.dmbr_parts[i].dp_start + LABELSECTOR; - if (off == 0) - return("no BSD partition\n"); + /* just in case */ + if (off == 0) + for (off = 0, i = 0; off == 0 && i < NDOSPART; i++) + if (mbr.dmbr_parts[i].dp_typ == DOSPTYP_NETBSD) + off = mbr.dmbr_parts[i].dp_start + LABELSECTOR; + + if (off == 0) + return("no BSD partition\n"); + } else + off = LABELSECTOR; /* Load BSD disklabel */ buf = alloca(DEV_BSIZE); |