Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Oct 1995 14:51:01 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        tony@thing.sunquest.com
Cc:        hackers@FreeBSD.ORG
Subject:   Re: MBR/Win95/IDE (3 questions)
Message-ID:  <199510032151.OAA02081@phaeton.artisoft.com>
In-Reply-To: <9510032122.AA20987@thing.sunquest.com> from "tony@thing.sunquest.com" at Oct 3, 95 02:22:16 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> However, when the FreeBSD bootloader prompts me for a choice, where does it 
> get this info from ? Does the information on other bootable selections come 
> from the FreeBSD bootloader rescanning the MBR, or is there some configuration
> file I'm missing (I think the former, though since I can't find any 
> documentation [maybe I'm not looking in the right place] I guess there could 
> be some other config file I'm missing)

It gets the information from the partition table in the MBR (it is a
replacement for the DOS MBR, so it contains the partition table).

It has a table of partition ID to OS name translations.  That is how it
puts up the menu.

It will also allow you to boot to a second drive (0x81).

Assuming your BIOS doesn't break DX, which is where the boot drive
information is passed, a boot sector loaded from the second ("D:")
drive can be a regular boot sector, or also a boot loader.  If DX is
corrupted (some AMI BIOS, etc.), then you can only boot from the first
drive unless you start hacking OS specific boot records.

The boot selector on FreeBSD is not actually part of the OS.

When you select a partition from the menu (or the partition is autoselected
by using a DOS/Win95 MBR by looking for the 0x80 flag bit in the partition
table to pick the active drive), the loader loads the OS specific boot
record from the partition.  For BSD, this is the boot record that disklabel
puts out there.

That, in turn, uses the DX register to identify the drive, finds the BSD
partition in the partition table, and knows how to read the disklabel
itself to find "/" (slice 'a'), and knows how to read a directory (but
not a subdirectory) to find the kernel.  Then it reads in the kernel,
sets protected mode, and jumps to the kernel's '_main' ( 'btext' in
locore.s in /sys/i386/i386), which in turn calls main (in init_main.c
in /sys/kern).

And then you are running.

> I've heard a lot of people complaining about not being able to configure
> Win95 and FreeBSD via the FreeBSD bootloader. Has anyone been able to do
> this ?
> Any similar problems with FreeBSD and NT ?

I have had no problems with either.

Win95 when it is installed replaces the boot loader basically to get the
message "Starting Windows 95" in place of "Loading MSDOS".  It's a
cosmetic change.

When this happens, it will blow over any other MBR boot selector you have.

> I'm currently 100% SCSI, but will likely be getting El Cheapo EIDE disc for
> Windoze.

Don't buy an RZ1000 based IDE controller until Intel fixes the chips.

I don't see a difference in SCSI and IDE prices any more anyway.  For big
drives, SCSI is 1.3->2 times cheaper (plus EIDE doesn't have *really* big
drives yet).

> If the bios boots from the IDE disc, which I think is the default (I'll
> clearly need the FreeBSD bootloader on the IDE disk) does this imply
> that the boot default (if I don't select a device) will have to be a
> slice on the IDE disk (i.e Windoze, not FreeBSD). 

If you have an IDE disk and a SCSI disk, to boot FreeBSD from the SCSI
disk if the IDE is the first in the INT 13 chain, you will have to hack
both the boot loader and the files locore.s and autoconf.c (to set the
ddevice numbers, since the DX register only supports 0x80 and 0x81 drive
ID's) in /sys/i386/i386, then rebuild a kernel.

Or boot from floppy, giving explicit device names.

> Basically back to the above question of how the boot loader works, how (if
> at all) I can configure it.
> I'd like the default to always be boot FreeBSD, even if I the bios boots IDE.

Good luck, you'll need it.

> Otherwise, I guess I'm looking at disabling IDE booting in the BIOS, and then
> see if the FreeBSD boot loader from the SCSI disc will be able to boot
> Windoze off the IDE disc.

Yep.  Or using a floppy.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



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