linux-mips-fnet
[Top] [All Lists]

Re: DECstation bootloader

To: linux-mips@fnet.fr
Subject: Re: DECstation bootloader
From: Harald Koerfgen <Harald.Koerfgen@home.ivm.de>
Date: Sun, 28 Mar 1999 18:26:02 +0200 (MEST)
Cc: (Houten K.H.C. van) <K.H.C.vanHouten@research.kpn.com>
In-reply-to: <199903201111.MAA23279@sparta.research.kpn.com>
Organization: none
Reply-to: "Harald Koerfgen" <Harald.Koerfgen@home.ivm.de>
Sender: harry@franz.no.dom
Hi Karel,

On 20-Mar-99 Karel van Houten wrote:
> Hi Harald,
> 
> You wrote:
>> ... 
>> Have you been using NetBSD and can it be that NetBSD stores partition
>> information in sector 0?
>> 
>> If so, then NetBSD is on the wrong track because sector 0 belongs to
>> the
>> PROM. Period.
>> 
> 
> What partition table format leaves sector 0 for the PROM? As far as I
> know
> MSDOS, NetBSD, SUN, all use the first sector for partition info.
> 
> If we really need the whole first sector for the bootloader, we have to
> create a new partition table format, which I would not like.

Well, I don't like this too. On the other hand, I don't see any benefit
from writing bootblocks or a two stage boot process when the PROM is able
to handle this nicely for us.

I agree, not storing partition tables in the boot block, like Ultrix does,
is not a very good idea. What we want to have is as much room as possible
for boot maps and, as a result, partition tables as small as possible. The
NetBSD partion tables are far to big for that, so the NetBSD way isn't a
good idea as well.

An alternative could be using slightly modified sun partition tables. My
proposal for the layout for the bootblock is:

typedef struct Dec_BootMap {
        int numBlocks;          /* Number of blocks to read. */
        int startBlock;         /* Starting block on disk. */
} Dec_BootMap;

struct Dec_DiskBoot {
        char spare1[8];
        int magic;              /* DEC_BOOT_MAGIC */
        int mode;               /* Mode for boot info. */
        int loadAddr;           /* Address to start loading. */
        int execAddr;           /* Address to start execing. */
        Dec_BootMap map[51];    /* Position of boot program. */
        unsigned short ncyl;       /* Data cylinder count */
        unsigned short nacyl;      /* Alt. cylinder count */
        unsigned short ntrks;      /* Tracks per cylinder */
        unsigned short nsect;      /* Sectors per track */
        unsigned char spare3[4];   /* Even more magic... */
        struct sun_partition {
                __u32 start_cylinder;
                __u32 num_sectors;
        } partitions[8];
        unsigned short magic;      /* Magic number */
        unsigned short csum;       /* Label xor'd checksum */
} Dec_DiskBoot;

That is enough that the Kernel recognises the sun partition table without
modification and leaves enough room for 51 boot maps which, even in the
worst case, is suitable for a 51 KB bootloader.

The only drawback is that fdisk needs to modified to deal with the
modified sun partition tables.

Comments?
---
Regards,
Harald

<Prev in Thread] Current Thread [Next in Thread>