Kernal “patch” in the IECHost firmware

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 🙂

This entry was posted in Retrocomputing, Technical, Uncategorized and tagged , , , , . Bookmark the permalink.

One Response to Kernal “patch” in the IECHost firmware

  1. Pingback: More on the INPUT# command | Luigi Di Fraia's e-Footsteps

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s