[Coco] OS9Boot position, what?

Robert Gault robert.gault at worldnet.att.net
Wed Aug 11 18:33:32 EDT 2004


Paul T. Barton wrote:
> I've noticed that: doing a 
> BUtil -i /d1   gives, for instance:
> Boot start LSN = 95 ($5F).
> Boot size = 28413 ($6EFD).
> 
> Then doing a:
> dir -e /d1   gives:
> blah blah Sector File Size FIleName
> -----------------------------------
> ..........5E.....6EFD......OS9Boot
> 
> There's always '+1' in BUtil of os9boot's
> location, what gives?
> 
> Paul T Barton
> 
This is a question of terminology and it would be confusing for anyone 
not very familiar with OS-9 disk structures.

Dir -e reports the disk sector where a file entry starts not where the 
program starts. BUtil reports the start of the code for OS9Boot. Let's 
see how what seems to be the same thing actually is different.

LSN0 at DD.BT (3 byte address) indicates the lsn where the bootfile code 
starts. When you go to that lsn, you will see as the first two bytes 
$87CD, the start of the first module in the file.

Dir -e is interested in the file structure of the disk, not the start of 
programs. When a directory lists an entry, they are all identical. They 
consists of 32 bytes per entry starting with the ascii entry name 
terminated with $80 added to the last character and the last 3 bytes as 
the lsn of the entry's header, the file descriptor. The file descriptor 
indicates, amongst other things, whether the directory entry is a 
subdirectory or a file, what the attributes are, the owner, and the date 
of creation.

So the short answer is that dir -e indicates the file descriptor while 
BUtil indicates the start of code for OS9Boot. Since the OS9Boot file is 
always the first file placed on a disk, the code always follows 
immediately after the file descriptor and the difference between what 
dir -e and BUtil report will always be +1.

Is that more than you ever wanted to know about BUtil? :)




More information about the Coco mailing list