Skocz do zawartości

MSI Z68MA-ED55


iStig
 Udostępnij

Rekomendowane odpowiedzi

Część I oczyszczenie kodu z błędów i ostrzeżeń

 

- UEFI ver.A50

http://msi.com/product/mb/Z68MA-ED55--B3-.html#/?div=BIOS

- Kompilator pod Windows z dnia 22-09-2011

http://www.acpica.org/downloads/binary_tools.php

- pomocna specyfikacja ACPI rev. 4.0a

http://www.acpi.info/DOWNLOADS/ACPIspec40a.pdf

- podręcznik iASL

http://www.acpica.org/download/aslcompiler.pdf

- dumpy z hardware Apple

http://tdev.me/2010/12/apple-hardware-dumps/

- specyfikacja konfiguracji w podpisie

-------------------------------------------------------------------------------------------------

 

Dezasemblujemy DSDT.aml w wyniku czego otrzymujemy DSDT.dsl

iasl -d dsdt.aml

Przeprowadzamy pierwszą kompilację, aby zobaczyć czy są jakieś błędy

iasl dsdt.dsl

Wynik:

Intel ACPI Component Architecture
ASL Optimizing Compiler version 20110922-32 [sep 22 2011] 
Copyright (c) 2000 - 2011 Intel Corporation

