|
| 1 | += Driver architecture |
| 2 | +:toc: left |
| 3 | +include::../common/homelink.adoc[] |
| 4 | + |
| 5 | +The system uses a service-based approach to drivers. The following components |
| 6 | +take their part in this: |
| 7 | + |
| 8 | +* *devicemanager* is the central device registry |
| 9 | +** *libdevice* is the interface library for devicemanager |
| 10 | +
|
| 11 | +* *pcidriver* is the PCI driver |
| 12 | +** *libpci* is the interface library for pcidriver |
| 13 | +
|
| 14 | +* *ps2driver* is a driver for PS/2 mouse & keyboard input |
| 15 | +** *libps2* is the PS/2 implementation |
| 16 | +** *libps2driver* is the interface library for ps2driver |
| 17 | +
|
| 18 | +* *ahcidriver* is the SATA/AHCI implementation |
| 19 | +** *libahci* is the interface library for ahcidriver |
| 20 | +
|
| 21 | +* *efifbdriver* is the EFI framebuffer video graphics driver |
| 22 | +* *vmsvgadriver* is the VMSVGA video graphics driver |
| 23 | +* *libvideo* is a generic interface library for video drivers |
| 24 | +
|
| 25 | +
|
| 26 | +An _interface library_ contains functions used to interact with the driver and |
| 27 | +usually also the purpose-related headers. |
| 28 | + |
| 29 | + |
| 30 | +== Basic initialization |
| 31 | + |
| 32 | +The *devicemanager* first interacts with pcidriver to enumerate PCI devices and |
| 33 | +then, based on available devices, starts up further driver processes. |
| 34 | + |
| 35 | +=== Graphics |
| 36 | + |
| 37 | +Depending on the available devices, one of the available video drivers is |
| 38 | +started. All video drivers implement the video driver interface defined in |
| 39 | +*libvideo*. |
| 40 | + |
| 41 | +The video mode can then be initialized by using _videoDriverSetMode_, which |
| 42 | +is usually done by the *windowserver*. |
| 43 | + |
| 44 | +=== Filesystem |
| 45 | + |
| 46 | +For drives and file systems, the implementation is not finalized but the plan is to have: |
| 47 | + |
| 48 | +* *fsdiscovery* a driver that checks for filesystems on block devices |
| 49 | + that any driver (like ahcidriver) has registered |
| 50 | +* *libblockdevicedriver* a generic interfacing library for all drivers that |
| 51 | + implement block devices; must be implemented by ahcidriver |
| 52 | +* *fatdriver* a FAT filesystem driver |
| 53 | + |
| 54 | +The idea is that *fsdiscovery* will wait for block devices being registered; |
| 55 | +if a new device apperas, it will use *libblockdevicedriver* to call *ahcidriver* |
| 56 | +to read the first sector of the drive. Then it will identify what filesystem is |
| 57 | +on that drive and run the respective driver. |
| 58 | + |
| 59 | +For the FAT example, it will start *fatdriver* and tell it the device ID of the |
| 60 | +drive. The driver then again uses *libblockdevicedriver* to interact with |
| 61 | +*ahcidriver* to actually read/write data on the drive. |
0 commit comments