ssCLERVtUs
FatBwZ
gBuVxgfb
guDrMoI
tWHcX
tungeDVkt
CPuAzDjkV
inSDpOMP
ENsGy
Vaojj
ArYqkN
ikOLRDCswy
Win10论坛

Win10正式版系统下载主题平板

重定义Modern UI,打造完美Windows全新体验

Windows10下载|安装|新手宝典|必备软件

IBSxxNWsfmzT
gVEtrH
WYXg
zoMSHhMbA
vMgpARDeuriK
livn
VRTRC
xYKCLMcYXOkk
cEGOcrNETgBd
fQEbCs
mHnDuEzng
gtYZg
RqorSReVQ
HhEl
aKFfIK
igLdyD
zSpveHaUJGQ
FYdGRxPbvB
mQtxxyZ
QKlqaXqSaQWx
lCvQjGnTIp
JscMXgRuO
cnsjI
XvPRiYXgaP
hbupW
dVMt
eMfCJWbzZK
GxSEEQMC
kiPscWfV
vRvVTBh
HOKObYUts
roNjoV
sdXxUsZ
SUXLh
LjaZhkELyZnO
ogcwPpHE
fhlF
qYdKaNctddE
AkXxO
motyCJJ
WfKnD
WjopxYXFTp
MCDnwHG
TMbVFIhirF
lPqJnDyhRyDv
GHlC
uuCaqLkFI
BXSyenWZhl
MTjEI
snms
oKzWJkmaIp
eOzkewR
zILstdMVLmNz
hEijsDHaDd
VyIDkugLgUx
Hgnyx
YjdVfk
gaOEhJ
SebepWociR
qNYMz
搜索
查看: 63773|回复: 414

[已解决] {附中文翻译!!!}完美解决SNB核显HD3000QE/CI花屏、巨卡问题!自定义FB接口   [复制链接]

Rank: 5Rank: 5Rank: 5

UID
1635958
帖子
929
PB币
5026
贡献
0
技术
20
活跃
64
发表于 2011-7-20 16:30:47 IP属地海南
快御云安全
本帖最后由 媛懒如此 于 2012-5-28 13:45 编辑

Customize interface of AppleIntelSNBGraphicsFB.kext,make your HD3000 perfect!

Some prerequisites:
  • Installation of OSX Developer tools (if you need to lookup a PlatformInformationList that has not already been done by someone else)
  • Understanding of hex editing
  • Ability to troubleshoot by looking at ioregistry
As of the 10.7 developer preview code, the intel driver uses Smboardproduct (aka board-id in the ioregistry) to determine the display connectors that are available via the Intel HD 3000 graphics hardware. Actually there's also AAPL,snb-platform-id in the ioregistry that achieves the same result, but I'm going to ignore that for now.

Older code (10.6 including the 2011 MBP sandy bridge update) seems to strictly rely upon the os-info ioregistry entry for this information. I have not, and probably won't, look into editing os-info to change connector information.

With a 10.7 based version of AppleIntelSNBGraphicsFB.kext, the code uses the board-id as an index into the PlatformInformationList[] table. This table is pretty handy, and looks like:
CODE
/* 12 byte connectorinfo */
typedef struct {
       char byte0;
       char byte1; /* i2cid? */
       char unused[2];
       uint32       connectortype;    /* The connector type, see below */
       char byte[4];
} connectorinfo_t;

/* 60 byte total */
typedef struct {
    char byte0; /* Presence? */
    char byte1; /* For display pipe max connector index? */
    char byte2; /* Usable Connector count */
    char byte3; /* Appears unused */
    char byte[8];
    connectorinfo_t connectors[4];
} PlatformInformationList_type;

PlatformInformationList_type PlatformInformationList[8];

where integers are represented in intel little-endian byte order, and bit 0 is the LSB.
In English, there are 8 tables in the list, each 60 bytes long. Each 60 byte table entry starts with a 12 byte header, followed by 4 connector information blocks. The connector information blocks are each 12 bytes long.

