Subject: Re: Bootloader 'Todo' List
To: Jason R Thorpe <thorpej@zembu.com>
From: Nicholas Clark <nick@ccl4.org>
List: port-arm32
Date: 11/11/2000 22:58:34
On Fri, Nov 10, 2000 at 07:58:41AM -0800, Jason R Thorpe wrote:
> On Fri, Nov 10, 2000 at 02:15:30PM +0000, Nicholas Clark wrote:
> 
>  > Does NetBSD do Linux ext2fs read write? And can it understand the partition
>  > table that Linux/arm uses? If the answer is yes&yes this would be useful
>  > even without Linux/arm emulation as I could painless install NetBSD on the
>  > spare root partition my ARM Linux setup currently has. (and triple boot)
> 
> It can handle the file system just fine.  What kind of partition table
> does Linux/arm use?

For a standard motherboard IDE drive it appears to take the drive space
beyond ADFS, treat it as a physical partition and write a logical partition
table, with 3 words per partition.
On boot I see:

Partition check:
 hda: [ADFS] hda1 [Linux] hda2 < hda3 hda4 hda5 hda6 >


the start of my /dev/hda2 looks like this:

0000000 deafa1de 00000002 00200001 deafa1de
0000020 00200003 00200001 deafab1e 00400004
0000040 00040001 deafa1de 00440005 0098c2eb
0000060 d31f8edf 19863e30 2f9c1e64 36d8b495

1st word is a flag
 deafa1de is the flag for ext2fs
 deafab1e is the flag for swap

2nd word is start sector of this logical within the physical
3rd is length in sectors

sectors are 512 bytes.

my /dev/hda3, /dev/hda4 and /dev/hda6 are ext2fs, 3 & 4 are 1G, 6 is over 4G
 /dev/hda5 is my swap, 130748K according to top. (~128M)
/dev/hda1 is ADFS, and is mounted.

That d31f8edf marks the end. I don't know if it's particularly special. As
far as the code loop is concerned "it's not (deafa1de or deafab1e) so stop
looking for more, print the '>'"

The code reads a block of 1024 bytes, so it appears that this table is
allocated 2 512 sectors.

I can send you the code if you have quarentine facilities :-)

Nicholas Clark
-- 
This message has been scanned for viruses and found to be clear of GPL.
It is safe to cut&paste anything you read here into BSD code.