John Nemeth wrote: > The following reply was made to PR bin/37656; it has been noted by GNATS. > > From: jnemeth%victoria.tc.ca@localhost (John Nemeth) > To: Eric Auge <eau%phear.org@localhost>, gnats-bugs%NetBSD.org@localhost > Cc: netbsd-bugs%NetBSD.org@localhost > Subject: Re: bin/37656: fdisk segfault on invalid MBR entries on non-x86 > geometry detection > Date: Wed, 2 Jan 2008 03:20:39 -0800 > > On May 25, 6:20am, Eric Auge wrote: > } Martin Husemann wrote: > } > The following reply was made to PR bin/37656; it has been noted by GNATS. > } > > } > From: Martin Husemann <martin%duskware.de@localhost> > } > Subject: Re: bin/37656: fdisk segfault on invalid MBR entries on non-x86 > geometry detection > } > Date: Wed, 2 Jan 2008 11:21:24 +0100 > } > > } > On Wed, Jan 02, 2008 at 02:13:59AM -0800, John Nemeth wrote: > } > > Not sure how this is handled, but yes the MBR would be all 0s. > } > > } > The MBR has a magic number at the end (see MBR_MAGIC_OFFSET and > MBR_MAGIC > } > in bootblock.h). > > The issue here is using the partition table to guess the disk > geometry. Obviously, if there isn't a valid partition table you can't > do that. BTW, I wrote code to do this 15 years ago. At that time, PC > BIOSes didn't have an "auto" setting for detecting disks automatically, > so you had to manually tell it the size of the disk. Usually if you > set the "type" to "47", it would let you enter the geometry manually. > My program told you what numbers to stick in there, so I called it > "type47". > > } Can fdisk fail in writing this magic number ? > > Only if there is a serious bug. > > } This is an fdisk generated MBR partitioning on the cobalt, all tests > } I've done were reporting this bad magic number. > > If that is the case, then it shouldn't have been using the > partition table to guess the disk geometry. yep but using what as we are not on x86 arch ? I don't think there is BIOS calls on cobalt, I'm no expert though. > > } But it now successfully boot, what the purpose of this "magic number" ? > > To let the BIOS know that it is a valid boot sector. If the > number isn't there, then the machine shouldn't boot at all. My previous post was including an fdisk output showing the "bad magic number" on each partition reported by fdisk but still the cobalt boot normally. fdisk was the tool used to build the partition. > }-- End of excerpt from Eric Auge Regards, Eric.
Description: OpenPGP digital signature