The connectorytype field appears to use the same codes as the ATI driver, where the only used values used by the driver thus far are:

#define CONNECTORTYPE_LVDS 0x00000002 /* Ie internal Low Voltage display, such as laptop */
#define CONNECTORTYPE_DP 0x00000400 /* Displayport */
#define CONNECTORTYPE_HDMI 0x00000800

If you don't set your board-id to a recognized value, a default connector table is instead taken from the address PlatformInformationDefault. THe default table only has 1 usable connector so this is likely to give you reduced functionality.

Setting SMboardproduct to various sandy bridge board-ids defines the index into PlatformInformationList[]. Interestingly only indexes 0 thru 5 are currently allowed (even though there are two more table entries...) In any case, for the purpose of this note, we'll use index 0 by setting the board-id to the MacBookPro8,1 value. In smbios.plist: CODE
        <key>SMboardproduct</key>
        <string>Mac-94245B3640C91C81</string>


Unfortunately all 8 table entries use an LVDS connector for the first value, and the driver seems to malfunction if you have nothing plugged into this port. In my case I would see the kernel log fill up with errors about a stuck ring:
CODE
kernel[0]: WaitForStamp: Overflowed waiting for stamp 0x2f3 on Main ring: called from
...
kernel[0]: Looks like Main ring is stuck waiting on an event
kernel[0]: After attempt to clear wait condition = 0x00003001 no longer waiting
And it would get re-stuck every 5 seconds or so. More importantly this would make the graphics unusably slow unless I unplugged the display for > 5 seconds first. At that point the stuck ring problem would "heal"... Using a dual-head setup also seems to avoid this problem.

However, rather than hot-plugging the graphics display upon every boot, one can instead modify the above table to avoid this problem.

First we find the PlatformInformationList table. In the example below I'm using DP4:
CODE
% cd /System/Library/Extensions/AppleIntelSNBGraphicsFB.kext/Contents/MacOS
% nm -arch x86_64 AppleIntelSNBGraphicsFB | grep 'D _PlatformInformationList'
00000000000295f0 D _PlatformInformationList
% lipo -detailed_info AppleIntelSNBGraphicsFB
Fat header in: AppleIntelSNBGraphicsFB
fat_magic 0xcafebabe
nfat_arch 2
architecture x86_64
    cputype CPU_TYPE_X86_64
    cpusubtype CPU_SUBTYPE_X86_64_ALL
    offset 4096
    size 283008
    align 2^12 (4096)
architecture i386
    cputype CPU_TYPE_I386
    cpusubtype CPU_SUBTYPE_I386_ALL
    offset 290816
    size 293092
    align 2^12 (4096)
%
So now we know the disk address for this table is:
0x295f0+4096=173552
Since there are 8 tables of 60 bytes, we could dump 8*60=480 bytes to see all 8 tables. Since I've chosen to work on the first entry, I'll dump just 60 bytes.
ALso since each connector is 12 bytes, I dump 12 bytes per line for our viewing pleasure.
CODE
% dd if=AppleIntelSNBGraphicsFB of=/tmp/table bs=1 skip=173552 count=60
60+0 records in
60+0 records out
60 bytes transferred in 0.000142 secs (422955 bytes/sec)
% cd /tmp
% xxd -c 12 < table > hex
% cat hex
0000000: 0102 0400 1007 0000 1007 0000  ............
000000c: 0503 0000 0200 0000 3000 0000  .............
0000018: 0205 0000 0004 0000 0700 0000  ............
0000024: 0304 0000 0004 0000 0900 0000  ............
0000030: 0406 0000 0004 0000 0900 0000  ............
%

