| 36 | == C) Devices Descriptors Placement == |
| 37 | |
| 38 | '''Internal peripherals''' are replicated in all clusters. In each cluster, the device descriptor is evidently stored in the same cluster as the hardware device itself. These device descriptors are mostly accessed by the local kernel instance, but can also be accessed by any thread running in any cluster (ICU, or MMC). To simplify the remote accesses to these structures, they are defined as global variables, in order to have the same base address for a given device in all clusters. |
| 39 | |
| 40 | '''External peripherals''' are shared resources, located in the I/O cluster. To minimize contention, the corresponding 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 server cluster, containing the device descriptor. |
| 41 | |
| 42 | The ''devices_dir_t'' structure contains extended pointers on all generic devices defined by ALMOS_MK. There is one entry per channel for the external devices. There is one single entry per internal device, but the CXY value is not significant. |
| 43 | |
| 44 | This device directory being implemented as a global variable, is replicated in all clusters, and is initialized in the kernel initialization phase. |
| 45 | |
45 | | 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. |
46 | | |
47 | | * 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, most accesses are local. |
48 | | * For '''external peripherals''', the hardware devices are shared resources, located in the I/O cluster. To minimize 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 server cluster, containing the device descriptor. |
| 55 | Finally, each generic device descriptor contains a link to the specific driver associated to the available hardware implementation. This link is established in the kernel initialization phase. |