[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ioperm and iopl in gnumach

From: Da Zheng
Subject: Re: ioperm and iopl in gnumach
Date: Tue, 04 Aug 2009 16:15:10 +0800
User-agent: Thunderbird (Macintosh/20090605)


Thomas Schwinge wrote:
> No.  ioperm is expected to work just fine, so please tell us if there are
> problems with it.  There are two ways to use it: either the GNU Mach RPCs
> i386_io_perm_create and i386_io_perm_modify (see
> [gnumach]/i386/include/mach/i386/mach_i386.defs) can directly be used, or
> the more standard (at least on x86) glibc ioperm function (see
> [glibc]/sysdeps/mach/hurd/i386/ioperm.c), which makes use of the former
> two RPCs.
> Note that you currently have to be the root user to make use of all this.
> This is what the envisioned (not yet existing, but which we've once been
> chatting about) ioperm server, sitting on /servers/ioperm, is meant to
> change.
I thought you said that ioperm currently didn't work in gnumach.
I am porting the keyboard driver to the user space and here is my problem:
The driver reads the keyboard status from the port 0x64, and it seems OK. It 
doesn't work when the driver tries to write the command to the port 0x64. The 
whole process dies. (the port 0x64 is used for both read the status and writing 
the command.)
I have used ioperm to acquire the access to the port 0x64 before accessing the 
port (K_STATUS is 0x64).
  if (ioperm (K_STATUS, 1, 1) < 0)
    return FALSE;
I use the root user to run the keyboard driver. I don't know what the possible 
reason is:-(
>> gnumach from the debian repository supports iopl. This gnumach provides
>> an iopl device and I find that this device only supports device_map
>> when I read the code. but I don't know how to use this device. Does the
>> device provide the same function as the iopl system call in Linux?
>> Could anyone give me an example showing how to change the I/O privilege
>> level with this device?
> I think that you're mixing up two things.  First, you shouldn't need to
> use the iopl function as it exists, for example, on Linux on x86:
> instead, on Mach, you can use the interface I spoke about above for that.
> Second, what this iopl Mach device is indeed being used for, is to access
> arbitrary device memory by using device_map, as you found out already.
I guess I did mix them up.
I read http://lists.debian.org/debian-hurd/2007/04/msg00067.html and find that 
X was using the iopl device. I know that X uses iopl in Linux, so I thought the 
iopl device in gnumach is equivalent to iopl in Linux.

Best regards,
Zheng Da

reply via email to

[Prev in Thread] Current Thread [Next in Thread]