seL4 / seL4

The seL4 microkernel

Home Page:https://sel4.systems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

x86 Serial Drivers in seL4 Kernel

chrisguikema opened this issue · comments

DornerWorks has been working with new x86 processors, and one of the things we've noticed is that the cards often won't use the 0x3f8 serial port.

It seems like seL4 does have some backup plan by reading the command line, or the BDA.

However, there are still cases where this serial is not accessible to the user, and the only accessible serial device is on the PCI bus. I'm sure this was intentional, but the seL4 kernel doesn't scan the PCI bus to search for device frames, that is all left up to the user, but in this edge case (not covered by the proofs) I think its necessary.

ARM and RISC-V are careful about not printing til after virtual memory is enabled. x86 assumes IOPorts will be used, which aren't controlled by the MMU, so there are a bunch of early prints. Heck, even the boot assembly assumes the use of COM1 to print error strings.

Is getting an x86 serial driver framework something the foundation would be interested in?

My thought would be:

  1. Load in initialization functions for a number of serial drivers
  2. Run a PCI scan, searching only for serial compatible VIDs/DIDs
  3. Search the command line for user input of which serial device to use
  4. Initialize the proper driver for early prints
  5. Once virtual memory is enabled, update the MMIO region to use virtual memory

Would this framework have any effect on the proof? Would anyone have any problems with this method? It would certainly make porting to new x86 platforms easier.