Subject: Re: File system image
To: Brian Rose <saider@gate.net>
From: Perry E. Metzger <perry@piermont.com>
List: tech-embed
Date: 02/08/2003 12:26:09
Brian Rose <saider@gate.net> writes:
> 1) PC BIOS boots and loads the first stage boot loader.

Okay, first of all, what is a "first stage boot loader" -- there isn't
really one per se on an x86.

The MBR has a tiny bit of code that loads a block from the start of
the MBR partition with NetBSD on it. That block has the addresses of
/boot hard coded into it by installboot(8), and loads /boot in.

So you can see that already there is complexity involved just in your
notion of "first stage boot loader" -- in fact we have the BIOS, then
the MBR, then the boot block in the active MBR partition, and then the
/boot program.

> 2) The first stage boot loader looks at the filesystem for the root
> partition on the current drive (whatever it booted on)

Well, sort of.

> 3) The first stage boot loader fetches the kernel file. This is
> usually netbsd, but in my case I type 'boot netbsd.test' so the
> bootloader will read the netbsd.test file into memory
> 4) After the bootloader loads the kernel into memory, it looks in the
> header to find the offset for the main() routine, computes the
> absolute address for the main() routine in RAM and jumps to it,
> effectively starting the kernel.

Actually, no. It goes to start, not main, and it has to fix all sorts
of things up first. It also passes all sorts of things in to the
kernel on the x86. Have a look at exec_netbsd in the arch/i386/stand goo.

> My guess is that something is wrong with my kernel image.

Well, maybe, maybe not. Why don't you post a transcript of the actual
behavior here so we can understand what is going on. When I say
transcript, I mean, a real full transcript, nothing left out.

Also...

How are you putting the file system onto the Disk on Chip? How are you
putting /boot and the kernel onto the Disk on Chip? How does the Disk
on Chip look to the hardware? Does the hardware think of it as an IDE
or similar drive?


-- 
Perry E. Metzger		perry@piermont.com