Re: to make soft interrupt with AX registers in linux?



In article <f7idph$eat$1@xxxxxxxxxxxxxxxx>, "google-rambo88"
<rambo88@xxxxxxxxx> writes:

I'd like to know to send to printer port, I did like this on DOS...
I used to use int86 () function to make soft interrupt...

I'd like to know how to make soft interrupt with AX registers in linux?

But this kind of using is it possible in linux ?

sendcharToPrinter ( char ch )
{
union REGS printer;

printer.h.ah = 0;
printer.h.al = ch;
printer.x.dx = 0x378
int86( 0x17, &printer, &printer );
}

As noted elsewhere, you probably don't want to do things this way
if you can avoid it.

If you're trying to actually print to a printer, just use the
lp/lpr commands or at least use the /dev/... pseudo-file.

If, on the other hand, you are trying to access a special device
that just happens to be attached to the parallel port, your options
go something like:

1) First, try to use the /dev/... device. You should be able to
both read and write to/from it.

2) There have generally been a few device drivers for the parallel
port that provide more general access. You might try a net
search to see if one of these will satisfy your purposes.

3) Linux (at least earlier versions) has the ioperm(2) call on
x86-based systems. This will give you access to execute x86
IO instructions. (Assume that there are lots of warnings here
about why this is dangerous to the health of your system.)

4) I'm fairly sure that I've noticed that some of the MS-DOS
emulators have the ability to also simulate INT instructions
and control real hardware devices. I've never personally used
one, however.

Note that any method that provides access beyond use of the lp/lpr
commands will require the program to have elevated privileges of
some form.

- dmw

--
.. Douglas Wells . Connection Technologies .
.. Internet: -sp9804- -at - contek.com- .
.