This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Q: convert DOS library to linux



> >I have some low-level functions  in source (asembler) [direct write and
> >read procedures between PC and N-AT module and interrupt processing].
> >I think (hope) that there is no int21 (or DOS specific) call in hi-level
> >C functions library.
> 
> Supposing there isn't, the code still won't work because :
> 1. (I assume) it's real mode code.

A mix of Turbo-C and assembler will convert fine to gcc and inline
asm, if you know what you're doing.  Real mode and protected mode
are not all that different for this kind of code.

> 2. User-mode programs under Linux are not allowed to do port IO.

Sure they are, given ioperm(2) as you reference below.

> 3. User-mode programs under Linux can't hook interrupts.

That much is true.

> Read the manual pages for ioperm(2), iopl(2), mem(4), port(4).
> There is a HOWTO for this kind of programming under Linux.
> It looks like you need to write a device driver.

Only for the interrupt support, or for long term reliablity.
Device drivers aren't that hard (in theory, anyway).

   - Larry Doolittle   ldoolitt@jlab.org