Contribute
Register

Converting an EISAID number to text/EISAID string (and back)

Status
Not open for further replies.

RehabMan

Moderator
Joined
May 2, 2012
Messages
181,111
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Let's say you're trying to understand how to detect different trackpads that may be installed in a laptop in ACPI code.

Consider this code:
Code:
                    Method (_HID, 0, NotSerialized)  // _HID: Hardware ID
                    {
                        If (LEqual (PS2V, 0x02))
                        {
                            If (And (OBID, 0x04))
                            {
                                Return (0x372B2E4F)
                            }
                            Else
                            {
                                Return (0x362B2E4F)
                            }
                        }
                        Else
                        {
                            If (LEqual (PS2V, 0x03))
                            {
                                Return (0x130FD041)
                            }
                            Else
                            {
                                If (LEqual (PS2V, One))
                                {
                                    If (And (OBID, 0x04))
                                    {
                                        Return (0x24068416)
                                    }
                                    Else
                                    {
                                        Return (0x23068416)
                                    }
                                }
                                Else
                                {
                                    Return (0x130FD041)
                                }
                            }
                        }
                    }

                    Method (_CID, 0, NotSerialized)  // _CID: Compatible ID
                    {
                        If (LEqual (PS2V, 0x02))
                        {
                            Return (Package (0x03)
                            {
                                0x130FD041, 
                                0x02002E4F, 
                                0x002B2E4F
                            })
                        }
                        Else
                        {
                            If (LEqual (PS2V, 0x03))
                            {
                                Return (0x130FD041)
                            }
                            Else
                            {
                                If (LEqual (PS2V, One))
                                {
                                    Return (Package (0x02)
                                    {
                                        0x8416, 
                                        0x130FD041
                                    })
                                }
                                Else
                                {
                                    Return (0x130FD041)
                                }
                            }
                        }
                    }

But what do all the numbers mean?

Turns out they are values that represent EISA identifiers. 32-bit numbers that represent strings like 'PNP0F13' (0x130FD041).

To make it easier, I created a script to do it, attached.

Usage:
Code:
SPEEDY-OSX:Projects RehabMan$ ./eisaid.sh
usage: eisaid.sh 0x[eisa-number], or eisaid.sh [eisaid-string]
SPEEDY-OSX:Projects RehabMan$ ./eisaid.sh 0x24068416
EisaId string for 0x24068416: ETD0624
SPEEDY-OSX:Projects RehabMan$ ./eisaid.sh ETD0624
EisaId("ETD0624") value: 0x24068416
SPEEDY-OSX:Projects RehabMan$ ./eisaid.sh SYN2B1C
EisaId("SYN2B1C") value: 0x1c2b2e4f
SPEEDY-OSX:Projects RehabMan$ ./eisaid.sh 0x1c2b2e4f
EisaId string for 0x1c2b2e4f: SYN2B1C
 

Attachments

  • eisaid.sh.zip
    1 KB · Views: 114
I know it's kind of late... But thank you so much for this script! It really helps me out right now to try and understand ASL.
 
Status
Not open for further replies.
Back
Top