home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / diskutil / mtools / patch.10t / text0000.txt < prev   
Encoding:
Text File  |  1993-08-05  |  4.4 KB  |  147 lines

  1. Ralph,
  2. > I also have used Mtools version 2.0.4, dated 11 Apr 91, but I am
  3. > interested in the patch which allows 10 sector/track disks!
  4. >
  5. > Can you pass it along?
  6.  
  7. The following patch is ok for Mtools 2.04 (the patched mtools is
  8. running without problems since July 91), but you can't format
  9. a 10 Sec/Trk disk on the Sparcstation.
  10.  
  11. Enjoy,
  12.   -bernd
  13.  
  14. ------------------------------ CUT
  15. From: r90p@jupiter.sun.csd.unb.ca (Schultz)
  16. Newsgroups: comp.sys.atari.st,comp.sys.atari.st.tech
  17. Subject: Re: ST Disks & Sparcstation Drives
  18. Date: 21 Mar 91 04:54:27 GMT
  19. Organization: University of New Brunswick, Fredericton
  20.  
  21. >
  22. >    A few months ago, some people were talking about reading Atari
  23. >    ST disks from a Sparcstation.  Does anyone know how to go about
  24. >    this?
  25. >
  26. >    Specifically, I want to read files from a double sided disk onto
  27. >    my Sparc and then transfer them to my ST hard disk via modem (I
  28. >    only have a single-sided floppy).
  29.  
  30. >From Mtools 2.03, patch #3:
  31.  
  32. # Mtools was posted to the unix-pc.sources news group (and mailed to the
  33. # moderator of comp.sources.unix) on the 17th of September 1990.  Since
  34. # then, patch #1 and #2 have been posted to unix-pc.sources,
  35. # comp.sources.bugs, and emailed to Rich Salz.
  36. # In addition, the current version of Mtools and all the patches are
  37. # available via anonymous ftp from cerl.cecer.army.mil (129.229.1.101).
  38. # Emmet P. Gray                           US Army, HQ III Corps & Fort Hood
  39. # ...!uunet!uiucuxc!fthood!egray          Attn: AFZF-DE-ENV
  40. # fthood!egray@uxc.cso.uiuc.edu           Directorate of Engineering & Housing
  41. #                                         Environmental Management Office
  42. #                                         Fort Hood, TX 76544-5057
  43.  
  44. Just a few days ago, I modified Mtools so that they can read
  45. and (be careful!) write single sided 3.5" floppies and e.g.
  46. floppies with 10 sec/track:
  47.  
  48. ---------------------------- < cut here > -------------------------
  49. *** devices.c_as_distrubuted    Mon Mar 11 17:39:48 1991
  50. --- devices.c    Mon Mar 11 17:41:34 1991
  51. ***************
  52. *** 27,37 ****
  53.   #endif /* MASSCOMP */
  54.   
  55.   #ifdef SPARC
  56.   struct device devices[] = {
  57. !     {'A', "/dev/rfd0c", 0L, 12, 0, (int (*) ()) 0, 80, 2, 18},
  58. !     {'A', "/dev/rfd0c", 0L, 12, 0, (int (*) ()) 0, 80, 2, 9},
  59.       {'\0', (char *) NULL, 0L, 0, 0, (int (*) ()) 0, 0, 0, 0}
  60.   };
  61.   #endif /* SPARC */
  62.   
  63.   #ifdef UNIXPC
  64. --- 27,94 ----
  65.   #endif /* MASSCOMP */
  66.   
  67.   #ifdef SPARC
  68. + #include <sys/types.h>
  69. + #include <sun/dkio.h>
  70. + #include <fcntl.h>
  71. + int init_sparc_fd();
  72.   struct device devices[] = {
  73. !     {'A', "/dev/rfd0c", 0L, 12, 0, init_sparc_fd, 80, 2, 0},
  74.       {'\0', (char *) NULL, 0L, 0, 0, (int (*) ()) 0, 0, 0, 0}
  75.   };
  76. + /*
  77. +  * Stuffing back the floppy parameters into the driver
  78. +  * allows for gems like 10 sector or single sided floppies
  79. +  * from Atari ST systems.
  80. +  * Also the table needs only one entry (SunOS already tries
  81. +  * for HD and DD floppies).
  82. +  * Note that it is necessary to set the partition info,
  83. +  * since otherwise e.g. a 800k floppy (80 tr., 2 heads, 10 sectors)
  84. +  * would only be read and writeable up to 720k.
  85. +  * 
  86. +  * Martin Schulz, Universite de Moncton, March 11, 1991.
  87. +  */
  88. + int
  89. + init_sparc_fd(fd, ntracks, nheads, nsect)
  90. + int fd, ntracks, nheads, nsect;
  91. + {
  92. + struct fdk_char dkbuf;
  93. + struct dk_map   dkmap;
  94. +     if (ioctl(fd, FDKIOGCHAR, &dkbuf) != 0) {
  95. +         ioctl(fd, FDKEJECT, NULL);
  96. +         return(1);
  97. +     }
  98. +     if (ioctl(fd, DKIOCGPART, &dkmap) != 0) {
  99. +         ioctl(fd, FDKEJECT, NULL);
  100. +         return(1);
  101. +     }
  102. +     if ( ntracks && nheads )
  103. +         dkbuf.ncyl    = ntracks * nheads;
  104. +     if ( nheads )
  105. +         dkbuf.nhead    = nheads;
  106. +     if ( nsect )
  107. +         dkbuf.secptrack = nsect;
  108. +     if ( ntracks && nheads && nsect )
  109. +         dkmap.dkl_nblk  = ntracks * nheads * nsect;
  110. +     if (ioctl(fd, FDKIOSCHAR, &dkbuf) != 0) {
  111. +         ioctl(fd, FDKEJECT, NULL);
  112. +         return(1);
  113. +     }
  114. +     if (ioctl(fd, DKIOCSPART, &dkmap) != 0) {
  115. +         ioctl(fd, FDKEJECT, NULL);
  116. +         return(1);
  117. +     }
  118. +     return(0);
  119. + }
  120.   #endif /* SPARC */
  121.   
  122.   #ifdef UNIXPC
  123. ---------------------------- < cut here > -------------------------
  124.  
  125. Replies to:                 Martin Schulz
  126.                             martin@atlantic.cs.unb.ca
  127.  
  128. ------------------------------ CUT
  129.  
  130. __________________________________________________________________________
  131. Bernd Raichle, Student der Universit"at Stuttgart | "Le langage est source
  132. privat: Stettener Str. 73, D-W-7300 Esslingen     |  de malentendus"
  133. email:  raichle@azu.informatik.uni-stuttgart.de   |  (A. de Saint-Exupery)
  134.  
  135.