| 5 | == A) Peripheral identification == |
| 6 | |
| 7 | ALMOS-MK identifies a peripheral by a composite index (func,impl). The '''func''' index defines a functionnal type, the '''impl''' index defines a specific hardware implementation. |
| 8 | * Each value of the functional index defines a generic (implementation independent) device XYZ, that is characterized by a specific API defined in the ''dev_xyz.h'' file). This generic |
| 9 | API allows the kernel to access the peripheral without taking care on the actual implementation. |
| 10 | * For each generic device XYZ, it can exist several hardware implementation, and each value of the implementation index '''impl''' is associated with a specific driver, that must implement |
| 11 | the API defined for the XYZ generic device. |
| 12 | |
7 | | * '''External peripherals''' are accessed through a bridge located in one single cluster (called ''cluster_io'', identified by the ''io_cxy'' parameter in the arch_info description). They are share ressources that can be used by all kernel instances, running in any cluster. Examples are the IOC disk controller, the NIC network controller, the TTY text terminal controller, the FBF graphical display controller, or the external ROM. |
| 15 | * '''External peripherals''' are accessed through a bridge located in one single cluster (called ''cluster_io'', identified by the ''io_cxy'' parameter in the arch_info description). They are shared ressources that can be used by any kernel instance, running in any cluster. Examples are the generic IOC device (Block Device Controller), the generic NIC device (Network Interface Controller), the generic TXT device (Text Terminal), the generic FBF device (Frame Buffer for Graphical Display Controller. |
18 | | For '''internal peripherals''', that are replicated in all clusters, the corresponding device descriptors are stored in the local cluster. For '''external peripherals''', the corresponding device descriptors are physically distributed on all clusters, as regularly as possible to minimize contention. |
| 25 | To represent the available peripherals in a given manicore architecture, ALMOS-MK uses device descriptors, implemented as the '''device_t''' structure. A device descriptor describes a single channel of a peripheral. It contains the functional index, the implementation index, the channel index, the physical base address, and the size of the physical segment containing the addressable registers for this peripheral channel. |
| 26 | |
| 27 | Each device descriptor contains also an embedded waiting queue containing the pending requests registered by the various clients. A client can be any thread, running on any core, in any cluster of the manicure architecture. |
| 28 | |
| 29 | Finally, each device descriptor for a generic device XYZ contains a link to the specific driver associated to the available hardware implementation. This link is established in the kernel initialization phase. |
| 30 | |
| 31 | * As '''internal peripheral''' are private resources, replicated in all clusters, the device descriptor is stored in the same cluster as the hardware device itself. Therefore, all access are local. |
| 32 | * For '''external peripherals''', all hardware devices are shared resources located in the I/O cluster. To avoid contention, the device descriptors are distributed on all clusters, as uniformly as possible. Therefore, an I/O operation involve generally three clusters: the client cluster, the I/O cluster, and the cluster containing the device descriptor. |