CENT.MBECK%MIT-OZ@MIT-MC.ARPA (04/26/84)
From: Mark Becker <CENT.MBECK%MIT-OZ@MIT-MC.ARPA> As a personal software project, I'm attempting to generate a BIOS for a CP/M 2.2 system (mine!). Since I've already things up and running with the manufacturer's BIOS, there are no real problems.. I just want the experience of putting one together. Anywho, I've been going through the listing of the current BIOS and find something peculiar - every time the console input routine is called, the current BIOS goes and flushes the disk buffers. I can't find anything on this in the CP/M manual.. could someone out there give me a hint as to why this is being done? Or do I just have an oddball BIOS? The hardware is an U.S. Micro S-100 12-slotter with their board set. Thanks in advance - Mark Becker -------
glen@aecom.UUCP (05/02/84)
In reply to: Mark Becker <CENT.MBECK%MIT-OZ@MIT-MC.ARPA>
Welcome, Mark, to hacker's paradise - BIOSland. The disk flush
you saw in the BIOS CONIN call is very common, especially on
systems implementing disk sector sizes of over 128 bytes. The
reason is simple: CP/M deals with record sizes of 128 bytes, so
the BIOS must buffer all disk operations if the sector size is
larger in order to accommodate the smaller read/writes.
The flush in your BIOS is simply a safety feature. Since writes
are also buffered, what would happen if you changed disks while
the system still had the buffer in memory? Simply, chaos. You'd
lose the ending sectors of your file and maybe the file entry
from the directory itself (especially if the BIOS buffers the
directory). Therefore, the BIOS dumps the buffer at the point
when most (system-friendly) users change disks - at console
input.
Some BIOSes even dump the buffer on console output for a case
where the system churns for a while on disk and then starts
outputting pages of stuff to the screen or printer. If the user
got frustrated, he might just reset the system and therefore lose
the buffer contents.
This is one bit of foresight you can thank your manufacturer for!
- E N J O Y ! -
Glen
- - - - - -
>From the core dump of:
Glen Marianko
ConIX Software Division, | Microcomputer Division,
Computer Helper Industries Inc. | AECOMputing Center
{philabs,pegasus,rocky2,ihnp4}!aecom!glen