www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/18/20:17:04

Date: 18 Jun 1995 18:52:03 -0500 (CDT)
From: jmccawle AT cs DOT uno DOT edu (Cap'n Hardgeus)
Subject: RE: CD-ROM in DJGPP
To: djgpp AT sun DOT soe DOT clarkson DOT edu

>Look in the DJGPP FAQ list (available as faq102.zip from the same place
>you get DJGPP).  Chapter 18 there describes how to issue software 
>interrupts from DJGPP programs.  (Btw, you don't have to allocate buffer
>in low memory, if the 4KB-long transfer buffer provided by DJGPP is long
>enough for you; this is also explained in the FAQ.)

     I have the FAQ, and I've tried doing it exactly the way they have it 
there, but it still doesn't work...I think the problem is in the pointer
the interrupt is expecting in my data structure...

>Either
>
>        (seg << 4) + offset
>
>or
>
>        (seg * 16) + offset
>
>never both.  Use "|" only if you know it's less than 16.
>Morten
 
     Won't that give me a linear 32-bit pointer?  I think that the interrupt
is expecting a different type of pointer ( maybe that's my problem! ).  I'm 
using my MK_FP ( make far pointer ) macro to make the pointer to the 
conventional memory block... ( seg << 16) | offset .  I am kind of new to 
this kind of 'pointer slinging'.


/* ---------Begin of code-------- */     

     _go32_dpmi_seginfo info;
     unsigned long temp;

     info.size = (100 + 15) / 16;
     
     _go32_dpmi_allocate_dos_memory( &info );

/* Is this the address that the interrupt is expecting?? */
Address_Of_Dos_Buffer = (unsigned long)info.rm_segment << 16 | info.rm_offset;

/* Linear 32-bit address */
Linear_Address_Of_Dos_Buffer = 
    (((unsigned long)info.rm_segment) * 16) + ((unsigned long)info.rm_offset);

/* LOTS of code left out, I copied info into the dos buffer */     
/* I put another structure in a dos buffer, etc. */

/* Tray request is a data structure located in 
   another dos buffer...I will send the segment
   and offset of tray_request to the interrupt,
   with the address of the OTHER data structure
   in one of the feilds...that's what the specs 
   say the interrupt wants! */

  tray_request.address = Address_Of_Dos_Buffer; 

/* Lots more code left out... */

  r.x.bx = info_two.rm_offset;  /* This is the segment and offset */
  r.x.es = info_two.rm_segment; /* Of the tray_request structure  */

  _go32_dpmi_simulate_int( 0x2f, &r );


/* ----------End of code--------- */

     I apologise for the vagueness of the code, but there is a whole lotta
code and I didn't want to eat up too much space...besides, who would read 
it? ;) 

>Here is a copy of the MSCDEX spec (uu encoded zip).  I hope this
>helps, i haven't actually read it yet.
>
>Bill

     I have the spec (thank you very much for sending it though!) and 
I can't really find what I'm looking for...This code worked flawlessly in
real mode ( it was writted by Barry Egerter ), but my port to DJGPP proved
fatal.  The only thing I can figure that would be wrong is all of this memory
garbage.  I would like to point out that I got interrupt 0x2f to work on 
subfunctions that do not require pointers to memory buffers.

John R. McCawley III
Cap'n Hardgeus



- Raw text -


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