Subject: Re: booting off RAIDframe mirror with i386 -current
To: <>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 07/02/2003 09:13:21
> Very roughly here is the layout (for i386):
> 
> 	block 0			start of real "a" partition
> 	block 1			disklabel for real disk
> 	block 0-16		space for "bootxx_*" first stage
> 	block 32 (maybe?)	raid label
> 	block 64		start of raid space
> 	block 65		disklabel for raid space
> 	block 80 (64+16)	start of FFS (or other) filesystem
> 
> > Is that in the code that loads the kernel?
> 
> This is in the bootxx_* code that loads /boot.  /boot itself is fine (it
> uses .../lib/biosdisk.c which deals with adding 64 if the partition type
> in the disk label is RAID)

I couldn't remember where that was last night - too much beer :-(

> but bootxx_* needs to know whether or not to
> add 64 as well, but currently the code doesn't look at the disklabel
> (space constraints I guess).  So I just took the approach of "if the
> open fails, try adding 64 to all read offsets and try again."

There are space constraints on the bootxx code, it isn't sat hard on its
space limit but (IIRC) some of the variants are within a few hundred bytes.
I think the bootxx_ustartfs is the biggest (you might ask why!) - there
must be a load of cr@p in it.

In any case the bootxx code can't easily look at the disklabel
without having all the code to go and read it.
If there is more than one (bootable) netbsd partition on the disk then
the label it has in its hand may not be the correct one.
Possibly disklbael should be written to the start of ALL netbsd
partitions on the disk - but that currently isn't the case.

	David

-- 
David Laight: david@l8s.co.uk