Jump to content


  • Content count

  • Joined

  • Last visited

About thanoulas

  • Rank
    InsanelyMac Protégé
  1. A couple of pages back, dong posted this decompiled code from the Megalodon Framebuffer OSStatus PCIE_Gen2_Enable(DriverGlobal *aDriverRecPtr) { UInt32 value, value1; pciepw32(aDriverRecPtr, 0xA2, pciepr32(aDriverRecPtr, 0xA2) & ~(1 << 13)); value = pciepr32(aDriverRecPtr, 0xA2); if (value & (1 << 9)) pciepw32(aDriverRecPtr, 0xA2, ((((value | (1 << 10)) & ~7) | ((value & 0x70) >> 4)) | (1 << 8)) & ~(1 << 7)); else pciepw32(aDriverRecPtr, 0xA2, value | (1 << 13)); value = pciepr32(aDriverRecPtr, 0xA4); if ((value & (1 << 23)) && (value & (1 << 24))) { regw32(aDriverRecPtr, 0x5488, regr32(aDriverRecPtr, 5488) & ~(1 << 25)); regw32(aDriverRecPtr, 0x548C, regr32(aDriverRecPtr, 548C) & ~(1 << 28)); regw32(aDriverRecPtr, 0x5404, regr32(aDriverRecPtr, 5404) | (1 << 25)); regw32(aDriverRecPtr, 0x5484, regr32(aDriverRecPtr, 5484) & ~0xF; regw32(aDriverRecPtr, 0x5410, regr32(aDriverRecPtr, 5410) | (1 << 23)); regw32(aDriverRecPtr, 0x548C, regr32(aDriverRecPtr, 548C) & ~0x1E); value = (value | 1) & ~2; value1 = pciepr32(aDriverRecPtr, 0xA1); if (value1 & (1 << 6)) pciepw32(aDriverRecPtr, 0xA1, value1 & ~0x40); pciepw32(aDriverRecPtr, 0xA4, ((((value & ~0x300) | 0x300) & ~0x3C000) & ~0x40) | 0x20); regw32(aDriverRecPtr, 0x541C, regr32(aDriverRecPtr, 541C) | (1 << 3)); regw32(aDriverRecPtr, 0x544C, 8); regw32(aDriverRecPtr, 0x4088, (regr32(aDriverRecPtr, 4088) & ~0xF) | 2); regw32(aDriverRecPtr, 0x544C, 0); } return noErr; } These registers are also visited by ATI_Init, so maybe you could try a stripped down ati_init with only these registers?
  2. 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();
  3. this is actually: rhdRec.FBbase = (void *)FBmap->getVirtualAddress() was that a typo?
  4. 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... )
  5. I changed my code to convert the kext to IOPCIFamily child but i didn't get a kernel panic. The screen changed to the weird state, and after a couple of seconds it restarted on its own.. (I don't really know what happens when IOPCIFamily panics, was this it?) So I added a couple of lines right before the return NULL at the end of the function: device->terminate(); this->terminate(); and tried again. Initializes fine, no kp, and no restart. Ignore this, it does panic. No clue why though.. Why read the option rom header, when we can read the device-id, vendor etc from the actual option rom (ATOMBIOS) that is already loaded in ATY_Init? We can get all the ATi devices through OSx and then compare them against the device-id we read from the atombios. If they don't match, then the card wasn't posted! There you go, this should skip the asicinit function if the deviceID that was read from osx was the same as the one that was read from the bios ATY_Init.zip
  6. ATY_Init was actually created after netkas's request in order to help initialize secondary ati video cards (like on crossfire) because the secondary cards do not POST. I guess it could help to read the connections and the DDC from the bios, but this is based on linux code and the necessary functions are missing. One would have to implement these functions in order to test anything. As far as the project is concerned (which is different from ATY_Init) no news yet. When and IF we have any success, be sure that we'll post about it.
  7. Guys, this is not even close to a driver yet. All it does is that it initialises the ATi cards by reading values from the BIOS. But it's a progress. And keep in mind I did not have anything to do with this, this is all dong's work. If anyone still wants to try this out, build it with xcode, add your deviceID to the plist and load the kext in single user mode. See if it panics for you and report here your card and a log if possible. If all goes well you should see a weird display state. Yeah, that's good. And yeah, that's all it does for now.
  8. Hehheh! Yeap, it worked! No kernel panic, and i got a nice weird display state I never imagined that seeing this would make me happy Considering this a success? I'll post the fixed source here later so everyone can try it with cards other than Mobility HD3650 Here's the Sourcecode. For the record my log shows ASIC_Init Success as in your log dong. If you want the full log I can post it. ATY_Init.zip
  9. I'll check that and report back ASAP
  10. Well I do have another hackbook that I can use to debug the kext with the kernel debug kit. I'll give it a try and tell you what happens. Another interesting (maybe?) thing is that I skipped the 544c offset and now it panics at the exact same address that is next in the Megalodon fb, 0x4088.
  11. Hi there. This is my first post in these forums and i'm really interested in the development of the ATY_HD Framebuffer. I'm a developer myself, so i could lend a hand if you'd like to. Anyway, i've tested out the ATY_Init code in my hackbook with a mobility HD3650 (M86) and I can verify that it panicks. Specifically, kernel panicks in rhd_init.c, function: void _RHDRegWrite(RHDPtr rhdPtr, CARD16 offset, CARD32 value) { *(volatile CARD32 *)((CARD8 *)(rhdPtr->IObase) + offset)) = value; } CARD16 offset was 544c, CARD32 value was 8 _RHDRegRead previously returned 0 for the offset 544c Hope it helps