x86 하드웨어 기반 Mac OS X 2008–2024 기술 아카이브
InfiniteMac OSx86 › OSx86 10.X 코어 아키텍처 및 부트 시스템 › 다양한 DSDT 고급 수정 기법 모음: 전원 버튼(PWRB) 활성화, 잠자기 깨우기 블…
625,378 reads · 2009-01-19 – 2013-01-21
기술 레퍼런스 10.X 코어 아키텍처 DSDT Gigabyte G31M / P35

다양한 DSDT 고급 수정 기법 모음: 전원 버튼(PWRB) 활성화, 잠자기 깨우기 블랙스크린 수정, 상판 닫기 잠자기 및 ASUS 핫키

시스템 DSDT 테이블을 직접 패치하여 본체 전원 버튼 종료 대화상자(PWRB) 활성화, 잠자기에서 깨어난 후 화면이 켜지지 않는 현상 수정, Clamshell 상판 닫기 잠자기 및 ASUS 노트북 기능 핫키를 구현하는 실전 ASL 코드 모음입니다.

주 저자
@pentiumpc 게시일: 2009-01-19
소속 컬렉션
OSx86 10.X 코어 아키텍처 및 부트 시스템
아카이브 기록 규모
누적 조회 625,378회 · 선별된 필드 노트 101건 (원본 게시물 107건에서 추출) · 2009-01-19 – 2013-01-21
참여 및 검증 멤버 (32)
@uman (21)@kizwan (18)@pentiumpc (8)@Slither2008 (6)@candykane (6)@richarda (5)@THeKiNG (4)@breakky (4)@Thireus (3)@Alexaar (2)@The Edge3000 (2)@Gurruwiwi (2)@EnzoFX (2)@Sweaty (2)@ping99 (2)@Nameci (2)+16 more
관련 하드웨어 참조
Workstation Coolers & Thermal Gear ↗ Gigabyte Motherboards ↗ Laptop RAM & SSD Upgrades ↗
한국어 전문 번역 기술 문서 · 터미널 명령어, Kext 파일명, ACPI 노드 및 부트 플래그는 원문 그대로 보존됩니다영문 원본 보기 (Original English) →

DSDT 오버라이드(DSDT Override)를 활용한 OS X 설치 스레드가 많이 올라와 있는데, DSDT를 직접 수정하면 여러 하드웨어 버그를 고치고 숨겨진 순정 기능들을 활성화할 수 있습니다.

구현 및 수정 가능한 항목들:
1. PWRB(본체 전원 버튼) 종료 팝업 활성화.
2. 시스템 잠자기 깨우기(System Wake) 후 화면이 까맣게 나오는 현상 수정.
3. Clamshell.kext와 연동하여 상판 닫기(Clamshell) 잠자기 활성화 (superhai가 기존 kext 지원을 중단함에 따라 DSDT 보완).
4. ASUS 노트북 전용 기능키(Hotkeys) 활성화.

추가 검증 중인 수정 사항:
1. USB 잠자기 관련 문제 해결 (제 ASUS 1000H 넷북에서는 완벽히 작동하지만 기가바이트 DS3L 데스크탑 보드에서는 작동하지 않음).

지난 주말 동안 집중적으로 분석해 알아낸 내용들을 정리한 것이며, 더 좋은 팁이나 패치 코드가 있다면 언제든 댓글로 보태 주시기 바랍니다.
모든 코드는 제 시스템에서 정상 작동을 검증했지만, 사양이 다른 기기에서는 직접 적용해 보며 동작 여부를 확인해야 합니다.
여러분 각자의 시스템에 맞는 DSDT 패치를 작성할 때 유용한 레퍼런스로 활용하시기 바랍니다.

커뮤니티 실측 및 기술 필드 노트

총 107개의 원본 스레드 응답 중 기술적 가치가 높은 101개의 필드 노트 수록

저자 업데이트 #1 @pentiumpc 2009-01-19

본체 전원 버튼 활성화하기

_HID를 _CID로 변경합니다.

Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C")) ---> Name (_CID, EisaId ("PNP0C0C"))
Name (_UID, 0xAA)
Name (_STA, 0x0B)
}

이 팁은 어느 사이트에선가 보고 적용한 것인데 정확한 출처가 기억나지 않네요(원작자분께 감사를 표합니다).
이렇게 수정하면 본체 전원 버튼을 눌렀을 때 OS X의 종료/잠자기 대화상자 메뉴가 화면에 나타납니다.

저자 업데이트 #2 @pentiumpc 2009-01-19

잠자기 깨우기 후 블랙스크린(화면 안 켜짐) 해결

EeePC 1000H에서는 잠자기에서 깨어날 때 백라이트가 켜지지 않아 화면이 까맣게 나오며, 밝기 조절 키를 한 번 눌러줘야만 화면이 들어옵니다. 기존에는 SleepWatcher와 Reggie를 조합해 깨어날 때 레지스터에 직접 값을 써넣는 방식으로 우회하곤 했습니다.

하지만 DSDT의 깨우기 메소드에서 밝기 값을 다시 설정해 주도록 수정하면 이 문제를 깔끔하게 해결할 수 있습니다.

Method (WAK, 1, NotSerialized) //WAKE up
{
\_SB.PCI0.SBRG.EC0.EC0W (Arg0)
\_SB.PCI0.NWAK (Arg0)
\_SB.PCI0.SBRG.SWAK (Arg0)
LPWK (Arg0)
Store(\_SB.ATKD.PBLG,local0) //---> Get Brightness level from NVS
\_SB.ATKD.PBLS(local0) //---> Set Brightness level.
}

마지막 두 줄을 추가하여 깨어날 때 화면 밝기 단계를 복원해 주면 됩니다.

시스템마다 메소드 이름이 다를 수 있으니 유사한 이름의 메소드를 찾아보세요.
또한 본인의 DSDT에서 밝기 값을 읽어오고(Get) 설정하는(Set) 메소드가 무엇인지 파악해야 합니다.
이 원리는 깨어난 후 초기화가 필요한 다른 장치 문제를 해결할 때도 응용할 수 있습니다.

저자 업데이트 #3 @pentiumpc 2009-01-19

상판 닫기 잠자기 (Clamshell Sleep) 구현

대부분의 해킨토시 노트북은 상판(LID)을 닫아도 잠자기에 들어가지 않습니다. 이를 해결할 DSDT 패치를 구글에서 백방으로 찾아봤지만 나오지 않길래 직접 코드를 작성해 해결했습니다.

혹시 더 나은 방법이나 대안을 알고 계신 분이 있다면 공유 부탁드립니다. 감사합니다.

