Using sysarch specific syscalls in assembly?
alexander
arundel at h3c.de
Mon Aug 8 20:10:22 GMT 2005
On Mon Aug 8 05, John Baldwin wrote:
> On Monday 08 August 2005 03:19 pm, alexander wrote:
> > Hi there.
> >
> > I wrote a program that needs to access I/O ports with the in/out
> > machinecodes. To gain priviliges to do so I have opened /dev/io. Now
> > somebody told me that I'd rather use i386_set_ioperm which will be much
> > saver, because of the port range limitation. Plus it will make the program
> > more portable because Linux does not have a /dev/io device node.
> >
> > i386_set_ioperm(2) states that this procedure is a system call. So it
> > should be easily accessable through assembly language and it's specific
> > syscall id. Unfortunately I wasn't able to find the syscall id in any of
> > the
> > syscalls.master files that are part of the source tree.
> >
> > <machine/sysarch.h> states that this is a sysarch specific syscall for i386
> > (hence the i386_*). The following definitions are being made:
> >
> > #define I386_GET_IOPERM 3
> > #define I386_SET_IOPERM 4
> >
> > These syscall numbers however are already taken by read(2) and write(2). So
> > how can I make use of these i386 specific syscalls? Is it even possible?
> >
> > Thx in advance.
>
> You have to call the sysarch() system call. The first argument to it would be
> the operation (I386_GET_IOPERM, etc.).
>
> --
> John Baldwin <jhb at FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
> "Power Users Use the Power to Serve" = http://www.FreeBSD.org
Thx a lot. That worked.
More information about the freebsd-hackers
mailing list