Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!mintaka!spdcc!ima!iecc!johnl From: johnl@iecc.cambridge.ma.us (John R. Levine) Newsgroups: comp.arch Subject: How wrong is MS-DOS? Summary: It has its charms. Message-ID: <1991Jan02.035501.9457@iecc.cambridge.ma.us> Date: 2 Jan 91 03:55:01 GMT References: <28774@mimsy.umd.edu> <37459@cup.portal.com> Organization: I.E.C.C. Lines: 72 Old-Subject: Re: Let's pretend In article <37459@cup.portal.com> ts@cup.portal.com (Tim W Smith) writes: >What does wrongness have to do with width of use? Look at MS-DOS, >for example, to see that wide use does not indicate lack of wrongness. Note to comp.arch purists: this article is about software architecture. I'd be the last to argue that MS-DOS is the world's best operating system, but it has its redeeming points. Remember that when the IBM PC first came out, there were three competing operating systems, DOS, CP/M, and the UCSD P-System, and since then there were lots of other competitors ranging from QNX to PC/IX. None have come anywhere near displacing DOS. DOS also scaled up reasonably well from its original extremely cramped memory environment, 16K or 64K, to its current 640K or 1MB. (IBM's OS/360 also had to work in 64K originally, and even on current 3090 systems with upwards of 128MB of RAM, some of the design compromises to squeeze OS into 64K are still evident in MVS.) I cheerfully admit that DOS completely fails to handle more than 1MB of RAM. It's not perfect. DOS mostly does two things, but it does them quite competently. It provides a program loader and a file system. The program loader is not as obvious as it looks, the CP/M loader didn't handle relocation entries and hence only handled executable images up to 64K. The DOS loader can load and relocate any amount up to the full available memory. The file system, as of DOS 2.x and later, is a little clunky but quite usable. It provides tree-structured directories containing files of arbitrary contents and length, with the ability to seek to any place in a file and read or write arbitrary length data. On floppy disks, it provides good performance since it tends to make files contiguous. There are strange limitations, e.g. the fixed size root directory and the 8+3 upper case only file names, but no worse than and in many cases better than a lot of other file systems. For a long time DOS couldn't handle a disk volume of more than 32MB, though that has been remedied in recent versions. In 1984 when I lashed up a 600MB Fujitsu Eagle disk to a PC AT, it appeared as disks D: through O:, but it did work reliably as the main disk on a network server. The best thing about DOS is its extreme extensibility. The fact that it uses software interrupts to communicate upwards with applications and downwards with the BIOS, combined with the ability of programs to load themselves permanently at runtime (so-called TSRs) and to intercept the software interrupts meant that user programs could make arbitrary extensions to DOS so long as they preserved the semantics of the calls. As a small example, there are many command history programs that intercept the "keyboard read line" system call and replace it with a version that provides history and intra-line editing. This approach provides history to any program that uses the keyboard read line call (of which there are admittedly not a whole lot) as opposed to the Unix approach in which csh and ksh have swell command history which is unavailable to any other program. As a much larger example, all PC networks before Microsoft provided the redirector interface worked by intercepting all of the file system calls such as open, close, read, write, seek, and read directory and passing references to remote files off to network code. There were compatibility problems when e.g. early versions of Novell network code provided a file name syntax more general than and hence incompatible with DOS's, but in most cases that network program interface is quite effective. I hear many voices crying out "but it's all a gross hack." Well, yes, it is. There are certainly bad things about DOS: the interfaces it didn't implement, particularly that to the screen, that force every new PC screen controller to have a hundred hardware modes that emulate every previous model of controller, and the single non-overlayed address space that is so filled up by TSRs that there's precious little space left for applications. But DOS provided extensible operating system interfaces ten years ago, something most versions of systems such as Unix have yet to offer. There are useful lessons to be learned figuring out what DOS does well and doing those things in a context that avoids DOS's mistakes. -- John R. Levine, IECC, POB 349, Cambridge MA 02238, +1 617 864 9650 johnl@iecc.cambridge.ma.us, {ima|spdcc|world}!iecc!johnl "Typically supercomputers use a single microprocessor." -Boston Globe