r1mikey / illumos-gate

An open-source Unix operating system
https://illumos.org
2 stars 0 forks source link

Remove UART hardcoding, move handling to kobj and prom #3

Closed r1mikey closed 1 week ago

r1mikey commented 3 weeks ago

A lot of early UART code has hardcoded MMIO addresses right now, just to get visibility of things before the right MMIO address is known.

  1. Make the loader64.efi port populate environment variables to communicate this information (bcons-mmio-base, bcons-mmio-size, bcons-type)
  2. Use the memory mapping code to ensure that the boot console region is mapped
  3. Have the EFI shim examine these variables from the environment module and set them in _xbootinfo
  4. Use _xbootinfo to fire up the early UART in the shim

Update the inetboot loaders to set the correct bcons_mmio_base, bcons_mmio_size and bcons_type in _xbootinfo.

Have kobj debugging code and prom use the _xbootinfo to set up the UART, or have no output otherwise. These could technically be the same code, but there are some comments in the prom code that it should live in genunix, which we should not preclude.

Have the BOP console UART code forward out to prom, which will be usable at this early stage.

Both the kobj code and the prom code will need to be aware of the presence of a proper driver and use polledio once that attaches. This part is much more complicated, so simply respect the current state of the art here.