Device (LID0)
{
Name (_HID, EisaId ("PNP0C0D")) //LID detection
Method (_PRW, 0, NotSerialized)
{
Return (Package (0x02)
{
0x0B,
0x04
})
}
Name (LIDS, One)
Method (_LID, 0, NotSerialized)
{
Store (^^PCI0.SBRG.EC0.SF13, LIDS) //LID register
XOr (LIDS, One, Local0)
IF (Local0) //if LID is closed
{
Notify (SLPB, 0x80) //Set system to sleep
}
Return (LIDS)
}

DSDT 안에서 LID 디바이스는 쉽게 찾으실 수 있을 텐데, 상판이 닫혔을 때 슬립 버튼(SLPB)에 잠자기 알림(Notify)을 보내는 줄만 추가해 주면 됩니다.

제 생각에 대부분의 일반 노트북은 상판 닫힘 이벤트를 OS가 해석해 잠자기 명령을 내리는 구조인데, OS X는 일반 PC의 LID 디바이스가 보내는 기본 알림을 알아듣지 못하는 것 같습니다. 그래서 아예 ACPI 하드웨어 레벨에서 직접 SLPB에 잠자기 신호를 보내도록 처리했습니다.

저자 업데이트 #4 @pentiumpc 2009-01-19

ASUS 기능키(Hotkey) 활성화하기

IORegistry 트리를 살펴봤을 때 "ASUS010"이나 "ATKD" 디바이스가 보인다면 ASUS 핫키 장치가 탑재된 모델이며, Fn+Fx 조합 기능키들을 살려낼 수 있습니다.

우선 각 기능키가 어떤 ACPI 알림(Notification) 코드를 발생하는지 알아내야 합니다. 저는 알림 코드를 로깅하고 분석하는 테스트용 Kext를 직접 만든 뒤, DSDT의 _GPE 스코프를 뒤져 각 키에 대응하는 인터럽트 메소드(_Qxx)를 찾아냈습니다. 매핑 구조를 모두 파악한 뒤에는 해당 인터럽트 메소드 안에 각 장치를 켜고 끄는 토글(Toggle) 코드를 직접 삽입했습니다.

덕분에 이제 백라이트, Wi-Fi, 블루투스, 카드 리더기, 웹캠 켜기/끄기와 화면 밝기 조절 등이 모두 작동합니다. 외부 모니터 전환이나 FSB 클럭 변경 같은 나머지 기능키들은 아직 분석 중입니다.

예시 코드..
Method (CAMS, 1, Serialized) //Camera Set
{
Return (OCMS (Arg0))
}

Method (CAMR, 0, Serialized) //Camera toggle : added
{
Store (OCMG , Local0)
XOr (Local0, One, Local0)
Return (OCMS (Local0))
}

Method (CAMG, 0, Serialized) //Camera Set
{
Return (OCMG )
}

위 코드는 이름만 봐도 알 수 있듯이 웹캠(Camera) 전원을 켜고 끄는 메소드입니다.

Method (_Q2A, 0, NotSerialized) //Camera
{
^^^^ATKD.CAMR //Toggle Camera
ATKN (0x1D) //notify ATKD
}

그리고 위 코드가 해당 키 이벤트를 처리하는 GPE 인터럽트 핸들러입니다.

저자 업데이트 #5 @pentiumpc 2009-01-19

USB 잠자기 오류 수정 (HPET)

Device (HPET)
                {
                    Name (_HID, EisaId ("PNP0103"))
                    Name (_CID, EisaId ("PNP0C01"))
                    Name (CRS, ResourceTemplate 
                    {
                        Memory32Fixed (ReadOnly,
                            0xFED00000,         // Address Base
                            0x00000400,         // Address Length
                            _Y03)
                    })
                    OperationRegion (^LPCR, SystemMemory, 0xFED1F404, 0x04)
                    Field (LPCR, AnyAcc, NoLock, Preserve)
                    {
                        HPTS,   2, 
                            ,   5, 
                        HPTE,   1, 
                                Offset (0x04)
                    }

Method (_STA, 0, NotSerialized)
{
Return (0x0F)
}

HPET 디바이스의 상태(_STA)가 항상 0x0F를 반환하도록 고정해 주면 잠자기에서 깨어난 후 USB 포트가 먹통이 되거나 핫플러그(Hot-plug) 인식이 안 되던 문제가 해결되는 것으로 보입니다.

이 문제를 일부러 재현하며 철저히 교차 검증한 것은 아니라 100% 확언할 수는 없지만, 현재 제 시스템은 Decrypter, AnV SMBIOS, PS2Nub/Controller, OpenHaltRestart만 올린 10.5.6 순정(Vanilla) 상태에서 아주 잘 돌아가고 있습니다.

별도의 IOUSB 수정 Kext는 전혀 쓰지 않습니다(오히려 쓰면 패닉이 나더군요).

업데이트 -- 이 부분은 최신 DSDT Patcher에서 -newHPET 옵션을 주면 자동으로 패치됩니다. 패치 후에는 Disabler.kext도 필요 없습니다.

필드 노트 #1 @Slither2008 2009-03-03

제 Asus EeePC 1000H의 dsdt.aml 파일을 뜯어보면서 _SB 아래의 메소드 구조를 파악하고 있습니다.

제가 정리한 아래 메소드 목록이 맞는지 봐주실 수 있나요?

메소드 - 설명 (S=Set / G=Get)

PBL (S/G) = 백라이트 (BackLight)
CAM (S/G) = 웹캠 (Camera)
CRD (S/G) = 카드 리더기 (Card Reader)
WLD (S/G) = 무선 랜 설정 / 조회 (Wireless Lan Set / Get)
CFV (S/G) = FSB 클럭 및 전압 설정 / 조회 (FSB Speed & Voltage Set / Get)
CAM (S/G) = 웹캠 설정 / 조회 (Camera Set / Get)
BTH (S/G) = 블루투스 설정 / 조회 (BlueTooth Set / Get)
SDSP = 디스플레이 출력 전환 (Switch/Swap Display)
CRD (S/G) = 카드 리더기 설정 / 조회 (Card Reader Set / Get)
HDPS = ?
PBP (S/G) =
M3G (S/G) = 모바일 3G 모뎀 (Mobile 3G)
HWCF = ?
GNVS = 볼륨 조회? (아마 틀렸을 겁니다. 메모리 참조값을 읽고 쓰는 용도 아닐까요?)
SNVS = 볼륨 설정? (마찬가지로 메모리 참조 관련일 것 같습니다)

남는 핫키(0x1d)를 이용해 웹캠과 블루투스를 켜고 끄는 데까지는 성공했습니다. 이어서 Wi-Fi 토글도 구현해 보려 했는데, 무선 랜 메소드 호출 구조는 단순한 ATKN(값) 호출보다 훨씬 복잡하더군요.

내부적으로 조건 분기를 거쳐 0x11을 넘길지 0x10을 넘길지 결정하는 로직이 들어 있는 것 같습니다. 제가 짠 코드로는 한 번 꺼지기만 할 뿐 다시 켜지지가 않네요(아마 분기 로직 일부가 빠진 모양입니다).

그리고 제작해 주신 Asus 테스트용 Kext를 로드해 보니 모든 버튼 입력이 정확히 감지됩니다! 다만 Wi-Fi 끄기 Fn 키를 누를 때만 매핑되지 않은 메소드라는 메시지가 뜨면서 블루투스나 Wi-Fi가 절전(Powersave) 상태로 진입하지 못했다는 로그가 계속 올라옵니다. 그 상태에서 다시 한 번 Wi-Fi Fn 키를 누르면 오류 메시지가 멈추고요.

이 현상에 대해 어떻게 생각하시나요?

감사합니다,

Steve 드림.

필드 노트 #2 @Slither2008 2009-03-03

제가 기준으로 삼고 있는 ACPI 이벤트 코드 목록입니다.

# 상단 은색 바로가기 버튼 (Silver buttons)
KEY_SILVER1="0000001a" # 화면 끄기 (Blank)
KEY_SILVER2="0000001b" # 해상도 변경 (Change resolution)
KEY_SILVER3="0000001c" # 사용자 지정 1 (User 1)
KEY_SILVER4="0000001d" # 사용자 지정 2 (User 2)

# Fn+F? 조합 키
KEY_Fn_F1="00000080" # 잠자기 (Sleep)
KEY_Fn_F2=("00000010" "00000011") # Wi-Fi 토글
KEY_Fn_F5="0000002*" # 밝기 낮추기 (Brightness down)
KEY_Fn_F6="0000002*" # 밝기 높이기 (Brightness up)
KEY_Fn_F7="00000016" # 백라이트 끄기 (Backlight off)
KEY_Fn_F8=("00000030" "00000031" "00000032") # 화면 출력 전환 (XRandR)
KEY_Fn_F9="00000012" # 작업 관리자 (Task Manager)
KEY_Fn_F10="00000013" # 음소거 (Mute)
KEY_Fn_F11="00000014" # 볼륨 낮추기 (Volume Down)
KEY_Fn_F12="00000015" # 볼륨 높이기 (Volume Up)

# 기타 ACPI 이벤트
POWER_AC="00000001"
POWER_BAT="00000000"

비어 있는 F3, F4 키를 활용해 커스텀 Fn 단축키를 만들고 싶다면 리눅스에서 acpi_listen 명령어로 해당 키 코드를 따내는 것이 가장 확실할 것 같습니다.

그나저나 왜 볼륨 조절 키 관련 함수들은 DSDT 안에서 눈에 잘 띄지 않는지 여전히 의문이네요.

저자 업데이트 #6 @pentiumpc 2009-03-03 ↳ Re: @Slither2008

Fn+F1 키는 별도의 키 코드를 반환하지 않으며, SLPB에 0x80 알림(Notify)을 보내 시스템을 즉시 잠자기에 넣습니다.
Fn+F5, Fn+F6 키는 0x20부터 0x2F 사이의 값을 반환합니다(총 15단계 화면 밝기).
Fn+F8 키는 다음 디스플레이 출력 모드 코드(내장 LCD, 외부 VGA, 또는 듀얼 확장)를 반환합니다.
AC 전원 어댑터 연결 시에는 0x50을 반환합니다.
배터리 모드 전환 시에는 0x51을 반환합니다.

이러한 키 이벤트들이 OS 상에서 실제로 동작하려면 이를 받아 처리해 줄 드라이버(Kext)가 필요합니다.

요즘 본업이 너무 바빠서 개발 중이던 전용 드라이버 작업을 잠시 중단해야 할 것 같습니다.
현재 베타 버전까지 만들어 둔 파일이 있으니 원하시는 분들은 자유롭게 테스트해 보세요.

ASUS 핫키 활성화 패키지 (media fire.com/download.php?4lnemnhjnzt)

이 패키지에는 핫키를 활성화하는 여러 구성 요소가 포함되어 있으며, 더 이상 SleepWatcher를 쓸 필요가 없고 Fn+F1은 딥 슬립(Deep Sleep), 상판 닫기(LID)는 일반 절전(Doze)으로 작동하게 해줍니다.
또한 plist 설정값을 수정해 대부분의 핫키에 원하는 커스텀 스크립트를 할당해 실행할 수도 있습니다. 제 시스템에서 한동안 실사용해 봤는데 꽤 안정적으로 잘 작동합니다.

설치하기 전에 반드시 본인의 기존 "DSDT.aml" 파일을 백업해 두시기 바랍니다.

저자 업데이트 #7 @pentiumpc 2009-03-03 ↳ Re: @Slither2008
@Slither2008Method - Description CFV (S/G) = FSB Speed & Voltage Set / Get SDSP = Switch/Swap Display HDPS = ? PBP (S/G) = HWCF = ? GNVS = Get Volume (I'm sure this is wrong. Probably gets and sets memory references?) SNVS = Set Volume (I'm sure this is wrong. Probably gets and sets memory references?) .

CFV = FSB 클럭만 설정하며 전압(Voltage)과는 무관합니다.
HDP/PBP = 내장 LCD, 외부 모니터 또는 양쪽 동시 출력을 설정합니다. 레지스터 설정 자체는 작동하지만 실제 화면 전환이 이루어지려면 맥의 디스플레이 해상도 갱신이 함께 일어나야 해서 처리가 아주 까다롭습니다.
HWCF = 용도 미상입니다.
G/S NVS = NVS(Non-Volatile SRAM, 비휘발성 메모리 영역 - 아마 BIOS 영역일 겁니다)의 값을 읽어오거나(Get) 설정(Set)합니다.

BIOS 메소드는 현재 바이오스 버전을 반환합니다.
INIT는 ATKD 장치를 초기화합니다(키 코드 반환값을 받으려면 반드시 먼저 실행되어야 합니다).

집 인터넷에서는 IPIS 포럼 로그인이 자꾸 풀려버리고 회사에서는 글을 올릴 시간이 없네요. 혹시 가능하시다면 제 패키지를 그쪽 포럼에도 대신 공유해 주시면 감사하겠습니다.

필드 노트 #3 @Slither2008 2009-03-03

유익한 정보와 베타 버전 Fn 키 드라이버를 공유해 주셔서 정말 감사합니다.

이 내용들을 정리해서 ipis 포럼에 가이드 글을 올려두겠습니다.

감사합니다,

Steve 드림.

필드 노트 #4 @Slither2008 2009-03-03

DSDT 수정을 통한 기능키 활성화 가이드 스레드:
ipis-osx.wik idot.com/forum/t-135417/enabling-function-keys-by-modifying-your-dsdt#post-403326

실험용 핫키 Kext 드라이버 배포 스레드:
ipis-osx.wik idot.com/forum/t-135405/experimental-asus-hotkey-enabler-kext-driver#post-403338

필드 노트 #5 @Slither2008 2009-03-04

제가 가진 프로그래밍 기술을 보태어 님의 Kext 개발을 함께 돕고 싶습니다.

혹시 실험용 Kext의 소스 코드를 공유해 주실 의향이 있으신가요?

감사합니다,

Steve 드림.

필드 노트 #6 @Slither2008 2009-03-05

기본적인 WorkLoop를 갖춘 뼈대(Skeleton) Kext를 직접 하나 작성해 봤습니다.

Kext가 초기화(init)되고, 탐색(probe)을 거쳐 ATKD 디바이스 넙(Nub)과 정상적으로 매칭된 뒤 start 함수까지는 잘 진입합니다.

그런데 IOInterruptEventSource를 추가하는 부분에서 막히고 있습니다.

start 함수 내부에 다음과 같이 선언했습니다:

interruptSrc = IOInterruptEventSource::interruptEventSource(
(OSObject*)this,
OSMemberFunctionCast( IOInterruptEventAction,
this,
&com_ipis_driver_AsusFNKeys::interruptOccurred ),
(IOService*)provider,
(int)0);

WorkLoop에 등록되지 않을 경우 에러를 출력하는 검증 코드도 넣어두었는데, 이 Kext를 로드하는 즉시 커널 패닉(KP)이 발생해 버립니다.

위 인터럽트 이벤트 소스 관련 코드를 주석 처리하고 순수 뼈대 템플릿만 남기면 드라이버가 아무 문제 없이 로드되는 걸로 보아 저 부분이 패닉의 원인인 것은 확실합니다.

혹시 올바른 구현 방향에 대해 조언을 주실 수 있다면 대단히 감사하겠습니다.

필드 노트 #7 @Alexaar 2009-04-13

안녕하세요! 어떻게 지내시나요?
1000H용 DSDT를 한층 더 개선해 보려고 하는데 고수분들의 도움이 필요합니다.

첫 번째 질문은 PS2 컨트롤러에 관한 것입니다(InsanelyMac 스레드에도 함께 올린 내용입니다: http://www.insanelymac.com/forum/index.php?showtopic=90… ↗ ):

현재 우리 모두 아래와 같은 코드를 사용하고 있는데요,

Device (PS2K)
                {
                    Name (_HID, EisaId ("PNP0303"))
                    Name (_CID, 0x0B03D041)
                    Method (_STA, 0, NotSerialized)
                    {
                        ShiftLeft (One, 0x0A, Local0)
                        If (And (IOST, Local0))
                        {
                            Return (0x0F)
                        }

                        Return (Zero)
                    }

                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
                        IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
                        IRQNoFlags () {1}
                    })
                }

                Device (PS2M)
                {
                    Name (_HID, EisaId ("SYN0A04"))
                    Name (_CID, Package (0x03)
                    {
                        0x000A2E4F, 
                        0x02002E4F, 
                        0x130FD041
                    })
                    Method (_STA, 0, NotSerialized)
                    {
                        ShiftLeft (One, 0x0C, Local0)
                        If (And (IOST, Local0))
                        {
                            Return (0x0F)
                        }

                        Return (Zero)
                    }

                    Name (_CRS, ResourceTemplate ()
                    {
                        IRQNoFlags () {12}
                    })
                }

이렇게 하면 IOReg 상에서 디바이스가 이중으로 중복 생성(Doubling)됩니다.

참고로 OpenBSD 부팅 로그에서 확인한 하드웨어 정보는 다음과 같습니다:

ichpcib0 at pci0 dev 31 function 0 "Intel 82801GBM LPC" rev 0x02: PM disabled
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbc0: using irq 1 for kbd slot
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0

pmsi0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pmsi0 mux 0

지금 코드도 작동은 잘 되지만 기왕이면 중복 등록 현상을 깔끔하게 고치고 싶습니다. 좋은 아이디어 있으신가요?

그리고 두 번째 질문은 상판을 열었을 때 자동으로 잠자기에서 깨어나게 하는(Wakeup on Clamshell Open) 기능입니다. 혹시 구현해 보신 분 계신가요?

필드 노트 #8 @Alexaar 2009-04-29

아직 아무도 답변이 없네요, 아쉽습니다.
우선은 본문에 올라온 패치들과 제가 직접 찾은 수정 사항들을 합쳐 자체 DSDT를 다듬고 있습니다. 현재 10.5.6에서 시스템 구동과 잠자기는 완벽하게 작동합니다. 다만 Fn 키 패치는 제 환경에서 아직 버그가 좀 있네요.
1000H DSDT를 더 개선할 방법을 계속 찾고 있는데, 특히 상판을 열었을 때 잠자기에서 깨어나는 기능을 꼭 구현하고 싶습니다. 아이디어 있으신 분 안 계신가요?

필드 노트 #9 @Thireus 2009-05-07

DSDT 안에서 다음 설정값으로 FSB가 작동하도록 고정하려면 어디를 어떻게 수정해야 하는지 알고 싶습니다:

FSB=54
PCIE=176

Windows XP에서 eeectl 유틸리티로 오버클럭하는 것과 똑같이 EeePC 1000H의 클럭을 1.9GHz로 끌어올리려고 합니다.

필드 노트 #10 @candykane 2009-05-13

InsanelyMac에서 찾은 유용한 자료인데 이 모음집 스레드에 함께 정리해 두면 좋을 것 같아 공유합니다.
_WAK 메소드를 수정해 잠자기 모드를 고치는 방법입니다.

_WAK 메소드에 관한 기술 정보.
인자(Arguments):
0 진입했던 절전 상태 값 (S1은 1, S2는 2 등).
결과 코드 (2개의 DWORD로 구성된 Package):
Status 절전 도중 발생한 조건들을 나타내는 비트 필드.
0x00000000 깨우기 신호가 전달되었으며 정상적으로 깨어남.
0x00000001 깨우기 신호가 전달되었으나 전력 부족으로 실패함.
0x00000002 깨우기 신호가 전달되었으나 발열 조건으로 인해 실패함.
그 외 값 예약됨(Reserved)
PSS 0이 아닌 경우, 전원 공급 장치가 실제로 진입했던 유효 S-state 값.

이 값은 전원 공급 장치에서 과도한 전류가 소모되어 목표했던 절전 단계(S-state)로 진입하지 못했을 때 이를 감지하는 데 사용됩니다.

즉, _WAK 메소드는 요청되었던 절전 상태 번호를 인자 하나로 받아들이고, 그 결과를 2개의 DWORD로 이루어진 패키지(Package)로 반환합니다. 첫 번째 값은 깨우기가 성공했는지(성공 시 0, 실패 시 0이 아닌 값)와 실패 원인을 알려주는 코드이고, 두 번째 값 역시 성공 시에는 0이며 실패 시에는 실제로 진입했던 절전 단계 값을 반환합니다. 간단히 말해 성공/실패 상태 코드입니다.

Package 선언의 첫 번째 인자는 패키지 내 요소의 개수를 지정하고, 중괄호 안의 내용이 실제 요소 값입니다. 따라서 아래에 추가할 코드는 두 요소가 모두 0인 2개짜리 패키지를 반환하는 선언입니다. ACPI 명세상 _WAK 메소드는 반드시 두 개의 값을 반환해야 하므로 이 구문이 필요합니다.
결국 핵심은 컴파일러가 요구하는 ACPI 명세를 충족시켜 경고를 없애고 항상 '정상 깨어남(성공)' 상태를 반환하도록 더미(Dummy) 반환값을 넣어주는 것입니다.

잠자기 모드 수정 방법:

DSDT에서 다음 항목을 검색하세요: _WAK

CODE
Method (_WAK, 1, NotSerialized)
{
Store (0xFF, DBG1)
If (LEqual (Arg0, 0x03))
{
Store (0x8F, SCP)
}

If (LEqual (Arg0, 0x04))
{
If (LEqual (OSFL, Zero))
{
If (LEqual (OSFX, 0x03))
{
Store (0x59, SMIP)
}
Else
{
Store (0x58, SMIP)
}
}

If (LEqual (OSFL, One))
{
Store (0x56, SMIP)
}

If (LEqual (OSFL, 0x02))
{
Store (0x57, SMIP)
}

If (LEqual (OSFX, 0x03))
{
Store (0x59, SMIP)
}
}

If (LEqual (Arg0, One)) {}
If (OSFL)
{
Notify (\_SB.PWRB, 0x02)
}
Else
{
If (LEqual (RTCW, Zero))
{
Notify (\_SB.PWRB, 0x02)
}
}

Notify (\_SB.PCI0.USB0, Zero)
Notify (\_SB.PCI0.USB1, Zero)
Notify (\_SB.PCI0.USB2, Zero)
Notify (\_SB.PCI0.USB3, Zero)
Notify (\_SB.PCI0.USB4, Zero)
Notify (\_SB.PCI0.USB5, Zero)
Return(Package(0x02){0x00, 0x00}) <------ 바로 여기에 추가하세요. 컴파일하기 전에 dsdt_fixed.txt를 편집하면 됩니다.
}

필드 노트 #11 @candykane 2009-05-13

백라이트 제어 (Backlight control)
노트북 DSDT에 추가하면 좋은 또 하나의 유용한 디바이스입니다 (_SB 스코프 아래에 추가):

CODE
Device (PNLF)
{
Name (_HID, EisaId ("APP0002"))
Name (_CID, "backlight")
Name (_UID, 0x0A)
Name (_STA, 0x0B)
}

순정 백라이트 제어 드라이버를 로드하는 데 큰 도움이 됩니다.

필드 노트 #12 @Thireus 2009-05-13

음... 제 질문에는 답변해 주실 수 있는 분이 아무도 안 계신가요?

필드 노트 #13 @candykane 2009-05-13

잠자기 및 깨어난 후 USB 먹통 문제 해결

드디어 제 노트북에서 잠자기 문제를 완벽히 해결했습니다!

원인은 바로 USB 쪽에 있었습니다…
해결책은 WAK 메소드 패치만큼이나 간단합니다:

DSDT에서 모든 USB 디바이스 항목 아래를 살펴보시면 다음과 같은 코드가 있을 겁니다:
QUOTE
Method (_PRW, 0, NotSerialized)
{
Return (GPRW (0xYZ, 0xYZ))
}
이제 Method (GPRW… 를 검색해서 찾은 뒤, 그 메소드 맨 마지막의 Return (PRWP 또는 원래 적혀 있던 변수명) 부분을 다음 코드로 바꿔줍니다:
CODE
Return (Package (0x02)
{
Zero,
Zero
})

다만 제 경우 여전히 수정된 EHCI/UHCI Kext들을 함께 사용해야 합니다. 그 Kext들 없이도 잠자기 자체는 잘 되지만, 깨어났을 때 UHCI 버스 장치들(블루투스와 지문 인식 센서)이 끊기더군요.

그나저나 수정된 EHCI Kext 말인데, 콘솔 로그에 끝없이 찍히는 소유권(Ownership) 디버그 메시지는 정말 끔찍하게 거슬립니다. 대체 왜 개발자들은 배포용 Kext에 그런 잡다한 디버그 출력을 켜두는 건지 모르겠네요. 일반 버전과 디버그 버전을 따로 빌드하든가, 아니면 Info.plist에 불리언(Boolean) 키를 하나 두어 디버그 출력을 끄고 켤 수 있게 만드는 게 어렵지도 않을 텐데 말입니다...

추신 1: 디버그 로그를 깔끔하게 제거한 수정 버전을 만들어 주신 Slice 님께 진심으로 감사드립니다. 덕분에 저도, 제 시스템 로그도 평화를 찾았습니다.
그런데 Slice 님의 USB 수정 Kext 소스 코드가 공개되어 있지 않아 내부적으로 정확히 어떤 처리를 하는 건지 여전히 궁금합니다. 원리만 알 수 있다면 그 처리 과정도 아예 DSDT 패치로 통합해 버릴 수 있을 텐데, 적어도 시도라도 해볼 수 있으니까요...

추신 2: 어젯밤에 너무 피곤해서 깜빡하고 빼먹은 중요한 내용이 있습니다: 바로 Device (PWRB), 즉 전원 버튼 디바이스입니다. 제 노트북 DSDT에는 PWRB가 아예 빠져 있길래 새로 추가해 주었습니다. 실제 맥북(MB)의 DSDT를 보면 USB 디바이스 관련 이벤트들이 모두 이 PWRB를 가리키고 있기 때문입니다.
따라서 본인의 DSDT에 PWRB가 없다면 Device (SLPB)를 검색해 그 위나 아래에 다음과 같이 추가해 주세요:
CODE
Scope (_SB)
{
Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C"))
}

Device (SLPB)
{
Name (_HID, EisaId ("PNP0C0E"))
Method (_PRW, 0, NotSerialized)
{
Return (Package (0x02)
{
0x0B,
0x04
})
}
}
}
그런 다음 Method (_Lxy…) 항목들을 검색해 보면 각 USB 디바이스들에 대한 GPE 이벤트 핸들러들이 나올 겁니다. 각각의 UHCI 항목 아래에 Notify (\_SB.PWRB, 0x02)를 추가해 주시고, EHCI 항목은 실제 맥북의 DSDT 구조를 그대로 이식해 다음과 같이 작성해 줍니다:
CODE
Scope (_GPE)
{
Method (_L03, 0, Serialized)
{
Notify (\_SB.PCI0.UHC1, 0x02)
Notify (\_SB.PWRB, 0x02)
}

Method (_L04, 0, Serialized)
{
Notify (\_SB.PCI0.UHC2, 0x02)
Notify (\_SB.PWRB, 0x02)
}

Method (_L0C, 0, Serialized)
{
Notify (\_SB.PCI0.UHC3, 0x02)
Notify (\_SB.PWRB, 0x02)
}

Method (_L0E, 0, Serialized)
{
Notify (\_SB.PCI0.UHC4, 0x02)
Notify (\_SB.PWRB, 0x02)
}

Method (_L05, 0, Serialized)
{
Notify (\_SB.PCI0.UHC5, 0x02)
Notify (\_SB.PWRB, 0x02)
}

Method (_L0D, 0, Serialized)
{
If (\_SB.PCI0.EHC1.PMES)
{
Store (0x01, \_SB.PCI0.EHC1.PMES)
Notify (\_SB.PCI0.EHC1, 0x02)
Notify (\_SB.PWRB, 0x02)
}

If (\_SB.PCI0.EHC2.PMES)
{
Store (0x01, \_SB.PCI0.EHC2.PMES)
Notify (\_SB.PCI0.EHC2, 0x02)
Notify (\_SB.PWRB, 0x02)
}
}
특히 EHCI 쪽에 추가한 PMES 처리 코드가 EHCI 잠자기 문제를 완전히 잡아주어, 적어도 제 시스템에서는 더 이상 EHCISleepEnabler를 쓸 필요가 없어졌습니다.
참고로 만약 저 _Lxx 메소드들 안에 HDEF(오디오) 관련 Notify가 들어 있다면 반드시 지워버리세요. 그대로 두면 잠자기가 풀려버립니다!
마지막 팁으로, 마우스나 키보드를 눌러 노트북/데스크탑의 잠자기를 깨우고 싶다면 IOReg에서 마우스/키보드가 연결된 USB 버스 이름을 확인한 뒤, 위 코드에서 해당 USB 버스의 Notify 대상을 PWRB 대신 SLPB로 바꿔주시면 됩니다.

유용하게 쓰시길 바랍니다!

필드 노트 #14 @candykane 2009-05-13

저도 방금 전원 버튼을 눌렀을 때 종료/로그아웃 대화상자가 뜨도록 설정하는 데 성공했습니다:
CODE
Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C"))
}

단순히 _HID를 _CID로 바꿔주기만 하면 되네요.

필드 노트 #15 @candykane 2009-05-13

DSDT를 통해 사운드를 잡는 완벽 가이드
오디오를 잡는 작업이 이렇게까지 복잡할 이유가 없습니다. 여러분 대부분은 이미 그래픽 카드를 잡기 위해 device-property(EFI 스트링)를 쓰거나 수정된 DSDT를 사용하고 계실 텐데, 굳이 오디오 정보를 주입하겠다고 별도의 인젝터 Kext를 또 로드해 시스템 자원을 낭비할 필요가 없습니다.

사운드를 정상 작동시키는 데 HDAEnabler.kext나 ALCinject.kext 같은 건 전혀 필요하지 않습니다.

정말로 필요한 것은 패치된 AppleHDA.kext(여기서는 AlainTox714 님의 버전)와 다음 3가지 핵심 정보뿐입니다:
layout-id
codec-id
PinConfigurations
이 정보들은 device-property 스트링으로 주입해도 되고 DSDT를 통해 주입해도 됩니다(개인적으로는 DSDT 방식이 훨씬 깔끔한 결과를 보여주었습니다).

두 가지 방법을 모두 테스트해 봤는데 양쪽 다 사운드가 잘 나왔지만, DSDT에 직접 기술하는 방식이 ACPI 표준 규격에 훨씬 더 부합합니다.

이미 사용 중인 /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAController.kext/Contents/Info.plist 파일 안에 ConfigData 값이 들어 있다면, 거기서 바로 PinConfigurations 데이터를 추출할 수 있습니다.

(각 4바이트 세그먼트에서 맨 마지막 바이트 값만 순서대로 뽑아내면 됩니다)
<00a71c1f 00a71d40 00a71e21 00a71f02 00b71c40 00b71d90 00b71ea1 00b71f02 00c71c2e 00c71d30 00c71e81 00c71f01 00d71c10 00d71d40 00d71e11 00d71f01 00e71c20 00e71d90 00e71ea1 00e71f01 00f71c12 00f71d10 00f71e11 00f71f01 01071c11 01071d70 01071e11 01071f01 02171c50 02171d21 02171e45 02171f01>

또 다른 방법은 리눅스 코덱 덤프 파일에서 [Jack]이 포함된 줄들을 찾은 뒤, 해당 Pin Default 16진수 값의 바이트 순서를 역순(Byte-reverse)으로 뒤집어 노드(Node) 번호 순으로 나열하는 것입니다.
CODE
Codec: SigmaTel STAC9274D
Address: 2
Vendor Id: 0x83847621
Subsystem Id: 0x80860419
Revision Id: 0x100201
Default PCM: rates 0x7e0, bits 0x0e, types 0x1
Default Amp-In caps: ofs=0x00, nsteps=0x0e, stepsize=0x05, mute=0
Default Amp-Out caps: ofs=0x7f, nsteps=0x7f, stepsize=0x02, mute=1

Node 0x0a [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x0221401f: [Jack] HP Out at Ext Front
Conn = 1/8, Color = Green
변환 결과: 1f402101
00a71c1f 00a71d40 00a71e21 00a71f02

Node 0x0b [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x02a19040: [Jack] Mic at Ext Front
Conn = 1/8, Color = Pink
변환 결과: 4090a102
00b71c40 00b71d90 00b71ea1 00b71f02

Node 0x0c [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x0181302e: [Jack] Line In at Ext Rear
Conn = 1/8, Color = Blue
변환 결과: 2e308101
00c71c2e 00c71d30 00c71e81 00c71f01

Node 0x0d [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x01114010: [Jack] Speaker at Ext Rear
Conn = 1/8, Color = Green
변환 결과: 10401101
00d71c10 00d71d40 00d71e11 00d71f01

Node 0x0e [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x01a19020: [Jack] Mic at Ext Rear
Conn = 1/8, Color = Pink
변환 결과: 2090a101
00e71c20 00e71d90 00e71ea1 00e71f01

Node 0x0f [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x01111012: [Jack] Speaker at Ext Rear
Conn = 1/8, Color = Black
변환 결과: 12101101
00f71c12 00f71d10 00f71e11 00f71f01

Node 0x10 [Pin Complex] wcaps 0x400181: Stereo
Pin Default 0x01117011: [Jack] Speaker at Ext Rear
Conn = 1/8, Color = Yellow
변환 결과: 11701101
01071c11 01071d70 01071e11 01071f01

Node 0x21 [Pin Complex] wcaps 0x400301: Stereo Digital
Pin Default 0x01452150: [Jack] SPDIF Out at Ext Rear
Conn = Optical, Color = Grey
변환 결과: 50214501
02171c50 02171d21 02171e45 02171f01

이렇게 구한 PinConfigurations 16진수 문자열을 device-property XML 파일에 넣기 위해 다음 터미널 명령어로 Base64 인코딩합니다:
CODE
echo "1f4021014090a1022e308101104011012090a101121011011170110150214501" | xxd -r -p | openssl enc -base64
제 BadAxe2 보드(STAC9274D)에서는 다음 결과값이 나왔습니다:
CODE
H0AhAUCQoQIuMIEBEEARASCQoQESEBEBEXARAVAhRQE=

이어서 오디오 하드웨어가 위치한 PCI 슬롯 경로를 확인합니다:
CODE
gfxutil -f HDEF; # 만약 실패하면 HDEF 대신 AZAL을 넣어 실행하세요

BadAxe2 보드에서는 다음과 같이 나왔습니다:
CODE
DevicePath = PciRoot(0x0)/Pci(0x1b,0x0)

그다음 제 XML 파일에 아래 내용을 추가하고 gfxutil로 16진수 EFI 스트링을 다시 생성했습니다: (gfxutil -s -v -n -i xml -o hex in.plist out.hex)
CODE
    <key>PciRoot(0x0)/Pci(0x1b,0x0)</key>
    <dict>
        <key>PinConfigurations</key>
        <data>
        H0AhAUCQoQIuMIEBEEARASCQoQESEBEBEXARAVAhRQE=
        </data>
        <key>codec-id</key>
        <string>0x83847683</string>
        <key>layout-id</key>
        <string>0x04000000</string>
    </dict>

코덱 덤프 파일을 드래그 앤 드롭하면 자동으로 PinConfigurations 데이터를 뽑아주는 스크립트나 작은 유틸리티가 하나 있으면 참 편리할 것 같네요.

결국 저는 BadAxe2 보드의 오디오도 DSDT에 직접 통합하는 방식을 택했습니다. 어차피 DSDT 안에 이미 수많은 패치들을 넣어둔 상태라 몇 바이트 더 추가하는 건 일도 아니고, 굳이 필요 없는 인젝터 Kext 하나를 덜 로드할 수 있으니까요.

다음 조건에 해당하시는 분들은 누구나 이 방법을 적용하실 수 있습니다:
- 현재 HDAEnabler.kext 또는 ALCinject.kext를 사용 중인 경우
- 패치된 AppleHDA.kext를 사용 중인 경우
- 본인 오디오 코덱에 맞는 3가지 필수 정보와 그에 대응하는 수정된 AppleHDA.kext를 보유하고 있는 경우
device-property 스트링이나 DSDT 중 편한 쪽으로 구현하시면 되지만 DSDT 방식이 압도적으로 깔끔합니다. 아래에 제가 현재 작업 중인 BadAxe1 보드(STAC9221D A2 코덱 탑재)와 BadAxe2 보드의 IORegistry 덤프 비교를 첨부합니다. 마무리되는 대로 전체 DSDT 파일이나 핵심 섹션 코드를 배포하겠습니다.

BadAxe1:
CODE
| | +-o HDEF@1B <class IOPCIDevice, registered, matched, active, busy 0, retain 8>
| | | | {
| | | | "IOPCIResourced" = Yes
| | | | "IOInterruptControllers" = ("io-apic-0","IOPCIMessagedInterruptController")
| | | | "IOName" = "pci8086,27d8"
| | | | "subsystem-id" = <17040000>
| | | | "IODeviceMemory" = (({"address"=18446744073225109504,"length"=16384}))
| | | | "class-code" = <00030400>
| | | | "revision-id" = <01000000>
| | | | "assigned-addresses" = <10d8008200000000000020e30000000000400000>
| | | | "built-in" = <00>
| | | | "acpi-device" = "IOACPIPlatformDevice is not serializable"
| | | | "name" = "pci8086,27d8"
| | | | "acpi-path" = "IOACPIPlane:/_SB/PCI0@0/HDEF@1b0000"
| | | | "subsystem-vendor-id" = <86800000>
| | | | "reg" = <00d800000000000000000000000000000000000010d800020000000000000000000000000040
000>
| | | | "compatible" = <"pci8086,417","pci8086,27d8","pciclass,040300">
| | | | "PinConfigurations" = <104021021010010120308101104001012190a1011160010130214501>
| | | | "layout-id" = 2
| | | | "IOPCIExpressLinkCapabilities" = 0
| | | | "IOPowerManagement" = {"ChildrenPowerState"=2,"CurrentPowerState"=2}
| | | | "IOInterruptSpecifiers" = (<1600000007000000>,<0400000000000100>)
| | | | "device-id" = <d8270000>
| | | | "vendor-id" = <86800000>
| | | | "device_type" = <"STAC9221A2">
| | | | "codec-id" = 2206496387
| | | | "IOPCIExpressLinkStatus" = 0
| | | | }

BadAxe2:
CODE
| | +-o HDEF@1B <class IOPCIDevice, registered, matched, active, busy 0, retain 8>
| | | | {
| | | | "IOPCIResourced" = Yes
| | | | "IOInterruptControllers" = ("io-apic-0","IOPCIMessagedInterruptController")
| | | | "IOName" = "pci8086,27d8"
| | | | "layout-id" = <04000000>
| | | | "subsystem-id" = <19040000>
| | | | "IOPCIExpressLinkCapabilities" = 0
| | | | "IODeviceMemory" = (({"address"=18446744073226158080,"length"=16384}))
| | | | "class-code" = <00030400>
| | | | "IOPowerManagement" = {"ChildrenPowerState"=2,"CurrentPowerState"=2}
| | | | "revision-id" = <01000000>
| | | | "IOInterruptSpecifiers" = (<1600000007000000>,<0200000000000100>)
| | | | "assigned-addresses" = <10d8008200000000000030e30000000000400000>
| | | | "built-in" = <00>
| | | | "acpi-device" = "IOACPIPlatformDevice is not serializable"
| | | | "device-id" = <d8270000>
| | | | "vendor-id" = <86800000>
| | | | "acpi-path" = "IOACPIPlane:/_SB/PCI0@0/HDEF@1b0000"
| | | | "subsystem-vendor-id" = <86800000>
| | | | "name" = "pci8086,27d8"
| | | | "IOPCIExpressLinkStatus" = 0
| | | | "reg" = <00d800000000000000000000000000000000000010d800020000000000000000000000000040
000>
| | | | "compatible" = <"pci8086,419","pci8086,27d8","pciclass,040300">
| | | | "PinConfigurations" = <1f4021014090a1022e308101104011012090a101121011011170110150214501>
| | | | "codec-id" = 2206496289
| | | | }

HDAEnabler.kext나 ALCinject.kext 없이 사운드가 작동할 리 없다고 생각하셨다면, 지금 바로 device-property 스트링이나 DSDT 주입을 직접 적용해 보세요.

필드 노트 #16 @candykane 2009-05-13

다음은 실제 DSDT에 들어가는 기본 코드입니다. 첫 번째는 BadAxe1용 예제이고 두 번째는 BadAxe2용 예제이니 두 섹션을 동시에 넣지 마시고 본인 보드에 맞는 하나만 사용하세요.
AUDIO IN DSDT:
CODE
______________________________________________________________

// 이 메소드는 DSDT 상단부(보통 Method (_WAK, 1, Serialized) 바로 뒤)에 넣습니다.
Method (DTGP, 5, NotSerialized)
{
If (LEqual (Arg0, Buffer (0x10)
{
/* 0000 */ 0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44,
/* 0008 */ 0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
}))
{
If (LEqual (Arg1, One))
{
If (LEqual (Arg2, Zero))
{
Store (Buffer (One)
{
0x03
}, Arg4)
Return (One)
}

If (LEqual (Arg2, One))
{
Return (One)
}
}
}

Store (Buffer (One)
{
0x00
}, Arg4)
Return (Zero)
}

______________________________________________________________

// DSDT 내의 모든 AZAL을 HDEF로 일괄 변경합니다.

______________________________________________________________

// BadAxe1용 예제 (주석 포함)

______________________________________________________________

// Device (HDEF) 블록의 맨 끝에 추가합니다.
// BadAxe1 (D975XBXLKR)
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x08)
{
"codec-id",
Buffer (0x04)
{
0x83, 0x76, 0x84, 0x83 // the hex codec ID (reverse order)
},
"layout-id",
Buffer (0x04)
{
0x02, 0x00, 0x00, 0x00 // the hex layout ID (reverse order)
},
"device_type",
Buffer (0x16) // the hex count + 1 for null terminated ascii string
{
"SigmaTel STAC9221D A2" // the string identifier
},
"PinConfigurations",
Buffer (0x1C) // the actual hex count
{
/* the PinConfigurations data as it appears.
/* 0000 */ 0x10, 0x40, 0x21, 0x02, 0x10, 0x10, 0x01, 0x01,
/* 0008 */ 0x20, 0x30, 0x81, 0x01, 0x10, 0x40, 0x01, 0x01,
/* 0010 */ 0x21, 0x90, 0xa1, 0x01, 0x11, 0x60, 0x01, 0x01,
/* 0018 */ 0x30, 0x21, 0x45, 0x01 /* one entry seems missing */
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}

______________________________________________________________

// BadAxe2용 예제

______________________________________________________________

// Device (HDEF) 블록의 맨 끝에 추가합니다.
// BadAxe2 (D975XBX2KR)
Method (_DSM, 4, NotSerialized)
{
Store (Package (0x08)
{
"codec-id",
Buffer (0x04)
{
0x21, 0x76, 0x84, 0x83 // the hex codec ID (reverse order)
},
"layout-id",
Buffer (0x02)
{
0x04, 0x00, 0x00, 0x00 // the hex layout ID (reverse order)
},
"device_type",
Buffer (0x13)
{
"SigmaTel STAC9274D"
},
"PinConfigurations",
Buffer (0x20)
{
/* 0000 */ 0x1f, 0x40, 0x21, 0x02, 0x40, 0x90, 0xa1, 0x02,
/* 0008 */ 0x2e, 0x30, 0x81, 0x01, 0x10, 0x40, 0x11, 0x01,
/* 0010 */ 0x20, 0x90, 0xa1, 0x01, 0x12, 0x10, 0x11, 0x01,
/* 0018 */ 0x11, 0x70, 0x11, 0x01, 0x50, 0x21, 0x45, 0x01
}
}, Local0)
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}

______________________________________________________________

필드 노트 #17 @kizwan 2009-06-01 ↳ Re: @pentiumpc

Acer 노트북 핫키 활성화 문의

@pentiumpcFn+F1 키는 별도의 키 코드를 반환하지 않으며, SLPB에 0x80 알림(Notify)을 보내 시스템을 즉시 잠자기에 넣습니다. Fn+F5, Fn+F6 키는 0x20부터 0x2F 사이의 값을 반환합니다(총 15단계 화면 밝기). Fn+F8 키는 다음 디스플레이 출력 모드 코드(내장 LCD, 외부 VGA, 또는 듀얼 확장)를 반환합니다. AC 전원 어댑터 연결 시에는 0x50을 반환합니다. 배터리 모드 전환 시에는 0x51을 반환합니다. 이러한 키 이벤트들이 OS 상에서 실제로 동작하려면 이를 받아 처리해 줄 드라이버(Kext)가 필요합니다. 요즘 본업이 너무 바빠서…

안녕하세요 pentiumpc 님,

도움을 청하고 싶은 일이 있습니다. 제 Acer 노트북의 몇 가지 핫키를 OS X에서 활성화하고 싶은데, 이 키들이 작동하려면 Windows에서는 "Launch Manager"라는 프로그램이, 리눅스에서는 "acer-acpi"라는 커널 모듈이 필요합니다. 이 핫키들은 무선 랜카드와 블루투스라는 두 가지 핵심 장치의 전원(On/Off)을 제어합니다. 다행히 무선 랜카드는 노트북 부팅 시 자동으로 전원이 켜지지만, 블루투스는 전원이 꺼진 상태로 부팅되어 OS X에서 아예 장치 인식조차 되지 않습니다. 혹시 리눅스용 "acer-acpi"를 OS X로 포팅하는 작업을 도와주실 수 있으실까요? 드라이버나 커널 확장(Kext) 프로그래밍 경험은 없지만 배우는 속도는 빠릅니다.

kizwan 드림

필드 노트 #18 @uman 2009-06-02 ↳ Re: @kizwan

Acer-acpi 관련

@kizwan혹시 리눅스용 "acer-acpi"를 OS X로 포팅하는 작업을 도와주실 수 있으실까요? 드라이버나 커널 확장(Kext) 프로그래밍 경험은 없지만 배우는 속도는 빠릅니다. kizwan 드림

반갑습니다 kizwan 님, InsanelyMac뿐만 아니라 여기서도 뵙게 되어 기쁘네요. 저도 예전엔 거기서 활동했었는데 포럼 시스템을 새로 개편할 때 제 계정이 날아가는 바람에...

acer_acpi 건 말인데요, 마침 제 아들도 Acer 노트북(기억이 맞다면 님과 동일한 모델)을 쓰고 있는데 하필 지금 하드 디스크가 고장 나가는 중이라 당장 테스트해 볼 수가 없네요. 어쨌든 작업을 시작하기에 가장 좋은 출발점은 (pentiumpc 님도 참고하셨던) superhai 님의 AMW0.kext입니다. 다만 superhai 님이 본인의 메인 다운로드 페이지에서 소스 코드를 내려버려서 저도 사본을 찾을 수가 없네요. 그분께 직접 쪽지(PM)를 보내 소스를 요청해 보셔야 할 겁니다.

-u

필드 노트 #19 @uman 2009-06-02

Acer ACPI 제어

어쩌면 DSDT 수정만으로도 해결이 가능할지 모릅니다. 제가 쓰는 Gateway 노트북의 DSDT를 살펴보니 무선 랜 같은 여러 기능을 켜고 끄는 핫키와 연동되는 것으로 보이는 제어 레지스터들이 다수 정의되어 있더군요.

DSDT 안의 Notify 메소드들을 한 번 쭉 살펴보시고 잠자기에서 깨어날 때(Resume) 호출되는 부분이 있는지 찾아보세요. 잠자기에 들어가면 블루투스 전원이 꺼지므로, 원래 켜져 있던 상태였다면 깨어날 때 다시 전원을 켜주는 로직이 필요할 겁니다. 따라서 특정 레지스터의 상태를 검사해 장치를 다시 켜는 코드가 DSDT 어딘가에 들어 있을 가능성이 높습니다.

필드 노트 #20 @uman 2009-06-02

kizwan 님께:

님의 DSDT 안에는 아마 AMW0라는 디바이스가 정의되어 있을 겁니다(리눅스용 acer_acpi 모듈 작성자인 Carlos가 정리한 이 노트(strang eworlds.co.uk/2007/11/24/amw0-later-models-aka-version-2-notes/)를 참고해 보세요).

님의 DSDT를 직접 보진 못했지만 추측건대, 장치 전원을 제어하는 기능키 로직이 현재 구동 중인 OS가 Windows인지 확인하는(_OSI) 조건문 블록 안에 묶여 있을 가능성이 있습니다. 혹시 DSDT 안에 _OSI가 Windows일 때만 실행되는 호출문이 있는지 확인해 보셨나요? 제 노트북에는 그런 구문이 있더군요.

만약 그렇다면 DSDT에서 Windows 전용 조건 제한을 풀어 활성화한 뒤, 간단한 Kext를 통해 DSDT에 정의된 AMW0 디바이스 메소드를 직접 호출하는 것이 *가능할지도* 모릅니다. 아마 superhai 님이 구현했던 방식도 바로 그것이었을 겁니다.

필드 노트 #21 @kizwan 2009-06-03

답장이 늦어 죄송합니다. 댓글 알림 메일이 오지 않아서 몰랐네요.

님 말씀이 정확히 맞습니다. 제 dsdt.dsl 파일에서 다음과 같은 코드를 발견했습니다:-

        Device (AMW0)
        {
            Name (_HID, "pnp0c14")
            Name (_UID, Zero)
            Name (WLMP, Zero)
            Name (WMID, Zero)
            Name (B0ED, Buffer (0x04)
            {
                0x00, 0x00, 0x00, 0x00
            })
            CreateDWordField (B0ED, Zero, WLID)
            Name (B1ED, Buffer (0x04)
            {
                0x00, 0x00, 0x00, 0x00
            })
            Name (B2ED, Buffer (0x04)
            {
                0x00, 0x00, 0x00, 0x00
            })
            CreateDWordField (B2ED, Zero, BUID)
            Name (_WDG, Buffer (0x0118)

그리고 이 부분도 있습니다:-

    Scope (_SB)
    {
        Method (_INI, 0, NotSerialized)
        {
            Store (0x07D0, OSYS)
            If (CondRefOf (_OSI, Local0))
            {
                If (_OSI ("Linux"))
                {
                    Store (One, LINX)
                }

                If (_OSI ("Windows 2001"))
                {
                    Store (0x07D1, OSYS)
                }

                If (_OSI ("Windows 2001 SP1"))
                {
                    Store (0x07D1, OSYS)
                }

                If (_OSI ("Windows 2001 SP2"))
                {
                    Store (0x07D2, OSYS)
                }

                If (_OSI ("Windows 2006"))
                {
                    Store (0x07D6, OSYS)
                }
            }

며칠 동안 DSDT 수정만으로 이 문제를 해결해 보려고 매달렸지만 아직 성과를 거두지 못했습니다. 우선 superhai 님께 AMW0.kext에 대해 문의해 볼 생각입니다. 참고로 Windows(XP 및 Vista)에서조차 "Launch Manager"라는 전용 프로그램을 설치하기 전까지는 블루투스 및 무선 랜 버튼이 전혀 작동하지 않습니다.

제 DSDT를 더 깊이 분석해서 수정할 수 있는 부분이 있는지 계속 시도해 보겠습니다.

친절한 답변에 감사드립니다.

kizwan 드림

필드 노트 #22 @uman 2009-06-03

_INI 코드 부분은 신경 쓰지 않으셔도 됩니다. 그건 단지 다른 메소드들이 참조해 분기 처리를 할 수 있도록 현재 OS 버전 번호를 변수(OSYS)에 저장해 두는 역할일 뿐입니다.

핵심은 Device(AMW0) 내부나 관련 메소드에서 Windows일 때만 작동하도록 막아둔 조건문이 없는지 확인하는 것입니다. 그 제한만 풀려 있다면 디바이스가 정상적으로 정의되어 IORegistry 트리에 등록될 겁니다. 그런 다음 superhai 님의 Kext를 활용하면 (a) Kext 코드 안에 원하는 동작(부팅 시 블루투스 켜기 등)을 아예 하드코딩해 넣거나, (b) 커널 내부 객체(Kext)와 통신하는 OS X용 Launch Manager 같은 GUI 앱을 만들 수 있을 겁니다.

만약 superhai 님의 AMW0가 IOKit 기반이라면 디바이스 인터페이스(Device Interface) API를 사용할 수 있습니다(Apple 개발자 문서 참고: gemma.apple.com/documentation/DeviceDrivers/Conceptual/AccessingHardware/AH_IOKitLib_API/AH_IOKitLib_API.html#//apple_ref/doc/uid/TP30000380-BAJDAJDJ).

도와드리고 싶지만 당장 제 수중에 테스트할 Acer 노트북이 없어서 큰 도움이 되지 못할까 봐 아쉽네요. 만약 pentiumpc 님이 소스 코드를 공개해 주셨다면 그분이 어떻게 구현했는지 참고할 수 있었을 텐데 말입니다. ASUS의 "ASUS010" 및 "ATKD" 디바이스나 Acer의 AMW0나 결국 모두 Microsoft의 WMI(pnp0c14) 인터페이스를 기반으로 동작한다는 점에서는 구조가 상당히 비슷할 것이기 때문입니다.

가장 훌륭한 지침서는 리눅스 진영의 Carlos가 작성한 acer_acpi 코드와 문서가 될 겁니다. 행운을 빕니다!

필드 노트 #23 @THeKiNG 2009-06-03

저는 Asus M50SV 노트북을 쓰고 있는 (불)행한 유저입니다.
저 역시 Fn 기능키 문제로 골머리를 앓고 있습니다...
제 노트북에서는 순정 상태(OOTB)에서 Wi-Fi/BT 토글(F2), 잠자기(F1), 화면 밝기 조절(F5+F6, 단 먼저 Windows에서 주변광 센서를 비활성화해야 함), LCD 끄기/켜기(F7)까지는 작동하지만, LCD/외부 모니터 전환(F8)을 누르면 즉시 재부팅되어 버리고 나머지 Fn 키들과 미디어 버튼들은 전혀 먹히지 않습니다.
pentiumpc 님이 올려주신 Kext(pkg)를 설치해 봤지만 아무 반응이 없는데, 제 DSDT에는 ASUS010이 없고 ATKD 디바이스 아래에 ATK0100으로 되어 있으니 당연한 결과일 겁니다. Kext의 Info.plist를 제 하드웨어 ID에 맞게 수정해 봤지만 여전히 감감무소식이네요.

그러다 아쉽게도 Windows 전용이긴 하지만 미디어 키와 Fn 키를 리매핑할 수 있게 해주는 ASUS Notebook Keys(forum.noteboo kreview.com/showthread.php?t=150016)라는 훌륭한 프로그램을 발견했습니다. 이 프로그램 덕분에 OS X에서 작동하지 않던 미디어 버튼들과 Fn 키들의 이벤트 코드를 모두 캡처할 수 있었고, 마침 소스 코드(rapid share.com/files/74365305/AsusNbKeys_v1.3_SRC.zip)도 공개되어 있더군요! 어쩌면 이 소스와 리눅스용 ACPI 이벤트 데몬인 ACPID(acpid.sourc eforge.net/)를 누군가 OS X로 포팅해 결합한다면 모든 키를 완벽히 살려낼 수 있지 않을까 싶습니다...
다만 트랙패드의 멀티미디어 터치 버튼 기능들은 이 프로그램으로도 이벤트가 잡히지 않는 걸 보니 순수하게 Synaptics 드라이버 레벨에서 처리되는 모양입니다. 한 가지 기묘한 점은 Windows에서 외장 마우스 연결 시 트랙패드를 항상 멀티미디어 모드로 고정하도록 설정해 두면, OS X로 부팅했을 때도 트랙패드 백라이트가 켜진 채로 유지되는데 정작 외장 마우스를 뽑아도 불이 꺼지지 않는다는 것입니다. 분명 Windows 드라이버가 특정 ACPI 플래그를 세팅하는 것 같은데... 이 부분은 좀 더 파봐야겠습니다.

제가 캡처한 키 이벤트 코드 목록은 다음과 같습니다:

미디어 플레이어 방향키 (현재 미작동):
Fn + "":
->: Event: 0x41 - 빨리 감기 (Fast forward)
<-: Event: 0x40 - 되감기 (Rewind)
^ : Event: 0x43 - 정지 (Stop)
v : Event: 0x45 - 재생/일시정지 (Play/Pause)

기능키 (Fn + F1~F12):
Fn + "":

F1: Event: 작동함 - 누르는 즉시 잠자기에 들어가서 코드 캡처 불가
F2: Event: 0x5D 작동함 - Wi-Fi/BT 전환 스위치
F3: Event: 0x50 - 메일 앱 실행
F4: Event: 0x51 - 웹 브라우저 실행
F5: Event: 0x2D 작동함 - 화면 밝기 낮추기
F6: Event: 0x1E 작동함 - 화면 밝기 높이기
F7: Event: 0x34 작동함 - LCD 켜기/끄기
F8: Event: 0x61 - LCD/VGA 전환 (누르면 즉시 재부팅됨)
F9: Event: 0x68 - 용도 미상
F10: Event: 0x32 - 음소거 (Mute)
F11: Event: 0x31 - 볼륨 낮추기
F12: Event: 0x30 - 볼륨 높이기

작동하지 않는 기타 문자 조합키 (+Fn):
Fn + "":
T: Event: 0x99 - 모뎀 켜기/끄기
A: Event: 0x7A - 주변광 센서 (Ambient light sensor)
C: Event: 0x8A - 용도 미상
V: Event: 0x82 - 화면 캡처 (추정)
Space: Event: 0x5C - Power4Gear 실행

상단 미디어 버튼 키:
Button 1: Event: 0x5C - Fn+Space와 동일 (Power4Gear 실행)
Button 2: Event: 0x6B - 용도 미상
Button 3: Event: 0x5C - 용도 미상
Button 4: Event: 0x95 - 용도 미상
혹시 작동하지 않는 나머지 Fn 키들을 살려낼 좋은 아이디어 있으신가요?

필드 노트 #24 @uman 2009-06-03

acpid 쪽을 한 번 살펴보겠습니다.

제가 ASUS 노트북을 갖고 있지도 않고 내부 구조에도 익숙지 않아 구체적인 해법을 드리긴 어렵지만, 몇 가지 방향을 제안하자면 다음과 같습니다:

1. 리눅스 진영의 코드를 참고하세요 -- 이 분야에서는 리눅스가 OSx86 진영보다 훨씬 앞서 있습니다.
2. 님의 접근 방향이 맞습니다. 이 골칫거리를 제대로 해결하려면 리눅스가 그랬듯 범용 프레임워크를 먼저 만들고, 각 노트북/데스크탑 제조사별 고유 코드는 그 범용 솔루션을 활용하는 플러그인 라이브러리 형태로 분리해야 합니다. 지금까지 OSx86에서는 너무나 많은 패치들이 특정 기종에만 종속된 하드코딩 방식으로 만들어졌습니다. 예를 들어 Dell Mini 유저들은 ApplePS2Keyboard.cpp 소스를 완전히 뜯어고쳐 여러 버그를 잡았지만, 코드를 지나치게 Dell Mini 전용으로 짜버려서 다른 기종 유저들은 전혀 쓸 수가 없게 되었죠.
3. 서로 다른 제조사의 노트북과 데스크탑을 가진 소수의 개발자들이 뜻을 모아 함께 작업할 수 있다면, 제조사별 플러그인이나 유저 공간(User-space) GUI 앱으로 손쉽게 커스터마이징할 수 있는 범용 ACPI/WMI 디바이스 드라이버를 만들어낼 수 있을 겁니다.

필드 노트 #25 @THeKiNG 2009-06-04 ↳ Re: @uman
@umanacpid 쪽을 한 번 살펴보겠습니다. 제가 ASUS 노트북을 갖고 있지도 않고 내부 구조에도 익숙지 않아 구체적인 해법을 드리긴 어렵지만, 몇 가지 방향을 제안하자면 다음과 같습니다: 1. 리눅스 진영의 코드를 참고하세요 -- 이 분야에서는 리눅스가 OSx86 진영보다 훨씬 앞서 있습니다. 2. 님의 접근 방향이 맞습니다. 이 골칫거리를 제대로 해결하려면 리눅스가 그랬듯 범용 프레임워크를 먼저 만들고, 각 노트북/데스크탑 제조사별 고유 코드는…

와우!
빠른 답변 감사합니다!
방금 기억났는데, 예전에 Superhai 님이 말씀하시길 OS X에는 기반 구성 요소가 빠져 있어서 ACPID는 쓸모가 없으니 시간 낭비하지 말라고 하셨던 적이 있네요...
믿어주세요, 저도 이 노트북과 리눅스에 관련된 자료는 눈에 불을 켜고 샅샅이 뒤져봤지만 구조가 달라서 OS X에는 직접적인 도움이 안 되더군요.
그나저나 ApplePS2 말씀하셨는데 혹시 VoodooPS2는 써보셨나요? 저는 꽤 오랫동안 VoodooPS2를 써오고 있는데 큰 버그 없이 아주 만족스럽습니다.
말씀대로 Superhai 님의 AMW0가 아주 훌륭한 출발점이 될 것 같고, 거기에 각 제조사별 고유 기능을 담당하는 플러그인 구조로 가면 이상적이겠네요.
아쉽게도 저는 개발자가 아니라 프로그래밍 언어는 전혀 모르지만, 논리적 추론과 집요한 검색만으로 찾은 모든 자료들을 이리저리 조합해 보고 있습니다.

필드 노트 #26 @kizwan 2009-06-05 ↳ Re: @uman
@uman_INI 코드 부분은 신경 쓰지 않으셔도 됩니다. 그건 단지 다른 메소드들이 참조해 분기 처리를 할 수 있도록 현재 OS 버전 번호를 변수(OSYS)에 저장해 두는 역할일 뿐입니다. 핵심은 Device(AMW0) 내부나 관련 메소드에서 Windows일 때만 작동하도록 막아둔 조건문이 없는지 확인하는 것입니다. 그 제한만 풀려 있다면 디바이스가 정상적으로 정의되어 IORegistry 트리에 등록될 겁니다. 그런 다음 superhai 님의 Kext를…

링크해 주신 문서를 열심히 공부해 보겠습니다. 완전히 이해하려면 시간이 좀 걸리겠네요.

그동안 제 dsdt.dsl에 존재하는 이름(Name)과 메소드(Method)에 맞춰 AMW0.kext의 소스 코드를 수정해 보았습니다. 덕분에 IORegistry 상에 AMW0 항목이 새로 등록되기는 했지만, 여전히 핫키 버튼들은 작동하지 않네요.

AMW0.kext는 아직 손봐야 할 부분이 아주 많은 것 같습니다. 어쩌면 ACPI4ASUS.kext의 소스 코드를 분석해 보면 더 많은 힌트를 얻을 수 있을지도 모르겠습니다.

혹시 dsdt.dsl 안에서 핫키 버튼 동작을 실제로 처리하는 Name이나 Method를 찾아내는 요령을 좀 알려주실 수 있으실까요? 제 DSDT를 실제 MacBook3,1의 DSDT와 비교해 보기도 했지만 아직 감을 못 잡고 있습니다. 예를 들어 아래 메소드가 부팅(POST) 시 무선 랜 장치를 켜라고 지시하는 함수라고 해석하면 맞을까요?

    Method (LAMN, 1, NotSerialized)
    {
        If (\_SB.AMW0.WLMP)
        {
            Store (Arg0, \_SB.AMW0.WLID)
            Notify (\_SB.AMW0, 0xB0)
        }
        Else
        {
            PHSR (0x1F, Arg0)
        }
    }

kizwan 드림

필드 노트 #27 @uman 2009-06-08

안타깝게도 저 역시 DSDT를 하나씩 배워가는 입장입니다. 게다가 대부분의 하드웨어 제조사들은 자체 ACPI 디바이스나 메소드의 동작 방식을 전혀 문서로 공개하지 않아서, 결국 시행착오를 거듭하며 부딪혀 보는 수밖에 없는 게 현실입니다.

혹시 가지고 계신 AMW0.kext를 제게 보내주실 수 있나요? 지금 만들고 있는 SD 카드 리더기 드라이버 작업을 마치고 아들의 Acer 노트북 수리가 끝나면 저도 함께 이리저리 뜯어보겠습니다.

필드 노트 #28 @kizwan 2009-06-09 ↳ Re: @uman
@uman음, AMW0 Kext의 소스 코드 말입니다. 감사합니다.

AMW0.kext와 소스 코드는 아래 주소에서 다운로드하실 수 있습니다:-
supe rhai.com/xdarwin.html

그나저나 SD 카드 리더기용 드라이버를 직접 개발 중이시라니 정말 흥미롭네요! 혹시 만드시는 드라이버가 Texas Instruments(TI) 칩셋 기반 SD 카드 리더기도 지원할 가능성이 있을까요?

그리고 GMA950 화면 깨짐(Artifacts) 문제는 아직 여전하신가요? Natit.kext나 EFI 스트링 방식은 시도해 보셨나요?

kizwan 드림

필드 노트 #29 @uman 2009-06-09 ↳ Re: @kizwan
@kizwanAMW0.kext와 소스 코드는 아래 주소에서 다운로드하실 수 있습니다:- supe rhai.com/xdarwin.html

[아차!] 저 페이지를 미처 못 봤었네요. 링크 알려주셔서 감사합니다! 다음 주쯤 아들네 Acer 노트북이 수리되어 돌아오면 저 소스를 가지고 본격적으로 작업을 시작해 보겠습니다.

@kizwan그나저나 SD 카드 리더기용 드라이버를 직접 개발 중이시라니 정말 흥미롭네요! 혹시 만드시는 드라이버가 Texas Instruments(TI) 칩셋 기반 SD 카드 리더기도 지원할 가능성이 있을까요?

네, 맞습니다! 바로 TI 칩셋용입니다. 제 Gateway와 아들네 Acer 노트북에 들어 있는 게 바로 그 칩셋이거든요. 사실 IOKit 및 커널 드라이버 프로그래밍에 본격적으로 입문하기 위한 연습 삼아 시작한 프로젝트입니다. 앞으로 구현하고 싶은 다른 구상들이 있는데, 우선 몸풀기로 적당한 규모의 작은 프로젝트부터 시작해 보려던 참이었습니다.

@kizwan그리고 GMA950 화면 깨짐(Artifacts) 문제는 아직 여전하신가요? Natit.kext나 EFI 스트링 방식은 시도해 보셨나요?

현재 iPC 배포판에서 추출한 두 개(?)의 Kext를 그대로 쓰고 있는데 내부적으로 어떻게 돌아가는지는 깊게 살펴보지 않았습니다. 화면 노이즈가 아주 경미한 수준이라 굳이 원인을 추적하진 않았거든요. 어차피 DSDT 수정 실력도 늘릴 겸 조만간 DSDT 주입 방식으로도 시도해 볼 생각이지만, 님도 직접 겪어보셔서 잘 아시겠지만 DSDT 작업이란 게 정말 시간을 엄청나게 잡아먹는 일이니까요!

-u

필드 노트 #30 @uman 2009-06-09 ↳ Re: @kizwan
@kizwan그나저나 SD 카드 리더기용 드라이버를 직접 개발 중이시라니 정말 흥미롭네요! 혹시 만드시는 드라이버가 Texas Instruments(TI) 칩셋 기반 SD 카드 리더기도 지원할 가능성이 있을까요?

어제 발표된 신형 맥북 라인업에 Apple이 드디어 순정 SD 카드 슬롯을 탑재했다는 소식을 듣고 이 드라이버 개발은 잠시 보류해 두었습니다. 계속 진행하기 전에 Apple의 순정 드라이버가 어떻게 구현되어 있는지부터 먼저 뜯어보고 싶어서요.

추가 커뮤니티 필드 노트 64건 펼치기전체 아카이브 기록
필드 노트 #31 @THeKiNG 2009-06-10 ↳ Re: @uman
@umanI've put this on hold with yesterday's news that Apple is including SD card slots on the new macbooks. I'd like to see what they have done before proceeding.

For sure they use USB SD Reader i bet on that...
Wonder where did PentiumPC go...
Maybe he can release the source for ACPI4Asus.kext to help us understand what he did and maybe someone can continue his work, if he has no time for that, for the rest of the custom "OEM" stuff that make our life's so PITA.

필드 노트 #32 @kizwan 2009-06-10 ↳ Re: @uman
@umanI'm using the two? kexts that I found in iPC. I didn't really pay much attention to what they do. The artifacts are minor enough that I haven't bothered to track them down. I may try the DSDT approach, since I want to get better at DSDT mods, but it's so time-consuming, as you've no doubt found out! -u

I was using Natit.kext for GMA950 on Acer Aspire 3680. No artifacts…that I can confirm. Right now I'm using EFI string. Don't forget to restore vanilla AppleIntelIntegratedFramebuffer.kext. Don't get excited yet, dual monitor only works with mirror mode.

I still unable to get display working with DSDT yet except for nVidia Go 7300 on Aspire 9420.

kizwan

필드 노트 #33 @kizwan 2009-06-10 ↳ Re: @uman
@umanI've put this on hold with yesterday's news that Apple is including SD card slots on the new macbooks. I'd like to see what they have done before proceeding.

I only heard new iPhone is coming soon…iPhone 3G S. ^_^

필드 노트 #34 @uman 2009-06-18

King,

It may be that your DSDT just has functions defined for Windows, especially since Linux guys also had problems.

Have you talked to or contacted the people at OSXCORES? They have patched BIOSes for OSX:

M50SV AS207 (osxcores.sit e50.net/user/image/asus-m50sv-as207.zip)
ASUS

M50V as209 (osxcores.sit e50.net/user/image/m50vas.209.zip)
ASUS

I'm not sure what fixes they have made, but they do custom work too. See:
osxcores.sit e50.net/services.htm

Perhaps they can help.
-u

필드 노트 #35 @kizwan 2009-06-24

uman,

Just got a reply from Superhai. Its look like Superhai will not continue AMW0 project. Is there anybody interested continuing his project? :'(

Other topic…
Sleep:-
I found out that by deleting entry for EHCI devices in Acer Aspire 9420 DSDT, it was able to sleep. Now the EHCI devices detected as external/expansion card. Funny thing is external hard disk, which connected to EHCI port, is not turn off when putting laptop to sleep. Is this also happen with real MacBook?

I tried to compare DSDT from MacBook3,1 with mine and I found this:-
Acer Aspire 9420:-

        Method (_L03, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB1, 0x02)
        }

MacBook3,1:-

        Method (_L03, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.UHC1, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }

I know that "Notify (\_SB.SLPB, 0x80)" will put computer to sleep but I don't know what "Notify (\_SB.PWRB, 0x02)" do. Do you know what "Notify (\_SB.PWRB, 0x02)" means? In my DSDT, PWRB is handle by SLPB (handle both sleep-button & power-button).

I also found "extra" method in EHCI function (MacBook3,1):-

                Method (_DSM, 4, NotSerialized)
                {
                    Store (Package (0x07)
                        {
                            "AAPL,current-available", 
                            0x04B0, 
                            "AAPL,current-extra", 
                            0x02BC, 
                            "AAPL,current-in-sleep", 
                            0x03E8, 
                            Buffer (0x01)
                            {
                                0x00
                            }
                        }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)
                }

I think instead of removing EHCI entry from DSDT, maybe I can use this code to set EHCI device as external device. Maybe this can fix sleep issue too.

Clamshell:-
Does real MacBook automatically resume from sleep when lid is open? Or still need to push keyboard button to resume from sleep, just like windows?

kizwan

필드 노트 #36 @uman 2009-06-24 ↳ Re: @kizwan
@kizwanuman, Just got a reply from Superhai. Its look like Superhai will not continue AMW0 project. Is there anybody interested continuing his project? :'(

I wish I could say yes, but my son's Acer has qualified for a replacement. So I won't have a machine that has an AMW0 to test. And that is a huge problem for development. As I understand it, Superhai's AMW0 basically allows you to call into the AMW0 device. The Linux project acer-acpi (and it's successor wmi-acpi) does the same, and supplies some utilities so that you can call/respond to the AMW0 methods.

The IOKit doc is pretty good at showing how to make a user-callable module that calls in-kernel routines. So if you know (or have someone who has an Acer and knows C) it shouldn't be hard to hack. My suggestion is to start a mini-group of Acer users, and see if anyone has any dev experience amongst the group.

Other topic… Sleep:- I found out that by deleting entry for EHCI devices in Acer Aspire 9420 DSDT, it was able to sleep. Now the EHCI devices detected as external/expansion card. Funny thing is external hard disk, which connected to EHCI port, is not turn off when putting laptop to sleep. Is this also happen with real MacBook?

I don't think you want to delete the EHCI devices. I think you need to Notify them like on my MacBook Pro DSDT.

I know that "Notify (\_SB.SLPB, 0x80)" will put computer to sleep but I don't know what "Notify (\_SB.PWRB, 0x02)" do. Do you know what "Notify (\_SB.PWRB, 0x02)" means? In my DSDT, PWRB is handle by SLPB (handle both sleep-button & power-button).

The Mac has 3 devices: PWRB (power button), SLPB (sleep button), and LID0 (the lid switch). Most hackbooks don't have all of these. I believe my gateway only had SLPB (although I am not sure-- my DSDT.dsl does have a PWRB, but I may have added it).

The power button has multiple functions. Normally if you hit it, it brings up a menu to sleep, shutdown, restart or cancel. But when the Mac is already sleeping (not thru lid sleep), it will wake from sleep. there is also some programmatic control of it in the System preferences. When a Mac has slept through the lid switch, then opening the lid switch resumes the Mac.

I also found "extra" method in EHCI function (MacBook3,1):- Method (_DSM, 4, NotSerialized) { Store (Package (0x07) { "AAPL,current-available", 0x04B0, "AAPL,current-extra", 0x02BC, "AAPL,current-in-sleep", 0x03E8, Buffer (0x01) { 0x00 } }, Local0) DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0)) Return (Local0) } I think instead of…

Strange my Macbook dsdt does not have this code AT ALL.

Clamshell:- Does real MacBook automatically resume from sleep when lid is open? Or still need to push keyboard button to resume from sleep, just like windows?

Opening the lid resumes from sleep.

I'm sorry I can't be of much use now. I'm hoping next week that I will find the time to backup and do a retail install of 10.5.7. Only then will I try more DSDT hacking, since right now my machine is a mess of hacked kexts!

-u

필드 노트 #37 @kDawg 2009-07-15

Multiple video card mods

Has anyone done any work trying to integrate multiple video cards? I've been searching for weeks. Trying to find info regarding DSDT in general is tough.

필드 노트 #38 @aschar1 2009-08-07

Fixing sleep and usb after wake up

I finally fixed sleep on my lappie!

Hi candykane,

did you already update to 10.5.8 and is your sleep fix stillworking?
Apple probably changed something in Powermanagement which is breaking sleep on most installs.
Do you use Openhaltrestart.kext or is sleep working without it?

Thanks Al

필드 노트 #39 @sk1nhd33t 2009-08-09 ↳ Re: @pentiumpc
@pentiumpcchange _HID to _CID Device (PWRB) { Name (_HID, EisaId ("PNP0C0C")) ---> Name (_CID, EisaId ("PNP0C0C")) Name (_UID, 0xAA) Name (_STA, 0x0B) } This one I got it off some site, cannot remember where. (credit goes to him/her) This will activate your power button to bring up the shutdown menu.

hmm weird, tried doing this on my gigabyte board but the shutdown menu wont show, when i press the power button my hack will just sleep thats it

필드 노트 #40 @The Edge3000 2009-08-11 ↳ Re: @sk1nhd33t
@sk1nhd33thmm weird, tried doing this on my gigabyte board but the shutdown menu wont show, when i press the power button my hack will just sleep thats it

Uncheck "Allow power button to put the computer to sleep" in energy saver =P.

필드 노트 #41 @Gurruwiwi 2009-08-17

I dont mean to hijack the thread, but what beeter place for 2 quick DSDT questions for people who actually seem to know what they are talking about !
No one has been able to answer me, well... because no one seems to actually KNOW what they are saying... Please please help!
DSDT is the voodoo of computers for to me loool...
Ok, I've got 2 Acer laptops and 1 Asus laptop. Just for reference. All had OSx, 10.4 to 10.5, many distros, my latest and greatest in my sig.

How on earth do I know if DSDT is doing something or not ?

iAtkos v7 Chameleon 2 RC1 (now RC2) and fassls DSDT script checked. DSDT.aml
is in root, but I tried in Extra folder and felt absolutely no difference.
On first boot I press power, poweroff window comes up (native install) My multimedia controller on my keyboard controls volume and front row funtions! (photos in link in signature) - Video card not detected (but with strings + 2 kext native HD res QE etc)
Out of the box, FN and up down increases/decreases screen brightness. Other fn work, very few dont.
. Audio works OTB, clicks pops etc, no internal or external mic. VoodooHDA is the same,
Ehternet with kext only... didnt try stringing it because I got it to work
So how do I know if DSDT is working? if I remove it I am almost certain my laptop will respond the same.

My previous laptops, NONE used DSDT, I pressed power button, they worked fine! Brightness and other stuff too... etc etc
and I am scared because I read sometimes
"Patch DSDT at you own risk! !
as in flashing the bios or something... can I bick my laptop with DSDT !?! When can DSDT be dangerous?

I want to try decompiling and fixing my dsdt for Snow... but I dont even know if

1) I actually need it
2) If it is working or not
3) it is dangerous, or when is it dangerous?

ok, three questions

"

필드 노트 #42 @kizwan 2009-08-17 ↳ Re: @Gurruwiwi
@Gurruwiwi1) I actually need it 2) If it is working or not 3) it is dangerous, or when is it dangerous? …

1) You don't need it unless you need it. If everything is working properly, so you don't need it. DSDT override just for PC that have problem with CPU alias (only can use one core), sound, graphic card, power management & etc.
2) It is working.
3) No hard evidence that it is dangerous. DSDT override can be applied by 2 ways; i) by using dsdt.aml file. ii) by flashing it to ROM permanently. Of course the second one is dangerous if you do it wrongly.

