Getting OUT from C

SHAWN BOSLEY ee171bap at sdcc13.UUCP
Thu Jun 12 00:25:54 AEST 1986


In article <60 at sunybcs.UUCP> mower at sunybcs.UUCP (James E. Mower) writes:
>I'm trying to write to an internal port within the AT running under
>XENIX.  Unfortunately, I don't know enough assembler to get to the 
>OUT function directly (I keep getting segmentation faults when I try
>to write to port 991 (decimal)) so I am looking for a comparable way

You are probably using the OUT instruction properly. It's the
protected mode of the 80286 that won't allow you to use an OUT
instruction unless your process is running at the most priviledged
level. Only the kernel is allowed to run at that level. The only
way under XENIX to use such instructions is to write a device driver
and link it to the kernel.

>to get to it from the C compiler under XENIX.  Can anyone tell me how
>this might be done?  Thanks in advance.

The C compiler won't do any better. You could alter pointer
variables but this would only work if I/O is memory mapped (which it
isn't). Even is I/O memory mapped, the protected mode won't allow
you to reference memory segments that don't belong to you.

Hope this helps!

-- Shawn Bosley



More information about the Comp.unix mailing list