This evening I was contemplating the idea of adding a “disk certification” option in IECHost, as per Inside Commodore DOS – program on page 91, which uses direct access programming, including job execution.
I was admiring how beautifully error checking is done within the BASIC listing there when I was struck again by something I noticed quite some time ago when I was first testing the IECHost firmware. Long story short, the following INPUT# command on a Commodore home-computer hangs if device 8 is not present on the IEC bus:
OPEN 15,8,15 INPUT#15,EN$,EM$,ET$,ES$ CLOSE 15
I hadn’t really tracked down the cause of the hanging so far, so I decided to look into it.
I found out that the Commodore Kernal code that sends the secondary address after TALK (at $EDC7) does not check ST before requesting a bus turnaround. Within the bus turnaround process a few things happen, one of which is that the IEC master waits for the CLOCK line to be pulled low: that never happens in absence of the device for which the TALK request is sent on the bus.
I’ve now changed the IECHost firmware (which was designed using the Commodore Kernal code as reference) so that a bus turnaround is not initiated if the secondary address after TALK fails to be transmitted: that’s the case when the addressed device is not on the bus.
Happy days 🙂