OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 10:22 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: writing drivers in aml
PostPosted: Sun Feb 23, 2014 8:02 am 
Offline
Member
Member

Joined: Wed Aug 21, 2013 7:08 am
Posts: 240
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

_________________
https://gitlab.com/h0bby1/micro-kernel


Top
 Profile  
 
 Post subject: Re: writing drivers in aml
PostPosted: Thu Jun 12, 2014 7:11 pm 
Offline
Member
Member
User avatar

Joined: Sun Sep 19, 2010 10:05 pm
Posts: 1074
I've considered this as well. Something else you should keep in mind... There's nothing that says that you couldn't compile your AML code to native code Just-In-Time. This should take care of any performance issues you may have trying to run "interpreted" driver code.

_________________
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott


Top
 Profile  
 
 Post subject: Re: writing drivers in aml
PostPosted: Fri Jun 13, 2014 7:34 am 
h0bby1 wrote:
wouldn't it be possible to handle most of the device initialisation code with an aml method instead of programming it in asm

But the initialization is just a small part of driver's job. So the low level code is still required. And what about initialization for a specific environment? I mean there are possible many initial values in device registers and a particular set of values is environment dependent. For example a ps2 controller has mouse and keyboard parts, but if user uses USB mouse, then initialization of mouse part is useless, and if user uses USB keyboard, then all the ps2 controller is useless.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: SemrushBot [Bot] and 51 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group