home *** CD-ROM | disk | FTP | other *** search
-
- CACHE.COM
-
- A memory cache facility for the KAYPRO II.
-
- By Steve McMahon
- For the Bay Area Kaypro Users & Programmers.
- February 26, 1983
-
-
- INTRODUCTION
-
- One of the oft-cited failings of CP/M is its lack of any
- way to `redirect' output intended for a logical device such as
- the list device or console to a disk file.
-
- The uses of such a redirect feature would be manifold.
- Transcripts of console operations could be kept, directory
- reports could be included in text files, Word Processor output
- could be saved in a disk file for special modification, etc. The
- ability to save the output of Perfect Printer in a disk file
- would allow the insertion of special graphics characters
- otherwise unavailable when redirection was used in conjunction
- with a text editor.
-
- A memory cache provides one way to get this type of
- redirection. The idea is to reserve a chunk of RAM out of the way
- of anything else and to make it into the logical LIST device.
- All list output will then be stored in the cache. Console output
- may also be placed there by using a ^P to cause console output to
- be echoed to the LIST device (the memory cache). However, some
- scheme must then be devised to get the cache into a disk file.
-
- CACHE.COM does just these things. The program overlays
- the Basic Input Output System (BIOS) of a 56k version of KayPro
- CP/M with a BIOS altered to create and control a cache in the top
- 8k of RAM. (Using a 56k version of CP/M leaves this area
- unused by the system, allowing its use for the cache.)
-
- To use CACHE, you will have to use MOVCPM.COM and
- SYSGEN.COM to create a 56k version of CP/M on disk. The new
- version of CP/M must actually be installed on disk. Though
- MOVCPM will allow you to create and immediately run a 56k version
- without writing it onto a disk, this will not work with CACHE!
- (Because when working this way MOVCPM is actually invoked at each
- warm start to reinstall a whole new BIOS. It overwrites the
- cache BIOS.)
-
-
- PUTTING A 56K VERSION OF CP/M ON A DISK
-
- The following is a sample transcript of an installation
- of a 56k version of CP/M on the disk on drive B:, using programs
- on a disk in A:. The disk in drive A: is unaffected, the B: disk
- will become the cache operating disk.
-
-
- -----------------Transcript of 56k installation----------------
- A>
- A>movcpm 56 *
-
- CONSTRUCTING 56k CP/M vers 2.2
- READY FOR "SYSGEN" OR
- "SAVE 34 CPM56.COM"
-
- Warm Boot
-
- A>sysgen
- KAYPRO SYSGEN VER 2.2
- SOURCE DRIVE NAME (OR RETURN TO SKIP) {Enter a return here}
- DESTINATION DRIVE NAME (OR RETURN TO REBOOT)b {enter b for B: drive}
- DESTINATION ON B, THEN TYPE RETURN {Another return here}
- FUNCTION COMPLETE
- DESTINATION DRIVE NAME (OR RETURN TO REBOOT) {Yet another return here}
-
- Warm Boot
-
- A>
- --------------------End Transcript------------------
-
- You will probably also wish to put CACHE.COM on the 56k
- CP/M disk.
-
-
- USING CACHE.COM TO FILE LIST OUTPUT
-
- The 56k CP/M disk must be placed in A: and cold booted
- (push the reset button). The cache may then be installed as
- simply as typing CACHE {RETURN}. The program will notify you if
- the overlay is successful. As a reminder of the modified BIOS's
- presence, warm boots will be signalled by "Reloading" rather than
- "Warm Boot".
-
- Now, any output directed to the LIST device will instead
- go to the cache. Typing ^P at the console will toggle on and off
- the LIST echoing of what goes on the CRT screen -- whatever
- happens between ^P's will be saved in the cache (It will not go
- to the printer!).
-
- If you over-run the 8k of buffer, the console bell will
- sound and the cache will reset itself. Earlier cache contents
- will be lost, but nothing dreadful happens to the operating
- system or whatever your working on.
-
- The cache resets itself with each warm boot. On
- receiving a warm boot command (such as a ^C or the end of a
- program), the cache BIOS will move the memory cache to the
- Transient Program Area (TPA) beginning at 100H and will indicate
- in pages of 256 bytes (100H) how much has been saved.
-
- The output may now be saved in a disk file with the CP/M
- resident command SAVE. Note that SAVE expects the number of
- pages to be saved in DECIMAL, while the console report is in
- HEXADECIMAL. (Sorry about that, I was too lazy to write a
- conversion routine.)
-
- So, if you received the report:
-
- --------------------------------------------
-
- Reloading
- 0DH pages saved beginning at 100H
-
-
- A>
-
- --------------------------------------------
-
- and wished to store the fruits of your labor in a file
- B:MYDOC.FIL, you should enter the command:
-
- SAVE 13 B:MYDOC.FIL
-
- (Note that 13 is the decimal form of 0DH. If base
- conversion does not come easy to you, there are tables available
- to make the conversion.)
-
- NOTE THAT ONCE A WARM BOOT HAS OCCURRED AND A SAVE NOTE HAS BEEN
- RECEIVED AT THE CONSOLE, RUNNING ANY TRANSIENT CP/M PROGRAM
- BEFORE SAVING TO A DISK FILE WILL CAUSE THE LOSS OF WHAT HAS BEEN
- SAVED IN RAM. (Note also that this is an exaggeration: if you
- know how to use DDT you may recover the actual cache from 0DE00H
- on, move it to the TPA and save it. There are nearly always ways
- to recover if you know what to do.)
-
- Parts of CACHE are loosely derived from programs
- described in Alan R. Miller's MASTERING CPM (SYBEX, 1983).
-
- Steve McMahon
- Berkeley
- f y