STATLTEC.DOC (Technical documentation file with STATLINE 4.11) ================================================================ This file contains some technical information about the STATLINE program and the accompanying programs. See STATLINE.DOC file for details on general usage of these programs. TECHNICAL DATA: --------------- The program consists of the following parts: - Buffer containing new device headers for block devices The disk-image of this buffer is used to store information about the program. Use TYPE STATLINE.COM to display a quick-reference for STATLINE. - Data used by resident portion - Service routines e.g. to reprogram video controller and to put information on screen - Interrupt interceptors - Device driver interceptors - Space for copy of video parameters and local stack - Data used by initialization (i.e. non-resident) portion - Service routines for initialization, e.g. for creating device table - Main routine Initialization: - The first thing the program does, is checking the DOS version. This should be 3.00 or above. I haven't tried the program on "odd" environments like OS/2, Windows, DeskView etc. but I don't expect it to work in them, simply because it makes the video adapter behave in a non-conventional way. - Checks if the program is already in memory, by searching for a specific string. Note: Just before the date of release, I discovered that STATLINE would not install after a warm start on a specific system with a little memory on the motherboard and a lot of memory on an expansion board. Apparently, the VDISK device driver used up so much memory that STATLINE landed on the expansion board, which I found out did its own RAM refreshing. Usually, all memory is cleared even on a warm start, because the timer chip and the DMA-chip (the two chips that work together to refresh the dynamic RAM) are deactivated and reprogrammed during the POST (power-on- self-test). Another resident program that uses a similar technique for determining if it has already been loaded, had the same problem. I quickly wrote a simple (non-resident) program MEMCLEAR.SYS which you may put into your CONFIG.SYS to avoid this problem. MEMCLEAR is included in this package. Even if you don't have problems with STATLINE, it might be a good idea to put it in your config. Note that MEMCLEAR only clears all memory above itself. It never overwrites memory that is in use. The source of MEMCLEAR, MEMCLEAR.ASM is included as well. - Read parameters from the command line and change values in memory (change values in resident copy of STATLINE if there is one, else change values in current copy) - Print report on screen if necessary - Exit program if STATLINE was already resident. - Create a table of device drivers as follows: . Search for NUL device using undocumented function call 52h (See PC magazine November 1989, vol 8 no 21) . If program didn't find NUL device, it stops with an error message. . If program did find NUL device, it also found number of drives on system. . Search along the chain of device drivers for block devices. . A new device header is created in STATLINE's memory that reflects all the data of the original device header, but with pointers to new strategy and interrupt routines. A maximum number of 16 drivers can be installed. This should be enough in most cases, as device drivers may be used for more than one drive. DOS for example uses only one device for all physical drives controlled by the regular BIOS int 13h. . For every drive in each device driver, undocumented function 32h is called to obtain the entry from the drive data table. Every entry is changed to reflect the address of the new device header. - Intercept the following interrupts: 13h,25h,26h (direct read/write), 9 (keyboard), 1Ch (timer) and 10h (video). - Check if the video parameters are already in RAM. If not, copy them. - Change the video parameters to reflect a 26th line for text modes - Switch on the 26th line by sending the modified video table to the 6845 video controller. - Reset disks so DOS knows that its information for each drive must be re-read from disk. This must be done because of the fake-interrupt 13h used by the device table creation routine. - Terminate and stay resident. EXPECTED PROBLEMS: ------------------ Don't read this before you have installed STATLINE. It will only confuse you. If you install STATLINE on a system, you may encounter the following two categories of problems: 1. Software problems: These can be expected mostly around the undocumented functions 32 and 52. The code around function 32 is basically a simple algorithm that searches for a known sequence of 4 bytes (which is the address of the device header). The code around 52 however depends on the fact that the value of the number of logical devices is 2 bytes before the NUL device. So the moment when Microsoft changes the offset of MAXDRIVE from the null device, STATLINE starts guessing the wrong drive letters (It will still not be dangerous to your system). However when Microsoft changes the entire device chain and file system architecture (which is not likely to happen, though) it means trouble. Effects could be as small as STATLINE signalling the wrong drive letter or as huge as your system crashing as soon as STATLINE is installed (or when any disk is accessed just after STATLINE has been installed). All this applies to possible future DOS versions. If you are installing a new DOS version that has not been tested with STATLINE, remove the STATLINE command from your autoexec.bat temporarily, so it can be tested manually by typing it from the DOS prompt. Also make sure that you have a bootable diskette handy, in case of disaster (If you're installing a new DOS version, you have one already - a bootable diskette that is) 2. Hardware problems: These can be expected mainly around the screen access of course. Many known computers and video cards support the CGA and/or Monochrome modes, but not nearly all of them really emulate those modes well enough to set up a 26th video line. I know of machines with monochrome screens that emulate Color Graphics text and graphics modes, but use high resolution text (14 line character box) and grey scales. Some of them even have a different video controller, so a 26th line simply doesn't display. STATLINE works (hear the beeps) but you can't see it. Something else that can happen is that if you start STATLINE, the screen starts rolling or acting crazy, caused by monitor synchronization problems. With most monitors it is possible to correct this by using "V.HOLD" and/or "V.SIZE". If it can't be corrected using the monitor settings, it's probably your (emulating) video card protesting against the reprogramming. These problems can occur even now (as opposed to software problems) and they are known at this moment but cannot be corrected without extensive knowledge about the various devices emulating CGA or MDA modes. I only know my own adapter from the inside out, and I know some other adapters, but certainly not every one of them. Most notable "strange adapters" are the Hercules cards and some old COMPAQ adapters that have their video controllers at the right addres but video memory somewhere else. I seem to recall from the original PC magazine article that STATLINE works on Hercules cards, though. I don't remember if everything went well on old Compaqs. RELEASE INFORMATION: -------------------- 1.00 Initial release as copied from PC magazine, July 1986. 2.00 Added disk indicator by intercepting disk interrupt Int 13h. 3.00 Enhanced disk indicator to include devices that don't use Int 13h, such as VDISK.SYS. Solved problem of disappearing status line by changing the video parameters and intercepting the timer interrupt Int 1Ch. (27 Mar 1989) 3.10 Changed program to support DOS 4.00. (3 Oct 1989) 4.00 About 80% of program rewritten because of different initialization using "new" undocumented function 52h (See PC magazine vol 8 no 21, 28 Nov 1989). Now ALL block device drivers are intercepted, instead of only those that don't use Int 13h. 4.01 Bug removed in video interrupt (Int 10h) handler. 4.02 Added option to switch off the status line for ill-behaved programs. (later on I discovered that it wasn't the program that was ill-behaved, but an error in my AUTOEXEC.BAT file preventing STATLINE from detecting that the display mode was changed). Added generic I/O control handler which is used by FORMAT and DISKCOPY to read from and write to disk directly. Initial release on SIMTEL20 and TRICKLE archive sites. (1 Oct 1990) 4.10 Rewrote command line parser completely. Also, the Int 13h handler no longer attempts to find out drive letters for hard disks. The "old" code assumed that every harddisk only has one partition. This of course is generally not the case. The program now simply displays the number (starting at 0 for the first hard disk) instead of a drive letter if a hard disk is accessed through Int 13h. Internal stack space was reduced - the resident portion is now slightly over 2 kilobytes. A severe mistake in the MEMCLEAR device driver was corrected. The MEMCLEAR device supplied with STATLINE 4.02 probably didn't do anything in most environments. Version 1.01 has been tested and proved reliable in several DOS versions. Fortunately, STATLINE itself has been programmed with more care than MEMCLEAR was. Sorry! (13 Jan 1991) 4.11 Clock display added. (6 Mar 1991) Jac Goudsmit