Re: Fwd: Hey guys, Im trying to follow the chain from 1581 super side sector to a record. Can someone help me understand the calculation involved?

From: Jim Brain <brain_at_jbrain.com>
Date: Wed, 4 Dec 2019 21:06:27 -0600
Message-ID: <a53ccd3d-9217-f9fe-2fc8-2a1b41340aa7_at_jbrain.com>
On 12/4/2019 8:32 PM, Scott Hutter wrote:
>
> Thanks Jim – Ive seen this article before. But what I don’t understand 
> is, for instance – when would a seek result in reading (in the super 
> side sector) from group 2?  Or 3?  All that the directory entry itself 
> provides is the track and sector of the initial super side sector 
> block. (Clearly Im missing something).  Thanks!
>
Well, you know that each super side sector holds references to a certain 
number of side sectors, and they in turn hold references to the records.

So, if you need to find record 999 ( 0 based counting).

You divide by 720 (number of records in a set of six side sectors), and 
get 1 with a remainder of 279.

So, we need to look at the super side sector and find the group 1 side 
sector start (t&s from $05/$06), and then call it up.

Dvide 279 by 120 and get 2 remainder 39.

So, we need to reference into the 3rd side sector (t&s from $08/$09) and 
pull out the 40th entry ($10+39*2 = $5e/$5f

Then, I think, if I remember correctly, you need to multiple 999+1 by 
the record size and divide by 254, and the remainder is the offset into 
the referenced t&s to find the record.  Read the record length of bytes 
from there, and that's your record.

Obviously, if at any point you find t0:s0 for any of the references, you 
will need to "extend" the entire system to support getting to your record.

Jim


> Scott
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for 
> Windows 10
>
> *From: *Jim Brain <mailto:brain_at_jbrain.com>
> *Sent: *Wednesday, December 4, 2019 7:14 PM
> *To: *cbm-hackers_at_musoftware.de <mailto:cbm-hackers_at_musoftware.de>
> *Subject: *Re: Fwd: Hey guys, Im trying to follow the chain from 1581 
> super side sector to a record. Can someone help me understand the 
> calculation involved?
>
> On 12/4/2019 6:08 PM, Julian Perry wrote:
>
>     If it's anything like the 1540/8050/8250 behaviour, your best bet
>     is to read up on Inside Commodore DOS, by Immers and  Neufield.
>
> It's not very much like the smaller drives.  The 8050/8250 might be 
> similar, not sure.
>
> But, definitely not the 1541/204/3040/4040/2031.
>
> The 1581 uses "super side sectors", explained here:
>
> http://www.unusedino.de/ec64/technical/formats/d81.html
>

-- 
Jim Brain
brain_at_jbrain.com
www.jbrain.com
Received on 2020-05-29 23:40:21

Archive generated by hypermail 2.3.0.