N O V A D O S D O C U M E N T A T I O N ========================================= R e l e a s e H NovaDOS is an enhanced CP/M compatible Disk Operating System which takes advantage of the features of the Z80 microprocessor. It provides a number of features over and above the Digital Re search BDOS, many of which are user-selectable at assembly time. It is similar in many respects to ZRDOS, a widely available commercial CP/M DOS, and can be made to emulate ZRDOS quite closely. Most Z system utilities which require ZRDOS will also operate under NovaDOS. NovaDOS supports many ZRDOS features including the calls to Get and Set Warm Boot Trap, Return DMA Address and return ZRDOS version number. Additional features include a DOS search path, 2 kinds of public files, archive bit support, improved manage ment of floppy drives and much more. The software interface pre serves all Z80 registers not involved in returning data to calling applications. Lindsay Haisley 14206 Spreading Oaks Drive Leander, TX 78641 (512) 259-1190 (512) 444-8691 (Z-node 77) NovaDOS - A replacement for CP/M 2.2 BDOS Release H. 03/14/89 NovaDOS is an update of SUPRBDOS, formerly P2DOS. The present incar nation as NovaDOS is the responsibility of: Lindsay Haisley 14206 Spreading Oaks Leander, TX 78641 (512) 259-1190 (vox) (512) 444-8691 (Z-node 77) Please notify Lindsay of any bugs or problems with NovaDOS. SUPRBDOS was updated from P2DOS by Benjamin Ho 626 Emerson St. Evanston, IL 60201 COPYRIGHT NOTICE ---------------- The source code for NovaDOS is copyright (c) 1985 by Herman Ten Brugge of The Netherlands. It may be freely copied and used for noncommercial purposes. Any commercial use is prohibited unless approved in writing by the original author, H.A.J. Ten Brugge. ALL RIGHTS RESERVED H.A.J. Ten Brugge Molenstraat 33 NL-7491 BD Delden The Netherlands Tel:..31-5407-1980 NZCOM is a registered trademark of Alpha Systems Corp., 711 Chats worth Place, San Jose, CA 95128. JetLDR is a registered trademark of Plu*Perfect Systems, 410 23rd St., Santa Monica, CA 90402 ZRDOS mentioned herein is copyright (C) 1985, 1986 By Dennis L. Wright. Thanks to Jay Sage for bits and bytes of higher education, Phil Newman for beta testing previous releases, Pat Price for beta test ing this release, Bridger Mitchell for his elegant code relocation algorithm and Jim Lill for his fine routines to display assembly stats. T A B L E O F C O N T E N T S --------------------------------- OVERVIEW OF FEATURES . . . . . . . . . . . . . . . . . . 1 DISCUSSION OF FEATURES . . . . . . . . . . . . . . . . . 3 Public Files . . . . . . . . . . . . . . . . . . . 3 Search Path . . . . . . . . . . . . . . . . . . . 3 Archived Files . . . . . . . . . . . . . . . . . . 4 Console Checking . . . . . . . . . . . . . . . . . . 5 Time and Date Stamping . . . . . . . . . . . . . . . 5 High Bit Characters . . . . . . . . . . . . . . . . 7 Permanent Media Relogging . . . . . . . . . . . . . 7 Changed Disks . . . . . . . . . . . . . . . . . . . 8 Use of Z80 Registers . . . . . . . . . . . . . . . . 8 Disk Initialization . . . . . . . . . . . . . . . . 9 NovaDOS Flags . . . . . . . . . . . . . . . . . . . 10 NOVADOS ERROR HANDLING . . . . . . . . . . . . . . . . . 11 CONFIGURATION AND INSTALLATION . . . . . . . . . . . . . 12 NOVADOS FUNCTIONS . . . . . . . . . . . . . . . . . . . . 13 Function 1: Read Console Byte . . . . . . . . . . 13 Function 2: Write Console Byte . . . . . . . . . . 13 Function 6: Direct Console I/O . . . . . . . . . . 13 Function 9: Display $-Terminated STring . . . . . 13 Function 10: Read Console String . . . . . . . . . 14 Function 11: Read Console Status . . . . . . . . . 14 Function 13: Reset Disk System . . . . . . . . . . 14 Function 15: Open File . . . . . . . . . . . . . . 15 Function 19: Erase (Delete) File . . . . . . . . . 15 Function 21: Write Sequential . . . . . . . . . . . 15 Function 34: Write Random . . . . . . . . . . . . . 15 Function 37: Reset Drive . . . . . . . . . . . . . 16 Function 38: Relocate Code . . . . . . . . . . . . . 16 Function 39: Return Fixed Media Vector . . . . . . . 16 Function 41: Get/Set NovaDOS Flags . . . . . . . . 17 Function 42: Set Path Address . . . . . . . . . . . 17 Function 47: Return Current DMA Address . . . . . . 17 Function 48: Return ZRDOS Version Number . . . . . 17 Function 50: Set Warm Boot Trap . . . . . . . . . . 17 Function 52: Reset Warm Boot Trap . . . . . . . . . 18 Function 200: Get Time . . . . . . . . . . . . . . . 18 Function 201: Set Time . . . . . . . . . . . . . . . 18 ASSEMBLY . . . . . . . . . . . . . . . . . . . . . . . . . 19 Loadable REL Files . . . . . . . . . . . . . . . . . 19 Patching PUTSYS with a HEX File . . . . . . . . . . 19 ADDITIONAL ASSEMBLY OPTIONS . . . . . . . . . . . . . . . 20 Binary Image Files . . . . . . . . . . . . . . . . . 20 SPR/PRL Files . . . . . . . . . . . . . . . . . . . 21 .foNovaDOS User's Manual Release H AN OVERVIEW OF NOVADOS FEATURES: ================================ NovaDOS is a 100% CP/M 2.2 compatible replacement for Digital Re search BDOS. It is not protected by Digital Research's copyright, and is limited only by the rather generous public domain restric tions in the original copyright notice reproduced above. It may be used with the standard Digital Research CCP or with any of the ZCPR's. The following features are improvements on the standard Digital Research BDOS and are discussed fully in the following sections. ** Two kinds of Public files are supported, as explained in the public files section below. ** A search path is available which will access system and public files in directories other than the default. The dospath address may be modified through an optional DOS Function 42 call. ** The archive file attribute bit (high bit of the second filename letter) is supported. Any file write operation will reset this bit on all file extents of the affected file. ** Console Status may be checked after every 256 characters of output. This makes it possible to exit a program doing contin uous screen output using ^S ^C even though other characters are waiting to be processed ** Time and date stamping of files is supported, assuming the directory has previously been set up to contain the stamps and the BIOS supports a calendar/clock. ** Two different methods are provided for sensing the change between single and double sided floppy disks on computers which support both formats. Both methods take advantage of the user- configurable nature of NovaDOS to gain direct access to powerful BIOS features not usually available to the DOS. ** Automatic logon of changed disks is supported. A changed disk is relogged into the system rather than declared R/O, as with CP/M. No warm boot is required. ** Permanent media (hard and RAM disks) are supported by a perma nent media vector and a fast disk reset option. ** An internal flags byte is available through a call to NovaDOS Function 41. These flags control the 256 character delay, access to public files, high bit character I/O and the relogging of permanent media. ** Error messages have been greatly improved and include the file names of files involved error conditions. Optional override of file R/O error provided. ** The delete key works like a backspace under function 10. The ^R (redraw buffer line) command has been eliminated to provide space. ** Functions may be assembled into NovaDOS to support software designed to run under ZRDOS. ** Support for high bit character I/O is may be enabled in the assembly. If included, this feature is under the control of the flags byte. ** Disk size can be as large as 65536 * 16K = 1 G byte. ** File size can be as large as 32 * 64 * 16K = 32 M byte. DISCUSSION OF FEATURES: ======================= Public files: ------------- Public files are files which appear to be independent of user area and may be accessed by an Open File request to any user number on the disk on which they reside. NovaDOS supports two kinds of public files. Type 1: Files whose names begin with "$" ($-Pub) Type 2: Files whose names have the attribute bit of the second filename character set. Type 1 $-Pub files include the submit command file $$$.SUB which should be public under ZCPR33 and 34. These ZCPR's read this file from directory a0: while older CPR's and many utilities which read, write or erase the $$$.SUB file expect to find it in the current user area on the A drive (A$:). The $-Pub facility solves the prob lem created by this difference. $-Pub files are R/W and can be erased from any directory by naming them unambiguously in a Function 19 call. Type 2 public files are defined for NovaDOS by setting the second filename attribute bit. Public files will be opened and read by NovaDOS just as if they were in the current user area on the default disk or on any disk in the NovaDOS search path. Public files are normally defined as read only, and an attempt to write to a public file will produce a standard NovaDOS error message. Resetting bit 2 of the internal flags (see the discussion of NovaDOS function 38) will turn off the public files facility. The write protect status of public files is determined by bit 4 of the flags bytes. Setting this bit sets all public files to R/O and resetting it declares them R/W unless they are additionally tagged with the Read Only attribute. The utility PUBLIC.COM is provided to manage this bit on selected files while PFILE.COM is provided to set/reset bits 2 and 4 of the flags byte within NovaDOS. Search path: ------------ NovaDOS provides an optional search path to access files not located in the default directory. The search path information consists of byte pairs specifying disk and user area for each dospath element. A pointer to the search path is contained at dos + 15h. Setting this pointer to 0 will disable the search path altogether. The current directory is not included in the search path unless specified in the path definition. NovaDOS will search for both system and public files in the current search path. All other files will be ignored. The utility DOSPATH.COM is provided to define and query the NovaDOS search path. It is self documenting and works in a manner quite similar to the Z3 utility dospath.COM. Note that invoking DOSPATH with no arguments will cancel the NovaDOS search path, while no similar function is available for the Z3 dospath utility. The search path consists of a series of byte pairs. The first byte of each path element pair is an ASCII disk letter while the second byte of each dospath element is the user area in binary form. User 1 is stored as 01h, user 2 as 02h and etc. The dospath is terminated by a binary 0. It is the responsibility of the cold boot to initial ize the DOS dospath area either with a valid DOS dospath or with zeros. The dospath address is hard coded into NovaDOS at assembly time. Function 42, if enabled in assembly, may be used to query and reset the dospath address at run time. See the discussion of functions below. The NovaDOS search path is in no way exclusive of, or in conflict with the ZCPR3 path. It is especially useful for non-ZCPR programs such as dBase and WordStar which require access to overlay files. Such overlays may be kept as system files in a directory specified in the NovaDOS path and accessed by such programs from any direc tory. The NovaDOS path will take precedence over the ZCPR3 path, and it must be remembered that EACH element of the Z3 path will cause NovaDOS to do a dospath search. This can increase file access time considerably. If you have the Z3 dospath enabled, you should use the NovaDOS path sparingly. Archived Files: --------------- A file is defined as archived if the attribute bit of the last character in the filename extension is set in its directory entry. This bit is customarily set by utilities which copy files for backup purposes or by other programs capable of setting attributes directly such as the Z3 utility PROT.COM. It is used to indicate that a copy of the file in its present form exists somewhere else, usually on a backup disk. NovaDOS will reset this bit in the directory entries for all extents of a file anytime the file is copied, renamed or otherwise changed in a manner which would affect the accuracy of a backup copy. This applies also to copies made by programs which copy filenames directly from one FCB to another (such as WordStar or any other program which creates a *.BAK file) since the archive bit is reset in the original FCB as soon as any change to the file is made. Console Checking: ----------------- If bit 1 of the flags byte is set, then the console status will be periodically checked during Function 2 or Function 9 console output and any pending ^S will be identified for the purpose of pausing the output. See the discussion under Function 41 on setting and reset ting the flags byte. Under Digital Research BDOS, the keyboard will lock up if a charac ter other than a ^S or ^C is typed during continuous screen output. On occasions when it is necessary to exit a program with ^S ^C, such as when an infinite loop condition exists, an improper keyboard entry will prevent a ^S from ever being recognized. If the Console Clearing feature of NovaDOS is enabled, then the console input device is automatically checked for ^S after every 256 characters of console output. During intensive console I/O, this will result in a somewhat more erratic keyboard operation than one would expect from standard BDOS, however the difference is only noticeable in games, flight simulators, animated debuggers or other programs requiring precise timing of keyboard input. A call to Function 41 can be made to disable this feature. Since this somewhat complex feature is implemented internally within the DOS console status check, it may on occasion be desirable to bypass this routine and obtain the console status directly from the BIOS. NovaDOS provides the ability to do this using DOS function 6, Direct console i/o. Setting register e to 0feh when calling function 6 will return the console status directly from the BIOS. Time and Date Stamping: ----------------------- Time and Date stamping are supported, assuming that a calendar/clock device is available via BIOS call. The address of this routine must be specified as an offset into the BIOS by the TIMEOFF equate in the header library Ndoshdr.LIB. The directory must have been previously initialized for standard date/time stamping of files in which case the time and date are initialized when a file is created under NovaDOS and updated each time a file is closed. The address of the BIOS date/time routine is stored at NovaDOS + 17h. Two function calls are provided to access the date/time information, assuming date/time stamping of files is enabled at assembly time. Function 200 accepts an address in DE at which to write date/time information in the following format: Date: defs 2 Date = 1 (Sunday, 01 Jan 1978) to Date = 65535 (Sunday, 05 Jun 2157) Hour: defs 1 Hour in BCD Minute: defs 1 Minute in BCD Second: defs 1 Second in BCD After returning to the caller, the current date and time will be stored at the requested address. Function 201 will set the calendar/clock from a similar data struc ture addressed on entry by register pair DE. The BIOS routine accessed for date/time information must observe the following protocol: Entry parameters: if getting time C = 000h To get time if setting time C = 0ffh To set time HL = pointer to time table in above format Exit parameters: if getting time HL = pointer to time table in above format if setting time none High Bit Characters: -------------------- High bit characters are standard ASCII characters with the high bit (7) set. They are often referred to as graphics characters since they are sometimes used to produce graphics on printers and CRT's which otherwise display the standard ASCII character set. Standard BDOS allows high bit characters to be read from the input device with the functions Console Input and Direct Console I/O (#s 1 and 6) but not with Function 10, Read Console Buffer. On output, high bit characters in the data stream are normally sent by all functions which send characters to the output device. If high bit character control is programmed into NovaDOS, then the stripping of high bits from the data stream is altered as shown in the following tables. yes = High bit stripped no = High bit not stripped Input (Bit 2) Output or echo (Bit 3) Function Norm Set Reset Norm Set Reset -------- --------------------------------------------- Read Console Byte yes yes yes yes yes no Write Console Byte --- --- --- yes yes no Direct Console I/O yes yes yes yes yes yes Display "$" String --- --- --- yes yes no Read Console String no yes no yes yes no Many computers cannot enter high bit characters from the keyboard. On such machines, the high bit facility is not needed and can be eliminated from the assembly. Permanent Media Relogging ------------------------- Under CP/M, a function 13 disk reset will treat the entire system as "new" and log in the A drive, reading the disk's directory to build an allocation vector. This takes time, and if the A drive is a permanently installed disk such as a hard disk or a ram disk there is no need to rebuild the allocation vector each time a function 13 is called. Flags bit 5 controls the re-initializing of the system (A) drive. If the flag bit is reset, no initialization will be per formed, which can dramatically reduce the time required for warm boots. There is a tradeoff for this feature. In the process of building the allocation vector the DOS normally checks for the presence of files whose names begin with "$" ("$$" for NovaDOS) and returns A=0ffh if such a file is found. The CCP may use this flag to determine the presence of a $$$.SUB file for processing by the submit facility, and need not perform another search of the disk directory to dis close the presence or absence of this file. If flags byte 5 is reset, Function 13 will always return A=0 and if the CCP is expec ting this "submit clue" it will not engage the submit process. Since the submit process has largely been replaced by ZEX on ZCPR3 sys tems, this is almost a non-problem, however dBase II still relies on the submit feature in chaining to other programs. If you use the "quit to" feature of dBase, you will want to set flags bit 5 for the duration of the process. Function 41 makes it easy to change this feature "on the fly". The utility FBOOT is provided to manipulate this bit. Changed Disks: -------------- NovaDOS is quite intelligent regarding changed floppy disks. A checksum table is maintained for each disk directory and is checked frequently with various disk operations. If a changed disk is sensed, NovaDOS will attempt to recover by relogging the drive and attempting to proceed with whatever operation is in progress. CP/M, by contrast, simply declares the offended drive to be read only and will not write to it until a Function 0 or Function 13 disk reset is performed. NovaDOS, as well as applications, CAN be confused, for instance, by swapping disks while files are open, so reasonable care should be exercised in this regard. As a companion feature, NovaDOS, unlike CP/M, doesn't reset the drive read/only bitmap with a Function 13 call. On systems which do not reload the DOS with each warm boot, the only way to reset a R/O drive to read/write is via a Function 37 call. Use of Z80 Registers: --------------------- Unlike some other CP/M DOS's, NovaDOS is fairly conscientious about preserving the Z80 Registers. On return from all calls the C, DE IX and IY registers are preserved. Registers A and HL will be set to zero if the called function does not return values in these regis ters. It should be noted, however, that software which is written to take advantage of this feature may not run properly under other DOS's. It was and is generally accepted practice among Z80 computer systems designers to make operating system software preserve the special Z80 registers IX, IY and the alternate register set across system calls. Unfortunately, this has not always been done and some BIOS's alter the contents of one or more of these registers. Known offenders in this area are some Osbornes, Zorba, Epson QX10, Televideo TS803/T-1, and probably others. NovaDOS uses the IX register and expects the contents thereof to be retained across BIOS calls. BIOS's which alter this register will cause NovaDOS to crash. Disk Initialization ------------------- Some systems, like the Kaypro 4 and 10, are capable of reading and writing both single and double sided floppy disks. On such systems, the floppy is usually un-initialized only on a warm boot, which means that applications such as cataloging programs which handle many floppy disks in the course of a run are unable to read both formats in the same run. Further problems are introduced with systems such as NZ-COM which do not allow the generation of a true warm boot. On such systems in is often quite difficult to un- initialize a floppy drive even with a Function 0 call. This is true even for such advanced DOS's as ZRDOS, all of which are limited to making standard BIOS calls via the BIOS jump table. Because NovaDOS is user configurable, it can access the BIOS in non-standard ways which allow it to turn off the current floppy format selection and force the redetermination of the format with the next disk login. There are two ways of achieving this, both of which involve some knowledge of the workings of the system BIOS. Each has its advantages, although the second method is more precise and preferable if it can be used. 1. The warm boot routine in BIOS usually contains a call to a disk initialization subroutine which resets all the internal flags and parameters for the disk system. If the address of this routine can be determined then it can be called each time a function 13 (reset disk system) call is made. This method has the disadvantage that it resets the entire disk system, and can thus only be used with a function 13 call and then only when full relogging of permanent media drives is enabled (see NovaDOS flags). The advantage is that the disk initialization call is generally easy to find (just about every system has one) and if the source for the system BIOS is available, a jump to this call can be placed in the base page along with the warm boot IOBYTE and DOS jump at system startup. 2. A single byte in the BIOS ROM scratch memory area usually con trols the determination of floppy format. The byte is a flag which tells the operating system whether or not the floppy format is known. On systems with two or more floppies there may be more than one such flag byte. Resetting this byte or bytes is a very precise way of resetting the floppy format without un- initializing permanent media as well. The reset can be performed when a disk is logged in rather than when it is logged out, and the system becomes more transparent to floppy format changes. Instructions and suggestions are provided in NDOSHDR.LIB for analy zing your BIOS in order to implement either of these methods. NovaDOS Flags: -------------- One of the more powerful features of NovaDOS is the flags byte. A number of run time features, as discussed below, are affected by the flags byte. Unlike features included or excluded by assembly con figuration options, the features affected by the flags may be controlled by setting and resetting individual bits in the flags byte. A special DOS function, Function 41, is available to both read and write to individual bits of this byte. The flags byte is most useful on systems such as NZ-COM which, unlike CP/M, don't reload the DOS with each warm boot call. Thus, the flags retain their settings until the system is cold booted. The NovaDOS flags byte is interpreted as follows: SET RESET Bit 0: Both type 1 and type 2 The public files public files are recognized. facility is disabled. Bit 1: The ability to poll the No checks for ^S are per- console input for ^S during formed during extended output is enabled. console output. Bit 2: Allow high bit characters to High bits will be stripped be entered into the con- off of all characters en- sole buffer if the high bit entered into the console facility is enabled. buffer. BIT 3: High bits will be passed High bits will be stripped by all NovaDOS functions from all output characters which send characters to the except those output by CRT. Function 6. BIT 4: Files with the public file Files with the public file attribute (second filename attribute set are read/ character high bit) are read write. only. BIT 5: The A drive will be searched If the A drive is a fixed and the allocation vector disk, the allocation vector rebuilt each time Function 13 will not be rebuilt on is called. Function 13 call, saving much time on warm boots. NOVADOS ERROR HANDLING: ======================= NovaDOS provides substantially more information in its error reports than does ZRDOS or standard CP/M DOS. The DOS function which encoun tered the error, the disk and the name of any file involved in the error are displayed. Entering ESC (or the key designated in NDOSHDR.LIB) after an file or disk read only error overrides the error and treats the file or disk as R/W. Any other key produces a jump 0 warm boot unless the warm boot trap is set. If the warm boot trap is set, error messages and error escape are disabled. Error Code Returns: ------------------- To maintain compatibility with ZRDOS inasmuch as possible, NovaDOS will return error codes on a DOS generated warm boot either with or without warm boot trapping. If the warm boot trap is set, the calling program can make use as it will of the error codes. Error Number NovaDOS ZRDOS CP/M 1 Disk Read Error Disk Read Error Bad Sector 2 Drive Select Error Drive Select Error Select 3 Disk R/O Error Disk R/O error R/O 4 File R/O Error File R/O error File R/O 5 Disk Write error Disk Changed Error - 6 - File Wheel Protected - CONFIGURING AND INSTALLING NOVADOS: =================================== Although you may run the pre-assembled versions of NovaDOS provided with this package and enjoy many of it's advanced features, full use of NovaDOS features requires re-assembly of the source code. All "fine tuning" for advanced features is done in the file NDOSHDR.LIB which contains extensive discussion and instructions for setting the assembly values and equates provided therein. NDOSHDR.LIB is essen tially a separate configuration manual for NovaDOS, and so details of the configuration process are not provided here. NovaDOS will assemble with either the fine SLR assembler Z80ASM (or it's big brother Z80ASM+) or with Microsoft's M80 which is slower but more readily available. The assembly process is covered in the last section. Read through NDOSHDR.LIB and then go back through it and set the options which suit your needs and your system. You may assemble to either a REL file for loading with NZ-COM or JetLDR or to a binary image with phased code addresses for use with PUTSYS. An option is also provided to assemble and link to a PRL file for use with code or utilities which can handle the opportunities provided by a relo cation bitmap. The file MAKENVDS.COM uses such a file to generate a copy of NovaDOS tailored to your system. NOVADOS FUNCTIONS: ================== The following discussion of functions covers only those features which differ in some respect from the Digital Research BDOS func tions. Any good CP/M reference manual will give information on the details of the standard BDOS functions. Function 1: Read Console Byte C = 01h ------------------------------ If high bit character control is enabled, the echoing of high bit characters to the screen with Function 1 is under the control of flags bit 3. Function 2: Write Console Byte C = 02h ------------------------------- An automatic check is made every 256 characters for the presence of ^S at the console input. This check will bypass any other character waiting to be processed by DOS console input and if a ^S has been typed, screen output will be halted. This feature will result in a slight loss of keyboard response speed during times of intensive screen output. This is only noticeable with programs such as games or animated debuggers requiring very precise timing of keyboard entry. The character checking feature may be disabled using function 41 to reset bit 1 of the flags byte. Function 6: Direct Console I/O C = 06h ------------------------------- This function, in addition to standard I/O capabilities, provides the ability to check console status directly via a call to the BIOS, bypassing the routines associated with the input checking feature of Functions 2 and 11. A call to this function with E = 0feh will return A = 0 if no character pending and A = 0ffh if a character is pending. Function 9: Display "$"-Terminated String C = 09h ------------------------------------------ Notes for Function 2 apply to Function 9 as well. Function 10: Read Console String C = 0ah --------------------------------- The delete key behaves in a respectable fashion, i.e. like the backspace key. As a result, the ^R (rewrite line) feature is no longer necessary and can be eliminated in assembly, if desired. If high bit character control is enabled, then the input and echoing of high bit characters is under the control of flags bits 2 and 3. Function 11: Read Console Status C = 0bh --------------------------------- This function is invoked by Functions 2 and 9 to check for a pending character. Any character other than ^S is read and stored internally for future processing, and a call to this function will indicate that a character is present at the input console, even though the pending character has already been read and stored. For a true call to the BIOS status routine, use Function 6 with E = 0feh. Function 13: Reset Disk System C = 0dh ------------------------------- Unlike CP/M, NovaDOS does not necessarily reset the Read Only vector on a function 13 call. Thus, if the runlog equate was set false in the header file at assembly time , a disk may be reset to R/W only by a call to function 37. If flags bit 5 is reset, the allocation vector will not be re built for fixed media. This will save a great deal of time on warm boots but may cause problems with other features as discus sed in the next two paragraphs. If Flags bit 5 is set, Function 13 returns A = 0ffh (the submit flag) if a file on the A drive exists whose name begins with "$$". Note that, unlike some other CP/M DOS's, a file whose name starts with a single $ character will not set the submit flag. $- Pub file names should not begin with "$$" if the submit flag is used by the CPR to establish the presence of submit command file. Function 14: Select Disk C = 0eh ------------------------- The Select Disk function contains the call to the BIOS RESDSK routine (if enabled) which is called prior to logging in a floppy drive. This allows both single and double sided disks to be read by machines which support both formats. With NovaDOS release H, a RESDSK call is made not only by this function when logging in a floppy in response to an external call, but also by any function which senses a changed disk since the last login of the floppy drive and calls this function internally. Function 15: Open File C = 0fh ----------------------- The set of files which are accessible via Function 15 is extended by the use of the NovaDOS search path and by the use of public files. See the section "Discussion of Features" above for a detailed explanation of the search path and public files. If a floppy disk has been changed the last disk reset NovaDOS will simply reset the drive and proceed. A changed disk under CP/M BDOS resulted in the disk being declared read only. Function 19: Erase (Delete) File C = 13h --------------------------------- It is worthy of note that even while public files are made be read only by setting flags byte 4, they may be erased with Func tion 19. Function 21: Write Sequential C = 15h ------------------------------ NovaDOS will consider all public files to be Read Only unless a call to Function 41 has altered this condition. Any attempt to write to such a file will produce a standard "File is R/O" mes sage. Writing to a file will cause the archive bit to be reset in the directory entry for the file when it is closed. Function 34: Write Random C = 21h -------------------------- See notes for Function 21. Function 37: Reset Drive C = 25h ------------------------- NovaDOS may be configured on assembly to emulate ZRDOS in the execution of this function. Standard CP/M DOS will reset the bits in the write protect vector for all drives which are not curren tly logged in. If ZRDOS emulation is enabled, only those drives which are specifically logged off are reset to a Read/Write condition. Function 38: Relocate Code C = 26h --------------------------- This is an experimental function which as yet has no applica tions. A pointer to a Relocation Control Block is passed in DE. Code specified by the block is relocated and address adjusted. The format for the RCB is as follows: defw oldloc ; Old location of code defw newloc ; New location of code defw offset ; Offset for address adjustment defw codesiz ; Size of block to relocate defw bitmap ; Pointer to relocation bitmap Addresses to be adjusted are referenced by the bitmap the set bits of which indicate the HIGH order byte of addresses to be adjusted. Such a bitmap is produced by linkers generating SPR or PRL files. If the code is operational in one location and is being moved to another address at which it is also expected to be operational, then offset = newloc - oldloc. It is possible, however, to address adjust code in memory without moving it. Thus, if bit maps exist for all references to each of several common blocks which the code must access, then this function may be called for each bitmap with the runtime address of the common block in the RCB offset word. The generation of multiple bitmaps of this nature may be beyond the capabilities of existing linkers. Function 39: Return Fixed Media Vector (Optional) C = 27h -------------------------------------- NovaDOS keeps a record of those media which are permanent within the system such as hard disks and RAM disks (not floppies). This function returns a bit map of such disks in a manner analogous to Function 24 (see any good DOS reference). This function is adap ted from ZRDOS vs. 1.9. Function 41: Get/Set/Reset NovaDOS Flags C = 29h ------------------------------------- On entry, register E contains a flag specification byte in which the bits corresponding to those flags to be altered are set. If bit 7 is set, the designated flags will be set, otherwise the flags will be reset. If E=0 on entry then the current flags byte will be returned in the A register. Function 42: Set Path Address (Optional) C = 2ah ----------------------------- If DE contains a non-zero value on entry, the path address is set to that value. If DE is 0, the current path address is returned in HL. Function 47: Return Current DMA Address (Optional) C = 2fh ----------------------------------------- The current DMA address is returned in HL. This function is necessary for ZRDOS emulation. Function 48: Return ZRDOS Version Number (Optional) C = 30h ----------------------------------------- A number of ZCPR Z-system utilities require ZRDOS and will abort with a message to that effect if a Function 48 call does not return a ZRDOS version number. This function returns a number corresponding to a valid ZRDOS version number. Function 50: Set Warm Boot Trap (Optional) C = 32h -------------------------------- This function replaces the internal DOS warm boot jump with an address received in DE. Internally generated warm boots will then be diverted to this address. This function is necessary for ZRDOS emulation. Error messages and the error escape option are disa bled when the warm boot trap is set. Function 52: Reset Warm Boot Trap (Optional) C = 34h ---------------------------------- This function resets the warm boot jump address to 0000h. If the warm boot trap is not set, the function in null. This function is necessary for ZRDOS emulation. Function 200: Get Time (Optional) C = C8h ----------------------- If date/time stamping is enabled, this function will write the current time to the buffer address passed in DE. See the section on Time and Date Stamping under "Discussion of Features". Function 201: Set Time (Optional) C = C9h ----------------------- If date/time stamping is enabled, this function will read the current time from the buffer address passed in DE and set the BIOS clock/calendar accordingly. See the section on Time and Date Stamping under "Discussion of Features". ASSEMBLY INSTRUCTIONS: ====================== There are two general methods for getting NovaDOS up and running. Each requires a different assembly and loading process as well as different software and settings within NDOSHDR.LIB, as discussed below. The method which you should use depends on your system and the software tools available to you. NovaDOS will assemble without modification with either SLR systems' excellent Z80ASM or with Microsoft's M80, which is more readily available. The former is highly recommend for speed and versatility. Method 1: Loadable REL file ---------------------------- If you are using the NZCOM/ZCPR34 package from Alpha Systems (highly recommended) your assembly and loading process is extremely simple. 1. Set cmnadr true in NDOSHDR.LIB 2. If using Z80ASM, assemble to a REL file with > Z80ASM nvds/r If using M80, assemble to a REL file with > M80 nvds,=nvds.z80/z 3. It is advisable to rename the resulting REL file with the extension ZRL to maintain consistency with existing NZCOM soft ware. You may load NovaDOS to memory with: > JETLDR nvds.zrl or > NZCOM nvds.zrl Method 2: Patching PUTSYS.COM with a HEX file ---------------------------------------------- If you have Z80ASM you may assemble NovaDOS to an Intel HEX file which may be overlaid onto the DOS image within PUTSYS.COM. NovaDOS may then be loaded onto the system tracks of any disk by running PUTSYS. 1. Set hexgen true in NDOSHDR.LIB. Set EITHER z33adr or intadr true depending on whether or not you are using ZCPR33 and have Z3BASE.LIB available. If Z3BASE.LIB is not available, you must set the DOS and BIOS address equates which follow. 2. If using Z80ASM, assemble to a HEX file with: > Z80ASM nvds/h If using M80, producing the HEX file is a two step process. You must make a note of the address putsdos (usually 1180h) in NDOSHDR.LIB for use with L80. a. Assemble to a REL file with: > M80 nvds,=nvds.z80/z b. Link to a HEX file with: > L80 /p:1180,nvds,nvds/e/n/x (use putsdos address) 3. Load the HEX file onto PUTSYS using MLOAD with: > MLOAD newsys=putsys.com,nvds.hex If you don't have MLOAD, you can use DDT to load NVDS.HEX into PUTSYS.COM as follows: > DDT putsys.com Make a note of the number under NEXT. At the DDT prompt, issue the commands: - invds.hex - r - ^C (exit DDT) Immediately issue the command "SAVE nn newsys.com", where nn is the high order byte (leftmost two digits) of the number under NEXT, converted to decimal. 4. Run PUTSYS to place NovaDOS onto your system tracks. ADDITIONAL ASSEMBLY OPTIONS: ============================ Binary Image: --------------- You may generate a binary image of NovaDOS which may, like the HEX file, be loaded into PUTSYS using DDT, placed in memory directly using any utility capable of doing so or patched in any one of a number of ways onto your system tracks. You may obtain a binary image of generic NovaDOS directly by running MAKENVDS or you may generate a custom version as follows. 1. Set intadr or z33adr true, depending on whether or not you are using ZCPR33 and have Z3BASE.LIB available. Set hexgen false. 2. If using Z80ASM, create a COM file with: > Z80ASM nvds If using M80 and L80, a two step process is required a. Generate a REL file with M80 with: > M80 nvds,=nvds.z80/z b. Generate a COM file from the REL file with: > L80 /p:100,nvds,nvds/e/n The resulting COM file should be renamed with the extent BIN to prevent it from being accidentally executed. You may load the BIN file into PUTSYS, if you wish, using DDT. Invoke DDT as before with > DDT putsys.com Make a note of the number of pages loaded (the high order two digits of the four digit figure under NEXT, converted to decimal). Issue the following commands to DDT. - invds.bin - r1180 (use the offset in PUTSYS of the DOS image) - ^C (exit DDT) Immediately issue the command "SAVE nn newsys", where nn is the number of pages of putsys loaded by DDT. SPR/PRL Files: -------------- SPR and PRL files are not in common use, but are useful in applica tions requiring a relocatable binary image of executable code. The file MAKENVDS.COM uses a PRL image of NovaDOS which can be used to generate a BIN file for use at any point in memory. PRL and SPR files contain a relocation bitmap following the active code which specifies bytes to be address adjusted. To generate a REL file compatible with the generation of SPR and PRL files set reladr true in NDOSHDR.LIB and assemble to a REL file using either supported assembler. Generation of the SPR or PRL file requires SLR Systems' SLRNK+ (the Cadillac of Z80 linkers) or LINK from Digital Research. The use of SPR/PRL files is beyond the scope of this manual.