home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / mtools2-xenixpatch / mtools.patch
Encoding:
Text File  |  1992-01-11  |  7.8 KB  |  290 lines

  1. diff -c ../mtools/Makefile .//Makefile
  2. *** ../mtools/Makefile    Sat Jan  4 18:59:15 1992
  3. --- .//Makefile    Sat Jan 11 23:21:39 1992
  4. ***************
  5. *** 3,17 ****
  6.   #
  7.   # check the Configure file for some examples of device-specific setups
  8.   # Berkeley flavors of Unix should include -DBSD in the CFLAGS
  9.   
  10. ! CFLAGS    = -O
  11. ! LDFLAGS    = -s
  12.   LD    = cc
  13.   LINT    = lint
  14.   SHLIB    =
  15. ! SHAR    = shar -a
  16.   BINDIR    = /usr/local/bin
  17. ! MANSECT    = 1
  18.   MANDIR    = /usr/man/man$(MANSECT)
  19.   #
  20.   # for AT&T Unix PC 7300/3b1 style shared libraries.
  21. --- 3,18 ----
  22.   #
  23.   # check the Configure file for some examples of device-specific setups
  24.   # Berkeley flavors of Unix should include -DBSD in the CFLAGS
  25. + # This setup is for Xenix 286.  A stack of 5000 seems to work OK.
  26.   
  27. ! CFLAGS    = -O -M2e
  28. ! LDFLAGS    = -s -M2e -i -F 5000  #Small model, separate I and D space
  29.   LD    = cc
  30.   LINT    = lint
  31.   SHLIB    =
  32. ! SHAR    = shar 
  33.   BINDIR    = /usr/local/bin
  34. ! MANSECT    = LOCAL
  35.   MANDIR    = /usr/man/man$(MANSECT)
  36.   #
  37.   # for AT&T Unix PC 7300/3b1 style shared libraries.
  38. ***************
  39. *** 116,122 ****
  40.       cp Mkmanifest.1 $(MANDIR)/mkmanifest.$(MANSECT)
  41.   
  42.   clean:
  43. !     rm $(PROGS)
  44.   
  45.   lint:
  46.       $(LINT) mattrib.c buf_read.c buf_write.c devices.c dir_read.c \
  47. --- 117,126 ----
  48.       cp Mkmanifest.1 $(MANDIR)/mkmanifest.$(MANSECT)
  49.   
  50.   clean:
  51. !     rm -f $(PROGS) core *.o
  52. ! relink:
  53. !     rm -f $(PROGS)
  54.   
  55.   lint:
  56.       $(LINT) mattrib.c buf_read.c buf_write.c devices.c dir_read.c \
  57. diff -c ../mtools/buf_read.c .//buf_read.c
  58. *** ../mtools/buf_read.c    Sat Jan  4 18:59:30 1992
  59. --- .//buf_read.c    Sat Jan 11 17:09:06 1992
  60. ***************
  61. *** 27,32 ****
  62. --- 27,34 ----
  63.       long where, tail, lseek();
  64.       void perror(), exit(), disk_flush();
  65.   
  66. +     long debug_num;
  67.                       /* don't use cache? */
  68.       if (disk_size == 1) {
  69.           where = (start * MSECTOR_SIZE) + disk_offset;
  70. diff -c ../mtools/devices.c .//devices.c
  71. *** ../mtools/devices.c    Sat Jan  4 18:59:32 1992
  72. --- .//devices.c    Sat Jan 11 18:05:52 1992
  73. ***************
  74. *** 46,51 ****
  75. --- 46,77 ----
  76.   };
  77.   #endif /* SPARC */
  78.   
  79. + /* The following table is for a 1.44 3.5 drive in A:, a 1.2 5.25 
  80. +  * drive in B:, and two hard disks, each beginning with a DOS 
  81. +  * partition.  Drives H: and L: force drive A: to hi and lo 
  82. +  * density; X: and Y: do the same for B:.  This shows all the
  83. +  * possibilities.  /dev/install and /dev/install1 are the preferred
  84. +  * driver entries.  If you do not have a second hard disk, do not
  85. +  * include an entry for /dev/hd1d. (Table added by H. van Cleef,
  86. +  * 12-20-91)
  87. +  */
  88. + #ifdef M_XENIX
  89. + struct device devices[] = {
  90. +     {'A', "/dev/install", 0L, 12, 0, (int (*) ()) 0, 80, 2, 18},
  91. +     {'A', "/dev/install", 0L, 12, 0, (int (*) ()) 0, 80, 2, 9},
  92. +     {'B', "/dev/install1", 0L, 12, 0, (int (*) ()) 0, 80, 2, 15},
  93. +     {'B', "/dev/install1", 0L, 12, 0, (int (*) ()) 0, 40, 2, 9},
  94. +     {'C', "/dev/hd0d", 0L, 16, 0, (int (*) ()) 0, 0, 0, 0},
  95. +     {'D', "/dev/hd1d", 0L, 16, 0, (int (*) ()) 0, 0, 0, 0},
  96. +     {'E', "/dev/hd12", 0L, 16, 0, (int (*) ()) 0, 0, 0, 0},
  97. +     {'H', "/dev/fd0135ds18", 0L, 12, 0, (int (*) ()) 0, 80, 2, 18},
  98. +     {'L', "/dev/fd0135ds9", 0L, 12, 0, (int (*) ()) 0, 80, 2, 9},
  99. +     {'X', "/dev/fd196ds15", 0L, 12, 0, (int (*) ()) 0, 80, 2, 15},
  100. +     {'Y', "/dev/fd148ds9", 0L, 12, 0, (int (*) ()) 0, 40, 2, 9},
  101. +     {'\0', (char *) NULL, 0L, 0, 0, (int (*) ()) 0, 0, 0, 0}
  102. + };
  103. + #endif /*M_XENIX*/
  104.   #ifdef UNIXPC
  105.   #include <sys/gdioctl.h>
  106.   #include <fcntl.h>
  107. diff -c ../mtools/fat_read.c .//fat_read.c
  108. *** ../mtools/fat_read.c    Sat Jan  4 18:59:54 1992
  109. --- .//fat_read.c    Sat Jan 11 01:12:31 1992
  110. ***************
  111. *** 17,24 ****
  112.   fat_decode(num)
  113.   unsigned int num;
  114.   {
  115. !     unsigned int fat, fat_hi, fat_low, byte_1, byte_2;
  116. !     int start;
  117.   
  118.       if (fat_bits == 12) {
  119.           /*
  120. --- 17,24 ----
  121.   fat_decode(num)
  122.   unsigned int num;
  123.   {
  124. !     unsigned long fat, fat_hi, fat_low, byte_1, byte_2;
  125. !     long start;
  126.   
  127.       if (fat_bits == 12) {
  128.           /*
  129. ***************
  130. *** 60,66 ****
  131.            */
  132.                       /* which bytes contain the entry */
  133.           start = num * 2;
  134. !         if (start <= 3 || start + 1 > (fat_len * MSECTOR_SIZE))
  135.               return(1);
  136.   
  137.           fat = (*(fat_buf + start + 1) * 0x100) + *(fat_buf + start);
  138. --- 60,66 ----
  139.            */
  140.                       /* which bytes contain the entry */
  141.           start = num * 2;
  142. !         if (start <= 3 || start + 1 > ((long)fat_len * MSECTOR_SIZE))
  143.               return(1);
  144.   
  145.           fat = (*(fat_buf + start + 1) * 0x100) + *(fat_buf + start);
  146. ***************
  147. *** 76,82 ****
  148.   fat_read(start)
  149.   int start;
  150.   {
  151. !     int buflen;
  152.       char *malloc();
  153.       void perror(), exit(), disk_read();
  154.                       /* only the first copy of the FAT */
  155. --- 76,82 ----
  156.   fat_read(start)
  157.   int start;
  158.   {
  159. !     long buflen;
  160.       char *malloc();
  161.       void perror(), exit(), disk_read();
  162.                       /* only the first copy of the FAT */
  163. diff -c ../mtools/fat_write.c .//fat_write.c
  164. *** ../mtools/fat_write.c    Sat Jan  4 18:59:55 1992
  165. --- .//fat_write.c    Sat Jan 11 01:13:49 1992
  166. ***************
  167. *** 14,20 ****
  168.   unsigned int num;
  169.   unsigned int code;
  170.   {
  171. !     int start;
  172.   
  173.       if (fat_bits == 12) {
  174.           /*
  175. --- 14,20 ----
  176.   unsigned int num;
  177.   unsigned int code;
  178.   {
  179. !     long start;
  180.   
  181.       if (fat_bits == 12) {
  182.           /*
  183. ***************
  184. *** 52,58 ****
  185.            */
  186.                       /* which bytes contain the entry */
  187.           start = num * 2;
  188. !         if (start <= 3 || start + 1 > (fat_len * MSECTOR_SIZE))
  189.               return(1);
  190.   
  191.           *(fat_buf + start + 1) =  code / 0x100;
  192. --- 52,58 ----
  193.            */
  194.                       /* which bytes contain the entry */
  195.           start = num * 2;
  196. !         if (start <= 3 || start + 1 > ((long)fat_len * MSECTOR_SIZE))
  197.               return(1);
  198.   
  199.           *(fat_buf + start + 1) =  code / 0x100;
  200. ***************
  201. *** 70,76 ****
  202.   void
  203.   fat_write()
  204.   {
  205. !     int fat_start, buflen, dups;
  206.       void disk_write();
  207.   
  208.       if (fd < 0)
  209. --- 70,76 ----
  210.   void
  211.   fat_write()
  212.   {
  213. !     long fat_start, buflen, dups;
  214.       void disk_write();
  215.   
  216.       if (fd < 0)
  217. diff -c ../mtools/mdir.c .//mdir.c
  218. *** ../mtools/mdir.c    Sat Jan  4 19:00:07 1992
  219. --- .//mdir.c    Sat Jan 11 18:12:58 1992
  220. ***************
  221. *** 78,86 ****
  222.               if (last_drive != 'x') {
  223.                   blocks = getfree() * MSECTOR_SIZE;
  224.                   if (!files)
  225. !                     printf("File \"%s\" not found\n\n", newname);
  226.                   else
  227. !                     printf("     %3d File(s)     %6ld bytes free\n\n", files, blocks);
  228.               }
  229.               if (init(drive, 0)) {
  230.                   fprintf(stderr, "%s: Cannot initialize '%c:'\n", argv[0], drive);
  231. --- 78,86 ----
  232.               if (last_drive != 'x') {
  233.                   blocks = getfree() * MSECTOR_SIZE;
  234.                   if (!files)
  235. !                     printf("File \"%s\" not found %8ld bytes free\n\n", newname,blocks);
  236.                   else
  237. !                     printf("     %3d File(s)     %8ld bytes free\n\n", files, blocks);
  238.               }
  239.               if (init(drive, 0)) {
  240.                   fprintf(stderr, "%s: Cannot initialize '%c:'\n", argv[0], drive);
  241. ***************
  242. *** 196,204 ****
  243.   
  244.       blocks = getfree() * MSECTOR_SIZE;
  245.       if (!files)
  246. !         printf("File \"%s\" not found\n", newname);
  247.       else
  248. !         printf("     %3d File(s)     %6ld bytes free\n", files, blocks);
  249.       close(fd);
  250.       exit(0);
  251.   }
  252. --- 196,204 ----
  253.   
  254.       blocks = getfree() * MSECTOR_SIZE;
  255.       if (!files)
  256. !         printf("File \"%s\" not found %8ld bytes free\n\n", newname,blocks);
  257.       else
  258. !         printf("     %3d File(s)     %8ld bytes free\n", files, blocks);
  259.       close(fd);
  260.       exit(0);
  261.   }
  262. diff -c ../mtools/msdos.h .//msdos.h
  263. *** ../mtools/msdos.h    Sat Jan  4 19:00:29 1992
  264. --- .//msdos.h    Sat Jan 11 14:56:34 1992
  265. ***************
  266. *** 2,10 ****
  267.    * msdos common header file
  268.    */
  269.   
  270. ! #define MSECTOR_SIZE    512        /* MSDOS sector size in bytes */
  271.   #define MDIR_SIZE    32        /* MSDOS directory size in bytes */
  272. ! #define MAX_CLUSTER    8192        /* largest cluster size */
  273.   #define MAX_PATH    128        /* largest MSDOS path length */
  274.   #define MAX_DIR_SECS    64        /* largest directory (in sectors) */
  275.   
  276. --- 2,10 ----
  277.    * msdos common header file
  278.    */
  279.   
  280. ! #define MSECTOR_SIZE    512L        /* MSDOS sector size in bytes */
  281.   #define MDIR_SIZE    32        /* MSDOS directory size in bytes */
  282. ! #define MAX_CLUSTER    8192L        /* largest cluster size */
  283.   #define MAX_PATH    128        /* largest MSDOS path length */
  284.   #define MAX_DIR_SECS    64        /* largest directory (in sectors) */
  285.   
  286. Only in ./: mtools.patch
  287.