akasei wrote:
Is it difficult to use AML? I'm asking because I only work in assembler language and creating my own interpreter is not going to my mind.
Your options are to make or use an AML interpreter to do these things, or to dump the AML code for all the mainboards you wish to support, and use a mainboard driver for each one.
If you wish to pursue the former route, I suggest taking a look at ACPICA. Though it is written in C, you can easily fulfill its interface needs even from assembly. I mean, it only needs a few functions.
If you wish to pursue the latter route, I again suggest taking a look at ACPICA. The package comes with tools you can execute under Linux, and you can use the output to reverse-engineer the AML of a given mainboard (it obviously must be executed on the target mainboard). Then you don't have to "execute the PIC method", but rather can do "the equivalent of executing the PIC method". On my laptop, for example, the PIC method does this:
Code:
Method (_PIC, 1, NotSerialized) // _PIC: Interrupt Model
{
GPIC = Arg0
PICM = Arg0
}
Remember, you are supposed to call this with 1 for APIC. OK, so what are these two identifiers? GPIC is a field in an OperationRegion:
Code:
OperationRegion (GNVS, SystemMemory, 0x9CFBCC18, 0x0383)
Field (GNVS, AnyAcc, Lock, Preserve)
{
[...]
Offset (0x7C),
GPIC, 8,
[...]
}
So that means, if I am not mistaken, that in order to use the APIC, I am supposed to set the qword at 0x9cfbcc18+0x7c to 1, using locking. But I'd have to read up on what that means specifically.
PICM is just a name, basically an internal variable. It is referenced in all the _PRT methods. So I can now execute these methods under the assumption that PICM = 1. So for instance:
Code:
Method (_PRT, 0, NotSerialized) // _PRT: PCI Routing Table
{
If (PICM)
{
Return (AR00 ())
}
Return (PR00 ())
}
Means I have to look up the routing information for that particular device in AR00. And that rabbit hole just keeps going.