lotus

previous page: 06.018 How can I find out the address and size of a BLOADed DOS 3.3 file?
  
page up: Apple II Csa2 FAQs
  
next page: 06.020 How does DOS 3.3 remember which sectors are used to store a file?

06.019 What information is included in the DOS 3.3 VTOC and catalog sectors?




Description

This article is from the Apple II Csa2 FAQ, by Jeff Hurlburt with numerous contributions by others.

06.019 What information is included in the DOS 3.3 VTOC and catalog sectors?

    VTOC

     The Volume Table of Contents (VTOC) is Sector $00 (0) on Track $11 (17).
This is the key sector from which all searches start out.

Example: A typical DOS 3.3 Disk's VTOC sector

Byte  00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E

0000- 04 11 0F 03 00 00 FE 00 00 00 00 00 00 00 00
0010- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0020- 00 00 00 00 00 00 00 7A 00 00 00 00 00 00 00
0030- 15 01 00 00 23 10 00 01 00 00 00 00 00 00 00
 ....
0080- 3F 7F 00 00 00 00 00 00 00 00 00 00 00 00 00
 ....
00F0- 00 00 00 00 00 00 00 7A 00 00 00 00 00 00 00

Byte   Meaning
----   -------
$00    Unused (always $04 on my disks)
$01-02 Track/Sector location of first catalog sector-- the standard
       location is Track $11/Sector $0F (17/15)
       Note: The location of first catalog sector may be different on some
       disks. DOS 3.3 can adjust; but, some utilities (e.g. Copy II Plus)
       assume T/S $11/$0F and will not be able to find the catalog.
$03    DOS version number ($03 for DOS 3.3)
$04-05 Unused
$06    Volume Number-- $01-$FE (1-254) is the standard range;
       $FE (254) is the standard default VN
       Note: This entry merely records the VN for handy reference.
       VN is set when a disk is INITed and it is embedded in the
       Address header of each sector.
$07-26 Unused
$27    Max number of Track/Sector pairs in each sector of
       a file's Track/Sector list-- normally $7A (122)
$28-2F Unused
$30    Last track where sectors were allocated-- in the example
       it is Track $15 (21)
$31    Direction of allocation-- $01 (+1)=inward; $FF (-1)=outward
$32-33 Unused
$34    Number of tracks per disk-- normally $23 (35)
$35    Number of sectors per track-- normally $10 (16)
$36-37 Number of bytes per sector-- normally $0100 (256)
$38-3B Bit map for Track $00-- four bytes per entry (only two bytes are
       used); each bit in the two-byte entry indicates whether a sector
       is in use (0) or free for use (1). See example just below.
$3C-3F Bit map for Track $01
 ....
$80-81 Bit map for Track $12 (18)
       Example: The entry shown is 3F 7F 00 00. Only the first two
       bytes (3F 7F) are used:

       Sector-  F E D C  B A 9 8   7 6 5 4  3 2 1 0
       Bit-     0 0 1 1  1 1 1 1   0 1 1 1  1 1 1 1
       Hex-        3        F         7        F

       This shows that on Track $12 only sectors $F, $E, and $7 (15, 14,
       and 7) are used. The other sectors on the track are free for use.
 ....
$C0-C3 Bit map for Track $22 (34)-- usually the last track
$C4-FF Unused on normal disks (may contain extra bit maps on disks with
       more than 35 tracks)

Catalog

     Starting at Track $11/Sector $0F (17/15 in decimal) and working downward
in the track (e.g. Sector $0E, $0D, ...), each catalog sector contains a
pointer to the next catalog sector, and seven file entries:

Byte   Meaning
----   -------
$00    Unused
$01    Track number of next catalog sector ($00 if no more)
$02    Sector number of next catalog sector
$03-0A Unused
$0B-2D First file entry
$2E-50 Second file entry
$51-73 Third file entry
$74-96 Fourth file entry
$97-B9 Fifth file entry
$BA-DC Sixth file entry
$DD-FF Seventh file entry

     Each file entry looks like this:

Byte   Meaning
----   -------
$00    Track number of this file's first track/sector list
$01    Sector number of this file's first track/sector list
$02    File type:
       Bit   Meaning
       ---   -------
       7     0=unlocked, 1=locked
       6-0   File type ($00=Text, $01=Integer, $02=Applesoft,
            $04=Binary, $08=S, $10=Relocatable, $20=A, $40=B)
$03-20 File name (high bits set; padded with blanks on right)
$21-22 Number of sectors allocated to this file

----------------------------
    

 

Continue to:













TOP
previous page: 06.018 How can I find out the address and size of a BLOADed DOS 3.3 file?
  
page up: Apple II Csa2 FAQs
  
next page: 06.020 How does DOS 3.3 remember which sectors are used to store a file?