🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #2967

Re: Bug in DoIO / SendIO ??

#2967
From: John J. Szucs
Date: Fri, 16 Mar 1990 18:53
71 lines
3572 bytes
In article <9003160832.AA23378@jade.berkeley.edu> BEYSSAC@FRESE51.BITNET writes:
>
>   There seems to be a bug in the KickStart 1.2 DoIO/SendIO routines.
>On entry they clear the IO_FLAGS fields of the IoRequest structure.
>
>   The DoIO routine begins with :
>
>   DoIO move.l  A1,-(A7)
>        move.b  #1,IO_FLAGS(A1)         ;should be or.b #1 !!!
>
>   SendIO begins with :
>
>   SendIO clr.b IO_FLAGS(A1)            ;should be and.b #$FE !!!
>
>
>   I discovered this using the trackdisk.device in raw mode with the
>IOTDF_INDEXSYNC flag. It didn't work ! I wrote a little patch for DoIO
>and SendIO, and now it works as it should. There is no problem with the
>other parts of the system.
>
>   I'm not quite sure it must be corrected this way, but as I say
>above, it now works.
>
>   Maybe this has already been corrected in the 1.3 roms, I didn't
>check...

In the AutoDocs for DoIO is the following paragraph (under the IMPLEMENTATION
section):

	"This function first tries to complete the IO via the "Quick I/O"
	 mechanism. The io_Flags field is always set to IOF_QUICK (0x01)
	 before the internal device call."

In the AutoDocs for SendIO is the following paragraph (under the FUNCTION
section) is the following sentence:

	"The io_Flags field of the IORequest will be set to zero before the
	 request is sent. See BegionIO() for more details."

Based on the above, DoIO and SendIO are functioning in accordance with the
documentation.

If you wish to send an I/O request (such as the trackdisk.device I/O
request you described) without the io_Flags field unchanged, use the BeginIO
function of amiga.lib, which is described (under the FUNCTION section of
the AutoDocs entry for BeginIO function) as:

	"This function takes an IORequest, and passes it directly to the
	 BEGINIO vector of the proper device. This works exactly like
	 SendIO, but does not clear the io_Flags field first."

Note that you must call WaitIO to wait for the completion of the I/O request.

To perform the equivalent of DoIO without io_Flags being modified:

	BeginIO(IORequest); /* send I/O request to device */
	Error=WaitIO(IORequest);  /* wait for I/O request to complete */
	SetSignal(0L,1<<ReplyPort->mp_SigBit);   /* clear reply port signal
						    bit */

where IORequest is an IORequest and ReplyPort is the reply port for the
IORequest.

================================================================================
|| John J. Szucs                    || The opinions expressed are my own and  ||
|| Systems Evaluation Group         || in no way represent the opinions or    ||
|| Product Assurance Department     || policies of Commodore Technology, Inc. ||
|| Commodore Technology, Inc.       || or any associated entity.              ||
================================================================================
UseNet: {rutgers|uunet}!cbmvax!jjszucs | "F u cn rd ths, u cn bcm a cmptr prgmr"
InterNet: jjszucs@cbmvax.commodore.com |
Technical Details
Message-ID: <10222@cbmvax.commodore.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uflorida!haven!udel!rochester!rutgers!cbmvax!jjszucs
References: <9003160832.AA23378@jade.berkeley.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uflorida!haven!udel!rochester!rutgers!cbmvax!jjszucs
From: jjszucs@cbmvax.commodore.com (John J. Szucs)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Bug in DoIO / SendIO ??
Summary: Not really a bug
Message-ID: <10222@cbmvax.commodore.com>
Date: 16 Mar 90 18:53:53 GMT
References: <9003160832.AA23378@jade.berkeley.edu>
Sender: jjszucs@cbmvax.commodore.com
Reply-To: jjszucs@cbmvax (John J. Szucs)
Followup-To: comp.sya.amiga.tech
Organization: Commodore, West Chester, PA
Lines: 71