Written by Ed Seward on 10 January 1986. Another Look at the Disk Structure for the ST There is one boot sector on a standard TOS disk. This is followed by the two copies of the FAT - each being five sectors long. Thus the disk directory starts in the third sector of track one. If the disk is given a label during the format process then that will be in the first directory position. The only characters that seem to go here are the eleven possible text positions followed by a byte with the value of eight in the twelfth byte. For further info see the February 1986 issue of ANTIC. A Look at the Structure of DESKTOP.INF When I started this text file it was just to keep track of the what I had figured out about DESKTOP.INF. Well as the hours wore on I kept understanding more of the file and this thing grew to what it is now. Let me start with a brief description of the way records begin and end within this file. The first byte of a record is always a value of $23 or can be thought of as the ASCII character "#". The second byte of a record I think of as identifying the record type. The ASCII representation of this byte is a letter. The last two bytes of a record should be $0D and $0A. When keeping this information in mind it is much easier to figure out what the purpose is of most of the file. The first record in the file has an identifier of "a" and contains six data bytes between the beginning and end info. These bytes are all zeroes until someone configures the RS232 port. This record contains that configuration information. The breakdown of the values possible and what they represent is shown below. (I will be refering to byte one in a record as being the one closest to the front of the file and counting towards the end of the file. Also, when talking about the character in the byte I will mean the character whose ASCII value is eqiuvalent to that in the byte.) Byte # Function char 1 duplex 0=full, 1=half 2 baud 0=9600, 1=4800, 2=1200, 3=300 3 parity 0=none, 1=odd, 2=even 4 bits/char 0=8, 1=7, 2=6, 3=5 5 flow control: Xon/Xoff Rts/Cts Char in byte off off 0 on off 1 off on 2 on on 3 6 strip bit 0=on, 1=off The second record has an identifier of "b" and it also contains six data bytes. The purpose of this record is to retain the configuration of the printer. The possible characters and the purpose of each byte is shown below. The first byte is at the top and the last at the bottom. Function "0" "1" Printer type Dot Diasy Color B/W Color Pixels/Line 1280 960 Quality Draft Final Printer port Printer Modem Paper Type Feed Single The next record has an identifier of "c" starts in byte $14 and its ASCII converted string is: #c7770007000700070055200505552220770557075057705503111010.. If you look at the control panel in low resolution you will find that the first 48 digits match up with the Red-Green-Blue level of the sixteen colors. The order in relation to the Control Panel is : 0 2 4 6 8 10 12 14 1 3 5 7 9 11 13 15 The byte in location $46 is the mouse click response setting on the controll panel. The next byte is the key click followed by the bell. The ASCII character "1" is on and "0" is off. The next two bytes are for the 'delay till repeat'. The final two data bytes are 'repeat speed'. (Please note that color number 3, the green, is the one that controls the DESKTOP's color.) The #d record contains nothing but 45 blanks and the 0D 0A end of record bytes. The #E record describes the resolution and has an overall length of eleven bytes including start and stop info. It's ASCII string would be: #E 1B 01 .. with a hex equivalent of : 23 45 20 31 42 20 0D 0A The four non-blank data characters represent the settings from the Set Preferences Window. (That would be confirm copies and deletes plus the screen resolution.) The "E" record is followed by four #W window descriptor records. If the first window record contains the string ASCII string " A:\*.*" or the appropraite drive id then a directory will be displayed upon booting up. The icon data starts in byte $FD. The disk icons are 34 bytes long. So far I have only seen two icon record types: M = file cabinet for disks T = trash can. Bytes three thru nine contain the location of the icon. Bytes 3,6 and 9 are blank characters ($20). Bytes 4,5,7 and 8 are the characters for the row then column with two bytes for each. The position is given by the ASCII character. For example row zero cloumn zero (top left corner) is represented by the following hex string - 20 30 30 20 30 30 20. Bytes 10 thru 14 I haven't figured out yet 20 30 30 20 for the disks and 20 30 32 20 for the trash can. Bytes 15 and 16 are $46 $46 (the character F). The next three bytes are blank identifier blank: for disk one this would be $41 for the character A. The text descriptor starts in byte 20 and is terminated with the byte value of $40. Starting with byte $F0 in one copy of the file DESKTOP.INF the bytes contain the following info: byte # F0 20 30 30 20 40 0D 0A 23 4D 20 30 30 20 30 32 20 100 30 30 20 46 46 20 44 20 52 41 4D 44 49 53 4B 39 110 37 40 20 60 06 40 20 0D 0A 23 4D 20 30 30 20 30 120 30 20 30 30 20 46 46 20 41 20 46 4C 4F 50 50 59 130 20 44 49 53 4B 40 20 40 20 0D 0A 23 4D 20 30 30 140 20 30 31 20 30 30 20 46 46 20 42 20 46 4C 4F 50 150 50 59 20 44 49 53 4B 40 20 40 20 0D 0A 23 54 20 160 30 30 20 30 33 20 30 32 20 46 46 20 20 20 54 52 170 41 53 48 40 20 40 20 0D 0A 23 46 20 46 46 20 30 The ASCII translation for these bytes is: F0 00 @..#M 00 02 100 00 FF D RAMDISK9 110 7@ .@ ..#M 00 0 120 0 00 FF A FLOPPY 130 DISK@ @ ..#M 00 140 01 00 FF B FLOP 150 PY DISK@ @ .. #T 160 00 03 02 FF TR 170 ASH@ @ ..#F FF 0 As I figure it so far, icon D starts in byte $FD and is: #M 00 02 00 FF D RAMDISK97@ .@ .. Icon A would start at byte $11F: #M 00 00 00 FF A FLOPPY DISK@ @ .. Icon B would start at byte $141: #M 00 01 00 FF B FLOPPY DISK@ @ .. The trash icon would start at $163: #T 00 03 02 FF TRASH@ @ .. On further playing with the DESKTOP I have found that the icon type is selected by the eleventh byte of each icon record. The valid range is zero to four as listed below: 0 FILE CABINET (Disk Drive) 1 FOLDER 2 TRASH CAN 3 EXECUTABLE FILE (identified in the records after the "#D FF 01 @ *.*@" record) 4 EXECUTABLE FILE ( There are five more records after the trash can The record identifiers for these are "F", "D", "G", "F" and "P" in that order. I haven't figured these out - yet. I know this skips over some bytes and does not fully explain DESKTOP.INF. However, this info has been found by experimenting. As such I make no guarantees as to how complete or accurate this information is. How does one make use of this info. If one knows which record they are going to change then all they have to do is scan the file skipping over the right number of $0D $0A byte combinations. New icons are placed right after the fourth window record. Thus, assuming one is going to change the "TRASH" icon's name; then skip a-E records, the for W records, any added icons like a ramdisk, the two floppy disk icons. This would place one at the first byte in the "TRASH" icons record. Why this info. Well I would like to be able to change the icon names and besides I was just curious. Also, I don't have the developer's kit, I don't like BASIC or LOGO, so why not learn the structure of things while waiting for an alternative to Hippo C that is flexible and reasonably priced. --------------------------------------------------------------------- As I take another look at this I would like to add a few comments. Since I wrote this, it has been pointed out that DESKTOP.INF can be modified in a properly set word processor. (The carriage return character was practically hitting me with a bat). The program "ICONNAME.PRG" or "ICNAME.PRG" was written with Personal Pascal and uses the above info to change the icon names. **** WARNING - only experiment with BACKUP copies of your boot disks as it is possible to make DESKTOP.INF unusable with invalid combinations. Send comments to: Ed Seward [73476,1664] or P.O. Box 6826 Alexandria, VA 22306 ^NuNVÿü/ &nBnÿþ g,0+Ð|æ@€ã@Àë =@ÿü0.ÿü°nÿþo=nÿüÿþ&S`Ð