delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/04/18:00:05.1

Path: news.mv.net!uunet!nyc.uu.net!sac.uu.net!newshub1.wanet.net!newshub.sdsu.edu!news-hog.berkeley.edu!ucberkeley!newsfeed.stanford.edu!news.crhc.uiuc.edu!vixen.cso.uiuc.edu!howland.erols.net!cyclone2.usenetserver.com!news-out.usenetserver.com!easynews!cyclone-west.rr.com!news.rr.com!news-west.rr.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!firehose.mindspring.com!not-for-mail
From: "Marp" <marp AT 0 DOT 0 DOT 0 DOT 0>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: problem with __dpmi_int()
Date: Mon, 4 Sep 2000 11:10:58 -0400
Organization: MindSpring Enterprises
Lines: 36
Message-ID: <8p0e17$jrj$1@slb3.atl.mindspring.net>
References: <sr79j8h7a6e143 AT corp DOT supernews DOT com>
NNTP-Posting-Host: 04.30.99.8e
X-Server-Date: 4 Sep 2000 15:10:31 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Xref: news.mv.net comp.os.msdos.djgpp:103165

"Ricardo Cropalato de Melo" <cropalat AT svn DOT com DOT br> wrote in message
news:sr79j8h7a6e143 AT corp DOT supernews DOT com...
> I 'm trying to read a floppy sector / sector, and i was doing it like this
> code:
>

<snip>

>  char setor[512] = "Teste";

<snip>

>     regs.x.es = _my_cs();
>     regs.x.bx = (unsigned) setor;

This is no good. "sector" most likely resides in memory above the
addressable range for real mode, and cs is a selector, not a real mode
segment address. You must use memory that has been allocated in conventional
memory. DJGPP allocates some of this memory and use it as a transfer buffer.
You can just use that instead of allocating the memory yourself.

So it should look something like this:

dosmemput(sector, sizeof(sector), __tb);
regs.x.es = __tb >> 4;
regs.x.bx = __tb & 0xf;
__dpmi_int(0x13, &regs);
dosmemget(__tb, sizeof(sector), sector);

You have to do something like this for any real mode ISR that requires a
real mode far pointer. Also, read chapter 18 of the djgpp faq for details on
why you need to do this. Hope this helps.

Marp


- Raw text -


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