paul@athertn.Atherton.COM (Paul Sander) (02/18/89)
A while back I posted a question on how to access a disk directly via the CP/M-Plus BIOS on a banked system. Several people replied, discussing the "Direct BIOS Call" BDOS function (number 50). Many thanks to those people. However, I am still having problems setting up a buffer properly. To perform a disk access (say, a READ for this example) I make the following calls to the BIOS via the BDOS: SETBNK, SELDISK, SETTRACK, SETSECTOR, SETDMA, READ. The result is that floppy drive turns on briefly, then turns off, and the buffer I specified by the SETDMA call does not contain data that I know are in the disk sector I specified. The buffer I am trying to set up is not in the shared memory area, and I get the feeling that the data are being copied into the wrong bank, and that I'm very lucky not to have CP/M crash on me. Here are my questions: Am I really setting up this access properly? If not, what am I doing wrong? Also, the reference I am using mentions the existence of a "System Control Block" which contains a bunch of useful information, and it also describes a BDOS function that returns the address of the block. Does anyone know what the format of the System Control Block is, and could they tell me what it is? I've contacted the vendor of my CP/M implementation, and they no longer carry DRI's Programmer's and System Guides. DRI has passed CP/M support on to a firm called Alexander and Lord, but they demand $350 for the manuals I need (a price which I am not willing to spend right now). Any help you can give me would be much appreciated. -- Paul Sander (408) 734-9822 | Do YOU get nervous when a paul@Atherton.COM | sys{op,adm,prg,engr} says {decwrl,sun,hplabs!hpda}!athertn!paul | "oops..." ?
bridger%rcc@RAND.ORG (Bridger Mitchell) (02/22/89)
>>However, I am still having problems setting up a buffer properly. To >>perform a disk access (say, a READ for this example) I make the >>following calls to the BIOS via the BDOS: SETBNK, SELDISK, SETTRACK, >>SETSECTOR, SETDMA, READ. The result is that floppy drive turns on >>briefly, then turns off, and the buffer I specified by the SETDMA call >>does not contain data that I know are in the disk sector I specified. Some suggestions that may help in directly reading a disk under CP/M Plus: Call SETBNK with A=1 to set the TPA bank. Call SECTRAN. Does the READ return with good status? Is the data in your buffer changed after the READ? Remember that in CP/M Plus the bios does *physical* sector io; you must have a full sector-sized buffer and do the deblocking in the application. CPM22RSX (or a similar name) is a tool for helping with this. The SCB (system control block) is mostly documented in the manual, but you don't need or want it for this purpose. It is in common memory, and is used for BIOS and BDOS parameters (e.g. current DMA address), configuration bytes, messages between the CCP and the BDOS, etc. Unless you *really* know the system's innards, treat it as strictly read-only! --bridger