Atree Sector Editor The Atree Sector Editor currently works only on disks using the trackdisk. device -- disks mounted on drives DF0: thru DF3: -- it will not yet work on hard disks, virtual disks, or the ramdisk. To enter the sector editor, simply highlight a file or empty directory on a disk mounted on one of the floppy drives then select "Sector Edit" from the "Utils" menu of Atree. If your Atree display highlighter is highlighting a file on a disk in one of the drives DF0: - DF3:, the sector editor will be activated and the first or File Header Block of the highlighted file will be displayed. If the directory is empty, the Directory Block will be displayed. If you attempt to activate the sector editor for any device other than the trackdisk.device, you will get an error requestor. Once in the sector editor, the options available are selectable from one of four menus or from the keyboard. All of the four menus (Mode, Display, Navigate, and Procedures) have letters to the right of the menu items. Pressing the corresponding key on the keyboard gives the same result as selecting the menu item with the mouse. In the Navigate menu, the "->" and "<-" combination refer to the keyboard's right and left arrow keys respectively. For a detailed description of the AmigaDOS filing system pertaining to floppy disks, refer to one of the two works below: The AmigaDOS Manual, Second Edition Commodore-Amiga, Inc. Bantam Books Amiga Disk Drives Inside & Out Abacus Books 5370 52nd Street SE Grand RApids, MI 49512 The Atree sector editor allows two ways of displaying disk sectors; Natural and Logical. With any sector displayed, press "n" then "l" and you will toggle back and forth between the two modes. Natural Display Mode: --------------------- In this mode, the user is simply shown the raw data of the sector in natural order. There is no text in the display to help the user understand what is being viewed. In Natural Display mode, the user may select to have each byte of data in the sector displayed in either ASCII or HEX format. To toggle between these, select "Ascii" or "Hex" from the "Display" menu. In natural hex mode, all 512 bytes of the sector are displayed in hexadecimal format (for those not familiar with the hexadecimal numbering system, see the file named "Numbering_Tutorial" on this disk). The hexadecimal numbers in the extreme left column of this display (the three digit numbers) reperesent the offset from the beginning of the sector of the first byte in the row. In this mode, the user may click the left mouse button with the mouse pointer on any byte in the sector -- a requestor will appear showing a total of four bytes. Each byte is part of a long word as measured from offset zero -- you are presented with the long word to which the selected byte belongs. The byte you selected may therefore appear in any one of the four positions of the bytes in the long word within the requestor. Thus, in natural hex mode, the sector may be edited one long word at a time. In natural ascii mode, the bytes of the sector are displayed in ASCII format in 8 rows of 64 bytes. This mode is of course useful when you are looking for text strings in program code or are viewing a text file. In ASCII mode, all values outside the ASCII range are displayed on your screen as a reverse-video space with a dot in the lower right hand corner; this corresponds to hex value 1F, decimal 31. While in natural ascii display mode, If you click the left mouse button with the mouse pointer anywhere in a row, you will be presented with a requestor that will allow you to edit the entire row. To save edits to disk, simply select the "Write" item from the "Procedures" menu. Logical Display Mode: --------------------- The Logical Display mode is more helpful in understanding what you are looking at. Even very experienced and knowledgeable users will probably opt to use this mode regularly. There are five kinds of sectors or blocks on floppy disks. Each is 512 bytes, or 128 long words. The five types are: Root Block User Directory Block File Header Block File List Block File Data Block Should you request to read a sector and the type of sector, due perhaps to disk corruption, is not a recognized AmigaDOS sector type, that sector will be displayed with the comment "Block Type: Not Known". To get out of this display, select one of the options from the "Navigate" menu. Note that Bitmap blocks will yield the above message, but you can view and edit them anyway. In Logical Display mode all of the data in each block is shown. But it is not shown in its natural order as it occurs in the block. Additionally, the display contains text strings which are useful in describing or defining what you are looking at. When in Logical display mode, only the File Data Block display responds to your request to view in Ascii or Hex. And only the data portion of that block will be shown in Ascii or Hex. All other block types will not respond at all to a request for Ascii or Hex display. To see other blocks in Ascii, you must select "Natural" from the "Display" menu and then, if not already in Ascii mode, select "Ascii" from the "Display" menu. What you see in each block is outlined below. The Root Block: --------------- To locate the Root Block of any floopy disk, press the "g" key or select "Goto" from the "Navigate" menu and enter the hex value 370 or the decimal value 880 (always precede hex values with a "$"). In the display, all block values are given in hexadecimal. This block is displayed in two rectangular boxes. The top, or smaller, box contains 6 screen lines. The information on these lines is as follows: Line 1: States that you are looking at a Root Block and gives the Type (always 2), and Secondary Type (always 1). Line 2: Tells you the creation date of the disk in days, minutes, and ticks (Tks) -- a tick is 1/50 of a second. Line 3: Tells you the name length and name of the disk (label or volume). Line 4: Tells you the status of the Bitmap (FFFFFFFF if good) and gives you the sector number of the first block of the bitmap. Line 5: Tells you the size of the Hash Table in the Root Block and tells you what the Checksum for the block is. Line 6: Tells you the date, in days, minutes and ticks, the disk was last altered. The larger or bottom box shows the complete hash table of the Root Block. The standard size is 72 long words (48 hex). Each entry in the hash table is the sector number of a user directory block or file header block. The "Mode" menu of the sector editor contains two items -- "View" and "Edit". If "View" is selected, then any time you click the left mouse button on a value which represents a disk sector number, the sector editor will read the sector and display it for you. Thus, if you click on line 4 where it says "First Block", you will be shown the first block of the disk's bitmap. Since bitmap blocks do not have a type assigned to them, the Atree sector editor will display the bitmap block in natural mode and will tell you "Block Type: not known". To get back to the root block, press the left arrow key or select "Previous" from the "Navigate" menu. In "View" mode you can also click on any of the hash table entries and the sector so selected will be displayed. You may return to the root block by pressing the left arrow key. While in "View" mode, if you click on a value that DOES NOT represent a disk sector, such as the name of the disk, you will be given a requester that allows you to edit that value. If you select the "Edit" mode from the "Mode" menu, then when you click on any value in the Root Block display, you will be able to edit it. In summary, "View" mode allows you to view or display sectors if you click on them and to edit other non-sector values if you click on them. "Edit" mode allows you to edit all values if you click on them. User Directory Block: --------------------- The display of a User Directory Block looks a lot like the Root Block. In the top, or smaller, box there are six lines. The information on each line is as follows: Line 1: You are told you are looking at a Directory block and you are given the type (always 2) and the Secondary Type (always 2). Line 2: You are given the date (in Days, Minutes, and Ticks) the directory was created. Line 3: You are given the name length and the name of the directory. Line 4: You are given the sector number of this directory block (the Key), and the parent directory sector number (Par). You are then given the sector number of the next directory or file with the same hash value (Nxt), if there is one. Last, you are given the protection (Pro) for this directory. Line 5: You are given the Checksum for this sector and the length of the comment, if one, associated with this directory. Line 6: You are given the comment, if one, associated with this directory. In the lower, or larger, box is the hash table associated with this directory. As with the Root Block, "View" mode allows you to edit all non-sector values if you click on them, and to view all sectors if you click on them. "Edit" mode allows you to edit all values in the block. See the discussion of "View" and "Edit" modes under the heading "The Root Block" above. File Header Block: ------------------ As with the Root and Directory blocks, the File Header Block display consists of two rectangular boxes. The smaller box at the top of the display contains seven lines of information as follows: Line 1: You are told what kind of block this is (File Hdr), and you are given the "Type" and "Secondary Type" (Always 2 and FFFFFFFD respectively). Line 2: You are given the date (in days, minutes, and ticks) the file was created on this disk. Line 3: You are given the name length and the name of this file. Line 4: You are given the sector number of this file header block (Key), the parent directory of this file (Par), the sector number of the next file/directory that yields the same hash value, if one, (Nxt), and you are given the protection associated with this file (Pro). Line 5: You are given the Checksum for this header block, the sector number of the File List Block, if one, associated with this file, and you are given the length of the comment (ComLen), if one, associated with this file. Line 6: You are given the comment associated with this file, if one. Line 7: You are given the total number of data block sectors entered in this file block's Data Table (Entries), the sector number of the first data block of this file (1stBlock), and the total number of bytes in the file. The lower, or larger, box in the display is the Data Table showing the sector numbers of the data blocks associated with this file. To read a file in order from beginning to end, you must read the sectors in order starting with the one in the lower right hand corner of this block and working backward. "View" and "Edit" modes function the same for File Header Blocks as they do for Root and Directory blocks. See the discussion of "View" and "Edit" under the heading "The Root Block" above. File List Block: ---------------- List blocks are blocks which contain the sector numbers of additional file data blocks in cases where the File Header Block did not have enough room to store all the sector numbers of the data blocks associated with the file. File Header Blocks can hold the sector numbers of up to 72 data blocks. If a file needs more data blocks, a File List Block is created to contain the additional sector numbers. The File Header Block contains the sector number of this list block, if one is used or needed. The File List Block is displayed in two rectangular boxes. The upper smaller box contains three line of information as follows: Line 1: You are told you are looking at a File List Block (List Block), and you are given the Type and Secondary Type of this block (always hex 10 and FFFFFFFD respectively). Line 2: You are given the sector number of this File List Block's sector (Key); you are given the block's Checksum, and you are given the number of sector number entries of additional data blocks contained in this block (NumBlocks). Line 3: You are given the sector number of the File Header Block that this File List Block belongs to or is associated with (Hdr Key), and you are given the sector number of the next list block, if one. The bottom box in this display contains a list or table of sector number entries representing the additional data sectors associated with the file. As with the File Header Block, these sectors must be read in order backward from the lower right hand corner of the box. "View" and "Edit" modes function the same for File List Blocks as they do for Root and Directory blocks. See the discussion of "View" and "Edit" under the heading "The Root Block" above. File Data Block: ---------------- File Data blocks contain (on floppy disks) 488 bytes of actual file data, and 24 bytes (six long words) of descriptive data pertaining to the data block. The display consists of two line of text at the top of the screen and a rectangular box below. The two lines of text contain the following information: Line 1: You are told the kind of block you are looking at (Data Block); you are given the Type for this block (Always 8), and you are given the sequence number of this data block (SeqNum) -- the sequence number is simply the number of the block as counted from the beginning. A SeqNum of 54 means this is the 54th data block in the file. Line 2: You are given the total number of bytes of actual file data contained in this block -- a full block should have hex 1E8 or decimal 488 bytes. You are next given the sector number of the next (in sequence) data block of the file (Nxt Blk), and you are given the Checksum for this block. The rectangular box at the bottom of the screen contains the 488 bytes of the block that are used for data -- whether all of them or just some of them actually represent data depends on whether or not the block is full, but you are shown all of the bytes in either case. "View" and "Edit" modes function the same for Data Blocks as they do for Root and Directory blocks. See the discussion of "View" and "Edit" under the heading "The Root Block" above. From the "Display" menu, you may select "Hex" or "Ascii" modes to view the data in the data block. Sector Editor Menus: Below is a quick description of the Atree Sector Editor menu options. Mode Menu: ---------- The two options (View and Edit) in this menu pertain only to the logical display mode. In the natural display mode, you may edit any value in the disk sector by clicking the left mouse button with the mouse pointer on the value you wish to modify. You will then be given a requester containing the long word to which that value belongs. In logical display mode, the "View" option permits you to click the left mouse button on sector values which, by design, are supposed to represent disk sectors. The sector editor will then read and display that sector. However, in "View" mode, clicking on any other sector values will present you with a requester permitting you to edit the value in question. In "Edit" mode, any sector values you click on will give you a requester so that you may edit the value. In natural display mode, either displayed as Ascii or Hex, you can only edit values no matter what they represent. In logical display mode, you have two choices -- view and edit; view allows you to easily navigate around a disk by clicking on sector values and edit allows you to edit the sector values if you want to. Display Menu: ------------- The Display Menu has four options; Ascii, Hex, Natural and Logical. Ascii and Hex options allow you to display the data in ascii or hex only when you are in the natural mode. The one exception is that File Data blocks in logical mode will have the data portion of the block displayed in ascii if requested. Natural and Logical modes are fully discussed in sections devoted to them above. Navigate Menu: -------------- The sector editor maintains a qeueu of the last 20 sectors read. Pressing the left arrow key or selecting "Previous" from this menu will allow you to recall and display the last sector read. Pressing the right arrow key will allow you to read the "next" sector in the qeueu. If you are already on the last sector entered in the qeueu and you press the right arrow key, you will read and display the first element of the qeueu, which may be the first sector you read in the current session. If you are on the first element of the qeueu already and you press the left arrow key, you will read and display the last sector entered in the qeueu. Example: You enter the sector editor with block 0x373 displayed. You then request to read 0x165 and 0x166. Sector 0x166 is currently being displayed. If you press the right arrow key, sector 0x373 will be read and displayed. If you press the left arrow key, sector 0x165 will be displayed. The "Goto" option permits you to enter a sector value. The sector editor will then read and display the sector, or give you a requester if you entered a value too large or too small. Floppy disks have 1760 sectors, numbered from 0 to 1759 -- any other number is out of range. Procedures Menu: ---------------- You may save any sector edits by selecting the "Write" option. The currently displayed sector's Checksum is calculated and modified on screen by selecting the "Do CkSum" option. This new calculation is not saved to disk.