kizwan

필드 노트 #43 @Gurruwiwi 2009-08-17

thanks for the reply

Ah, ok, you can actually flash a BIOS to mimic hardware change... ouch! no thanks.

The thing is kizwan, if I remove the DSDT.aml file, my system boots (Leo) and behaves the same! Which is really weird since I have perfect use of my multimedia pad (volume, next song, ff, rw, mute, hold and, believe it or not, and, the "enter" button works the same as Enter key, the arrows next to it like cursor, and the envolving white lines "tabs" stuffs depending on program, firefox, openoffice, folders, etc...) and 75% of bios FN keys etc.

For instance, my webcam, out of the box, reads in profile as "Acer Crystal Eye Webcam" - 100% opertional including ichat, ibooth, etc, which is know to crash with some "working" webcams - this withou dsdt or patching or stringing

That is why I say I have no idea, following logic from what I read, how the DSDT WORKS to help boot or not. even if its not present this laptop boots Leo like if it had.

Now I do have dual boot with dsdt present on both sides, but I guarantee you with single boot I had this behaviour

필드 노트 #44 @EnzoFX 2009-09-03

So the powerbutton fix, will make my power button do either sleep or shutdown/logout/resatart prompt? It depends on the setting in System Prefs is what you guys are saying? (Once enabled through dsdt)

