Contribute
Register

DSDT / ASL question for Dell Latitude E6410

Joined
Sep 22, 2011
Messages
301
Motherboard
Thinkpad T61-Clover
CPU
T9300/ICH8M
Graphics
Quadro NVS 140m, 1280x800
Mac
MacBook Pro
This is a question for those who have a basic understanding of programming and logic and it would help to know ASL. Is the code below a bug in the DSDT for the Dell Latitude E6410 (also in other Dell Latitude models)? Does this expression ALWAYS evaluate to TRUE and if so, should LOr be replaced with LAnd? The original unpatched DSDT.dsl is attached.

The Dell Latitude DSDT (BIOS A17) contains Method (GNOT) with the following lines of code in the disassembled DSDT.dsl:

Code:
                    If (LOr (LGreater (OSYS, 0x07D0), LLess (OSYS, 0x07D6)))
                    {
                        Notify (\_SB.PCI0, Arg1)
                    }
                    Else
                    {
                        Notify (\_SB.PCI0.VID, Arg1)
                    }
OSYS is assigned a value depending on the Operating System (Linux: 0x03E8; Win 2001: 0x07D1; Win 2001 SP1 & SP2 0x07D2; Win 2006: 0x07D6; Win 2009: 0x07D9.

It appears that the ASL programmer was trying to create a condition, where something is done for Windows 2001 that is different from what is done for Linux, Win 2006 and Win 2009. Instead, it appears to me that the programmer has created a condition that ALWAYS evaluates to TRUE, so the first branch ( Notify (\_SB.PCI0, Arg1) ) is always executed. Those, like me, who set OSYS for Darwin equal to OSYS for Linux (or Windows 2006 or Windows 2009) will inadvertently always be setting it to Windows 2001.

Am I correct in my logic? If I'm not correct, where am I wrong?

Thanks for any feedback that would help me to learn.
 

Attachments

Last edited:
Joined
Sep 22, 2011
Messages
301
Motherboard
Thinkpad T61-Clover
CPU
T9300/ICH8M
Graphics
Quadro NVS 140m, 1280x800
Mac
MacBook Pro
I'm confident that this is a bug (or at least a coding mistake that does not achieve the programmer's intended functionality), although I'm not sure that it affects MacOS at all (especially since the "standard" HPET DSDT patch removes the HPET dependency on OSYS). My concern about this bug is that it's in BIOS version A17 (a mature version after multiple revisions) and it appears in other Dell Latitude models. This is such an obvious mistake that it makes you wonder about QA and whether other bugs are lurking in this DSDT.
 
Joined
Sep 22, 2011
Messages
301
Motherboard
Thinkpad T61-Clover
CPU
T9300/ICH8M
Graphics
Quadro NVS 140m, 1280x800
Mac
MacBook Pro
EDIT: I observed this before learning about overriding _OSI with XOSI. The XOSI override might be a better way to handle the _OSI calls in the Dell Latitude E6410 DSDT. I'm still learning about XOSI and haven't drawn a conclusion.

Interesting observation: Method (OSID) in the Dell Latitude E6410 DSDT assigns a value to the parameter ACOS conditional upon the operating system. For those who are patching the Darwin OS identification in their Latitude E6410 DSDT, you also may want to patch the ACOS assignment. The example below shows the patch for a Darwin OS identification as "Linux." Note my addition of "Name (DARW, "Darwin")" and "If (LOR(\_OSI (LINX),\_OSI (DARW)))" analogous to the OSYS patch. What I find interesting about this ACOS assignment is that the coding style is different from the OSYS assignment coding style (creates variables like LINX for the operating system values). It's minor, but combined with the "bug" in Post #1, it makes me wonder just how thoroughly this DSDT code was reviewed at Dell (or wherever final sign-off was completed).

Code:
    Name (W98S, "Microsoft Windows")
    Name (NT5S, "Microsoft Windows NT")
    Name (WINM, "Microsoft WindowsME: Millennium Edition")
    Name (WXP, "Windows 2001")
    Name (WLG, "Windows 2006")
    Name (WIN7, "Windows 2009")
    Name (LINX, "Linux")
    Name (DARW, "Darwin")
    Scope (\_SB)
    {
        Name (ACOS, 0x00)
        Method (OSID, 0, NotSerialized)
        {
            If (LEqual (ACOS, 0x00))
            {
                Store (0x01, ACOS)
                If (CondRefOf (\_OSI, Local0))
                {
                    If (\_OSI (WXP))
                    {
                        Store (0x10, ACOS)
                    }

                    If (\_OSI (WLG))
                    {
                        Store (0x20, ACOS)
                    }

                    If (\_OSI (WIN7))
                    {
                        Store (0x80, ACOS)
                    }

                    If (LOR(\_OSI (LINX),\_OSI (DARW)))
                    {
                        Store (0x40, ACOS)
                    }
                }
                Else
                {
                    If (STRE (\_OS, W98S))
                    {
                        Store (0x02, ACOS)
                    }

                    If (STRE (\_OS, WINM))
                    {
                        Store (0x04, ACOS)
                    }

                    If (STRE (\_OS, NT5S))
                    {
                        Store (0x08, ACOS)
                    }
                }
            }

            Return (ACOS)
        }
 
Last edited:
Top