Showing changes from revision #0 to #1:
Added | Removed | Changed
The entry for MiscOp does much of the work for a MiscOp SWI. It is passed the same values as FileCore_MiscOp. The reason codes you must support are 0 (Mount), 2 (Lock floppy drive) and 3 (Unlock floppy drive) for floppy drives, you must also support reason codes 1 (Poll changed) and 4 (Poll period).
Your routine must preserve registers, and the N, Z and C flags – except where specifically stated otherwise.
You may only return an error from reason code 0 (Mount). This must be done in the same way as for the DiscOp entry.
For drives with disc sensing, reason code 1 (Poll changed) must always return changed in the spun-down state. If the drive is spun-up, you must return maybe changed if the drive has been permanently spun-up since the last ‘Poll changed’; other wise you must
return changed.
Reason codes 2 (Lock floppy drive) and 3 (Unlock floppy drive) must always perform that action. You must not try to track the state of the drive locking; FileCore does this for you.
Reason code 5 (Eject disc) will never be called if bits 6 and 7 of the descriptor block are clear, since this indicates that no drives support power-ejection. Otherwise it may get called in a variety of situations: for example, after dismounting all discs as part of
shutting down all filing systems.
Reason code 5 (Eject disc) is also called whenever FileCore issues an UpCall 1 (medium not present), or an UpCall 2 (medium not known). In this case, the top bit of the drive number is set, indicating that a disc should be ejected from the drive considered to be most appropriate. The values passed to the UpCall in R4 (the iteration count) and in R5 (the minimum timeout period) are also passed on in the same registers to the MiscOp entry point. The filing system may treat these as appropriate; for example, it may choose to eject only on iteration 0 for an auto-insert detect drive, as doing further ejects may make it hard to get a new disc into the drive.