well, good news, booted with display connected only to posted card, then, when gui appeared, conencted monitor to unposted card and voila
Graphics/Displays:
ATI Radeon HD 2600 XT:
Chipset Model: ATI Radeon HD 2600
Type: Display
Bus: PCIe
Slot: Slot-1
PCIe Lane Width: x4
VRAM (Total): 256 MB
Vendor: ATI (0x1002)
Device ID: 0x9588
Revision ID: 0x0000
ROM Revision: 113-B1480A-236
EFI Driver Version: 01.00.236
Displays:
SyncMaster:
Resolution: 1680 x 1050 @ 60 Hz
Depth: 32-bit Color
Core Image: Hardware Accelerated
Mirror: Off
Online: Yes
Quartz Extreme: Supported
Rotation: Supported
Display Connector:
Status: No display connected
ATI Radeon HD 4850:
Chipset Model: ATI Radeon HD 4850
Type: Display
Bus: PCIe
Slot: Slot-1
PCIe Lane Width: x16
VRAM (Total): 512 MB
Vendor: ATI (0x1002)
Device ID: 0x9442
Revision ID: 0x0000
ROM Revision: 113-B1480A-236
EFI Driver Version: 01.00.236
Displays:
SyncMaster:
Resolution: 1680 x 1050 @ 60 Hz
Depth: 32-bit Color
Core Image: Hardware Accelerated
Main Display: Yes
Mirror: Off
Online: Yes
Quartz Extreme: Supported
Rotation: Supported
Display Connector:
Status: No display connected
http://img509.images...cardworking.png
now need to make it all automatic.
122 replies to this topic
#61
Posted 18 April 2009 - 02:40 PM
#62
Posted 18 April 2009 - 03:45 PM
if anyone wanna test, here it is http://rapidshare.de...al.tar.bz2.html
add your bios dump(of unposted carf) into natit as ATY,bin_image key, for your card section, atm it has bioses of 4850/4870/2600xt
add device-id of unposted card to ATY_Init.kext plist (replace 95881002 there)
boot single user, kextload natit
kextlaod aty_init
kextunload aty_init
exit
p.s. dont install aty_init to /S/L/E or /Extra , it has to be unloaded before continuing
Unposted card is the card which is not set as inital graphics port, the card which displays nothing on boot.
add your bios dump(of unposted carf) into natit as ATY,bin_image key, for your card section, atm it has bioses of 4850/4870/2600xt
add device-id of unposted card to ATY_Init.kext plist (replace 95881002 there)
boot single user, kextload natit
kextlaod aty_init
kextunload aty_init
exit
p.s. dont install aty_init to /S/L/E or /Extra , it has to be unloaded before continuing
Unposted card is the card which is not set as inital graphics port, the card which displays nothing on boot.
#63
Posted 18 April 2009 - 04:09 PM
netkas, on Apr 18 2009, 10:45 AM, said:
if anyone wanna test, here it is add device-id of unposted card to ATY_Init.kext plist (replace 95881002 there)
Since your inbox is full, I reply your message here:
Quote
u have any idea why problems happen when aty_init wasnt unloaded and osx drivers alrady loaded ?
Quote
I made kext to set AAPL,card_posted=1 key for card , if asic_init was succesfull, and on start , kext checks if AAPL,card_posted =0 or not present, then it calls asic_init.
#64
Posted 18 April 2009 - 04:41 PM
I'm curious, now that I have working 3d with the drivers that OHAI sent to me for my 4870x2 (pictures to verify will come tomorrow) and working Motmot and Quail, does this mean that using ATY_init could enable the second core on both 4870x2 and 3870x2? This probably wouldn't really benefit people with only 2 DVI ports right now until Apple decides to use some OpenCL or something, but could this enable the other 2 DVI ports on cards with 4 DVI ports? I think with Apple going with OpenCL and multiple GPUs that this could really help.
#65
Posted 18 April 2009 - 06:35 PM
strange thing, when aty_init attaches to more then one device, it says - Map IO memory failed, when tries to run first time, but second time(it happens right after first try) - all is ok, then i unlaod kext and boot, but instead of desktop i get blue screen (and desktop is loaded, i can see via vnc)
now code for that logic i described works too.
black knight, u will need to setup keys for second card too, and aty_init, so it can enable card for using for opencl, in snowleo.
u will need to set AAPL,card_posted=1 key for first(working) chip and AAPL,force_post=1 for second chip.
EDIT:
bad news - it doesnt work if u dont add ur devid into aty_init
good news - got it working without single user mode.(unloading via mach_init.d)
http://rapidshare.de...st.tar.bz2.html
now code for that logic i described works too.
black knight, u will need to setup keys for second card too, and aty_init, so it can enable card for using for opencl, in snowleo.
u will need to set AAPL,card_posted=1 key for first(working) chip and AAPL,force_post=1 for second chip.
EDIT:
bad news - it doesnt work if u dont add ur devid into aty_init
good news - got it working without single user mode.(unloading via mach_init.d)
http://rapidshare.de...st.tar.bz2.html
#66
Posted 19 April 2009 - 12:45 AM
Hehe, ATY,bin_image never really crossed my mind when I posted the source, cause I just have one card on my laptop and it reads my bios from the legacy address. Sorry for that, i guess the IOReg image is better since you can force the second card to initialize with its own atombios.
I was using a windows app the other day, which dumps the EDID from displays, and I saw an interesting thing in it. It scans the all the PCI option roms (we do know where they always reside, and the length is fixed) so i guess we could scan through it the same way, look for vendor 0x1002 and initialize only the card that is NOT in 0xC00000 ? That way we can ensure that we only initialize the second card, even if they are identical! I will start experimenting
EDIT:
We could even use it to initialize three - card configurations (CrossfireX) this way! (I guess...
)
I was using a windows app the other day, which dumps the EDID from displays, and I saw an interesting thing in it. It scans the all the PCI option roms (we do know where they always reside, and the length is fixed) so i guess we could scan through it the same way, look for vendor 0x1002 and initialize only the card that is NOT in 0xC00000 ? That way we can ensure that we only initialize the second card, even if they are identical! I will start experimenting
EDIT:
We could even use it to initialize three - card configurations (CrossfireX) this way! (I guess...
#67
Posted 19 April 2009 - 09:56 AM
when i read expansion rom from pci config space, i get 0x00000000 value ;(
#68
Posted 20 April 2009 - 01:39 PM
got an idea how to detect posted card 
bootloader passes framebuffer start address to kernel
memory regions in IODeviceMemory of card have one region pointing to framebuffer(or whatever ) start.
so, if this two value matches - card was posted.
this worked out
bootloader passes framebuffer start address to kernel
memory regions in IODeviceMemory of card have one region pointing to framebuffer(or whatever ) start.
so, if this two value matches - card was posted.
this worked out
#69
Posted 20 April 2009 - 04:19 PM
here is sources, added iopciclassmatch , so it doesnt attached to hdmi audio.
posted card detection logic described in previous post.
if AAPL,card_posted key set for card, then kext will skip POSTing
if AAPL,force_post key set for card (and AAPL,card_posted isnt set), then kext will force POSTing card (mostly usefull for some debug purposes).
IOProbeScore increased to 65000, if u plan to use natit with it, set IOProbeScore in natit's plist to 65500.
Also kext check if devid of bin_image from ioreg matches card's devid.
Source: attachment.
how to use - install natit into Extra mkext (do u dont need to load it manualy)
boot single user mode, kextload aty_init.kext and kextunload aty_init.kext
type exit, enter.
issues : if aty_init.kext wasnt kextunloaded, gui will not appear, need to find out why or make a workaround.
posted card detection logic described in previous post.
if AAPL,card_posted key set for card, then kext will skip POSTing
if AAPL,force_post key set for card (and AAPL,card_posted isnt set), then kext will force POSTing card (mostly usefull for some debug purposes).
IOProbeScore increased to 65000, if u plan to use natit with it, set IOProbeScore in natit's plist to 65500.
Also kext check if devid of bin_image from ioreg matches card's devid.
Source: attachment.
how to use - install natit into Extra mkext (do u dont need to load it manualy)
boot single user mode, kextload aty_init.kext and kextunload aty_init.kext
type exit, enter.
issues : if aty_init.kext wasnt kextunloaded, gui will not appear, need to find out why or make a workaround.
Attached Files
#70
Posted 20 April 2009 - 04:24 PM
netkas, on Apr 20 2009, 11:19 AM, said:
here is sources, added iopciclassmatch , so it doesnt attached to hdmi audio.
posted card detection logic described in previous post.
if AAPL,card_posted key set for card, then kext will skip POSTing
if AAPL,force_post key set for card (and AAPL,card_posted isnt set), then kext will force POSTing card (mostly usefull for some debug purposes).
IOProbeScore increased to 65000, if u plan to use natit with it, set IOProbeScore in natit's plist to 65500.
Also kext check if devid of bin_image from ioreg matches card's devid.
Source: soon, few things to test.
posted card detection logic described in previous post.
if AAPL,card_posted key set for card, then kext will skip POSTing
if AAPL,force_post key set for card (and AAPL,card_posted isnt set), then kext will force POSTing card (mostly usefull for some debug purposes).
IOProbeScore increased to 65000, if u plan to use natit with it, set IOProbeScore in natit's plist to 65500.
Also kext check if devid of bin_image from ioreg matches card's devid.
Source: soon, few things to test.
#71
Posted 20 April 2009 - 04:50 PM
Hey dong, maybe I found a problem in ur driver,
this
rhdRec.FBbase = (void *)FBmap->getPhysicalAddress()
FBmap->getPhysicalAddress() gives nothing that looks like address of framebuffer, so i had to implement it via IODeviceMemory
look more at sources i posted.
this
rhdRec.FBbase = (void *)FBmap->getPhysicalAddress()
FBmap->getPhysicalAddress() gives nothing that looks like address of framebuffer, so i had to implement it via IODeviceMemory
Quote
if( !( bar[0] = device->getDeviceMemoryWithIndex( 0 ) ) ) {
LOG( "Couldn't map BARi!\n" );
return NULL;
};
if (bar[ 0 ]->getPhysicalAddress() == PE_state.video.v_baseAddr) unposted = false;
LOG( "Couldn't map BARi!\n" );
return NULL;
};
if (bar[ 0 ]->getPhysicalAddress() == PE_state.video.v_baseAddr) unposted = false;
look more at sources i posted.
#72
Posted 20 April 2009 - 05:06 PM
netkas, on Apr 20 2009, 05:50 PM, said:
Hey dong, maybe I found a problem in ur driver,
this
rhdRec.FBbase = (void *)FBmap->getPhysicalAddress()
FBmap->getPhysicalAddress() gives nothing that looks like address of framebuffer, so i had to implement it via IODeviceMemory
look more at sources i posted.
this
rhdRec.FBbase = (void *)FBmap->getPhysicalAddress()
FBmap->getPhysicalAddress() gives nothing that looks like address of framebuffer, so i had to implement it via IODeviceMemory
look more at sources i posted.
this is actually:
rhdRec.FBbase = (void *)FBmap->getVirtualAddress()
was that a typo?
#73
Posted 20 April 2009 - 05:11 PM
what typo?
rhdRec.FBbase has address which doesnt match real framebuffer address.
rhdRec.FBbase has address which doesnt match real framebuffer address.
#74
Posted 20 April 2009 - 05:32 PM
netkas, on Apr 20 2009, 06:11 PM, said:
what typo?
rhdRec.FBbase has address which doesnt match real framebuffer address.
rhdRec.FBbase has address which doesnt match real framebuffer address.
I just compared the sources I have with the ones you posted, I haven't checked if the address that I get is the actual framebuffer address, but I just found a difference and pointed it out.
Your source has
rhdRec.FBbase = (void *)FBmap->getPhysicalAddress();
and mine
rhdRec.FBbase = (void *)FBmap->getVirtualAddress();
#75
Posted 20 April 2009 - 06:29 PM
ah well... anyway it has wrong values, with virtual too
#76
Posted 20 April 2009 - 07:19 PM
netkas, on Apr 20 2009, 01:29 PM, said:
ah well... anyway it has wrong values, with virtual too 
This is interesting. It looks like you need "WithRegister" to get correct IO memory map, but "WithIndex" to get correct FB memory map. For my x1400, "WithIndex" works for both IO and FB. Anyway, the FB map base is obviously in fact not needed by rhdAtomInit, thus a wrong value did not cause problems.
I have a question, what are the usage of "device->retain();" and "bar[ 0 ]->retain();" in your code? There is no corresponding "release()", would that be a reason that the kext won't be unloaded automatically?
#77
Posted 20 April 2009 - 08:06 PM
well... that was in code which I used as example of using IODevicememory, bar->retain is useless yeah 
problems with unloading existed before it, it even not unloading problem, the problem is that if X2000 loads durring ATY_init is in memory (maybe not even attached), then OSX cant get to gui
i just checked instances number of aty_init class after kextloading it, it's 0, means kexts unattached from device, but still present in memory. wtf.
problems with unloading existed before it, it even not unloading problem, the problem is that if X2000 loads durring ATY_init is in memory (maybe not even attached), then OSX cant get to gui
i just checked instances number of aty_init class after kextloading it, it's 0, means kexts unattached from device, but still present in memory. wtf.
#78
Posted 20 April 2009 - 09:00 PM
netkas, on Apr 20 2009, 03:06 PM, said:
well... that was in code which I used as example of using IODevicememory, bar->retain is useless yeah
problems with unloading existed before it, it even not unloading problem, the problem is that if X2000 loads durring ATY_init is in memory (maybe not even attached), then OSX cant get to gui
i just checked instances number of aty_init class after kextloading it, it's 0, means kexts unattached from device, but still present in memory. wtf.
problems with unloading existed before it, it even not unloading problem, the problem is that if X2000 loads durring ATY_init is in memory (maybe not even attached), then OSX cant get to gui
i just checked instances number of aty_init class after kextloading it, it's 0, means kexts unattached from device, but still present in memory. wtf.
#79
Posted 20 April 2009 - 09:21 PM
>Did you check the instances number of the provider "device"?
Ahm....how to check ?
Ahm....how to check ?
#80
Posted 20 April 2009 - 10:23 PM
netkas, on Apr 20 2009, 04:21 PM, said:
>Did you check the instances number of the provider "device"?
Ahm....how to check ?
Ahm....how to check ?
type it before and after kextload ATY_Init.kext
and look for the line corresponding to the video card, for me it's like:
| | | +-o VID@0 <class IOPCIDevice, registered, matched, active, busy 0, retain 13>
check how the retain count changes.
You may need release your bar[0] even without retain it. Well, I tested it, still same problem. Even if you load ATY_Init without doing the initialization thing, the gui will be destroyed.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users



Sign In
Create Account










