Newbie question - Keyboard/io map

Hi everyone, total beginner here. I just started with this system and I got it set up on the x86/pc99 platform.

With some wrangling I was about to set up mappings for the video memory (physical 0xb8000) and I was able to show output on the screen.

Now I would like to read the keyboard as well. My difficulty is that I now require access to I/O ports 0x60 and 0x64 (from user mode of course). Naturally by default I see they are turned off in the TSS. My questions,

  • Is this a good use case for the cap metaphor?
  • Can caps be as small as one bit in size, so that I/O access can be handled at the finest level? Could they also be delegated based on range, like Untyped does?
  • Any pointers on things I could start looking at/learning about? I’m still not sure how things work in detail.

Thanks!
-Eric

Hi Eric, cool that you got the screen going - what hardware platform are you using? Or is it just qemu?

To answer your questions:

  1. The kernel api has methods for programming IO Ports, see the manual [1] and the functions in libsel4 [2]
  2. take a look at the Capabilities tutorial [3] if you haven’t already
  3. The tutorials [3] are a good start, and also looking at seL4 test you can see fairly detailed exercising of the kernel api

[1] http://sel4.systems/Info/Docs/seL4-manual-latest.pdf
[2] API Reference | seL4 docs
[3] Capabilities | seL4 docs

Awesome thanks! Yes that is the kind of API I’m looking for. Just to be clear, this API is wrapping individual I/O accesses at the syscall layer, i.e. there is no facility like linux’s ioperm(2) that actually enables I/O for the process?

-Eric

Oh, I forgot to say that I am on i386 PC platform - 32-bit, no frills. Just getting a hang of the basics.

No, the seL4 api is much lower level. AFAIK we do not have any higher level api’s wrapping IO ports.

Hmm, yeah, I was thinking that ioperm(2) would be the primitive operation, in the sense that it enables the IN and OUT instructions to work which would be desirable in a device driver context. Let me play around with the port API and the keyboard and serial devices and I’ll see what happens.

Thanks for your help!