delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/30/03:32:19

X-magnet-rcpt: <djgpp AT delorie DOT com>
From: "Mark Usher" <marku AT magnet DOT at>
Cc: <djgpp AT delorie DOT com>
Subject: RE: Tricky interrupt problem
Date: Tue, 30 Mar 1999 10:32:19 +0200
Message-ID: <E5E743A4F743D211BE7800104B9D6426266F@BURNTS40BDC>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook CWS, Build 9.0.2212 (4.71.2419.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2013.600
Importance: Normal
Reply-To: djgpp AT delorie DOT com

> I suggest to stop trying to reinvent the wheel, and instead read the
> documentation.  You have been pointed to section 18.2 of the FAQ which
> explains how to do that.  That section includes a working example of
> code which does something very similar to what you need; use that
> example as the starting point.

I did read section 18.2 and worked on it for a couple of hours before even
asking for further help.
There is no problem to pass a ControlBlock to the driver, the pointer to the
block being in in ds:dx.
That is easily done as in 18.2 of the FAQ, using the default transfer buffer
as you say.
The problem is that the Control Block contains 3 long pointers to 3 more
blocks which the driver needs access to and read / fill in on return, which
means as far as I understand it, that I must create at least three more
transfer buffers in conventional memory.
ie.
struct ControlBlock
{
	byte	Command;
	unsigned short	length_Tx;
	unsigned int	pTx;
	unsigned short	length_Rx;
	unsigned int	pRx;
	unsigned short	lengthReply;
	unsigned int	pReply;
}

The creation of a transfer buffer was simple enough via the FAQ and reading
the libc docs.
I couldn't though, despite trying, manage to get the conventional memory
long pointer to fill in pTx, pRx and pReply that I need to pass in the
control block.
I was looking at the way the __tb macro is defined but this seemed specific
to the transfer buffer, and I looked through the libc sources, but couldn't
find anything of use.

Maybe as you say I am trying to re-invent the wheel, but at the moment I
cannot see another way of acheiving this. As you can see it is complicated
by the need to send and return information in other blocks.

Sorry if I am overlooking something that is obvious to you, I am trying, and
reading the FAQ and docs as I go.

Mark Usher
marku AT magnet DOT at




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019