home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / ST_NEWS / STN_01_C.MSA / DATA_DOC05 < prev    next >
Text File  |  1994-03-14  |  4KB  |  74 lines

  1. üDISKMANIPULATION ON THE ATARI SF DISK DRIVES PART IÇ
  2. by Richard Karsmakers
  3.  
  4. Published  originally in üST NEWSÇ Volume 1 Issue  2,  launched  on 
  5. August 9th, 1986.
  6.  
  7. On  of  the  most  fascinating things  to  do  with  computers  is 
  8. communicating  with  external  devices.   These  can  be   robots, 
  9. miniature  trains,  other  computer systems  or  disk  drives.  To 
  10. communicate  with  most  of  these  devices  requires   additional 
  11. hardware,  and some knowledge about how to communicate with  them. 
  12. Since  most people have a disk drive with their ST's,  one  really 
  13. cannot  say  that it is an additional device,  and  the  knowledge 
  14. needed is also fairly limited.  So the disk drive turns out to  be 
  15. one  of the easiest external devices to communicate  with.  That's 
  16. what  makes  disk  manipulating  so  interesting.  With  a  little 
  17. experience you might even be able to manipulate text strings in  a 
  18. program  or data file,  or even translate complete programs  (what 
  19. about a custom TOS or so?).  In this article I will try to explain 
  20. some of the basics of disk manipulating,  to enable everyone to do 
  21. simple  disk  manipulations.   But  look  out,   however,  because 
  22. manipulating disks can cause damage to your data!
  23. The  first thing you must know,  is how diskettes are  devided  in 
  24. parts.  On  a regular formatted single sided disk,  there  are  80 
  25. tracks  (numbered  from 0 to 79 from the outside to  the  inside), 
  26. that are split up into 9 sectors (numbered from 1 to 9) each.  The 
  27. Operating  System  treats  two sectors as  a so  called   cluster. 
  28. Somewhere  on a disk is a space reserved for the Operating  System 
  29. to  use  to determine which clusters are used and  which  clusters 
  30. aren't.  The  space that is reserved therefore is located  on  the 
  31. first  track of the disk,  and is called FAT,  which is short  for 
  32. File Allocation Table.  In each entry in the FAT there are  values 
  33. that  determine whether a block is used,  unused of  damaged  (bad 
  34. data medium).  When it is used,  it contains the value that points 
  35. to  the  next cluster that is used by the file,  or  a value  that 
  36. determines  the  "last cluster in a  file".  More  about  specific 
  37. values later.
  38. The  other part of a diskette that is usually very  important,  is 
  39. the  list  of  files included on  it,  called  the  directory.  It 
  40. contains information about file location,  file size, date/time on 
  41. which the file was created and file type. It is quite difficult to 
  42. manipulate  the directory,  because the TOS uses  calculations  on 
  43. bit-level instead of byte level. More about that later.
  44. Another  part of the disk that is very important to the  operating 
  45. system  is  track  0  sector  1:  the  boot  sector.  It  contains 
  46. information  about cluster size,  density,  number of sectors  per 
  47. track,  number  of sides per disk,  etc.  It might even contain  a 
  48. small  machine language program (boot code) to read in  a  program 
  49. after  system  RESET  (this is done on  the  original  version  of 
  50. Brataccas).  The  boot sector is MS/DOS V2.x  compatible,  and  it 
  51. makes the ST computer system very flexible. It is even possible to 
  52. put  the  directory  on another place on  the  disk,  to  redefine 
  53. cluster size,  redefine sector size,  etc.  In theory the ST  disk 
  54. drive can read any boot-sector compatible 3,5" disk with between 1 
  55. and 83 tracks,  that may each have between 1 and 11 sectors.  Some 
  56. disk drives (like the ones of many 1040 ST's) might have alignment 
  57. problems  so  that  tracks with number 80 to  82  cannot  be  read 
  58. properly.  And  nearly all disk drives have problems when using  a 
  59. disk with more than 10 sectors per track.  A very nice program  to 
  60. experiment  with  these values is "820 KB  Format"  from  Sputnik-
  61. Horror  soft.  You  can  redefine even  the  number  of  directory 
  62. entries!
  63.  
  64.  
  65.  
  66.  
  67. In  the  next  issue of üST NEWSÇ I will explain  more  about  exact 
  68. values,  positions,  etc., and I will tell you how to produce your 
  69. first  successful disk manipulations.  If you think you  have  had 
  70. very nice/nasty experiences with disk manipulating, please contact 
  71. me as soon as possible....
  72.  
  73.  
  74.