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



"google-rambo88" <rambo88@xxxxxxxxx> wrote:

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 ?

Not that way. Software interrupts are only available in 16-bit code.
However:

sendcharToPrinter ( char ch )
{
union REGS printer;

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

What you're doing here is writing one byte to the printer port. That can
be done without using software interrupts by using outport:

outportb( 0x378, ch );

However, you will have to be root, and you will have to use ioperm to set
the I/O permission mask.

On the other hand, there are almost certainly better ways to do what you
want. Your standard parallel port will probably be exposed as a special
file, /dev/lp0. You can send bytes to it just by writing to this file.
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.