writing drivers in aml
Posted: Sun Feb 23, 2014 8:02 am
as i got acpica working, i was wondering about the possibility to write device drivers as an aml method associated with a device
as acpica come also with a compiler, and seem to be able to add methods in a namespace, as aml seem to have functions to handle conditions, port io, interupt handling, ressource mapping, access to pci configuration space, wouldn't it be possible to handle most of the device initialisation code with an aml method instead of programming it in asm, and then adding those device initialisation method in the namespace at runtime after a pci scan for the detected device
i don't know if there could be a lot of advantage about doing that, but it could make driver code totally portable, and cpu independant, and device initialisation code doesn't have to be super fast either, anyway there is always plenty of delaying and waiting in device initialisation, so it wouldn't make a big difference to execute some aml code, and the driver code could use directly all the ressource informations from the acpi tables regarding io, interupt etc, and could probably also be synchronised with the acpi hardware access
as acpica come also with a compiler, and seem to be able to add methods in a namespace, as aml seem to have functions to handle conditions, port io, interupt handling, ressource mapping, access to pci configuration space, wouldn't it be possible to handle most of the device initialisation code with an aml method instead of programming it in asm, and then adding those device initialisation method in the namespace at runtime after a pci scan for the detected device
i don't know if there could be a lot of advantage about doing that, but it could make driver code totally portable, and cpu independant, and device initialisation code doesn't have to be super fast either, anyway there is always plenty of delaying and waiting in device initialisation, so it wouldn't make a big difference to execute some aml code, and the driver code could use directly all the ressource informations from the acpi tables regarding io, interupt etc, and could probably also be synchronised with the acpi hardware access