Columns


CUG New Releases

CUG #431: DOS Remote Installable File System

Victor R. Volkman


Victor R. Volkman received a BS in Computer Science from Michigan Technological University. He has been a frequent contributor to C/C++ Users Journal since 1987. He is currently employed as Senior Analyst at H.C.I.A. of Ann Arbor, Michigan. He can be reached by dial-in at the HAL 9000 BBS (313) 663-4173 or by Usenet mail to sysop@hal9k.com.

Introduction

Kyle A. York (McGraw Hill School Systems) submits his Remote Installable File System for DOS. The Remote Installable File System provides a LAN that links two computers through the serial port so they may share resources. RIFS installs itself as a TSR using the MSCDEX convention for installable file systems. Shareable resources are currently limited to available disk drives, including hard disks, CD-ROM, and network drives. RIFS also supports the redirection of a client parallel port to a file or device on the server. RIFS supplies 32-bit Cyclic Redundancy Check (CRC) to guarantee error-free file transfers. The CUG Library distribution includes full source in C and ASM as well as MS-DOS executables. RIFS for DOS (released 10/08/94) is immediately available as CUG volume #431.

RIFS compiles under Borland Turbo C 2.0 and uses some Turbo C-specific structures in the server packet processing. York's intention was to do as much of the code with standard C as possible. Specifically, he has limited the assembly code to only the most time-critical tasks and certain tasks that are notoriously difficult in C, such as interrupt handlers. The 32-bit CRC module is also in assembly language, for performance reasons — it is five times faster in assembly than it would be in C. Actual CRC calculations are produced from an algorithm by Rob Warnock published in comp.compression on Usenet. The assembly language files are tailored for use with Borland Turbo Assembler.

Installing and Running RIFS

You can get up and running with RIFS in just a few minutes. This example assumes COM1 for serial connections:

1. Connect computers via serial cables and null-modem

2. Add the following to config.sys on the client PC

   LASTDRIVE = Z
3. On the server PC, type

   SHARE
   RSERVER /COM1
4. On the client PC, type

   RCLIENT /COM1
5. On the client PC, type

   RDRIVE /local=Z /remote=C
(this links the client's drive Z to the server's drive C.

This is the simplest possible example of using RIFS. Each of the commands includes several options. Both TCLIENT and RSERVER allow command-line options to specify communications parameters. The /speed= option lets you select any baud rate from 300 to 115,200 baud.

RIFS supports COM1-COM4 as defined by the BIOS data area. You may define additional nonstandard COM ports by combining the /irq= and /port= parameters. For example, you might use /irq=0B and /port=02e8 on a customized COM port. RIFS cannot access FOSSIL interface COM ports, nor can it exploit smart serial boards. RIFS does not take advantage of data buffering available on serial ports with NS16550-compatible UART chips.

Both RCLIENT and RSERVER can unload their RAM resident portions via the /remove parameter. RDRIVE is technically not a TSR, since it merely changes settings in the resident part of RCLIENT and then exits without permanently allocating RAM. However, RDRIVE also has a /remove parameter, which serves to unmap any remote drive associations made so far. You can then re-use the drive letter for a different mapping.

Printer Port Redirection

Once an RCLIENT/RSERVER session is established, you can also take advantage of parallel port redirection services. Just as RDRIVE lets the client use the remote disk system as a local drive, RPORT lets the client share the remote computer's printer as if it were local. Specifically, any of LPT1-LPT3 on the local computer can be mapped to LPT1-LPT3 on the remote computer.

MSCDEX and Installable File Systems

The Microsoft MS-DOS CD-ROM Extensions (MSCDEX) provide a much simpler method of allowing access to a non-local drive than redirecting INT 21h (Disk Request) and associated functions. Instead, an installable file system, such as RCLIENT, only needs to chain into INT 2Fh (Multiplex). The advantage is that this module has to provide only a handful of services, allowing DOS to do most of the work. Any disk that is compatible with DOS is automatically compatible with RIFS.

For those interested in low-level details of IFS, York recommends chapter 4 of Schulman et al., Undocumented DOS (ISBN 0-201-63287-X). I have found the Microsoft Press book MS-DOS Extensions (ISBN 1-55615-212-4), by Ray Duncan, to be helpful in detailing MSCDEX functions. You might also look in the Microsoft Developer's Network CD-ROM under the "Microsoft CD-ROM Extensions Device Driver Kit (DDK)."

System Requirements

RIFS required software and hardware requirements are minimal:

The RCLIENT module works with MS-DOS 3.2 and later, except for MSDOS 4.x. RCLIENT has been tested with MS Windows 3.1 and Desqview 2.4 and can run either inside a DOS window or before Windows or Desqview is loaded. In the latter case, the remote drives become available to all windows. Note also that the remote drive can only be accessed sequentially — rather than simultaneously — by multiple windows. RCLIENT will not work with Windows NT 3.0 and may not be compatible with OS/2.

The RSERVER module runs in one of two possible states. On a computer running only DOS, it runs in an internal multitasking state. If it runs under Desqview, the internal multitasking must be disabled with the /nobackground command-line switch. Further, it must be run in a dedicated window, which causes a slight decrease in performance. RSERVER running with multitasking disabled works with any multitasking operating system that runs DOS programs. It has been tested with Window NT 3.0 and Desqview. RSERVER will not run with Windows 3.1 unless it is rewritten to be a VxD.

RIFS operates efficiently even on older PCs. York has benchmarked 23,000 bps effective throughput rates on a classic 4.77Mhz PC and 115,200 bps on a 12Mhz 80286. The maximum rate of standard serial ports is 115,200 bps due to the baud rate oscillator division.

Documentation, Licensing, and Support

RIFS documentation consists primarily of a usage guide and technical notes in a five-page ASCII file. The usage section explains the underlying theory of operation as well as the command-line syntax for RCLIENT, RSERVER, RDRIVE, RSTATUS, and RPORT. The technical notes highlight some of the design decisions, including the advantages of implementation using MS-DOS Installable File System hooks. A separate file documents the client/server communication protocol. The structure of a packet is shown in Figure 1.

York intends RIFS primarily for personal, noncommercial use. He specifically asks you to refrain from reselling the product until contacting him first. Also, he asks that you retain his name where it appears in comments when incorporating his code into your program. Last, if you produce modified versions of the source, please indicate your name as well.

Since RIFS is freeware, a formal technical support plan is unavailable. However, the author encourages feedback by email whether positive or negative.

Future RIFS Development

York has several ambitious ideas for improving RIFS in the future. Some of these include: