feat: devices via caps (BootInfo, init assigns devices, drivers map MMIO/DMA themselves, IRQ-driven input); drop boot device wiring and info pages; headless display fallback
This commit is contained in:
22
docs/ipc.md
22
docs/ipc.md
@@ -73,6 +73,28 @@ one region, so delegating or revoking it means the same thing everywhere.
|
||||
`RegionAddress(cap)` returns a region's physical base so a driver can
|
||||
program a device's DMA; pool regions are physically contiguous.
|
||||
|
||||
Boot also maps one read-only page into init at `types::bootinfo::BOOT_INFO_VA`
|
||||
listing, for each board device, its kind, physical base, IRQ line and the
|
||||
slots holding its region and IRQ capabilities, plus the SystemControl slot.
|
||||
It is the only page boot writes for userspace.
|
||||
|
||||
## Devices
|
||||
|
||||
Init decides which driver gets which device: it asks each virtio slot for
|
||||
its device id (mapping a minted copy of the region capability, then
|
||||
dropping it), and hands the disk, GPU and keyboard (or, with no keyboard,
|
||||
the UART) to their drivers before anything else (`libkos::device`):
|
||||
|
||||
1. init `Call`s the driver's endpoint `[SETUP, MMIO, kind]` carrying the
|
||||
region capability, then `[SETUP, IRQ]` with the IRQ capability, then
|
||||
`[SETUP, DONE]`. A driver with no device gets only `DONE`.
|
||||
2. The driver maps the region, allocates its own DMA memory
|
||||
(`CreateRegion`, `MapRegion`, `RegionAddress`) and resets the device.
|
||||
3. A driver with an IRQ routes it to a notification bound to its thread
|
||||
(`SetIrqNotification`, `BindNotification`) and acknowledges once to arm
|
||||
it. Lines start masked, are masked again by the kernel on every
|
||||
interrupt, and are re-armed by `AckInterrupt`.
|
||||
|
||||
## Messages
|
||||
|
||||
A message is 4 words and at most one capability. The capability is
|
||||
|
||||
Reference in New Issue
Block a user