Subject: Boot block size (Re: DISREGARD: Re: HELP: need 1.3I kernel)
To: None <leo@wau.mis.ah.nl>
From: maximum entropy <entropy@zippy.bernstein.com>
List: port-atari
Date: 12/15/1998 13:42:08
>Date: Tue, 15 Dec 1998 09:30:01 +0100
>From: Leo Weppelman <leo@wau.mis.ah.nl>
>
>Great! I hope you didn't loose too much of your filesystem....

Luckily for me, installboot does the right thing, and won't write more
than sizeof(struct bootblock) to the disk.  So I ended up with a
mangled bootblock, but no filesystem corruption.

>You shouldn't have modified the length coded (and checked) in the Makefile...
>If you take a look at .../arch/atari/include/disklabel.h, down at the bottom
>of the file, I think you'll understand why. The bootblock structure
>defined there, describes the layout of a bootblock (surprise ;-). As you
>see, the bootxx (secondary boot) code, is written at the end of the bootblock.
>If you make the secondary boot code bigger, it runs into the next block.
>That block contains the filesystem superblock (if I recall correctly).

Yes, that was the critical information I was missing.  After reading
disklabel.h it's pretty obvious what's going on.
        u_int8_t        bb_bootxx[BBMINSIZE - LABELOFFSET - LABELMAXSIZE];
Which of course gives exactly 6656 bytes for bootx.

Should we start thinking about going to a 3-stage loader scheme (boot
sector + bootxx + /boot)?  Right now, my bootxx text+data is 6468
bytes, which leaves only 188 bytes for future growth.  I very quickly
"outgrew" that remaining space, even with only a few simple changes.

Cheers,
entropy

--
entropy -- it's not just a good idea, it's the second law.