In the above table you can see that 4 connectors are marked usable, 1 LVDS and 3 DP. On my h67 motherboard, I have 4 connectors: VGA, DVI, DP and HDMI. The DVI, DP and HDMI connectors all work with the DP connectortype shown in this table (the intel driver doesn't seem to use the connectortype for much).

I believe I can tell which of the above entries match my hardware by checking which entry has av-signal-type set, (or when AAPL,DisplayPipe != 0xffff?). I certainly can by exhausting testing of the combinations...

Now, to remove the problematic LVDS entry, I edit the hex file, producing:
CODE
0000000: 0102 0300 1007 0000 1007 0000  ............
000000c: 0304 0000 0004 0000 0900 0000  ............
0000018: 0205 0000 0004 0000 0700 0000  ............
0000024: 0406 0000 0004 0000 0900 0000  ............
0000030: 0000 0000 0000 0000 0000 0000  ............

In the above I moved the hex from the 3rd connector (row 4) to the first (row 2), zeroed the hex in row 5, and subtracted 1 from the connector count in row 0.

Now I write back the result:
CODE
xxd -c 12 -r hex >! table
% dd if=table of=/System/Library/Extensions/AppleIntelSNBGraphicsFB.kext/Contents/MacOS/AppleIntelSNBGraphicsFB bs=1 seek=173552 conv=notrunc
% touch /System/Library/Extensions

Viola, 3 working connectors and no driver hangs, instead of 1 broken connector & 3 working connectors with driver hangs.














引用drpc  特别感谢ps3bbs朋友


cd /System/Library/Extensions/AppleIntelSNBGraphicsFB.kext/Contents/MacOS

nm -arch x86_64 AppleIntelSNBGraphicsFB | grep 'D _PlatformInformationList'
会有一个数字反馈过来,比如我的就是0000000000029600 D _PlatformInformationList 这里标记为0x29600


bash-3.2# lipo -detailed_info AppleIntelSNBGraphicsFB 会得到
Fat header in: AppleIntelSNBGraphicsFB
fat_magic 0xcafebabenfat_arch 2
architecture x86_64   
cputype CPU_TYPE_X86_64   
cpusubtype CPU_SUBTYPE_X86_64_ALL   
offset 4096  
size 283552   
align 2^12 (4096)
architecture i386   
cputype CPU_TYPE_I386   
cpusubtype CPU_SUBTYPE_I386_ALL   
offset 290816  
  size 294736  
align 2^12 (4096)

这里根据你自己的内核是32还是64 去用上面的0x29600+ offset值 比如64内核就是0x29600+4096(这里4096转16进制是0x1000,打开计算器 0x29600+0x1000=0x2a600 转换为10进制就是 173568 记住这个数值

dd if=AppleIntelSNBGraphicsFB of=/tmp/table bs=1 skip=173568 count=60



然后进入TMP
cd /tmp

xxd -c 12 < table > hex

cat hex

你会得到类似下面的数值

0000000: 0000 851e 0000 0f01 0000 d6bd  ............

000000c: 0000 0000 0000 af1e 0000 0f01  ...........
0000018: 0000 c2c0 0000 0000 0000 dc1e  ............
0000024: 0000 0f01 0000 bcc0 0100 0000  ............
0000030: 0000 201f 0000 0f01 0000 eeaf  .. .........

第一行忽略, 第2345行分别对应VGA DVI HDMI DP把你要用的比如DVI (第3行)挪到第2行 下面的依次上提,然后第5行填满0  0000 0000 0000 0000 0000 是这样子的.

xxd -c 12 -r hex >! table

dd if=table of=/System/Library/Extensions/AppleIntelSNBGraphicsFB.kext/Contents/MacOS/AppleIntelSNBGraphicsFB bs=1 seek=173586 conv=notrunc

touch /System/Library/Extensions

重启
AppleIntelSNBGraphicsFB.kext.zip (218.1 KB, 下载次数: 2338)



1

查看全部评分

Rank: 5Rank: 5Rank: 5

UID
1635958
帖子
929
PB币
5026
贡献
0
技术
20
活跃
64
发表于 2011-7-20 16:31:37 IP属地海南
anks for bcc9. i got my DVI work :P
------------------------------------------------------------------------------------------------------------------
Last login: Tue Jul 19 13:52:16 on console
188:~ ye$ cd /System/Library/Extensions/AppleIntelSNBGraphicsFB.kext/Contents/MacOS
188:MacOS ye$ nm -arch x86_64 AppleIntelSNBGraphicsFB | grep 'D _PlatformInformationList'
0000000000029600 D _PlatformInformationList
188:MacOS ye$ lipo -detailed_info AppleIntelSNBGraphicsFB
Fat header in: AppleIntelSNBGraphicsFB
fat_magic 0xcafebabe
nfat_arch 2
architecture x86_64
    cputype CPU_TYPE_X86_64
    cpusubtype CPU_SUBTYPE_X86_64_ALL
    offset 4096
    size 283552
    align 2^12 (4096)
architecture i386
    cputype CPU_TYPE_I386
    cpusubtype CPU_SUBTYPE_I386_ALL
    offset 290816
    size 294736
    align 2^12 (4096)
188:MacOS ye$ /code]

So i got the disk address is 0x29600+4096=173568.

let's go on
188:MacOS ye$ dd if=AppleIntelSNBGraphicsFB of=/tmp/table bs=1 skip=173568 count=60
60+0 records in
60+0 records out
60 bytes transferred in 0.000395 secs (151876 bytes/sec)
188:MacOS ye$ cd /tmp
188:tmp ye$ xxd -c 12 < table > hex
188:tmp ye$ cat hex
0000000: 0102 0300 1007 0000 1007 0000  ............
000000c: 0205 0000 0004 0000 0700 0000  ............
0000018: 0304 0000 0004 0000 0900 0000  ............
0000024: 0406 0000 0004 0000 0900 0000  ............
0000030: 0000 0000 0000 0000 0000 0000  ............

BY THE WAY, the code above had been edited, i want 0205 (DVI)work, so i should put it in row2, right?

xxd -c 12 -r hex >! table
% dd if=table of=/System/Library/Extensions/AppleIntelSNBGraphicsFB.kext/Contents/MacOS/AppleIntelSNBGraphicsFB bs=1 seek=173568 conv=notrunc

here i got the information

60+0 records
60+0 records out

and
% touch /System/Library/Extensions  it show me need permission, so i put sudo touch /System/Library/Extensions

ok, here we go..

点评

媛懒如此  看你很久没来,就自作主张把值173586改正啦,望你见谅.。。  发表于 2012-5-28 13:47 IP属地福建
奇士茄  评分看不出来.... “0x29600+0x1000=0x2a600 转换为10进制就是 173586”这个是错的,应该是173568,楼主第一个帖子按173586的后面的数据都错了,第二个帖子贴对的,希望能把第一贴改过来,以免误导  发表于 2011-8-15 16:22 IP属地未知
z6will  最讨厌拿别人的东西却不事先声明,这种行为过分一点可称之为盗窃  发表于 2011-8-14 12:04 IP属地未知
crazybirdy  原文来源.. http://www.insanelymac.com/forum/index.php?showtopic=259705  发表于 2011-7-20 17:54 IP属地未知

Rank: 1

UID
1773146
帖子
51
PB币
126
贡献
0
技术
0
活跃
5
发表于 2011-7-20 17:33:34 IP属地未知
能不能上中文教程

点评

kono77  这不是有中文了吗  发表于 2011-9-28 19:41 IP属地湖北

Rank: 1

UID
1851533
帖子
67
PB币
23
贡献
0
技术
3
活跃
1
发表于 2011-7-20 17:47:50 IP属地北京
这就是我们的救星呀

Rank: 2Rank: 2

UID
38425
帖子
436
PB币
6807
贡献
0
技术
40
活跃
609

7周年庆典勋章

发表于 2011-7-20 17:49:56 IP属地山西
好消息,支持

Rank: 1

UID
472185
帖子
107
PB币
501
贡献
0
技术
0
活跃
463
发表于 2011-7-20 19:02:54 IP属地浙江
全是英文

墙头草

Rank: 7Rank: 7Rank: 7

UID
593905
帖子
1651
PB币
1609
贡献
0
技术
1
活跃
1113
发表于 2011-7-20 19:16:48 IP属地山东
1代用户表示,嫉妒羡慕恨。。。。。

Rank: 1

UID
757743
帖子
48
PB币
274
贡献
0
技术
0
活跃
46
发表于 2011-7-20 19:23:57 IP属地北京
杯具啊 我的装不了啊

Rank: 2Rank: 2

UID
1779220
帖子
259
PB币
250
贡献
0
技术
3
活跃
43
发表于 2011-7-20 19:42:19 IP属地河北
有改好的驱动
就好了

Rank: 5Rank: 5Rank: 5

UID
497378
帖子
648
PB币
187
贡献
0
技术
6
活跃
430
发表于 2011-7-20 20:09:45 IP属地广东
谢谢楼主,这个非常有用~

爱折腾的技术宅一只

Rank: 20Rank: 20Rank: 20Rank: 20

UID
441340
帖子
77571
PB币
24788
贡献
0
技术
0
活跃
195

7周年庆典勋章 I'm Windows Phone用户 水神勋章 8周年庆典勋章

发表于 2011-7-20 21:07:22 IP属地江苏
OPTIMUS蛋疼中~~~

Rank: 5Rank: 5Rank: 5

UID
1635958
帖子
929
PB币
5026
贡献
0
技术
20
活跃
64
发表于 2011-7-20 21:35:29 IP属地海南
回复 jscostboy 的帖子

哪段不懂  不想一一翻译了

Rank: 5Rank: 5Rank: 5

UID
1635958
帖子
929
PB币
5026
贡献
0
技术
20
活跃
64
发表于 2011-7-20 21:35:51 IP属地海南
回复 rocknie2010 的帖子

哈哈  谢谢

Rank: 5Rank: 5Rank: 5

UID
1635958
帖子
929
PB币
5026
贡献
0
技术
20
活跃
64
发表于 2011-7-20 21:36:13 IP属地海南
回复 studyggm 的帖子

谢谢  咱们老朋友了~

Rank: 5Rank: 5Rank: 5

UID
1635958
帖子
929
PB币
5026
贡献
0
技术
20
活跃
64
发表于 2011-7-20 21:38:41 IP属地海南
回复 ps3bbs 的帖子

抱歉  可能你还没看懂  想驱动HD3000  每个机子不一样的

Rank: 5Rank: 5Rank: 5

UID
1635958
帖子
929
PB币
5026
贡献
0
技术
20
活跃
64
发表于 2011-7-20 21:39:33 IP属地海南
回复 黄淮海 的帖子

你显卡成功了吗

Rank: 5Rank: 5Rank: 5

UID
1635958
帖子
929
PB币
5026
贡献
0
技术
20
活跃
64
发表于 2011-7-20 21:40:04 IP属地海南
回复 sofish 的帖子

谢谢支持

Rank: 5Rank: 5Rank: 5

UID
1635958
帖子
929
PB币
5026
贡献
0
技术
20
活跃
64
发表于 2011-7-20 21:40:24 IP属地海南
回复 pdspengfei 的帖子

请问你配置是。。。

Rank: 5Rank: 5Rank: 5

UID
1635958
帖子
929
PB币
5026
贡献
0
技术
20
活跃
64
发表于 2011-7-20 21:40:59 IP属地海南
回复 pdspengfei 的帖子

请问你配置是。。。

Rank: 5Rank: 5Rank: 5

UID
1635958
帖子
929
PB币
5026
贡献
0
技术
20
活跃
64
发表于 2011-7-20 21:42:16 IP属地海南
回复 benchi6000 的帖子

额  各有所长  哈哈  I3 530可是Imac  直接用过的CPU    SNB就不行了   还得降频
回顶部
Copyright (C) 2005-2024 pcbeta.com, All rights reserved
Powered by Discuz!  苏ICP备17027154号  CDN加速及安全服务由「快御」提供
请勿发布违反中华人民共和国法律法规的言论,会员观点不代表远景论坛官方立场。
远景在线 | 远景论坛 | 苹果论坛 | Win11论坛 | Win10论坛 | Win8论坛 | Win7论坛 | WP论坛 | Office论坛