My power button currently does nothing! =P

필드 노트 #45 @kizwan 2009-09-03 ↳ Re: @EnzoFX
@EnzoFXSo the powerbutton fix, will make my power button do either sleep or shutdown/logout/resatart prompt? It depends on the setting in System Prefs is what you guys are saying? (Once enabled through dsdt) My power button currently does nothing! =P

For a working power button in Mac OS X, a dialog box will appear if you press the power button. In this dialog box, you have a choice either you want to sleep, restart or shutdown (you will see all of the 3 choices).

If your power button does nothing, it means it have not yet enabled in DSDT (most machine has this enabled by default). If you have tried to enabled it in DSDT, maybe the code is wrong. Try to check it again.

kizwan

필드 노트 #46 @EnzoFX 2009-09-03

I have not tried, but I will.

I was just wondering if what it did (Once working) depended on the setting in Sys Prefs. I.e. whether it just sleeps, or if it gives you the shutdown/etc options.

필드 노트 #47 @kizwan 2009-09-03 ↳ Re: @EnzoFX
@EnzoFXI have not tried, but I will. I was just wondering if what it did (Once working) depended on the setting in Sys Prefs. I.e. whether it just sleeps, or if it gives you the shutdown/etc options.

Once it working it will always shows you the options, either sleep, shutdown or restart. There is no setting in System Preferences for power button.

