K-DOS - An Alternative to Atari DOS
K-DOS from K-Byte is an alternative to the Atari Disk Operating System, DOS II. The file management system of K-DOS is compatible with Atari DOS, but offers a greater level of control over peripheral devices and memory. Although it offers many features which will be appreciated by every Atari user, K-DOS will be of most use to the serious programmer.
Since the benefits to be gained by using K-DOS are the result of certain tradeoffs, the potential buyer should think hard about how much a more convenient disk operating system is really worth.
Chief among these trade-offs is the amount of memory that K-DOS leaves available to the user. K-DOS is memory resident, so most of its features are immediately accessible, but it also takes up a great deal of space. With a Basic cartridge inserted, the amount of free memory available in a 40K system is 25,228 bytes. This is almost 7K less than the 32,274 bytes available with Atari DOS, or the 31,758 bytes available with OS/A+.
Besides reducing the amount of memory available for programming, the large size of K-DOS puts the start of low memory above $3000. (An optional program included with the package lets you remove the plain English error messages, which saves enough bytes to bring the end of KDOS just below $3000). Machine language programs which are assembled to run just above the end of Atari DOS, may conflict with K-DOS, and may not run under it.
If you have memory to spare, however, K-DOS offers many attractive features. It is, for example, a pleasure to use: all DOS functions are accessible from Basic, Pilot, the Assembler cartridge, or whatever program environment you happen to be in.
Since K-DOS is command driven, you need not call up a menu to execute a DOS function. You simply precede the command by a comma (or some other character which you can define as significant to DOS), and the DOS function is executed without changing program environments.
The syntax required for command lines is flexible, so commas can be replaced by spaces, lower case is acceptable, and the DOS environment automatically resets the inverse character shift. Device defaults are supplied whenever possible, and short abbreviations are allowed, so a minimum of keystrokes is required to perform any function. Error messages appear in plain English, rather than a frustrating number code.
Unlike OS/A+, which puts you back in the operating system every time you hit System Reset, K-DOS will only bypass Basic if you hit the Start key along with System Reset. And unlike Atari DOS, the device handler for the 850 interface unit boots automatically if it is turned on. There is no need for a separate AUTORUN.SYS file.
The reason that K-DOS can let you use DOS command lines from Basic is that it re-routes all input to the line editor (although it gives you a command, KILL, which will take its "hooks" out of the handler table if desired).
This greater level of control over the system is characteristic of K-DOS. For example, the 6502 BREAK instruction is vectored to get you back to DOS any time the instruction is encountered, rather than having the system hang up. You may get a little better idea of what this means if you slip in the Basic cartridge and type INPUT (RETURN).
With Atari DOS II, the system locks up, and the only way to recover is to turn the computer off and reboot. With KDOS, a BRK message appears, and you enter DOS. You should even be able to recover from the dreaded "editing lockup," which occurs when Basic moves a block of exactly 256 bytes (You must still know enough about how Basic works to reset the statement pointers, however, as that particular bug tampers with your program code before it crashes the system).
Another aspect of the system control offered by K-DOS is that it allows you to stop disk I/O just by hitting the BREAK key, without destroying your data. It also tries very hard to read and write marginal sectors before bombing out, which is important, given the notorious speed fluctuation of older Atari disk drives.
K-DOS puts some nice touches on some of the original DOS functions. For example, INIT combines formatting and writing DOS files to the new disk in one operation, although these functions are still available separately. The duplicate disk function offers the option of a straight sector copy for boot-disks that do not have file information on them, and also allows the faster write without verify and continuous retrying of bad sectors.
There is a separate APPEND command, which allows you to enter data at the end of a file directly from the keyboard. The append function uses any space available in the last sector, rather than starting a new sector as Atari DOS does. The binary load command prints to the screen the location in memory into which the file is being loaded, if you so desire, which is much more convenient than reading the headers and calculating the addresses by yourself.
But K-DOS doesn't take up all that memory for the sake of a few slight modifications. It also contains a complete machine language monitor which allows you to examine memory in hexadecimal and ASCII formats, alter memory by typing in either hex or ASCII values, and examine and alter the contents of the registers. K-DOS gives you two ways to execute a machine language program. GO runs the program after closing all devices, and does not preserve the registers. PROCEED continues a program after a breakpoint has been reached, without changing the contents of the registers or the status of any device, making it a very handy debugging tool.
Similarly, the command XIT allows you to get back to a Basic program that calls DOS, and continues to run that program from the point at which DOS was called.
A null device handler has been added, so that you can test I/O operations quickly by directing them to N:. LOMEM lets you examine and alter the bottom of memory available to a cartridge. This allows you to reserve space for machine language programs, or just to reduce the amount of memory available to see if a Basic program will run on the minimum 16K system. UDC allows you to add your own user-defined commands to the system.
In addition, K-DOS offers many commands which allow you to access certain routines used internally by DOS, just by giving a one-word command. For example, COLD and WARM provide an easy way to coldstart or warmstart a cartridge. RESET reboots the 850 handler when you have expanded the drive buffers -- or just forgotten to turn it on when you booted up.
TEXT corresponds to a GRAPHICS 0 call in Basic, and opens the screen device, which is handy for moving the display list when you want to load a program into high memory. CLOSE closes all files, turns off the sound, resets VBLANK vectors, and turns off Player-Missile graphics. ER followed by a number will print the English error message for that error number, which is very handy when you want to interpret I/O errors that are generated by Basic.
None of these functions is earthshaking, and all can be accomplished in other ways with a little effort, but the author's attitude was that as long as the routines for doing them were already in DOS, it made sense to allow them to be accessed easily.
Unfortunately, the lack of depth in the documentation runs somewhat counter to this intention of allowing the programmer easy access. The glossy K-DOS Handbook is nicely bound, comes with a pocket summary card, is clearly written, gives examples of the proper syntax for each command, and covers most of the commands very well.
However, it treats some of the more esoteric commands in a cursory manner. Take, for example, the explanation of the UNLOAD command: "Tries to erase area where cartridge is; unloads any RAM based cartridge and resets LOMEM back to end of DOS." The beginner will no doubt read this sentence, re-read it once to verify that all of the words are in English, and then press on, no better or worse for the experience.
The experienced user, on the other hand, might gather from this explanation that it is possible to load a program into RAM, and fool the system into thinking that the program is cartridge-based, allowing an easy transition back and forth between that program environment and DOS. The inference would then be that the UNLOAD command erases this program, and lets the system know that no cartridge is present. But how do you set up this "RAM based cartridge" in the first place? No clue is given, leaving the experienced user perhaps more frustrated than the beginner.
Another example of a similar sort is the system equate files that are supposed to give the user access to system routines, such as the one to type text messages from a buffer. There are no detailed examples of how to use them, however, and the internal commenting is too scanty to allow most users to benefit from them. Features like these could be real selling points to the ambitious programmer if they were treated less superficially in the documentation.
My impression of K-DOS is that aside from these omissions in the documentation, it is a convenient tool for the user who is serious about programming.
As one who uses his computer mostly for programming, I have found K-DOS especially helpful in developing software that combines Basic with machine language subroutines. But I think that K-DOS will be of much less interest to the casual programmer who may have less than 40K of memory.
While such a user might appreciate some of the features, he would probably never take advantage of the machine language monitor, the null device, or many of the other goodies which make K-DOS so big--and so expensive. If you fall into that category, you might be better off spending the money on something that will let you gobble dots, eradicate insects, or save the universe.
Sheldon Leemon, 14400 Elm St., Oak Park, MI 48237.