- 积分
- 160
- 最后登录
- 2023-1-13
- 精华
- 0
- 阅读权限
- 20
- 主题
- 17
- UID
- 1461883
- 帖子
- 326
- PB币
- 211
- 威望
- 5
- 贡献
- 0
- 技术
- 0
- 活跃
- 647
- UID
- 1461883
- 帖子
- 326
- PB币
- 211
- 贡献
- 0
- 技术
- 0
- 活跃
- 647
|
发表于 2020-2-23 18:05:54
IP属地四川
|显示全部楼层
首先感谢@左右流之和@hugarninwow两位老哥的启发。
左右流之关于OC对A卡的deviceproperties注入的帖子给了我注入N卡的想法,hugarninwow提供的GT240的DSDT给我的操作提供了依据。前情提要:我的台式U游戏本(带核显已可以硬解,主板出厂没给核显输出,只能走MXM独显输出)在更换了GK核显免驱N卡过后已经可以在外接的屏幕上加载WEG正常工作,但笔记本内屏一直无法识别,IOReg里面看不见内屏,使用nv_disable=1进系统才能用内屏显示,但此时N卡没有驱动所以外屏又无法工作。
在10.12时代,按上述方法进系统内屏还能花屏,但现在15的下跑完代码内屏直接黑屏了。
切换OC引导后问题仍在,偶然我发现关于本机里面的N卡虽然识别但并未内建,所以尝试用OC对PCI设备打补丁来内建,尝试成功,附上内建前后的对比:
方法就是在deviceproperties里面加入显卡对应的PCI设备并注入如下内建代码,但并未解决内屏问题,也必须加载WEG才能使用外屏(若不加载则内外屏皆黑)
此时正好hugarninwow向我提供了n卡本本的DSDT:
- Device (GFX0)
- {
- Name (_ADR, Zero) // _ADR: Address
- Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
- {
- Local0 = Package (0x28)
- {
- "@0,connector-type",
- Buffer (0x04)
- {
- 0x00, 0x08, 0x00, 0x00 // ....
- },
- "@1,connector-type",
- Buffer (0x04)
- {
- 0x00, 0x08, 0x00, 0x00 // ....
- },
- "@0,compatible",
- Buffer (0x0B)
- {
- "NVDA,NVMac"
- },
- "@0,device_type",
- Buffer (0x08)
- {
- "display"
- },
- "@0,name",
- Buffer (0x0F)
- {
- "NVDA,Display-A"
- },
- "@0,built-in",
- Buffer (0x04)
- {
- 0x01, 0x00, 0x00, 0x00 // ....
- },
- "@0,backlight-control",
- Buffer (0x04)
- {
- 0x01, 0x00, 0x00, 0x00 // ....
- },
- "@0,display-cfg",
- Buffer (0x04)
- {
- 0x03, 0x01, 0x00, 0x00 // ....
- },
- "@0,pwm-info",
- Buffer (0x14)
- {
- /* 0000 */ 0x01, 0x14, 0x00, 0x64, 0xA8, 0x61, 0x00, 0x00, // ...d.a..
- /* 0008 */ 0x08, 0x52, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // .R......
- /* 0010 */ 0x00, 0x04, 0x00, 0x00 // ....
- },
- "@1,compatible",
- Buffer (0x0B)
- {
- "NVDA,NVMac"
- },
- "@1,device_type",
- Buffer (0x08)
- {
- "display"
- },
- "@1,name",
- Buffer (0x0F)
- {
- "NVDA,Display-B"
- },
- "NVCAP",
- Buffer (0x14)
- {
- /* 0000 */ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ........
- /* 0008 */ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, // ........
- /* 0010 */ 0x00, 0x00, 0x00, 0x00 // ....
- },
- "VRAM,totalsize",
- Buffer (0x04)
- {
- 0x00, 0x00, 0x00, 0x20 // ...
- },
- "device_type",
- Buffer (0x0C)
- {
- "NVDA,Parent"
- },
- "device-id",
- Buffer (0x04)
- {
- 0x34, 0x0A, 0x00, 0x00 // 4...
- },
- "model",
- Buffer (0x17)
- {
- "NVIDIA GeForce GT 130M"
- },
- "AAPL,aux-power-connected",
- Buffer (0x04)
- {
- 0x01, 0x00, 0x00, 0x00 // ....
- },
- "AAPL,backlight-control",
- Buffer (0x04)
- {
- 0x01, 0x00, 0x00, 0x00 // ....
- },
- "hda-gfx",
- Buffer (0x0A)
- {
- "onboard-2"
- }
- }
- DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
- Return (Local0)
- }
- }
- Device (HDAU)
- {
- Name (_ADR, One) // _ADR: Address
- Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
- {
- Local0 = Package (0x02)
- {
- "hda-gfx",
- Buffer (0x0A)
- {
- "onboard-2"
- }
- }
- DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
- Return (Local0)
- }
- }
复制代码
按照这段代码并结合左右流之多帖子,我加入流让系统可以正确识别N卡的参数并重新启动。但却遭遇了重启,重启后系统报错。我定位到造成报错的是device_type,即下面这一段,在n卡本本中device_type是的值是NVDA,Parent:
重启报的是一段类似早期MAC五国的代码,可以看出OC的注入是有作用的,因为NVDAStartup和PCI都出现了报错,但本人的能力还不能解决这些问题,所以来论坛与大家探讨。
报错信息:
- panic(cpu 2 caller 0xffffff80006652fa): Kernel trap at 0xffffff7f83acea06, type 14=page fault, registers:
- CR0: 0x000000008001003b, CR2: 0x0000000000000000, CR3: 0x000000000589f000, CR4: 0x00000000003626e0
- RAX: 0x0000000000000000, RBX: 0xffffff81ec813d64, RCX: 0xffffff8001087238, RDX: 0x0000000000000008
- RSP: 0xffffff81ec813d60, RBP: 0xffffff81ec813e40, RSI: 0xffffff80010231c8, RDI: 0x0000000000000000
- R8: 0xffffff8000ea4360, R9: 0x0000000000000000, R10: 0xffffff819eb945c8, R11: 0x0000000000000010
- R12: 0x0000000000000000, R13: 0xffffff7f83acefad, R14: 0x0000000000000000, R15: 0xffffff8020e77f40
- RFL: 0x0000000000010246, RIP: 0xffffff7f83acea06, CS: 0x0000000000000008, SS: 0x0000000000000010
- Fault CR2: 0x0000000000000000, Error code: 0x0000000000000000, Fault CPU: 0x2, PL: 0, VF: 1
- Backtrace (CPU 2), Frame : Return Address
- 0xffffff81ec8137c0 : 0xffffff800053bb2b mach_kernel : _handle_debugger_trap + 0x47b
- 0xffffff81ec813810 : 0xffffff80006734d5 mach_kernel : _kdp_i386_trap + 0x155
- 0xffffff81ec813850 : 0xffffff8000664f4e mach_kernel : _kernel_trap + 0x4ee
- 0xffffff81ec8138a0 : 0xffffff80004e2a40 mach_kernel : _return_from_trap + 0xe0
- 0xffffff81ec8138c0 : 0xffffff800053b217 mach_kernel : _DebuggerTrapWithState + 0x17
- 0xffffff81ec8139c0 : 0xffffff800053b5fb mach_kernel : _panic_trap_to_debugger + 0x21b
- 0xffffff81ec813a10 : 0xffffff8000cd2aa9 mach_kernel : _panic + 0x61
- 0xffffff81ec813a80 : 0xffffff80006652fa mach_kernel : _sync_iss_to_iks + 0x2aa
- 0xffffff81ec813c00 : 0xffffff8000664ff8 mach_kernel : _kernel_trap + 0x598
- 0xffffff81ec813c50 : 0xffffff80004e2a40 mach_kernel : _return_from_trap + 0xe0
- 0xffffff81ec813c70 : 0xffffff7f83acea06 com.apple.nvidia.NVDAStartup : __ZN11NVDAStartup5probeEP9IOServicePi + 0x666
- 0xffffff81ec813e40 : 0xffffff8000c1a8da mach_kernel : __ZN9IOService15probeCandidatesEP12OSOrderedSet + 0x63a
- 0xffffff81ec813ef0 : 0xffffff8000c1a10e mach_kernel : __ZN9IOService14doServiceMatchEj + 0x2ce
- 0xffffff81ec813f50 : 0xffffff8000c1c8ad mach_kernel : __ZN15_IOConfigThread4mainEPvi + 0x15d
- 0xffffff81ec813fa0 : 0xffffff80004e213e mach_kernel : _call_continuation + 0x2e
- Kernel Extensions in backtrace:
- com.apple.nvidia.NVDAStartup(14.0)[B7E8FE3A-5A44-3EA0-9A3B-345B583BFF31]@0xffffff7f83acd000->0xffffff7f83ad0fff
- dependency: com.apple.iokit.IOPCIFamily(2.9)[ADD485B5-3EF8-37C4-B3C5-F86326E497A4]@0xffffff7f80f2f000
- BSD process name corresponding to current thread: kernel_task
- Boot args: keepsyms=1 Slide=1 darkwake=0
- Mac OS version:
- 19D76
- Kernel version:
- Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64
- Kernel UUID: A8DDE75C-CD97-3C37-B35D-1070CC50D2CE
- Kernel slide: 0x0000000000200000
- Kernel text base: 0xffffff8000400000
- __HIB text base: 0xffffff8000300000
- System model name: iMac18,2 (Mac-77F17D7DA9285301)
- System shutdown begun: NO
- Panic diags file available: YES (0x0)
- System uptime in nanoseconds: 4465078180
复制代码
我也尝试过删除device_type,不加载WEG并添加了@0,@1等接口信息,但测试结果虽然不重启报错了,但不加载WEG时内外屏皆黑,此时我听到了开机的声音说明可以进系统。
|
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
|