Subject: Re: File system image
To: David Laight <david@l8s.co.uk>
From: Brian Rose <saider@gate.net>
List: tech-embed
Date: 02/07/2003 18:33:23
David Laight wrote:

>>11) FTP the test image to my test machine, reboot and at the boot 
>>prompt, select netbsd.test as the kernel to boot.
>>
>>The bootloader seems to load the kernel (I see the numbers) and then 
>>reboots immediately.
>>    
>>
>
>You need to use the correct geometry of the target drive when you
>build your image.  Otherwise it will go 'tits up'.
>
>Actually you also have a problem unless the image is copies to the
>bottom of the hard disk because part of teh boot sequence uses
>absolute sector numbers.
>
>
>	David
>  
>

I thought that the target drive would be irrelevant after booting. 
Here's some more background on my little project.

I am building for a i386 target. The machine is a PC104 sized system 
with a 2GB hard drive and a 32MB Disk-On-Chip. My goal is to develop a 
small NetBSD system that will fit on the DOC without the need for a hard 
drive. But for now I am booting off of the hard drive. There is no 
floppy in the system. I installed NetBSD and then to test out my 
modified kernels, with their built in filesystems, I simply ftp the 
memdrive kernels into the root of the hard drive, reboot, and select the 
memdrive kernel from the bootloader. The root partition is only 400MB in 
size, so there should be no 1024 cylander boundary problems from the 
bootloader.

Here's my understanding of the process. Please feel free to fill in any 
gaps.

1) PC BIOS boots and loads the first stage boot loader.
2) The first stage boot loader looks at the filesystem for the root 
partition on the current drive (whatever it booted on)
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.

My guess is that something is wrong with my kernel image. Since I had 
created kernels with essentially the same process (outlined in a 
previous email), using a 1.44M floppy image, I assumed that my disk 
image was bad. After doing some research, the disklabel step seemed the 
most likely point of failure, and I have been stuck on that ever since.

So trying to understand David's comments, it would seem that the 
memdrive filesystem needs some disklabel information from my 2GB target 
hard drive? What happens if I put this on a different hard drive or the DOC?

Thanks for any insight,

Brian