delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/09/14:16:50

From: Seyil Yoon <wings AT interlog DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Newbie to DJGPP2.01 from BC5.02 struggling with int13h stuff.
Date: Fri, 09 Oct 1998 14:07:38 -0400
Organization: UUNET Canada News Transport
Lines: 102
Message-ID: <361E50EA.42398FCE@interlog.com>
NNTP-Posting-Host: 209.47.85.27
Mime-Version: 1.0
X-Mailer: Mozilla 4.06 [en] (Win98; U)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

--------------63CDFBB40F4BA860D9604662
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Having previously worked in BC5.02, there are a bunch of issues
that I never had to deal with that I now do because of DJGPP2.01.

In BC5.02, here is what I would have written:

void
Int13Read( unsigned char  ucDrive,
           unsigned short usCyl,
           unsigned char  ucHead,
           unsigned char  ucSect,
           unsigned char  ucSectorsToRead,
           far char *     fpcBuffer)
{
    union REGS   InRegs;
    union REGS   OutRegs;
    struct SREGS SegRegs;

    unsigned char ucSectorMask;

    ucSectorMask = (unsigned char) (usCyl >> 2);
    ucSectorMask |= ucSect;

    InRegs.h.ah = 2;
    InRegs.h.al = ucSectorsToRead;
    InRegs.h.ch = (unsigned char) usCyl;
    InRegs.h.cl = ucSectorMask;
    InRegs.h.dh = ucHead;
    InRegs.h.dl = ucDrive;
    SegRegs.es  = FP_SEG(fpcBuffer);
    InRegs.x.bx = FP_OFF(fpcBuffer);

    int86x(0x13, &InRegs, &OutRegs, &SegRegs);
}

In DJGPP2.01, I realize that int86() will not work in this case
(since int13h/ah=2 is not on the list of "supported" functions).
But after reading the FAQ and the help, I am not sure how exactly
I should be tackling this. I have the feeling it has to do with
__dpmi_regs,
__dpmi_int, and some other stuff which I don't understand completely.
Any help would be greatly appreciated.

Seyil Yoon (wings AT datarec DOT com)
Research Programmer, Data Recovery Labs (http://www.datarec.com)

P.S. Thanks to all who answered my question  regarding namespaces.

--------------63CDFBB40F4BA860D9604662
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
Having previously worked in BC5.02, there are a bunch of issues
<BR>that I never had to deal with that I now do because of DJGPP2.01.
<P>In BC5.02, here is what I would have written:<TT></TT>
<P><TT>void</TT>
<BR><TT>Int13Read( unsigned char&nbsp; ucDrive,</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned
short usCyl,</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned
char&nbsp; ucHead,</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned
char&nbsp; ucSect,</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned
char&nbsp; ucSectorsToRead,</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; far
char *&nbsp;&nbsp;&nbsp;&nbsp; fpcBuffer)</TT>
<BR><TT>{</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; union REGS&nbsp;&nbsp; InRegs;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; union REGS&nbsp;&nbsp; OutRegs;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; struct SREGS SegRegs;</TT><TT></TT>
<P><TT>&nbsp;&nbsp;&nbsp; unsigned char ucSectorMask;</TT><TT></TT>
<P><TT>&nbsp;&nbsp;&nbsp; ucSectorMask = (unsigned char) (usCyl >> 2);</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; ucSectorMask |= ucSect;</TT><TT></TT>
<P><TT>&nbsp;&nbsp;&nbsp; InRegs.h.ah = 2;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; InRegs.h.al = ucSectorsToRead;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; InRegs.h.ch = (unsigned char) usCyl;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; InRegs.h.cl = ucSectorMask;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; InRegs.h.dh = ucHead;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; InRegs.h.dl = ucDrive;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; SegRegs.es&nbsp; = FP_SEG(fpcBuffer);</TT>
<BR><TT>&nbsp;&nbsp;&nbsp; InRegs.x.bx = FP_OFF(fpcBuffer);</TT><TT></TT>
<P><TT>&nbsp;&nbsp;&nbsp; int86x(0x13, &amp;InRegs, &amp;OutRegs, &amp;SegRegs);</TT>
<BR><TT>}</TT>
<P>In DJGPP2.01, I realize that int86() will not work in this case
<BR>(since int13h/ah=2 is not on the list of "supported" functions).
<BR>But after reading the FAQ and the help, I am not sure how exactly
<BR>I should be tackling this. I have the feeling it has to do with __dpmi_regs,
<BR>__dpmi_int, and some other stuff which I don't understand completely.
<BR>Any help would be greatly appreciated.
<P>Seyil Yoon (wings AT datarec DOT com)
<BR>Research Programmer, Data Recovery Labs (<A HREF="http://www.datarec.com">http://www.datarec.com</A>)
<P>P.S. Thanks to all who answered my question&nbsp; regarding namespaces.</HTML>

--------------63CDFBB40F4BA860D9604662--

- Raw text -


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