public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* DOS2linux
@ 2001-08-27 19:39 Bart Vandewoestyne
  2001-08-27 19:59 ` DOS2linux Randy.Dunlap
  2001-08-27 20:06 ` DOS2linux Alan Cox
  0 siblings, 2 replies; 14+ messages in thread
From: Bart Vandewoestyne @ 2001-08-27 19:39 UTC (permalink / raw)
  To: linux-kernel

I have a routine from a DOS driver that looks like this:

static int getslotinfo( void )
{
  static char buff[320], *s=&buff[0]; int valid;

  inregs.h.ah=0xd8; inregs.h.al=0x1; inregs.h.cl=DiSC_Id.slot>>12;
inregs.h.ch=0;
  sregs.ds=FP_SEG(s); inregs.x.si=FP_OFF(s);
  int86x(0x15, &inregs, &outregs, &sregs);
  valid=outregs.h.ah;
  if(!valid) { DiSC_Id.it=buff[itconf]; DiSC_Id.dma=buff[dmachd]; }
  return(valid);
}

(full DOS-code is at http://mc303.ulyssis.org/heim/downloads/DISCDRV.C
)

Doing some research learned me that this piece of code does the
following things (according to http://www.ctyme.com/intr/rb-1641.htm
):

1) set AX register to 0xd800
2) set slot number to DiSC_Id.slot, (eg. 1 in my case -> base is
0x1000)
3) set function number to read
4) assign a 320-byte buffer for standard configuration data block
5) execute a software interrupt via the DOS specific int86x function,
this puts configuration data into the 320-byte buffer.
6) check if we get a valid return
7) if we have a valid situation, assign values from the configuration
block to DiSC_Id.it (it level) and DiSC_Id.dma (dma level)


So here's my question:

On http://www.ctyme.com/intr/rb-1641.htm I can see that this is all
about reading data from an EISA SYSTEM ROM.  I can't imagine there
doesn't exist some linux-API that allows me to do just the same.

What function calls and header files should I use in order to read
this 'EISA SYSTEM ROM' and assign the correct values to DiSC_Id.it and
DiSC_Id.dma ?

If there doesn't exist an API for this, what memory ranges should i
probe in order to get these values?


Thanks for answers,
mc303

-- 
Ing. Bart Vandewoestyne			 Bart.Vandewoestyne@pandora.be
Hugo Verrieststraat 48			       GSM: +32 (0)478 397 697
B-8550 Zwevegem			 http://users.pandora.be/vandewoestyne
----------------------------------------------------------------------
"Any fool can know, the point is to understand." - Albert Einstein

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: DOS2linux
@ 2001-08-28 15:10 Camiel Vanderhoeven
  2001-08-28 15:27 ` DOS2linux Camiel Vanderhoeven
  0 siblings, 1 reply; 14+ messages in thread
From: Camiel Vanderhoeven @ 2001-08-28 15:10 UTC (permalink / raw)
  To: Bart.Vandewoestyne; +Cc: linux-kernel

From: Bart Vandewoestyne <Bart.Vandewoestyne@pandora.be>
> > Did you do a normal read from memory, or did you use port-i/o?
>
>I used the inb() function.

Sorry for asking, I just wanted to make sure it wasn't something simple...

>My card is at 1000h, that's something i know for sure, because I can
>probe the EISA ID at 0x1000+0xc80.

Good.

> > I'm not very familiar with
> > the EISA architecture, but I do know that each card can use the
> > following I/O ranges:
> > X000h-X0FFh; X400h-X4FFh; X800h-X8FFh; XC00-XCFF, where X is the slot
> > number.
>
>I guess you mean X0000h-X0FFF; X1000-X1FFF; ...

No, I don't. Each EISA slot occupies four 256-byte ranges. That is because 
any address that looks like X100h-X3ffh; X500h-X7ffh etc. is misinterpreted 
by older ISA hardware.

Camiel.

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Dos2Linux
@ 2001-09-04  9:02 Bart Vandewoestyne
  0 siblings, 0 replies; 14+ messages in thread
From: Bart Vandewoestyne @ 2001-09-04  9:02 UTC (permalink / raw)
  To: linux-kernel

How do I translate the following piece of DOS-code to linux?

static union {
  unsigned int *a;      // One 32 bits address
  unsigned long  l;     // One 32 bits long
  unsigned int w[2];    // Two 16 bits words
  unsigned char  b[4];  // Four 8 bits bytes
} DMAaddr;

static union {
  signed int w;         // One 16 bits words
  signed char  b[2];    // Two 8 bits bytes
} DMAcntr;

...

static void setadr( unsigned int far *buff, unsigned int length )
{
  unsigned int lw;

  lw = FP_SEG( buff );                // Segment address of buffer
  DMAaddr.w[1] = ( lw >> 12 ) & 0xf;    // Makes real 32bit address
  DMAaddr.w[0] = ( lw << 4 ) & 0xfff0;
  DMAaddr.l += ( unsigned long )FP_OFF( buff );
  DMAcntr.w = length;
}


Thanks,
mc303

-- 
Ing. Bart Vandewoestyne			 Bart.Vandewoestyne@pandora.be
Hugo Verrieststraat 48			       GSM: +32 (0)478 397 697
B-8550 Zwevegem			 http://users.pandora.be/vandewoestyne
----------------------------------------------------------------------
"Any fool can know, the point is to understand." - Albert Einstein

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2001-09-04  9:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-27 19:39 DOS2linux Bart Vandewoestyne
2001-08-27 19:59 ` DOS2linux Randy.Dunlap
2001-08-27 20:06 ` DOS2linux Alan Cox
2001-08-27 20:19   ` DOS2linux Bart Vandewoestyne
2001-08-27 20:28     ` DOS2linux Alan Cox
2001-08-27 23:39     ` DOS2linux Camiel Vanderhoeven
2001-08-28  6:54       ` DOS2linux Bart Vandewoestyne
2001-08-28 14:45         ` DOS2linux Camiel Vanderhoeven
2001-08-28 15:03           ` DOS2linux Bart Vandewoestyne
2001-08-28 15:30             ` DOS2linux Brian Gerst
2001-08-27 22:23   ` DOS2linux Dr. Kelsey Hudson
  -- strict thread matches above, loose matches on Subject: below --
2001-08-28 15:10 DOS2linux Camiel Vanderhoeven
2001-08-28 15:27 ` DOS2linux Camiel Vanderhoeven
2001-09-04  9:02 Dos2Linux Bart Vandewoestyne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox