Subject: IOKit intergration
To: None <>
From: Emmanuel Dreyfus <>
List: tech-kern
Date: 04/21/2003 19:50:23

I'm still working on MacOS X's IOKit emulation. There are some choices
to do:

The kernel low level drivers and the userland programs that use them
communicate using a page of shared memory, for performance sake. This
page contains information such as the mouse button status

In order to emulate this, I have two options

1) Modify wscons, introducing iokit hooks to maintain the data in the
page. Seems easy, but intrusive. Everything will be #ifdef COMPAT_MACH,
but usually, we avoid folding compatibility code in other kernel

2) Mark the page as unreadable for user processes, and on page faults,
update the information and make it readable. Problem: how can I know
when it must be made unreadable again? Use a callout for that?

3) Use a callout to get the information from wscons and update the page.
Seems bad on the performance front.

I'm not sure #2 and #3 are possible: it is usable for data that is
pollable, but this shared memory is also used for event queues:
mousdons, mouseup, keydown, and so on... Anyone sees a way of getting
theses by polling?

Option #1 seems the way to go. Opinions?
Emmanuel Dreyfus