kizwan

필드 노트 #48 @The Edge3000 2009-09-07

I applied the power button fix. However, It only seems to work when I check the box to allow it to sleep the computer. Other than that, it does nothing - no menu or anything.

필드 노트 #49 @Common_Sense 2009-09-08

I applied the power button fix but it doesn't work, when I press it my computer will enter sleep mode without displaying any message just like it did before I applied the fix, I have a gigabyte EP45-DS3LR, anyone knows whats wrong?, this is how the DSDT looks like:

Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C")) --> Name (_CID, EisaId ("PNP0C0C"))
Method (_STA, 0, NotSerialized)
{
Return (0x0B)
}
}

필드 노트 #50 @gnychis 2009-09-25

I have a Thinkpad X300, that whenever I put to sleep, I see the wireless light blink, and the the laptop wakes up. It seems as though the wireless card is waking the system after a second or two every time I sleep it.

Does anyone have any recommendations for this in terms of the DSDT? I've attached mine if it helps.

필드 노트 #51 @msingh 2009-10-05

DSDT advice needed

My system is a Dell D830.

After a lot of tinkering around, I managed to install Snow Leopard on it. Please see my guide ↗.

I did a few DSDT mods to get some basic fixes.

Now, the system sleeps (S3 suspend to ram) but does not deep sleep (S5 suspend to disk), shutdown or reboot. I am using OpenHaltRestart.kext and SleepEnabler.kext. The latter made it possible to even suspend.

I am including my dsdt.dsl (which includes my fixes, by the way).

I see tantalizing references to the sleep button, SBTN, etc., but I have not found any systematic documentation for the code (btw. I am comfortable with coding as I do plenty of numerical coding in my work).

Can anyone take a look and let me know what I need to do to fix my poweroff and hibernate problem ?

The DSDT repository does not contain a fixed DSDT for my laptop.

PS: Microsoft's ASL compiler should be outlawed.

필드 노트 #52 @2nerd4u 2009-10-20 ↳ Re: @sk1nhd33t
@sk1nhd33tchange _HID to _CID Device (PWRB) { Name (_HID, EisaId ("PNP0C0C")) ---> Name (_CID, EisaId ("PNP0C0C")) Name (_UID, 0xAA) Name (_STA, 0x0B) } This one I got it off some site, cannot remember where. (credit goes to him/her) This will activate your power button to bring up the shutdown menu.

hmm weird, tried doing this on my gigabyte board but the shutdown menu wont show, when i press the power button my hack will just sleep thats it
mine will shut down instantly
edit: well actually it just goes to sleep mode verry fast^^ too bad my system wont wake from sleep...

필드 노트 #53 @Sweaty 2009-12-21

DSDT shutdown patch

With this and new restart patch chameleon booter from Duvel (strong beer that) I have only fakesmc as an added kext, although I'm about to reinstall voodoohda so I can hopefully have two soundcards working.. anyway this is mm67's work I just found it a pain to find the detail on insane so posting it here.. Thanks to all who put together these fixes. Need to add the two operation region bits and change your method PTS

    OperationRegion (DEBG, SystemIO, 0x80, One)
    Field (DEBG, ByteAcc, NoLock, Preserve)
    {
        DBG1,   8
    }

    OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
    Field (PMRS, ByteAcc, NoLock, Preserve)
    {
            ,   4,
        SLPE,   1,
                Offset (0x08),
        GPSE,   16, 
        GPSS,   16,
                Offset (0x12),
            ,   1, 
        SWGC,   1 
    }

    Method (_PTS, 1, NotSerialized)
    {
        Or (Arg0, 0xF0, Local0)
         Store (Local0, DBG1)
        Store (Zero, \_SB.PCI0.LPCB.AG3E)
        If (LEqual (Arg0, 0x05))
        {
            Store (Zero, SLPE)
            Sleep(0x10)
        }
    }

