Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jun 1998 17:38:04 -0400 (EDT)
From:      Bill Paul <wpaul@skynet.ctr.columbia.edu>
To:        mike@smith.net.au (Mike Smith)
Cc:        mike@smith.net.au, current@FreeBSD.ORG
Subject:   Re: 'fatal trap 12' on boot (smp and up)
Message-ID:  <199806302138.RAA05124@skynet.ctr.columbia.edu>
In-Reply-To: <199806281653.JAA19780@antipodes.cdrom.com> from "Mike Smith" at Jun 28, 98 09:53:32 am

next in thread | previous in thread | raw e-mail | index | archive | help
Of all the gin joints in all the towns in all the world, Mike Smith had 
to walk into mine and say:

> > floating around. One of them, which I think is a DSI, refuses to
> > run the FreeBSD boot block. (I say 'I think it's a DSI' because the
> > stupid machine doesn't have any identifying vendor markings on it
> > whatsoever.)
> 
> Eyecch.

Well, yeah. I looked at it some more today. There's an FCC compliance
sticker on the bottom that says 'NOTEBOOK COMPUTER' and that's it.
There's also a sticker that says 'Model 7200T' or something. It's a
real no-name laptop.
 
> > You can actually configure the thing to boot from internal disk,
> > floppy or CD-ROM. When I put the FreeBSD install floppy or CD-ROM
> > in and try to boot, it says 'Loading boot block from FLOPPY: FAILED'
> > or 'Loading boot block from CD-ROM: FAILED' and moves on to the
> > internal disk and loads LoseNT.
> > 
> > As a hack, I dug up a set of MS-DOG 6.22 floppies and put an
> > ATAPI CD-ROM driver on one of them so that I could boot the laptop
> > in MS-DOG and access the FreeBSD install CD. From there I ran
> > fbsdboot.exe, and successfully loaded the install kernel.
> > 
> > Clearly, the machine likes the MS-DOG bootstrap and the LoseNT
> > bootstrap, but not ours. Unfortunately, I don't think I'm clever
> > enough to find the exact problem myself, and I can't really load
> > FreeBSD on this machine since they need it with LoseNT (grrrr).
> 
> Just out of curiosity, what happens if you take the "MSDOS" signature 
> off the top of a DOS boot floppy and drop it onto the FreeBSD image? 
> (I realise the resulting bootblock won't work, but it would tell us 
>  something about the criteria they're using.)

I actually got it to work doing something like that. The following
patch to sys/i386/boot/biosboot/start.S in FreeBSd 2.2.6 makes it happy:

--- start.S	1998/06/30 19:59:50	1.1
+++ start.S	1998/06/30 21:15:07	1.2
@@ -75,6 +75,17 @@
 	.text	
 
 ENTRY(boot1)
+	/*
+	 * XXX This is here to make certain really brain-damaged
+	 * machines happy. Apparently, MS-DOG boot sectors start
+	 * with a short jump instruction followed by a no-op, and
+	 * some machines just refuse to load any boot block that
+	 * doesn't start the same way.
+	 */
+	jmp microsoft_sucks
+	nop
+microsoft_sucks:
+
 	/*
 	 * start (aka boot1) is loaded at 0x0:0x7c00 but we want 0x7c0:0
 	 * ljmp to the next instruction to adjust %cs


I disassembled the boot block from an MS-DOG floppy and it has
the following structure:

- short jump to 'foo'
- no-op instruction
- the string "MSDOS5.0"			(8 bytes)
- some junk				(33 bytes)
- the string "NO NAME    FAT12   "	(19 bytes)
- foo (start of boot block code)

Basically, there's a jump and a no-op, about 60 bytes of stuff, then
the start of the boot code. The jump skips over the 60 bytes of whatever.
Initially I duplicated all of this in start.S and yes, it worked. But
I wanted to see how much of this was really necessary so I started
whittling things down. It turns out that all you really need to make
the bastard happy is the jump and the no-op.

I don't know if this is something to do with the BIOS or something
peculiar about how the x86 CPUs work, but with these three bytes,
it loads the FreeBSD boot floppy fine. I'm sure Bruce Evans will
jump in eventually to explain everything, except why nobody thought
to do this in the first place.

If nobody objects seriously, I'm going to commit this change to 2.2.x
and -current in a couple days. (Or somebody else can do it sooner, if
they want.)

The only problem now is that I can't modify the copy of the boot blocks 
on my 2.2.6 CDs.

-Bill

-- 
=============================================================================
-Bill Paul            (212) 854-6020 | System Manager, Master of Unix-Fu
Work:         wpaul@ctr.columbia.edu | Center for Telecommunications Research
Home:  wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
=============================================================================
 "It is not I who am crazy; it is I who am mad!" - Ren Hoek, "Space Madness"
=============================================================================

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806302138.RAA05124>