DSDT.dsl   1690:                     0xFDFC0000,         // Length
Error    4045 -                               ^ Length is larger than Min/Max window
DSDT.dsl   1804:                         CreateDWordField (CRS1, \_SB.PCI0._Y07._MIN, MN8L) 
Warning  1121 -                                      ResourceTag larger than Field ^  (Tag: 64 bits, Field: 32 bits) 
DSDT.dsl   1809:                         CreateDWordField (CRS1, \_SB.PCI0._Y07._MAX, MX8L) 
Warning  1121 -                                      ResourceTag larger than Field ^  (Tag: 64 bits, Field: 32 bits) 
DSDT.dsl   1812:                         CreateDWordField (CRS1, \_SB.PCI0._Y07._LEN, LN8L) 
Warning  1121 -                                      ResourceTag larger than Field ^  (Tag: 64 bits, Field: 32 bits) 
DSDT.dsl   1866:                         CreateDWordField (CRS2, \_SB.PCI0._Y0D._MIN, MN9L) 
Warning  1121 -                                      ResourceTag larger than Field ^  (Tag: 64 bits, Field: 32 bits) 
DSDT.dsl   1869:                         CreateDWordField (CRS2, \_SB.PCI0._Y0D._MAX, MX9L) 
Warning  1121 -                                      ResourceTag larger than Field ^  (Tag: 64 bits, Field: 32 bits) 
DSDT.dsl   1872:                         CreateDWordField (CRS2, \_SB.PCI0._Y0D._LEN, LN9L) 
Warning  1121 -                                      ResourceTag larger than Field ^  (Tag: 64 bits, Field: 32 bits) 
DSDT.dsl   2213:                         IO (Decode16,
Error    4086 -                                     ^ Min/Max/Length/Gran are all zero, but no resource tag
DSDT.dsl   2308:                         Acquire (MUT0, 0x0FFF) 
Warning  1123 -                                              ^ Result is not used, possible operator timeout will be missed
DSDT.dsl   4767:                         Name (_PLD, Buffer (0x10) 
Error    4100 -           Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   4782:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   4799:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   4816:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   4833:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   4850:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   4867:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   4884:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   4901:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   4936:                         Name (_PLD, Buffer (0x10) 
Error    4100 -           Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   4951:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   4968:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   4985:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   5002:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   5019:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   5036:                             Name (_PLD, Buffer (0x10) 
Error    4100 -               Invalid object type for reserved name ^  (found BUFFER, requires Package) 
DSDT.dsl   6443:         Name (_T_0, Zero) 
Remark   5011 -                   ^ Use of compiler reserved name (_T_0) 
DSDT.dsl   6504:         Name (_T_0, Zero) 
Remark   5011 -                   ^ Use of compiler reserved name (_T_0) 
DSDT.dsl   7408:                 Name (_T_0, Zero) 
Remark   5011 -                           ^ Use of compiler reserved name (_T_0) 
DSDT.dsl   7538:                     Name (_T_1, Zero) 
Remark   5011 -                               ^ Use of compiler reserved name (_T_1) 
DSDT.dsl   7650:                 Name (_T_0, Zero) 
Remark   5011 -                           ^ Use of compiler reserved name (_T_0) 
DSDT.dsl   7780:                     Name (_T_1, Zero) 
Remark   5011 -                               ^ Use of compiler reserved name (_T_1) 

ASL Input:     DSDT.dsl - 7979 lines, 253970 bytes, 3178 keywords
Compilation complete. 18 Errors, 7 Warnings, 6 Remarks, 103 Optimizations

 

No to lecimy po kolei:

 

:arrow:1.

Error    4045 -                               ^ Length is larger than Min/Max window

Edytujemy dsdt.dsl i szukamy problematycznego fragmentu:

DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
                   0x00000000,         // Granularity
                   0x02000000,         // Range Minimum
                   0xFFDFFFFF,         // Range Maximum
                   0x00000000,         // Translation Offset
                   0xFDFC0000,         // Length
                   ,, _Y06, AddressRangeMemory, TypeStatic) 

Sprawdzamy czy Length jest odpowiedni stosując informację ze strony 13 podręcznika iASL:

Validation of values for Resource Descriptors is performed wherever possible.

Address Descriptors: Values for AddressMin, AddressMax, Length, and Granularity are validated:

AddressMax must be greater than or equal to AddressMin

Length must be less than or equal to (Max-Min+1)

If Granularity is non-zero, it must be a power-of-two minus one.

The IsMinFixed and IsMaxFixed parameters are validated against the values given for the

AddressMin, AddressMax, Length, and Granularity. This implements the rules given in Table 6-40

of the ACPI 4.0a specification.

czyli

Length <= Range Maximum- Range Minimum+1

Mi wygodnie pracuje się na Windowsowym kalkulatorze z widokiem dla programistów.

Zgodna wartość to 0xFDE00000 (0xFFDFFFFF-0x02000000+1), więc poprawiamy istniejącą i mamy jeden błąd mniej.

 

:arrow:2.

Warning  1121 -                                      ResourceTag larger than Field ^  (Tag: 64 bits, Field: 32 bits)

Zaglądamy co linii kodu z błędem i widzimy, że został użyty operator CreateDWordField .Wskazówka z kompilatora wskazuje że Field powinien być 64bits, więc zamieniamy operator CreateDWordField na CreateQWordField.

Dodatkowe informacje na stronie 585 specyfikacji ACPI.

Pozbyliśmy się 6 ostrzeżeń, więc sprawdzamy dalej:

 

:arrow:3.

Error    4086 -                                     ^ Min/Max/Length/Gran are all zero, but no resource tag

Zaglądamy do naszego pliku i mamy:

Name (CRS, ResourceTemplate () 
                   { 
                       IO (Decode16,
                           0x0000,             // Range Minimum
                           0x0000,             // Range Maximum
                           0x00,               // Alignment
                           0x00,               // Length
                           _Y16) 
                       IO (Decode16,
                           0x0000,             // Range Minimum
                           0x0000,             // Range Maximum
                           0x00,               // Alignment
                           0x00,               // Length
                           _Y17) 
                       IO (Decode16,
                           0x0000,             // Range Minimum
                           0x0000,             // Range Maximum
                           0x00,               // Alignment
                           0x00,               // Length
                           ) 
                       IO (Decode16,
                           0x0000,             // Range Minimum
                           0x0000,             // Range Maximum
                           0x00,               // Alignment
                           0x00,               // Length
                           _Y18) 
                   }) 

Sprawdzamy w specyfikacji (str. 612) składnię operatora IO

IO (Decode, AddressMin, AddressMax, AddressAlignment, RangeLength,

DescriptorName) => Buffer

W opisie argumentów znajdujemy, że pole DescriptorName jest opcjonalne, ale możemy także przeczytać w opisie zmian kompilatora, że tą nazwę przydałoby się mieć

http://www.acpica.org/download/changes.txt

iASL: Allow certain "null" resource descriptors. Some BIOS code creates

descriptors that are mostly or all zeros, with the expectation that they will

be filled in at runtime. iASL now allows this as long as there is a "resource

tag" (name) associated with the descriptor, which gives the ASL a handle

needed to modify the descriptor. ACPICA BZ 873.

Sprawdzamy jakie nazwy nie były użyte – w omawianym DSDT kolejna wolna to _Y21, więc dopisujemy ją tak aby kod wygląd następująco:

Name (CRS, ResourceTemplate () 
                   { 
                       IO (Decode16,
                           0x0000,             // Range Minimum
                           0x0000,             // Range Maximum
                           0x00,               // Alignment
                           0x00,               // Length
                           _Y16) 
                       IO (Decode16,
                           0x0000,             // Range Minimum
                           0x0000,             // Range Maximum
                           0x00,               // Alignment
                           0x00,               // Length
                           _Y17) 
                       IO (Decode16,
                           0x0000,             // Range Minimum
                           0x0000,             // Range Maximum
                           0x00,               // Alignment
                           0x00,               // Length
                           _Y21) 
                       IO (Decode16,
                           0x0000,             // Range Minimum
                           0x0000,             // Range Maximum
                           0x00,               // Alignment
                           0x00,               // Length
                           _Y18) 
                   }) 

:arrow:4.

Warning  1123 -                                              ^ Result is not used, possible operator timeout will be missed

Mutex (MUT0, 0x00) 
                   Method (ENFG, 1, NotSerialized) 
                   { 
                       Acquire (MUT0, 0x0FFF) 
                       Store (IOCE, INDX) 
                       Store (IOCE, INDX) 
                       Store (Arg0, LDN) 
                   } 

                   Method (EXFG, 0, NotSerialized) 
                   { 
                       Store (IOCL, INDX) 
                       Release (MUT0) 
                   }

Zaglądamy do specyfikacji -strona 579. Operator Acquire ma w parametrach Mutexa oraz podany w ms timeout. Ustawienie wartości na 0xFFFF powoduje, że operator ma czekać w nieskończoność na dostęp do Mutexa. Ostrzeżenie kompilatora wynika z tego, że nie jest sprawdzana zwracana wartość Asquire, czyli nie sprawdza się czy Aquire zadziałał prawidłowo, czy też nastąpił timeout… Ten drugi przypadek jest gorszy, bo jeśli był timeout, a nigdzie nie było to weryfikowane, to może dojść do równoległego dzielenia zasobu.

Dodatkowo można spojrzeć jak to jest rozwiązane u Apple, zaglądając do dumpów z ich maszyn i tak w przypadku iMaca12,2 w DSDT mamy:

Acquire (MUTX, 0xFFFF)

Ok, nie jest to ładne rozwiązanie, ale skoro Apple sie tez nie przejmuje to ostatecznie zmieniamy naszą wartość na 0xFFFF i kolejny warning mniej.

 

:arrow:5.

Error    4100 -           Invalid object type for reserved name ^  (found BUFFER, requires Package)

Name (_PLD, Buffer (0x10) 
                       { 
                           /* 0000 */    0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                           /* 0008 */    0x30, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }) 

Ponownie zaglądamy z do specyfikacji ACPI w poszukiwaniu _PLD. Na stronie 203 znajdziemy po co to, a na stronie 362 znajdziemy ładny przykład

Zmieniamy, więc nasz kod na:

Name (_PLD, Package(1) { Buffer (0x10) 
                       { 
                           /* 0000 */    0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                           /* 0008 */    0x30, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
                       }}) 

I tak z pozostałymi wystąpieniami, czyli 16 błędów mniej.

 

:arrow:6.

Remark   5011 -                   ^ Use of compiler reserved name (_T_0) 
lub
Remark   5011 -                               ^ Use of compiler reserved name (_T_1) 

Skoro nazwa zarezerwowana to zmieńmy ją na inną – przyjęło się zmieniać wystąpienia ‘_T_’ na ‘T_’

Np.

Name (_T_0, Zero) 

Po zmianie

Name (T_0, Zero)

 

:arrow:Wynik pracy:

Intel ACPI Component Architecture
ASL Optimizing Compiler version 20110922-32 [sep 22 2011] 
Copyright (c) 2000 - 2011 Intel Corporation

ASL Input:     DSDT.dsl - 7979 lines, 254150 bytes, 3178 keywords
AML Output:    DSDT.aml - 28166 bytes, 919 named objects, 2259 executable opcodes

Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 119 Optimizations

 

w drugiej części powrzucam dodatki.

Odnośnik do komentarza
Udostępnij na innych stronach

  • 2 miesiące temu...

Dołącz do dyskusji

Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.

Gość
Dodaj odpowiedź do tematu...

×   Wklejono zawartość z formatowaniem.   Usuń formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Odnośnik został automatycznie osadzony.   Przywróć wyświetlanie jako odnośnik

×   Przywrócono poprzednią zawartość.   Wyczyść edytor

×   Nie możesz bezpośrednio wkleić grafiki. Dodaj lub załącz grafiki z adresu URL.

Ładowanie
 Udostępnij

×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Korzystanie z tej witryny, wymaga zakceptowanie naszych warunków Warunki użytkowania.