also your LPCB has to be like so

            Device (LPCB)
            {
                Name (_ADR, 0x001F0000)
                OperationRegion (LPC0, PCI_Config, 0xA4, 0x02)
                Field (LPC0, ByteAcc, NoLock, Preserve)
                {
                    AG3E,   1
                }

I suppose add device ID if you need it, I'm on ICH10 so don't.

Also attaching blackosx's duvel+rekursor version of RC4 here, replace your chameleon boot file with the one from here and add these to boot.plist to get unique UUID and restart fix:

    <key>DeviceID</key>
    <string>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</string>

    <key>RestartFix</key>
    <string>YES</string>
필드 노트 #54 @mm67 2009-12-21 ↳ Re: @Sweaty
@SweatyWith this and new restart patch chameleon booter from Duvel (strong beer that) I have only fakesmc as an added kext, although I'm about to reinstall voodoohda so I can hopefully have two soundcards working.. anyway this is mm67's work I just found it a pain to find the detail on insane so posting it here.. Thanks to all who put…

It's only this :

    OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
    Field (PMRS, ByteAcc, NoLock, Preserve)
    {
            ,   4,
        SLPE,   1,

and this:

        If (LEqual (Arg0, 0x05))
        {
            Store (Zero, SLPE)
            Sleep(0x10)
        }

that make the shutdown work, rest of the code is Gigabyte specific. This address 0x0430 is also motherboard specific, it is PMBASE+30h. Address of PMBASE is defined in FACP, on most boards it can also be checked from processor definitions. For example I have this in my dsdt:

Processor (CPU0, 0x00, 0x00000410, 0x06)

Here 0x00000410 is referring to PMBASE+10h so I use 0x430 on my Gigabyte board. On my MSI board's dsdt I have this:
Processor (P001, 0x01, 0x00000810, 0x06) {}

So in MSI shutdown code I use this:
OperationRegion (PMRS, SystemIO, 0x0830, 0x13)

필드 노트 #55 @Sweaty 2009-12-21

Ok cheers mate, had to add the other bits on my board (asus p5ql/epu) to get it to compile, I'll try the simpler way later.. At least it did work the way I bodged it

EDIT: OK fixed code as you suggested I needed to use 0x830, also got rid of unnecessary bits, sometimes I needed to turn PSU off with 0x430 (before I could restart, shutdown was complete), that seems fixed now. Thanks a lot.

필드 노트 #56 @adityaxavier 2010-01-09

Im in a fix.. Everywhere there is a DSDT Fix for getting the USB port to be displayed as Built-in but i need the opposite..
USB - 3 shows as built-in, but it has bluetooth. hence on sleep i loose bluetooth.. if i remove the entry altogether, i have it as external but my sleep fails..

Am having Lenovo T60p. with ICH7-M chipset.

Thanks,
Xavier

필드 노트 #57 @ping99 2010-01-18

Shutdown & Restart with sleep fix-Thanks to Sweaty & mm67

Many thanks to Sweaty and mm67. You are really nice. This resolve the problem I thought it would never be resloved.

I just made a small change to Method (_PTS, 1, NotSerialized) in order to resolve sleep issue on my notebook CQ60-202TX. Now let me put all together step by step as a guide. This might help newbie.

1 Add OperationRegion below before Method (_PTS, 1, NotSerialized)
OperationRegion (DEBG, SystemIO, 0x80, One)
Field (DEBG, ByteAcc, NoLock, Preserve)
{
DBG1, 8
}

OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
Field (PMRS, ByteAcc, NoLock, Preserve)
{
, 4,
SLPE, 1,
Offset (0x08),
GPSE, 16,
GPSS, 16,
Offset (0x12),
, 1,
SWGC, 1
}

2 Check Device (LPC) if there is a similar Operation Region "LPC" like below. If you don't have LPC device, just search Name (_ADR, 0x001F0000), sometimes the device name is different.
Device (LPC)
{
Name (_ADR, 0x001F0000)
OperationRegion (LPC0, PCI_Config, 0xA4, 0x02)
Field (LPC0, ByteAcc, NoLock, Preserve)
{
AG3E, 1
}
If there is no OperationRegion LPC, please add code above. In my dsdt's OperationRegion LPC0, there is an EXPE instead of AG3E. So I did not modify it, but had to change a bit in Method (_PTS, 1, NotSerialized) . See mine below:
OperationRegion (LPC0, PCI_Config, 0x40, 0xC0)
Field (LPC0, AnyAcc, NoLock, Preserve)
{
Offset (0x60),
, 10,
EXPE, 1
}

3 Add code below in Method (_PTS, 1, NotSerialized) like this
Method (_PTS, 1, NotSerialized)
{
Or (Arg0, 0xF0, Local0)
Store (Local0, DBG1)
Store (Zero, \_SB.PCI0.LPC.EXPE) //Please change to \_SB.PCI0.LPC.AG3E if you don't have the EXPE, but add AG3E.
If (LEqual (Arg0, 0x05))
{
Store (Zero, SLPE)
Sleep(0x10)
}
Else
{
//**Original Code, this resolved my sleep issue.
}
}

//This is written by mm67. You are really nice.
This address 0x0430 is also motherboard specific, it is PMBASE+30h. Address of PMBASE is defined in FACP, on most boards it can also be checked from processor definitions. For example I have this in my dsdt:

Processor (CPU0, 0x00, 0x00000410, 0x06)

Here 0x00000410 is referring to PMBASE+10h so I use 0x430 on my Gigabyte board. On my MSI board's dsdt I have this:
Processor (P001, 0x01, 0x00000810, 0x06) {}

So in MSI shutdown code I use this:
OperationRegion (PMRS, SystemIO, 0x0830, 0x13)

4 Add these in your com.apple.Boot.plist and then put "boot_RC4_Duvelv2.1_Rekursor" under your boot partition. 
        <key>DeviceID</key>
        <string>******XX-***X-***X-***X-************</string>
        <key>RestartFix</key>
        <string>YES</string>

Now you can remove OpenHaltRestart.kext and PlatformUUID.kext or other similar kexts.

필드 노트 #58 @Nameci 2010-01-31 ↳ Re: @pentiumpc
@pentiumpcMost portable system don't sleep on closing the LID, I tried to find a DSDT fix for it but cannot find it. (google is my best friend.) so I wrote 1 to fix my own. If you have a better or alternative method, please let me know. Thanks. Device (LID0) { Name (_HID, EisaId ("PNP0C0D")) //LID detection Method (_PRW, 0, NotSerialized) {…

Noob here.

Never did work on my dsdt, I have errors after compiling on which it cannot find the registers. After much of googling, I have edited one value on my dsdt, on the LID0, instead of 0x03 I have made it to 0x04. I have sleep on lid close now, but I still don't have wake on lid open or wake on keyboard press after sleep via Fn+F1.

Here is my DSDT.dsl if somebody care to point me to the right direction.

필드 노트 #59 @Nameci 2010-01-31

I have repatched the dsdt once again with a fresh one. I delete all dsdt and did the patching once again, i still have sleep on lid close, Fn+F1, on the power button. I can wake thru power button with no problems, I can wake buy plugging or unplugging a usb device. But no wake on lid open or keyboard.

With this dsdt, clamshelldisplay.kext is not necessary anymore, so I have removed this kext.

Btw I have modded my dsdt on LID as almost the same on earlier post by pentiumpc.

Any ideas on how to enabel wake on lid open?

필드 노트 #60 @uman 2010-03-04

What you need to find is the method that is called upon a lid switch event, which means it is under EC0, the embedded controller device. On a MacBook, it's typically _Q20, which looks like this:

                    Method (_Q20, 0, NotSerialized)
                    {
                        Store (LSTE, LIDS)
                        Notify (\_SB.LID0, 0x80)
                    }

On my Gateway, it's _Q8A:

                    Method (_Q8A, 0, NotSerialized)
                    {
                        If (LIDE)
                        {
                            Store ("_Q8A : LID Switch Event", Debug)
                            Store (0x01, LIDE)
                            If (IGDS)
                            {
                                Store (0x90, SMIF)
                                Store (0x00, TRP0)
                            }

                            Notify (\_SB.LID0, 0x80)
                        }

on many other notebooks, it's _Q09. So you'll need to find where it is, and add the appropriate Notify call, to inform the OS that the laptop should be woken up. (I've modified my DSDT to use LID0, to better match the MacBook DSDT).

필드 노트 #61 @kizwan 2010-03-11

Enabled bluetooth on Acer Aspire 9420

Do you remember, not a long time a go, I'm pursuing to enable bluetooth in Mac OS X? I'm still unable to get the bluetooth button working but I'm able to make the bluetooth device working via DSDT hacking. I'm still however unable to trigger the bluetooth ON/OFF button. I even trying to re-map the bluetooth ON/OFF button to another button (Fn+..) but unsuccessful. Therefore, I modify System Wake (_WAK) to enable bluetooth. This is for temporary solution. When hot booting the computer, it need to be put to sleep one time only & waking up the computer will turning ON the bluetooth device. To make it working cleanly, I modify both System Wake (_WAK) and Prepare to Sleep (_PTS). In the process, I also fixed the wireless device won't turn ON after waking from sleep.

_WAK code:-

    Method (_WAK, 1, NotSerialized)
    {
        Store (Arg0, P80H)
        If (LEqual (Arg0, 0x03))
        {
            Store (CIRT, \_SB.PCI0.LPCB.EC0.CIRE)
        }

        If (LOr (LEqual (Arg0, 0x03), LEqual (Arg0, 0x04)))
        {
            Store (EEPM, \_SB.PCI0.LPCB.EC0.WEPM)
            Store (CAST, \_SB.PCI0.LPCB.EC0.CAME)
            Store (WLPW, \_SB.PCI0.LPCB.EC0.WLEN)
            Store (BTPW, \_SB.PCI0.LPCB.EC0.BTEN)
            Store (WLLE, \_SB.PCI0.LPCB.EC0.WLLD)
            Store (BTLE, \_SB.PCI0.LPCB.EC0.BTLD)
        }

        Store (0x00, \_SB.PCI0.LPCB.EC0.MUTE)
        Store (0x00, \_SB.PCI0.LPCB.EC0.KTAF)
        Store (0x01, \_SB.PCI0.LPCB.EC0.KTEE)
        // start
        // Add support for Wireless & Bluetooth devices (power & LED).
        // Turned ON Wireless & Bluetooth devices after resume from Sleep.
        Store (0x01, \_SB.PCI0.LPCB.EC0.WLEN)
        Store (0x01, \_SB.PCI0.LPCB.EC0.WLLD)
        Store (0x01, \_SB.PCI0.LPCB.EC0.BTEN)
        Store (0x01, \_SB.PCI0.LPCB.EC0.BTLD)
        // end
..................

_PTS code:-
- Preventing the wireless device from turn OFF before goes to sleep. Therefore, the wireless device can be turn ON after waking from sleep.

    Method (_PTS, 1, NotSerialized)
    {
        Store (Arg0, P80H)
        Store (0x01, \_SB.PCI0.LPCB.EC0.MUTE)
        If (LEqual (Arg0, 0x03))
        {
            Store (\_SB.PCI0.LPCB.EC0.CIRE, CIRT)
        }

        If (LEqual (Arg0, 0x04))
        {
            Store (0x01, \_SB.PCI0.LPCB.EC0.BLNK)
            Store (0x00, \_SB.PCI0.LPCB.EC0.CIRE)
        }

        If (LOr (LEqual (Arg0, 0x03), LEqual (Arg0, 0x04)))
        {
            Store (\_SB.PCI0.LPCB.EC0.WEPM, EEPM)
            Store (\_SB.PCI0.LPCB.EC0.CAME, CAST)
            Store (\_SB.PCI0.LPCB.EC0.WLEN, WLPW)
            Store (\_SB.PCI0.LPCB.EC0.BTEN, BTPW)
            Store (\_SB.PCI0.LPCB.EC0.WLLD, WLLE)
            Store (\_SB.PCI0.LPCB.EC0.BTLD, BTLE)
        }

        Store (0x00, \_SB.PCI0.LPCB.EC0.CAME)
        Store (0x00, \_SB.PCI0.LPCB.EC0.CIRE)
        // Preventing Wireless device from turning OFF when system going to Sleep.
        // Store (0x00, \_SB.PCI0.LPCB.EC0.WLEN)
        // start
        // Add support for Wireless (LED) & Bluetooth (power & LED) devices.
        // Turned OFF Wireless (LED) & Bluetooth (power & LED) devices before going to Sleep.
        Store (0x00, \_SB.PCI0.LPCB.EC0.WLLD)
        Store (0x00, \_SB.PCI0.LPCB.EC0.BTEN)
        Store (0x00, \_SB.PCI0.LPCB.EC0.BTLD)
        // end
        If (LEqual (Arg0, 0x05))
        {
            PHSR (0x28, 0x00)
        }
    }

Applying this fix causing the computer unable to sleep anymore because USB4 device (where the bluetooth device attached to) causing the system wake immediately. I remember that according to ACPI Specification revision 4 documentation; in addition to the _PRW control method, _PSW control method can be used to enable or disable the device’s ability to wake a sleeping system.

Arguments: (1) Arg0 – An Integer containing a wake capability control 0 – Disable the device’s wake capabilities 1 – Enable the device’s wake capabilities

By looking at USB4 device in DSDT, there is _PSW entry that can be manipulate. This is the entry for USB4 device in DSDT after modifying the argument (set to 0):-

            Device (USB4)
            {
                Name (_ADR, 0x001D0003)
                OperationRegion (U4CS, PCI_Config, 0xC4, 0x04)
                Field (U4CS, DWordAcc, NoLock, Preserve)
                {
                    U4EN,   2
                }

                Name (_PRW, Package (0x02)
                {
                    0x0E, 
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        // Store (0x03, U4EN)
                        // Disable USB4 capability to wake a sleeping system
                        Store (0x00, U4EN)
                    }
                    Else
                    {
                        Store (0x00, U4EN)
                    }
                }

                Method (_S3D, 0, NotSerialized)
                {
                    Return (0x02)
                }

                Method (_S4D, 0, NotSerialized)
                {
                    Return (0x02)
                }
            }

The last FIX enable the computer to sleep again.

kizwan

필드 노트 #62 @uman 2010-03-12

Nice work! Too bad I don't have bluetooth!

I've come to the conclusion that getting access to keyboard events is impossible in DSDT. I think you have three choices: construct an AMW0 device kext to bind to the AMW0 (which I presume is in your DSDT). This would be a challenge, but might allow you to be straight retail. Two, hack at ApplePS2Keyboard (if PS2) or something else if USB. Or three, do the same with VoodooPS2 (again if PS2).

If you have USB, your job may be easier, since you might be able to do it outside kernel space.

필드 노트 #63 @kizwan 2010-03-12

Battery indicator

I'm successfully compiled AMW0.kext for SL but got kernel panic while initializing some MethodTerm at boot. Since AMW0.kext project is not finished, I think I'm going to try ACPI4ASUS.kext instead. If ACPI4ASUS.kext developed to works with AMW0 v2 interface (AMW0 and WMID), it should works with other laptop model too.

I'm trying to enable battery icon by patching DSDT. It is being done by adjusting ADP1 & BAT0 code according to DSDT from MBP4,1. Not successful yet, but the battery indicator did show up. It said battery is not detected & current power source is power adapter. Do you think it is possible to make it working by just patching the DSDT?

EDIT: I have found the right "query method" to automatically turn ON Bluetooth device during boot-up. I just tried all of the "query method" in the DSDT until I found the right one.

                    Method (_Q3F, 0, NotSerialized)
                    {
                        // start
                        // auto turn ON Bluetooth device during computer startup
                        Store (0x01, \_SB.PCI0.LPCB.EC0.BTEN)
                        Store (0x01, \_SB.PCI0.LPCB.EC0.BTLD)
                        // end
                        HKEY (0x3F)
                    }

kizwan

필드 노트 #64 @breakky 2010-03-13

Can you somebody help me to enable my audio on Snow Leopard?My audio chip is Realtek ALC662:
I make a codec dump:You can download and see it.

hot file.com/dl/32500771/8b28fa6/Realtek_ALC662_dump.txt.rar.html

I want to fix my audio in DSDT, so I read your tutorial and convert the Default pinconfig on each "[JACK]" device:

Mic (colour:Pink) 01a19830 ---> reversed 3098a101

Mic which is not a jack 99a3093f ---> 3f09a399

HP - 0121401f ---> 1f402101

SPDIF -01441120 ---> 20114401

This is my audio configuration on my laptop.

I don't know how to generate values which I haveto enter in my DSDT.This is my DSDT (HDEF):

Device (HDEF)
            {
                Name (_ADR, 0x001B0000)
                OperationRegion (HDAR, PCI_Config, 0x4C, 0x10)
                Field (HDAR, WordAcc, NoLock, Preserve)
                {
                    DCKA,   1, 
                            Offset (0x01), 
                    DCKM,   1, 
                        ,   6, 
                    DCKS,   1, 
                            Offset (0x08), 
                        ,   15, 
                    PMES,   1
                }

                Name (_PRW, Package (0x02)
                {
                    0x0D, 
                    0x03
                })
            }
필드 노트 #65 @breakky 2010-03-13 ↳ Re: @kizwan
@kizwanEDIT: I have found the right "query method" to automatically turn ON Bluetooth device during boot-up. I just tried all of the "query method" in the DSDT until I found the right one. Method (_Q3F, 0, NotSerialized) { // start // auto turn ON Bluetooth device during computer startup Store (0x01, \_SB.PCI0.LPCB.EC0.BTEN) Store (0x01,…

Where you put this code?

I searched in my DSDT for

Method (_Q3F, 0, NotSerialized)

, But didn't find it.I have a laptop with Bluetooth, where to put this code?

필드 노트 #66 @uman 2010-03-13 ↳ Re: @kizwan
@kizwanI'm successfully compiled AMW0.kext for SL but got kernel panic while initializing some MethodTerm at boot. Since AMW0.kext project is not finished, I think I'm going to try ACPI4ASUS.kext instead. If ACPI4ASUS.kext developed to works with AMW0 v2 interface (AMW0 and WMID), it should works with other laptop model too.

So does Asus use AMW0, or do you need to add that code from AMW0. A WMID kext would be useful as many PC vendors use that interface. uninc's DSDT was hideously intertwined with WMID.

I'm trying to enable battery icon by patching DSDT. It is being done by adjusting ADP1 & BAT0 code according to DSDT from MBP4,1. Not successful yet, but the battery indicator did show up. It said battery is not detected & current power source is power adapter. Do you think it is possible to make it working by just patching the DSDT?

I'm not sure, but given that the ACPI 4.0 spec devotes pages and pages to battery and power issues, I think it is at least possible. I also intend to try to solve this (but it's a lower priority for me because my laptop battery is toast anyway). I tried VoodooBattery, which worked great (it told me my battery was toast, lol), but then it kernel panic'ed HARD and I had to repair my disk, so I won't be using that again.

EDIT: I have found the right "query method" to automatically turn ON Bluetooth device during boot-up. I just tried all of the "query method" in the DSDT until I found the right one. Method (_Q3F, 0, NotSerialized) { // start // auto turn ON Bluetooth device during computer startup Store (0x01, \_SB.PCI0.LPCB.EC0.BTEN) Store (0x01,…

I still don't understand how query methods are executed, nor how they are bound to some device. ACPI says:

"For an embedded controller event, OSPM will queue the control method of the name _QXX, where XX is the hex format of the query code. Notice that each embedded controller device can have query event control methods. Similarly, for an SMBus driver, if no driver registers for SMBus alarms, the SMBus driver will queue control methods to…

And then they discuss it more with a completely unhelpful example. Oh wait, the acpi implementers guide is more helpful:

What’s the trap? Using decimal instead of hexadecimal numbers in _Lxx, _Exx, and _Qxx names in your ASL code. When the number (xx) in the _Lxx, _Exx, or _Qxx event handler object name in the ASL code does not match the number of the bit in the GPE register block (or match the number of the embedded controller query number in the case…

DSDT is fun but time consuming!

필드 노트 #67 @uman 2010-03-13 ↳ Re: @breakky
@breakkyWhere you put this code? I searched in my DSDT for Method (_Q3F, 0, NotSerialized) , But didn't find it.I have a laptop with Bluetooth, where to put this code?

Each laptop model is going to be different. That's why you have to be prepared to do some work to get DSDT going. You will first need to determine what symbols, events, and queries correspond to your bluetooth device. Then kizwan's code can act as a guide.

필드 노트 #68 @kizwan 2010-03-13 ↳ Re: @breakky
@breakkyWhere you put this code? I searched in my DSDT for Method (_Q3F, 0, NotSerialized) , But didn't find it.I have a laptop with Bluetooth, where to put this code?

It is hardware & BIOS specific. You may have different query method. I'm afraid, you need to try & error every query method in your DSDT.

EDIT: You may want to follow uman suggestion (next post) to get your audio working. It is much easier.
As for your sound, you need to do a lot of work to get your sound working. You already have HDEF entry in DSDT, so you just missing legacy/patched kext. You need to put your ConfigData & Pin Config in legacy/patched kext. Use this legacy kext as a template:-
media fire.com/?vkzyzmtzozo
If you like to put ConfigData & PinConfigurations in DSDT, this is how HDEF entry will look like (between "// start" & "// end"):-

            Device (HDEF)
            {
                Name (_ADR, 0x001B0000)
                Name (HDWA, 0x00)
                Name (_PRW, Package (0x02)
                {
                    0x05, 
                    0x03
                })
                Method (_PS0, 0, Serialized)
                {
                    If (LEqual (HDWA, 0x00))
                    {
                        Store (0x01, HDWA)
                        HKEY (0x8F)
                    }
                }

                Method (_PS3, 0, Serialized)
                {
                    Store (0x00, HDWA)
                }
                // start - required code
                Method (_DSM, 4, NotSerialized)
                {
                    Store (Package (0x0C)
                    {
                        "built-in",
                        Buffer (One)
                        {
                            0x00
                        },

                        "codec-id",
                        Buffer (0x04)
                        {
                            0x83, 0x08, 0xEC, 0x10
                        },

                        "ConfigData",
                        Buffer (0x40)
                        {
                            /* 0000 */    0x01, 0x47, 0x1C, 0x30, 0x01, 0x47, 0x1D, 0x11,
                            /* 0008 */    0x01, 0x47, 0x1E, 0x0B, 0x01, 0x47, 0x1F, 0x01,
                            /* 0010 */    0x01, 0x87, 0x1C, 0x10, 0x01, 0x87, 0x1D, 0x01,
                            /* 0018 */    0x01, 0x87, 0x1E, 0xA0, 0x01, 0x87, 0x1F, 0x90,
                            /* 0020 */    0x01, 0xA7, 0x1C, 0x20, 0x01, 0xA7, 0x1D, 0x31,
                            /* 0028 */    0x01, 0xA7, 0x1E, 0x81, 0x01, 0xA7, 0x1F, 0x01,
                            /* 0030 */    0x01, 0xE7, 0x1C, 0x40, 0x01, 0xE7, 0x1D, 0xE1,
                            /* 0038 */    0x01, 0xE7, 0x1E, 0x45, 0x01, 0xE7, 0x1F, 0x01
                        },

                        "layout-id",
                        Buffer (0x04)
                        {
                            0x0C, 0x00, 0x00, 0x00
                        },

                        "device-type",
                        Buffer (0x11)
                        {
                            "Mobile ALC883 S/T"
                        },

                        "PinConfigurations",
                        Buffer (0x10)
                        {
                            /* 0000 */    0x30, 0x11, 0x0B, 0x01, 0x10, 0x91, 0xAB, 0x01,
                            /* 0008 */    0x20, 0x31, 0x81, 0x01, 0x40, 0xE1, 0x45, 0x01
                        }
                    }, Local0)
                    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                    Return (Local0)
                }
                // end - required code
            }

I'll try to construct ConfigData & PinConfigurations for you but I can't promise.

kizwan

필드 노트 #69 @uman 2010-03-13

Are you planning to use VoodooHDA, or AppleHDA? If Voodoo, first rename all references to HDEF to ALC6 (or whatever turns you on :)) Doing so will prevent AppleHDA from loading and matching your HDA device. If AppleHDA is loaded, then VoodooHDA doesn't load.

Next, and this is common for both Apple and Voodoo. Add this to your HDEF or ALC6 device:

Method (_DSM, 4, NotSerialized) { Store (Package (0x04) { "layout-id", Buffer (0x04) { 0x0C, 0x00, 0x00, 0x00 }, "PinConfigurations", Buffer (Zero) {} }, Local0) DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0)) Return (Local0) }

You can then add your pin configs in there or in the plist depending on how you want to get sound going. See the great guide on infinitemac, or the one on projectosx.

Search my posts and look for my question on pinconfigs to find the links. I'm still trying to find out how to get my pinconfigs without Windows, since I don't run that anymore!

필드 노트 #70 @barnum 2010-03-13 ↳ Re: @kizwan
@kizwanBy looking at USB4 device in DSDT, there is _PSW entry that can be manipulate. This is the entry for USB4 device in DSDT after modifying the argument (set to 0):- Device (USB4) { Name (_ADR, 0x001D0003) OperationRegion (U4CS, PCI_Config, 0xC4, 0x04) Field (U4CS, DWordAcc, NoLock, Preserve) { U4EN, 2 } Name (_PRW, Package (0x02) {…

can you tell me what modification should I apply to this code to disable sleep for a device in usb2 ?

regards,
Vincent

필드 노트 #71 @kizwan 2010-03-13 ↳ Re: @uman
@umanSo does Asus use AMW0, or do you need to add that code from AMW0. A WMID kext would be useful as many PC vendors use that interface. uninc's DSDT was hideously intertwined with WMID.

Looks like I still need to go through WMI and ACPI documentation to have better understanding. Then I can make this successful.

@umanI'm not sure, but given that the ACPI 4.0 spec devotes pages and pages to battery and power issues, I think it is at least possible. I also intend to try to solve this (but it's a lower priority for me because my laptop battery is toast anyway). I tried VoodooBattery, which worked great (it told me my battery was toast, lol), but then…

Yeah, it's a low priority for me too. Just playing around.

I guess to make it working, maybe need to determine which query method it use. I said that because I found that there are query method that called ADP1 & BAT0 device. Just don't know what it do & what it contribute to battery detection.

@umanI still don't understand how query methods are executed, nor how they are bound to some device. ACPI says: And then they discuss it more with a completely unhelpful example. Oh wait, the acpi implementers guide is more helpful:

I'm going to grab the acpi implementers guide.

@umanDSDT is fun but time consuming!

I agree.

필드 노트 #72 @kizwan 2010-03-13 ↳ Re: @barnum
@barnum… can you tell me what modification should I apply to this code to disable sleep for a device in usb2 ? …

Do you mean you want to disable USB2 capability to wake a sleeping system, don't you? If in "Device (USB2)" entry it have _PSW (Power State Wake) method, you will need to change it according to my modification.

                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        // Store (0x03, U4EN)
                        // Disable USB4 capability to wake a sleeping system
                        Store (0x00, U4EN)
                    }
                    Else
                    {
                        Store (0x00, U4EN)
                    }
                }

Refer to arguments for _PSW:

Arguments: (1) Arg0 – An Integer containing a wake capability control 0 – Disable the device’s wake capabilities 1 – Enable the device’s wake capabilities

That is why I change both condition to execute the same thing. So that it always execute the same "Store" operation as if it is Arg0=0.

kizwan

필드 노트 #73 @breakky 2010-03-13 ↳ Re: @uman
@umanAre you planning to use VoodooHDA, or AppleHDA? If Voodoo, first rename all references to HDEF to ALC6 (or whatever turns you on :)) Doing so will prevent AppleHDA from loading and matching your HDA device. If AppleHDA is loaded, then VoodooHDA doesn't load. Next, and this is common for both Apple and Voodoo. Add this to your HDEF or…

I planed to use AppleHDA with DSDT.aml fix.This is my original DSDT.aml

hot file.com/dl/32576445/45eb3b8/DSDT.dsl.zip.html

By the way I use AsereBLN booter 1.1.9.

필드 노트 #74 @kizwan 2010-03-13 ↳ Re: @breakky
@breakkyI planed to use AppleHDA with DSDT.aml fix.This is my original DSDT.aml

Try this legacy kext for ALC662 (Snow Leopard):-
media fire.com/?kmnykkqmy5m

Make sure AppleHDA.kext in /System/Library/Extensions/ folder is original kext. Remember to put _DSM method in Device (HDEF) (please refer to uman's post #81 →).

You also need to put DTGP code in DSDT. Put it afterMethod (_WAK) function.

    Method (DTGP, 5, NotSerialized)
    {
        If (LEqual (Arg0, Buffer (0x10)
                {
                    /* 0000 */    0xC6, 0xB7, 0xB5, 0xA0, 0x18, 0x13, 0x1C, 0x44, 
                    /* 0008 */    0xB0, 0xC9, 0xFE, 0x69, 0x5E, 0xAF, 0x94, 0x9B
                }))
        {
            If (LEqual (Arg1, One))
            {
                If (LEqual (Arg2, Zero))
                {
                    Store (Buffer (One)
                        {
                            0x03
                        }, Arg4)
                    Return (One)
                }

                If (LEqual (Arg2, One))
                {
                    Return (One)
                }
            }
        }

        Store (Buffer (One)
            {
                0x00
            }, Arg4)
        Return (Zero)
    }

kizwan

필드 노트 #75 @breakky 2010-03-14

When I try to compile my dsdt.dsl I get one error:

4644: DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Error    4067 -    ^ Object is not accessible from this scope (DTGP)


Nevermind I found where is the error and fix it!

필드 노트 #76 @kizwan 2010-03-14 ↳ Re: @breakky
@breakkyWhen I try to compile my dsdt.dsl I get one error: 4644: DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0)) Error 4067 - ^ Object is not accessible from this scope (DTGP) Nevermind I found where is the error and fix it!

How about the sound? Is it working?

필드 노트 #77 @richarda 2010-03-16

This thread has been very useful for me. I now just miss one last step to have the "perfect" install.
I'm running Snow Leopard on an ASUS eeePC 901 from the SD card. It's a bit slow but this is OK.

My problem: whenever I go to sleep and wake-up from sleep, I guess the SD card (my "boot drive") gets brutally ejected and…well, it's bad.

My question: is there any DSDT mod that would allow my SD card to stay mounted (powered maybe) during all the cycle wake-sleep-wake ?

I found a lot of approaching stuff on the thread but nothing exactly like that. this would make may day.

Any idea anyone ?

Thanks, Richard.

필드 노트 #78 @uman 2010-03-18 ↳ Re: @richarda
@richardaThis thread has been very useful for me. I now just miss one last step to have the "perfect" install. I'm running Snow Leopard on an ASUS eeePC 901 from the SD card. It's a bit slow but this is OK. My problem: whenever I go to sleep and wake-up from sleep, I guess the SD card (my "boot drive") gets brutally ejected and…well, it's bad.…

Yes, but it depends on the underlying hardware. I've found los of good info about my own laptop in my chipset doc (ICH7), and there is lots of good info on the SATA part of the device control. I assume the SSD is controled through SATA?

필드 노트 #79 @richarda 2010-03-18

Thanks for the info. Not sure I was clear enough tough. I'm having the problem with the SD card (I believe it's using an internal USB port) and the machine is an eeePC 901.
I need help on this one…please.

필드 노트 #80 @uman 2010-03-19 ↳ Re: @richarda
@richardaThanks for the info. Not sure I was clear enough tough. I'm having the problem with the SD card (I believe it's using an internal USB port) and the machine is an eeePC 901. I need help on this one…please.

My bad. I'm so used to SD cards not working, that I assumed you meant SSD.

You could try the following:

1. Determine what USB slot your SD card is occupying. Easiest is to highlight he drive in disk utility and right-click Information. You should see something like: IODeviceTree:/PCI0@0/USB7@1D,7. That tells me that it's using USB7.

2. Edit your DSDT to replace the _PRW for the indicated USB slot with:

            Device (USB7)
            {
                ...
            // package (argnum) {GPEbit, Wakelevel, PowerResource}
            Name(_PRW, Package()
                {
                    <xx>, // Bit number in GPEx_EN to enable USB resume 
                    0x01  // Reference to lowest sleeping state which can be 
                       // entered while still providing wake functionality
                       // no relative power resource specified
                })

where I have <xx> above, keep your DSDT's existing value, as that's the handler in the GPE for USB7. What I've highlighted in red is the change. Your existing DSDT likely has 0x03, which is effectively powered off.

What the 0x01 does is says that the drive still needs power. That *might* be enough to keep it from being ejected. But it might also prevent the computer from sleeping.

Take a look at the ACPI spec (4.0 rev) Chapter 7.2 for some of the things you can do with power management.

필드 노트 #81 @saul1d 2010-03-20

ive been lurking around on this thread for a week or two now, and i'm more interested in getting my laptop fully working. ive been running osx for about a year now and i'm pretty familiar with everything except DSDT.

basically what i'm trying to get working:

- GMA X3100: was working with leo, but with 10.6.2 i lost the ability to make the
screen turn off.(although i still have QE/CI)
- Backlight: has never worked, "invalid firmware max backlight" problem. i was
hoping DSDT would be able to fix this
- Sleep: although i'm not too worried about it, it would be nice.

I have a Gateway M6841. I don't think it's a too popular system to be using for a hackintosh, so there's not much help that i've found in the forums.

here is my patched DSDT. its patched for sleep, backlight, and gmax3100 but it hasnt changed any of the problems. thanks to anyone that can help or at least point me in the right direction, i do have programming experience if it helps.

필드 노트 #82 @richarda 2010-03-20 ↳ Re: @uman
@umanMy bad. I'm so used to SD cards not working, that I assumed you meant SSD. You could try the following: 1. Determine what USB slot your SD card is occupying. Easiest is to highlight he drive in disk utility and right-click Information. You should see something like: IODeviceTree:/PCI0@0/USB7@1D,7. That tells me that it's using USB7.…

Hello,
Thanks a lot. In the disk utility I got: /PCI0@0/EUSB@1D,7
And in the DSDT file, at Device(EUSB) I don't have a lot of things. Just

{
Name (_ADR, 0x001D0007)
}

nothing else. Any idea what else I can add to make it working in that case ?

필드 노트 #83 @kizwan 2010-03-20 ↳ Re: @richarda
@richardaThanks a lot. In the disk utility I got: /PCI0@0/EUSB@1D,7 And in the DSDT file, at Device(EUSB) I don't have a lot of things. Just { Name (_ADR, 0x001D0007) } nothing else. Any idea what else I can add to make it working in that case ?

You're allowed to add what it don't have.

kizwan

필드 노트 #84 @richarda 2010-03-20

Allright, I got that but in this case I guess I have to pute something like

Name(_PRW, Package
{
<xx>, // Bit number in GPEx_EN to enable USB resume
0x01 // Reference to lowest sleeping state which can be
// entered while still providing wake functionality
// no relative power resource specified
})

But how to determine the <xx> value then ?

필드 노트 #85 @uman 2010-03-21 ↳ Re: @richarda
@richardaAllright, I got that but in this case I guess I have to pute something like Name(_PRW, Package { <xx>, // Bit number in GPEx_EN to enable USB resume 0x01 // Reference to lowest sleeping state which can be // entered while still providing wake functionality // no relative power resource specified }) But how to determine the <xx> value…

That's the problem then. You really need to have some of the resources specified for your USB (UHCI) and EHCI ports. Since you don't have anything, you can add the GPE handlers, and things should work. The best way to proceed, is to first identify which Mac model your machine is closest to, and then take the requisite parts, carefully excising out the problematic parts.

For my hack, I looked at the list of mac models on wikipedia, and then chose MacBook 2,1 as the closest. I then edited my smbios.plist to reflect those values. I then compared my DSDT to the MacBook 2,1 DSDT and ioreg, and found they were surprisingly close. I've included below, some pieces for you to try from a MacBook 2,1 DSDT:

    Scope (\_GPE)
    {
...
        Method (_L03, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB1, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }

        Method (_L04, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB2, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }
...
        Method (_L0C, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB3, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }

        Method (_L0D, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB7, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }

        Method (_L0E, 0, NotSerialized)
        {
            Notify (\_SB.PCI0.USB4, 0x02)
            Notify (\_SB.PWRB, 0x02)
        }
...

Note the parts in red. If you already have level handlers in your GPE scope that use these numbers (so say you already have _L03), you will have to change them, and change the part in the USB1 declaration for, say, _L03. Don't put really large numbers, because there's a part in the DSDT that says the handlers go only up to 0xXX (I've forgotten where that is). Just make sure you use unused numbers. For example, in my DSDT I added one for _L11 for my firewire.

            Device (USB1)
            {
                Name (_ADR, 0x001D0000)  // keep your existing ADDR lines!!!
                Device (HUB1)                       // will become HUB2 for USB2
                {
                    Name (_ADR, 0x00)
                    Device (PRT1)
                    {
                        Name (_ADR, 0x01)
                    }

                    Device (PRT2)
                    {
                        Name (_ADR, 0x02)
                    }
                }

                OperationRegion (U1CS, PCI_Config, 0xC4, 0x04)
                Field (U1CS, DWordAcc, NoLock, Preserve)
                {
                    U1EN,   2
                }

                Name (_PRW, Package (0x02)
                {
                    0x03,     // must match number you use in _Lxx handler
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x03, U1EN)
                    }
                    Else
                    {
                        Store (0x00, U1EN)
                    }
                }

                Method (_S3D, 0, NotSerialized)  // note: I don't have these
                {
                    Return (0x03)
                }

                Method (_S4D, 0, NotSerialized) // note: I don't have these
                {
                    Return (0x03)
                }
            }

The parts in red will change to match each USB port, so U1CS, U1EN becomes U2CS and U2EN for USB2, along with changing HUB1 to HUB2. I don't have the _S3D and _S4D methods in my DSDT and from reading the spec, I don't think they are needed.

So USB2, looks like:

            Device (USB2)
            {
                Name (_ADR, 0x001D0001)
                Device (HUB2)
                {
                    Name (_ADR, 0x00)
                    Device (PRT1)
                    {
                        Name (_ADR, 0x01)
                    }

                    Device (PRT2)
                    {
                        Name (_ADR, 0x02)
                    }
                }

                OperationRegion (U2CS, PCI_Config, 0xC4, 0x04)
                Field (U2CS, DWordAcc, NoLock, Preserve)
                {
                    U2EN,   2
                }

                Name (_PRW, Package (0x02)
                {
                    0x04,      // A different _L04 is a different _LXX handler than USB1!
                    0x03
                })
                Method (_PSW, 1, NotSerialized)
                {
                    If (Arg0)
                    {
                        Store (0x03, U2EN)
                    }
                    Else
                    {
                        Store (0x00, U2EN)
                    }
                }

                Method (_S3D, 0, NotSerialized)
                {
                    Return (0x03)
                }

                Method (_S4D, 0, NotSerialized)
                {
                    Return (0x03)
                }
            }

Do the same edits for USB3 and USB4 (if you have USB4) and even USB5, and USB6 if you have a desktop with lots of USB ports (although I suspect you will need another EHCI hub there, but I don't know).

USB7 is quite different:

            Device (USB7)
            {
                Name (_ADR, 0x001D0007)
                Device (HUB7)
                {
                    Name (_ADR, 0x00)
                    Device (PRT1)
                    {
                        Name (_ADR, 0x01)
                    }

                    Device (PRT2)
                    {
                        Name (_ADR, 0x02)
                    }

                    Device (PRT3)
                    {
                        Name (_ADR, 0x03)
                    }

                    Device (PRT4)
                    {
                        Name (_ADR, 0x04)
                    }

                    Device (PRT5)
                    {
                        Name (_ADR, 0x05)
                    }

                    Device (PRT6)
                    {
                        Name (_ADR, 0x06)
                    }

                    Device (PRT7)
                    {
                        Name (_ADR, 0x07)
                    }

                    Device (PRT8)
                    {
                        Name (_ADR, 0x08)
                    }
                }

                Name (_PRW, Package (0x02)
                {
                    0x0D,     // yet another different handler
                    0x03      // I suggested you change this to 0x1
                })
                Method (_S3D, 0, NotSerialized)
                {
                    Return (0x03)
                }

                  Method (_S4D, 0, NotSerialized)
                {
                    Return (0x03)
                }
            }

Remove the parts in yellow for the USB7, since they don't match the change from 0x03 -> 0x01. Plus I suspect they really aren't needed.

필드 노트 #86 @uman 2010-03-21

Oh, and if this doesn't work, there are bits you can set that essentially control power settings, ejectability, etc. But that is hugely dependent on your chipset. I have an ICH7, and most of that is the same in ICH9, and ICH10, but if you have an nvidia chipset, that's *totally* different.

필드 노트 #87 @richarda 2010-03-21

OK, I'm 200% lost now. This is way too complex for me. I guess I have to find somebody litterate enough who solved the problem on the eee901 and just copy his settings.

Thanks anyway.

필드 노트 #88 @barnum 2010-03-26
                Device (HUB1)                       // will become HUB2 for USB2
                {
                    Name (_ADR, 0x00)
                    Device (PRT1)
                    {
                        Name (_ADR, 0x01)
                    }

                    Device (PRT2)
                    {
                        Name (_ADR, 0x02)
                    }
                }

Hi,
Can You explain me what the "utility" of this part of the usb declaration"

In my dsdt, I doesn't have that.
Thank,
Barnum

필드 노트 #89 @uman 2010-03-29

You won't need it, then. It's because on my gateway, the ports have integrated hubs. See ACPI spec, section 9.13 for full details.

필드 노트 #90 @adriangb 2010-04-01 ↳ Re: @ping99

Sorry of reviving this and cutting in
@ping99
I have an ASRock x58 Extreme (similar to ASUS boards), and sleep doesn't work OTB. I've been looking around, and it seems I would need to modify Method (_PTS, 1, NotSerialized).
I read your post, and it seems that the edits you did are somewhat similar to what I should do in my DSDT, whoever I have a few doubts:

@ping99... 1 Add OperationRegion below before Method (_PTS, 1, NotSerialized) OperationRegion (DEBG, SystemIO, 0x80, One) Field (DEBG, ByteAcc, NoLock, Preserve) { DBG1, 8 } OperationRegion (PMRS, SystemIO, 0x0430, 0x13) Field (PMRS, ByteAcc, NoLock, Preserve) { , 4, SLPE, 1, Offset (0x08), GPSE, 16, GPSS, 16, Offset (0x12), , 1, SWGC, 1 }

Is

OperationRegion (DEBG, SystemIO, 0x80, One)
    Field (DEBG, ByteAcc, NoLock, Preserve)
    {
        DBG1,   8
    }

really necessary? mm67 seems to think not (or is that for shutdown only?)

@ping99...2 Check Device (LPC) if there is a similar Operation Region "LPC" like below. If you don't have LPC device, just search Name (_ADR, 0x001F0000), sometimes the device name is different. Device (LPC) { Name (_ADR, 0x001F0000) OperationRegion (LPC0, PCI_Config, 0xA4, 0x02) Field (LPC0, ByteAcc, NoLock, Preserve) { AG3E, 1 } If there…

Here is my LPCB:

Device (LPCB)
            {
                Name (_ADR, 0x001F0000)
                Device (IELK)
                {
                    Name (_HID, "AWY0001")
                    OperationRegion (RXA0, PCI_Config, 0xA0, 0x20)
                    Field (RXA0, ByteAcc, NoLock, Preserve)
                    {
                            ,   9, 
                        PBLV,   1, 
                                Offset (0x10), 
                            ,   1, 
                        PBMS,   1, 
                            ,   1, 
                        PMCS,   1, 
                        ECNS,   1, 
                                Offset (0x11), 
                        ECT1,   16, 
                        ELEN,   1, 
                                Offset (0x14)
                    }

                    Method (\_GPE._L0A, 0, NotSerialized)....

Where should I put OperationRegion (LPC0...? Before Device (IELK)? After Name (_HID, "AWY0001")? Inside OperationRegion (RXA0, PCI_Config, 0xA0, 0x20) somehow?

@ping993 Add code below in Method (_PTS, 1, NotSerialized) like this Method (_PTS, 1, NotSerialized) { Or (Arg0, 0xF0, Local0) Store (Local0, DBG1) Store (Zero, \_SB.PCI0.LPC.EXPE) //Please change to \_SB.PCI0.LPC.AG3E if you don't have the EXPE, but add AG3E. If (LEqual (Arg0, 0x05)) { Store (Zero, SLPE) Sleep(0x10) } Else { //**Original…

Here is my current -disastrous- Method (_PTS, 1, NotSerialized):

Method (_PTS, 1, NotSerialized)
    {
        Or (Arg0, 0xF0, Local0)
        Store (Arg0, DBG8)
        PTS (Arg0)
        Store (Zero, Index (WAKP, Zero))
        Store (Zero, Index (WAKP, One))
        If (LAnd (LEqual (Arg0, 0x04), LEqual (OSFL (), 0x02)))
        {
            Sleep (0x0BB8)
        }

        If (LEqual (Arg0, 0x05))
        {
            Store (0x99, SMIP)
            Store (One, \_SB.PCI0.LPCB.IELK.AG3E)
            Store (Zero, SLPE)
            Sleep (0x10)
        }
        Else
        {
            Store (Zero, \_SB.PCI0.LPCB.IELK.AG3E)
        }
        Store (ASSB, WSSB)
        OSYS ()
        Store (AOTB, WOTB)
        Store (AAXB, WAXB)
        Store (Arg0, ASSB)
        Store (OSFL (), AOTB)
        Store (OSYS (), OSTP)
        Store (Zero, AAXB)
    }

The original is:

Method (_PTS, 1, NotSerialized)
    {
        Store (Arg0, DBG8)
        PTS (Arg0)
        Store (Zero, Index (WAKP, Zero))
        Store (Zero, Index (WAKP, One))
        If (LAnd (LEqual (Arg0, 0x04), LEqual (OSFL (), 0x02)))
        {
            Sleep (0x0BB8)
        }

        Store (ASSB, WSSB)
        Store (AOTB, WOTB)
        Store (AAXB, WAXB)
        Store (Arg0, ASSB)
        Store (OSFL (), AOTB)
        Store (OSYS (), OSTP)
        Store (Zero, AAXB)
    }

, Adrian

Post Scriptum (P.S.): I attached my DSDT's, CST and IST tables, so if someone could lok at them and tell me if I -for example- managed to insert the C-States, P-States, etc-States into the DSDT correctly, I would be eternally grateful.

필드 노트 #91 @ping99 2010-07-04

First all, you just need to add OperationRegion PMRS below.

OperationRegion (PMRS, SystemIO, 0x0430, 0x13)
Field (PMRS, ByteAcc, NoLock, Preserve)
{
, 4,
SLPE, 1
}

* Pay attention to 0x0430 in red. It depends your motherboard. You have Processor (CPU0, 0x00, 0x00000410, 0x06) in your dsdt, you can use 0x0430. If you have Processor (P001, 0x01, 0x00000810, 0x06) then use 0x0830. It is PMBASE+30h.

Secondly, look into Method (_PTS, 1, NotSerialized) to see whether "If (LEqual (Arg0, 0x05))" there. If not, add code as below. If already there, just insert.

If (LEqual (Arg0, 0x05))
{
Store (0x01, \_SB.PCI0.LPC.EXPE) // hibernate fix. Will return to S5 after power back
Store (Zero, SLPE) // zero SLP_SMI_EN, else won't shutdown
Sleep (0x10) // wait for bit to set
}

Yours is modified as below:

Method (_PTS, 1, NotSerialized)
{
Store (Zero, \_SB.PCI0.LPC.EXPE) //Check Device (LPC) or LPCB if you have this EXPE or something like this. change it to match yours.
If (LEqual (Arg0, 0x05))
{
Store (0x01, \_SB.PCI0.LPC.EXPE) // hibernate fix. Will return to S5 after power back
Store (Zero, SLPE) // zero SLP_SMI_EN, else won't shutdown
Sleep (0x10) // wait for bit to set
}

Store (Arg0, DBG8)
PTS (Arg0)
Store (Zero, Index (WAKP, Zero))
Store (Zero, Index (WAKP, One))
If (LAnd (LEqual (Arg0, 0x04), LEqual (OSFL , 0x02)))
{
Sleep (0x0BB8)
}

Store (ASSB, WSSB)
Store (AOTB, WOTB)
Store (AAXB, WAXB)
Store (Arg0, ASSB)
Store (OSFL , AOTB)
Store (OSYS , OSTP)
Store (Zero, AAXB)
}

필드 노트 #92 @SaGaR 2010-12-20

i tried the sleep fix, but i can't get it to work, sleep in general doesn't work, when i press the sleep button, my screen freezes and that's all, when i press the powerbutton i get the restart/shutdown popup and all works again.

Lidsleep also does the same, screen freezes but stays on.

i wanna ask you if you plz wanna look at it?

필드 노트 #93 @ribben89 2011-02-05

really nice job!

Here is my problem... I have a Compal Ifl90 with intel 7300 @ 2GHz and 8600m gt 512mb with Snow Leopard 10.6.3 .

The problem i have is that my screen brightness slider at setting wasn't there! But with some dsdt editing i managed to show up but when i move the slider nothing happen and returns to it's original position! Any help please below is my code from Device (LCD)

Device (LCD)
                    {
                        Method (_ADR, 0, NotSerialized)
                        {
                            Return (0x0110)
                        }

                        Method (_DCS, 0, NotSerialized)
                        {
                            ^^^^LPCB.PHSS (0x0C)
                            Store (CADL, Local0)
                            Store (CSTE, Local1)
                            And (Local0, One, Local0)
                            And (Local1, One, Local1)
                            If (Local0)
                            {
                                Store (One, LCDA)
                            }
                            Else
                            {
                                Store (Zero, LCDA)
                            }

                            If (LCDA)
                            {
                                If (LEqual (Local1, One))
                                {
                                    Return (0x1F)
                                }
                                Else
                                {
                                    Return (0x1D)
                                }
                            }
                            Else
                            {
                                If (LEqual (Local1, One))
                                {
                                    Return (0x0F)
                                }
                                Else
                                {
                                    Return (0x0D)
                                }
                            }
                        }

                        Method (_DGS, 0, NotSerialized)
                        {
                            If (LCDA)
                            {
                                Return (One)
                            }
                            Else
                            {
                                Return (Zero)
                            }
                        }

                        Method (_DSS, 1, NotSerialized)
                        {
                        }

                        Method (_BCL, 0, NotSerialized)
                        {
                            If (^^^^LPCB.ECOK ())
                            {
                                If (LEqual (OSYS, 0x07D6))
                                {
                                    If (LEqual (^^^^LPCB.EC0.OSTY, Zero))
                                    {
                                        Store (One, ^^^^LPCB.EC0.OSTY)
                                    }
                                }
                                Else
                                {
                                    If (LEqual (^^^^LPCB.EC0.OSTY, One))
                                    {
                                        Store (Zero, ^^^^LPCB.EC0.OSTY)
                                    }
                                }
                            }

                            Return (Package (0x0A)
                            {
                                0x46, 
                                0x28, 
                                Zero, 
                                0x0A, 
                                0x14, 
                                0x1E, 
                                0x28, 
                                0x32, 
                                0x3C, 
                                0x46
                            })
                        }

                        Method (_BCM, 1, NotSerialized)
                        {
                            Divide (Arg0, 0x0A, Local0, Local1)
                            Store (Local1, ^^^^LPCB.EC0.BRTS)
                        }

                        Method (_BQC, 0, NotSerialized)
                        {
                            Multiply (^^^^LPCB.EC0.BRTS, 0x0A, Local0)
                            Return (Local0)
                        }
                    }

In my try to make it show up i also added

Name (_HID, EisaId ("LCD1234"))

in Device (LCD)

And

Device (PNLF)
                    {
                        Name (_HID, EisaId ("APP0002"))
                        Name (_CID, "backlight")
                        Name (_UID, 0x0A)
                        Name (_STA, 0x0B)
                    }

right above Device (LCD)

Also i am able to change brightness from my Fn Buttons but no notification is shows as the sound changing does!

Please any ideas?

필드 노트 #94 @Marchrius 2013-01-21

Led Wireless

How I can turn on wireless led with code in DSDT?

교차 검증 및 토론 참여 멤버: @Thireus @uman @THeKiNG @pocenk @adriangb
출처 및 기여자 이력 (등록된 기여자 32명 · 원본 스레드 #1960)
사용자명기여 역할게시물 수활동 기간
@uman핵심 기여자212009-06-02 → 2010-03-29
@kizwan핵심 기여자182009-06-01 → 2010-03-20
@pentiumpc주 저자82009-01-19 → 2009-03-03
@Slither2008핵심 기여자62009-03-03 → 2009-03-05
@candykane핵심 기여자62009-05-13
@richarda핵심 기여자52010-03-16 → 2010-03-21
@THeKiNG핵심 기여자42009-06-03 → 2009-06-18
@breakky핵심 기여자42010-03-13 → 2010-03-14
@Thireus핵심 기여자32009-05-07 → 2009-05-13
@Alexaar기여 멤버22009-04-13 → 2009-04-29
@The Edge3000기여 멤버22009-08-11 → 2009-09-07
@Gurruwiwi기여 멤버22009-08-17
@EnzoFX기여 멤버22009-09-03
@Sweaty기여 멤버22009-12-21
@ping99기여 멤버22010-01-18 → 2010-07-04
@Nameci기여 멤버22010-01-31
@barnum기여 멤버22010-03-13 → 2010-03-26
@adriangb기여 멤버22010-04-01
@kDawg기여 멤버12009-07-15
@aschar1기여 멤버12009-08-07
@sk1nhd33t기여 멤버12009-08-09
@Common_Sense기여 멤버12009-09-08
@gnychis기여 멤버12009-09-25
@msingh기여 멤버12009-10-05
@2nerd4u기여 멤버12009-10-20
@mm67기여 멤버12009-12-21
@adityaxavier기여 멤버12010-01-09
@pocenk기여 멤버12010-01-29
@saul1d기여 멤버12010-03-20
@SaGaR기여 멤버12010-12-20
@ribben89기여 멤버12011-02-05
@Marchrius기여 멤버12013-01-21

언어 선택 · Choose your language