Subject: port-i386/6887: fdisk -i makes disk unbootable
To: None <>
From: Wolfgang Helbig <helbig@Informatik.BA-Stuttgart.DE>
List: netbsd-bugs
Date: 01/27/1999 10:52:28
>Number:         6887
>Category:       port-i386
>Synopsis:       fdisk -i makes disk unbootable
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-i386-maintainer (NetBSD/i386 Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 27 02:05:01 1999
>Originator:     Wolfgang Helbig
>Release:        NetBSD-current Jan 23 1999
NetBSD 1.3I (RVC1) #1: Sun Jan 24 19:01:26 CET 1999
cpu0: family 6 model 5 step 2
cpu0: Intel Pentium II (686-class)
real mem  = 133824512
avail mem = 123015168
using 1659 buffers containing 6795264 bytes of memory
pcib0 at pci0 dev 7 function 0
pcib0: vendor 0x1106 product 0x0586 (rev. 0x41)
pciide0 at pci0 dev 7 function 1: VIA Technologies VT82C586A IDE Controller
pciide0: bus-master DMA support present
pciide0: primary channel configured to compatibility mode
wd0 at pciide0 channel 0 drive 0: <WDC AC310100B>
wd0: drive supports 16-sector pio transfers, lba addressing
wd0: 9671MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 19807200 sectors
wd0: 32-bits data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2

System: NetBSD rvc1 1.3I NetBSD 1.3I (RVC1) #1: Sun Jan 24 19:01:26 CET 1999 helbig@rvc1:/usr/src/sys/arch/i386/compile/RVC1 i386

	After doing an fdisk -i, the system doesn't boot. After started
	by the BIOS, the mbr-code either hangs w/o any messages or
	on a machine with a i486/100MHz the mbr prints the message
		Error loading operating system.
	To recover, I did an fdisk -i from a NetBSD-1.3.2-boot floppy. This
	gives you a bootable disk again.
	See above
	I tried to fix the code in mbr.S, but to no avail. I found out,
	that the 32-bit address prefix ("addr32") seems to confuse the
	Pentium II. It hangs after the first such instruction in boot: 
	Removing those prefixes leads to a "Error loading operation system"
	message. The mbr used the int13-extension branch. I forced it
	to jump to the noext: branch. Removing the addr32-prefixes
	again gives
		"Error loading operation system"
	I don't know of any way to fix the mbr-code and strongly suggest
	to use the NetBSD-1.3.2 mbr, which works flawlessly on both
	the Pentium II with 10 GB-disk and on the i486 with 800 MB-disk.
	Both disks have one used DOS-partition, homing the NetBSD-system.