home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / diskutil / mtools / devices.c < prev    next >
C/C++ Source or Header  |  1993-08-05  |  3KB  |  88 lines

  1. /*
  2.  * Device tables.  See the Configure file for a complete description.
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include "msdos.h"
  7.  
  8. #ifdef DELL
  9. struct device devices[] = {
  10.     {'A', "/dev/rdsk/f0d9dt", 0L, 12, 0, (int (*) ()) 0, 40, 2, 9},
  11.     {'A', "/dev/rdsk/f0q15dt", 0L, 12, 0, (int (*) ()) 0, 80, 2, 15},
  12.     {'A', "/dev/rdsk/f0d8dt", 0L, 12, 0, (int (*) ()) 0, 40, 2, 8},
  13.     {'B', "/dev/rdsk/f13ht", 0L, 12, 0, (int (*) ()) 0, 80, 2, 18},
  14.     {'B', "/dev/rdsk/f13dt", 0L, 12, 0, (int (*) ()) 0, 80, 2, 9},
  15.     {'C', "/dev/rdsk/dos", 0L, 16, 0, (int (*) ()) 0, 0, 0, 0},
  16.     {'\0', (char *) NULL, 0L, 0, 0, (int (*) ()) 0, 0, 0, 0}
  17. };
  18. #endif /* DELL */
  19.  
  20. #ifdef ISC
  21. struct device devices[] = {
  22.     {'A', "/dev/rdsk/f0d9dt", 0L, 12, 0, (int (*) ()) 0, 40, 2, 9},
  23.     {'A', "/dev/rdsk/f0q15dt", 0L, 12, 0, (int (*) ()) 0, 80, 2, 15},
  24.     {'A', "/dev/rdsk/f0d8dt", 0L, 12, 0, (int (*) ()) 0, 40, 2, 8},
  25.     {'B', "/dev/rdsk/f13ht", 0L, 12, 0, (int (*) ()) 0, 80, 2, 18},
  26.     {'B', "/dev/rdsk/f13dt", 0L, 12, 0, (int (*) ()) 0, 80, 2, 9},
  27.     {'C', "/dev/rdsk/0p1", 0L, 16, 0, (int (*) ()) 0, 0, 0, 0},
  28.     {'D', "/usr/vpix/defaults/C:", 8704L, 12, 0, (int (*) ()) 0, 0, 0, 0},
  29.     {'E', "$HOME/vpix/C:", 8704L, 12, 0, (int (*) ()) 0, 0, 0, 0},
  30.     {'\0', (char *) NULL, 0L, 0, 0, (int (*) ()) 0, 0, 0, 0}
  31. };
  32. #endif /* ISC */
  33.  
  34. #ifdef MASSCOMP
  35. struct device devices[] = {
  36.     {'A', "/dev/rflp", 0L, 12, 0, (int (*) ()) 0, 80, 2, 8},
  37.     {'\0', (char *) NULL, 0L, 0, 0, (int (*) ()) 0, 0, 0, 0}
  38. };
  39. #endif /* MASSCOMP */
  40.  
  41. #ifdef SPARC
  42. struct device devices[] = {
  43.     {'A', "/dev/rfd0c", 0L, 12, 0, (int (*) ()) 0, 80, 2, 18},
  44.     {'A', "/dev/rfd0c", 0L, 12, 0, (int (*) ()) 0, 80, 2, 9},
  45.     {'\0', (char *) NULL, 0L, 0, 0, (int (*) ()) 0, 0, 0, 0}
  46. };
  47. #endif /* SPARC */
  48.  
  49. #ifdef UNIXPC
  50. #include <sys/gdioctl.h>
  51. #include <fcntl.h>
  52.  
  53. int init_unixpc();
  54.  
  55. struct device devices[] = {
  56.     {'A', "/dev/rfp020", 0L, 12, O_NDELAY, init_unixpc, 40, 2, 9},
  57.     {'C', "/usr/bin/DOS/dvd000", 0L, 12, 0, (int (*) ()) 0, 0, 0, 0},
  58.     {'\0', (char *) NULL, 0L, 0, 0, (int (*) ()) 0, 0, 0, 0}
  59. };
  60.  
  61. int
  62. init_unixpc(fd, ntracks, nheads, nsect)
  63. int fd, ntracks, nheads, nsect;
  64. {
  65.     struct gdctl gdbuf;
  66.  
  67.     if (ioctl(fd, GDGETA, &gdbuf) == -1) {
  68.         ioctl(fd, GDDISMNT, &gdbuf);
  69.         return(1);
  70.     }
  71.  
  72.     gdbuf.params.cyls = ntracks * nheads;
  73.     gdbuf.params.heads = nheads;
  74.     gdbuf.params.psectrk = nsect;
  75.  
  76.     gdbuf.params.pseccyl = gdbuf.params.psectrk * gdbuf.params.heads;
  77.     gdbuf.params.flags = 1;        /* disk type flag */
  78.     gdbuf.params.step = 0;        /* step rate for controller */
  79.     gdbuf.params.sectorsz = 512;    /* sector size */
  80.  
  81.     if (ioctl(fd, GDSETA, &gdbuf) < 0) {
  82.         ioctl(fd, GDDISMNT, &gdbuf);
  83.         return(1);
  84.     }
  85.     return(0);
  86. }
  87. #endif /* UNIXPC */
  88.