diff options
author | 1996-09-25 12:26:59 +0000 | |
---|---|---|
committer | 1996-09-25 12:26:59 +0000 | |
commit | 5d95af854c2f4a5381994979ad5eb2971e090e15 (patch) | |
tree | 9e07cedbceac7407df0498a9b8892f6eca3ead04 | |
parent | shrink an error message (diff) | |
download | wireguard-openbsd-5d95af854c2f4a5381994979ad5eb2971e090e15.tar.xz wireguard-openbsd-5d95af854c2f4a5381994979ad5eb2971e090e15.zip |
prefer DOSPTYP_386BSD MBR partition; from tholo
-rw-r--r-- | sys/arch/i386/boot/disk.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/boot/start.S | 14 |
2 files changed, 20 insertions, 2 deletions
diff --git a/sys/arch/i386/boot/disk.c b/sys/arch/i386/boot/disk.c index 4bf990cca7c..e92bb57e771 100644 --- a/sys/arch/i386/boot/disk.c +++ b/sys/arch/i386/boot/disk.c @@ -78,10 +78,16 @@ devopen() dptr = (struct dos_partition *)&iobuf[DOSPARTOFF]; sector = LABELSECTOR; for (i = 0; i < NDOSPART; i++, dptr++) - if (dptr->dp_typ == DOSPTYP_386BSD) { + if (dptr->dp_typ == DOSPTYP_OPENBSD) { sector = dptr->dp_start + LABELSECTOR; break; } + if (i >= NDOSPART) + for (i = 0; i < NDOSPART; i++, dptr++) + if (dptr->dp_typ == DOSPTYP_386BSD) { + sector = dptr->dp_start + LABELSECTOR; + break; + } lp = &disklabel; Bread(sector++, lp); if (lp->d_magic != DISKMAGIC) { diff --git a/sys/arch/i386/boot/start.S b/sys/arch/i386/boot/start.S index 288c75326ad..dfb383cc2de 100644 --- a/sys/arch/i386/boot/start.S +++ b/sys/arch/i386/boot/start.S @@ -62,7 +62,8 @@ LOADSZ = 15 # size of unix boot PARTSTART = 0x1be # starting address of partition table NUMPART = 4 # number of partitions in partition table PARTSZ = 16 # each partition table entry is 16 bytes -BSDPART = 0xA5 # value of boot_ind, means bootable partition +BSDPART = 0xA6 # OpenBSD partition identification +OLDBSDPART = 0xA5 # 386/Net/FreeBSD partition identification BOOTABLE = 0x80 # value of boot_ind, means bootable partition .text @@ -179,6 +180,16 @@ again: addl $PARTSZ, %ebx data32 loop again +again2: + addr32 + movb %es:4(%ebx), %al + cmpb $OLDBSDPART, %al + data32 + je found + data32 + addl $PARTSZ, %ebx + data32 + loop again2 data32 movl $enoboot, %esi data32 @@ -378,6 +389,7 @@ endofcode: /* throw in a partition in case we are block0 as well */ /* flag, head, sec, cyl, typ, ehead, esect, ecyl, start, len */ . = _C_LABEL(boot1) + PARTSTART +startoflabel: .byte 0x0,0,0,0,0,0,0,0 .long 0,0 .byte 0x0,0,0,0,0,0,0,0 |