Trappable disk drive detection in bios or bdos?

43 views
Skip to first unread message

Richard Deane

unread,
Jun 29, 2024, 6:55:48 AM (6 days ago) Jun 29
to retro-comp
For any version of CP/M is there a BDOS/BIOS call which can detect the existence or absence of a disk drive without invoking the non-recoverable bdos trap, so that the application can choose how to handle it?

I am particularly interested in cp/m-80 (v3)  and cp/m-68k.

I thought the 68k bios 9 dsksel call might allow it but seemingly not (unless of course my code is broken :) )

Even a bdos patch would be acceptable.

Richard


Douglas Miller

unread,
Jun 29, 2024, 7:40:29 AM (6 days ago) Jun 29
to retro-comp
CP/M-80 v3 (and I presume CP/M-68K) has a BDOS call to allow you to change the behavior of the BDOS on errors ("set error mode"). This allows one to "probe" different disk drives via seldsk without causing a fatal warm boot - provided the vendor's BIOS has implemented the seldsk function such that it "probes" the hardware. Unless you're only interested in whether the BIOS has a table entry for the given disk drive. Note that the BIOS seldsk entry does not normally take any draconian action on error (it should simply return a NULL for the DPH), but some vendors did do things like force a reboot on seldsk errors.

CP/M 2.2 has a documented method for programs to dynamically patch the BDOS to trap the errors and thus make them non-fatal. There are pointers to the error handlers near the beginning of the BDOS, and a program could substitute their own handlers - provided they made certain to restore the original ones when they exit (in case the BIOS doesn't reload the BDOS).
Reply all
Reply to author
Forward
0 new messages