home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
S
/
SD-81.ARK
/
SD-81.MSG
< prev
Wrap
Text File
|
1989-09-27
|
2KB
|
40 lines
04/04/84 Sigi Kluger El Paso RCPM
First off... sorry for the mess-up in SD-80. Sometimes it helps if you
know what you're doing!
Anyway, the bug is now fixed and that with an extra bonus... Seems like
the way SD has been working right now, it would get mighty confused with
extremely large files. To backtrack a bit, filesize is stored in the
directory as follows:
ENTRY+12 EX (extent number 0..31)
ENTRY+14 S2 (extent overflow 0..31)
ENTRY+15 RC (record count in last extent)
This means that the largest extent number is 1FH. In order to allow
files larger than 512k, the S2 byte is used. S2 is incremented every
time EX is incremented to 20H. EX is then zeroed. The highest number
in S2 is 0F. EX and S2, therefore, form a 9-bit number. The least sig-
nificant bits 0..4 being EX, the most significant bits 5..8 being S2.
That 9-bit number is the total number of extents possible. Multiplied
by 16k, we get 8192k, the maximum file (and disk) size under CP/M 2.2.
(If I have bored you so far, please realize that many people out there
don't know this)
In SD, the file size was stored as a 2-byte value, one byte being the
total number of extents, the other being the number of sectors in the
last extent. From the previous explanation it should be easy to see
that you can't fit a 9-bit value into a byte. SD up to version 8.1
therefore truncated all files over 4MB to 4096k. In SD-81, the file
size is stored as a normal (as opposed to byte-reversed) 16-bit integer
in sector units (8192k = 65536 sectors).
Not feeling a desire to perform a major rewrite, I did not change the
fact that SD loads and sorts ALL directory entries and then scans the
list for the highest numbered extent and displays it. The main reason
for changing it would be to save space and to possibly speed the program
up insignificantly. Should anyone ever tackle this, please make SD re-
port correct file sizes for random files with holes. (One way of doing
it would be to scan the directory and add up the RC