user_hostile Posted August 17, 2012 Share Posted August 17, 2012 Sorry if it shows my utter ignorance on the subject, but the ssse3 instructions emulator must necessarily be written in assembly? A high level language, (aka as an HLL, e. g., C, Java, etc.) can be thought of as the Sargent who orders a private to dig the trenches. Assembly language can be thought of as the private who actually does the digging. In other words, assembly language is closer to the actual machine language that the processor uses than the HLL. In the early days of compiler design, not much effort was put into creating the most efficient implementation of an algorithm, and higher compiled languages typically ran slower then they should. In those cases where you needed responsive code (say communications on a PC), assembly language was used instead. It's also very tedious to write and rather boring, because one HLL statement can involve from as few as one (shift) to a as many as several hundred (so I was told, other's can correct me). (I recall that OS2 v2.0 was written in assembly! Which was the only way they could ensure a GUI worked responsively on a 80286 at the time; check out MS Windows for 286 and you will understand why.) Since then, compilers have come a long way in implementing clever short-cuts in code. Nowadays, there's very little to be gained to the point that you'd be challenged to write an assembly level version. But when new instruction come out, there's a learning curve involved with implementing them in an efficient manner in a compiler. Hence, we're better off writing at the assembly language level. From what little I see on wikipedia, I note that there are 16 discrete instructions for SSSE3. Presuming the various different kinds of execution for each instruction, we're looking at a lot of assembly instructions. The other problem is that fact that the hardware that can't be use the SSSE3 instruction is now obsolete. As time goes on, more folks will upgrade to hardware and the demand incentive to emulate SSSE3 will fade away. Unless there's a concerted effort by folks on this and other boards to make the patch for a working 64-bit 10.7 and beyond using AMD's sans SSSE3 will be gone by the end of the year. At least that's my take on it, YMMV. 2 Link to comment Share on other sites More sharing options...
PookyMacMan Posted August 17, 2012 Share Posted August 17, 2012 Sorry if it shows my utter ignorance on the subject, but the ssse3 instructions emulator must necessarily be written in assembly? To add to user_hostile's point, an SSSE3 emulator is unnecessary. With the old SSE3 emulator in years past, that was necessary because the kernel and many applications (and Rosetta) used SSE3. Here with SSSE3, the instructions (AFAIK) are only in the kernel and not in applications; therefore an on-the-fly dynamic emulator is not needed, but rather some brilliant mind needs to translate the SSSE3 instructions to SSE3 so it is a static (doesn't change) translation. 1 Link to comment Share on other sites More sharing options...
theconnactic Posted August 18, 2012 Share Posted August 18, 2012 Is there somewhere a starter guide for devs in AMD assembly (or x86 assembly, if it's not any difference)? No, just kidding: i have barely basic knowledge of c-type languages and unfortunately don't have the time and skills necessary to do the task. Let's hope for something from Nawcom, if he's really better from his health issues, or for some undiscovered pro-AMD talented person to show up. Link to comment Share on other sites More sharing options...
user_hostile Posted August 18, 2012 Share Posted August 18, 2012 To add to user_hostile's point, an SSSE3 emulator is unnecessary. With the old SSE3 emulator in years past, that was necessary because the kernel and many applications (and Rosetta) used SSE3. Here with SSSE3, the instructions (AFAIK) are only in the kernel and not in applications; therefore an on-the-fly dynamic emulator is not needed, but rather some brilliant mind needs to translate the SSSE3 instructions to SSE3 so it is a static (doesn't change) translation. And you fought my ignorance. So if I understand this problem, it's matter of taking the source code of the kernal, compiling it into assembly, doing a search for the instruction, swapping it out with a macro, and living happily ever after, right? I'm only trying to understand the scale of the work involved here (the SSSE3 to SSE3 conversion is a separate issue) 1 Link to comment Share on other sites More sharing options...
PookyMacMan Posted August 18, 2012 Share Posted August 18, 2012 Is there somewhere a starter guide for devs in AMD assembly (or x86 assembly, if it's not any difference)? No, just kidding: i have barely basic knowledge of c-type languages and unfortunately don't have the time and skills necessary to do the task. Let's hope for something from Nawcom, if he's really better from his health issues, or for some undiscovered pro-AMD talented person to show up. Haha actually there are good Assembly guides out there; it's not the most complex language! Yeah, nawcom healthwise is doing great, haven't seen any activity on his blog in a while though. He's still on irc.osx86.hu, which is a good sign. And you fought my ignorance. So if I understand this problem, it's matter of taking the source code of the kernal, compiling it into assembly, doing a search for the instruction, swapping it out with a macro, and living happily ever after, right? I'm only trying to understand the scale of the work involved here (the SSSE3 to SSE3 conversion is a separate issue) Very close. Basically in the kernel source there are a bunch of C headers and C files, along with Assembly files for certain kernel instructions. So basically one goes into the source, modifies the Assembly files as needed, and compiles. 1 Link to comment Share on other sites More sharing options...
theconnactic Posted August 22, 2012 Share Posted August 22, 2012 It just has come to my mind: we have patches for AMD, made by bronzovka and rawx86. Using some text tool, can't we just separate the specific AMD instructions by comparing with the vanilla source and then apply them to the Mountain Lion source? Or even better, following and useful advice from Meklort, apply them as a binary patch to the Mountain Lion binary? It would be possible to test it? If yes, i'm willing to do it and make the experiment. Can someone point me to some text tool that make possible to compare and extract the differences between two texts (these would be the patched kernel and the vanilla kernel) saving me the time to do it by eye, so i can re-patch it and compile it for mountain lion instead? Can someone explain me what tools and procedures do i use to apply a binary patch to the binary kernel? Link to comment Share on other sites More sharing options...
shawnanastasio Posted August 23, 2012 Share Posted August 23, 2012 I thought the same thing theconnactic, however I soon realized that Mountain Lion is 100% 64-bit ONLY, so if this did work, only those with AMD Bulldozer cpus with SSSE3 would be able to actually start the OS. We need those SSSE3 > SSE3 Translations! (But no rush, i'm fine on ubuntu until i can get a modern version of OS X on this computer) 1 Link to comment Share on other sites More sharing options...
theconnactic Posted August 25, 2012 Share Posted August 25, 2012 I'm running Lion 10.7.4 and, as i said, it runs just fine on my PC. But 32-bit only, so no Finder and other 64-bit apps (even my CPU being a 64-bit capable CPU; ssse3 is crucial for Lion to support 64-bit apps on 32-bit mode). With Mountain-Lion, as you said, we'll definitely need a ssse3 emulator for non-FX CPUs, but even that won't be enough: until now, we couldn't get a Lion 64-bit kernel to work on AMD CPUs, even Buldozer ones; the maximum we got was 64-bit app support, only on Buldozer CPUs. To run Mountain Lion, we've got to do better than that: we'll need a 64-bit kernel and the ssse3 emulator (a static one, easier than the previous on the fly sse3 emulator, but still no easy a task) for the non-FX CPUs. So the road ahead has a lot of pitfalls. Link to comment Share on other sites More sharing options...
theconnactic Posted August 30, 2012 Share Posted August 30, 2012 Haha actually there are good Assembly guides out there; it's not the most complex language! Could you give me the directions to one that's available on the internet for free download? Yeah, nawcom healthwise is doing great, haven't seen any activity on his blog in a while though. He's still on irc.osx86.hu, which is a good sign. Glad to hear that! So he abandoned AMD hackintoshing altogether? Very close. Basically in the kernel source there are a bunch of C headers and C files, along with Assembly files for certain kernel instructions. So basically one goes into the source, modifies the Assembly files as needed, and compiles. Do you have an idea of what have i to look for in order to adapt the XNU kernel to run on AMD machines? As for the ssse3 emulator, has it to be written in assembly? Do you have, or do you know where do i find a copy of the source of the old sse3 emulator (which would serve as a good example of how to start an emulator for ssse3)? Link to comment Share on other sites More sharing options...
PookyMacMan Posted August 31, 2012 Share Posted August 31, 2012 Could you give me the directions to one that's available on the internet for free download? Try a few of the following: 1. http://www.drpaulcarter.com/pcasm/ 2. http://www.friedspace.com/assembly/intro.php 3. http://savannah.nongnu.org/projects/pgubook/ (hit the Downloads link to download it) Glad to hear that! So he abandoned AMD hackintoshing altogether? No, it's just that his AMD machine broke and he didn't have the money for a new one; last I heard he was trying to scrape enough together for a cheap AMD build... Do you have an idea of what have i to look for in order to adapt the XNU kernel to run on AMD machines? As for the ssse3 emulator, has it to be written in assembly? Do you have, or do you know where do i find a copy of the source of the old sse3 emulator (which would serve as a good example of how to start an emulator for ssse3)? Yes; all you have to do is edit the assembly files in the source, which are labeled with a .s extension. One example is bcopy.s. Just look for .s files in the XNU source. And, I believe I said this before, but you do not need to write an SSSE3 emulator! All you need to do is edit all the .s files, change SSSE3 calls to SSE3, and that should do the trick. An emulator is not necessary at all; it would be extra and unneeded work. Just translate the SSSE3 calls to SSE3 and see how it rolls. 1 Link to comment Share on other sites More sharing options...
theconnactic Posted August 31, 2012 Share Posted August 31, 2012 Thank you, Pooky! This is quite valuable information! So this ssse3 calls are found always inside the assembly code, right? Or could some of them have been written in c? If it's the case, do you know the appearance that a ssse3 call statement would have in c? I'm planning to make some experiences with the latest Mountain Lion and the Lion XNU kernel, keeping in mind your suggestions about simply changing ssse3 calls to sse3 calls, as soon as i gain some fluence in assembly coding. Or, if it's possible to be done in c, i can do it tonight. Link to comment Share on other sites More sharing options...
PookyMacMan Posted August 31, 2012 Share Posted August 31, 2012 It's only in Assembly. No C files contain it. Link to comment Share on other sites More sharing options...
theconnactic Posted August 31, 2012 Share Posted August 31, 2012 So it's time to learn (assembly), then to play. Link to comment Share on other sites More sharing options...
Lordadmiral Drake Posted September 1, 2012 Share Posted September 1, 2012 Tried to get lion running on my AMD laptop using v6 kernel But system never manages to boot I get errors that IOStorageFamily.kext is not found, followed by Still waiting for root device CPU is AMD Athlon X2 QL-65 SB is AMD SB700 Link to comment Share on other sites More sharing options...
theconnactic Posted September 1, 2012 Share Posted September 1, 2012 You must set your SATA mode as AHCI in the BIOS. Did you do that? In addition, you should try RAW's kernel (http://osx86.co/f100/10-7-4-amd-kernel-t7687/page1.html), since it's the most stable yet for AMD machines, specially if you plan to run the latest iteration of Lion, 10.7.4. Link to comment Share on other sites More sharing options...
Lordadmiral Drake Posted September 2, 2012 Share Posted September 2, 2012 SATA is set as AHCI, can't change that in this crippled InsydeH2O setup utility anyway. Copied that linked kernel into root now and testing that EDIT: Put in new kernel and IOStorageFamily.kext from 10.7.3 This got me rid of lots of errors, but Still waiting for root device still persists Link to comment Share on other sites More sharing options...
theconnactic Posted September 3, 2012 Share Posted September 3, 2012 Are you sure SATA is set to AHCI? Which method did you use to install OSX? Link to comment Share on other sites More sharing options...
Lordadmiral Drake Posted September 3, 2012 Share Posted September 3, 2012 I copied my existing OS X 10.7.4 installation to the laptop harddrive using CCC. Yes I'm sure. I can't check in BIOS because these options are not available but I checked under windows with device manager I also installed AppleATIATA.kext Link to comment Share on other sites More sharing options...
theconnactic Posted September 3, 2012 Share Posted September 3, 2012 Is your SATA controller an ATI one? If not, it won't work. You said you used CCC, huh? I have my doubts about the capability of CCC to make a bootable hackintosh HD clone. Maybe you solve this issue by reinstalling chameleon (use the one from Mountain Lion installation topics). Link to comment Share on other sites More sharing options...
Lordadmiral Drake Posted September 4, 2012 Share Posted September 4, 2012 I did reinstall Chameleon (latest version). Laptop HDDs are attached to and ATI SB700 southbridge Link to comment Share on other sites More sharing options...
theconnactic Posted September 4, 2012 Share Posted September 4, 2012 My best advice is that you wipe your installation out and start all over again, using devout's method ([AMD] 10.7.3 Guide - Experimental Only - InsanelyMac Forum), that worked like a charm for me. Since you already have an OSX installation, you won't lose anything: when everything is up and running, you connect your other HD, the one from which you made your cloning in the first place, then you use OSX's Migration Tools to import your settings, programs etc. (but after use it, don't forget to check if it don't messed with your kernel before you restart your machine.) If you don't want to resort to such drastic measures, i think some of this solutions are a bit outdated, but maybe you want to try (one of) them: http://www.ihackinto...or-root-device/ http://apple2pc.blog...oot-device.html http://osx86.co/f85/...1467/page3.html Please report back, for us to know what worked in the end. Link to comment Share on other sites More sharing options...
Lordadmiral Drake Posted September 5, 2012 Share Posted September 5, 2012 I just noticed that AppleATIATA.kext does not contain device ID of my laptops SATA controller. Patching that now and then trying out if helped Edit: Didn't work. Found out that AppleATIATA.kext requires SATA ports to be in IDE mode. Which is impossible because my BIOS setup lacks that option Link to comment Share on other sites More sharing options...
Lordadmiral Drake Posted September 10, 2012 Share Posted September 10, 2012 Here's what I tried in the meantime: Downloaded Niresh v2 10.7.3 and burned iso to disc: Doesn't even load Chameleon bootloader, stuck at blinking underscore Install ATI and AHCI packages from Niresh iso to laptop HDD using existing hackintosh and USB 3.0 to SATA adapter: Didn't do anything Install SuperVIAATA package from Niresh iso (also contains my SATA-controllers ID (0x43911002)) to laptop HDD: localhost kernel[0]: kxld[com.c0rk007hck.SuperVIAATA]: The Mach-O file is malformed: Invalid magic number: 0xfeedfacf. localhost kernel[0]: Can't load kext com.c0rk007hck.SuperVIAATA - link failed. localhost kernel[0]: Failed to load executable for kext com.c0rk007hck.SuperVIAATA. localhost kernel[0]: Kext com.c0rk007hck.SuperVIAATA failed to load (0xdc008016). localhost kernel[0]: Failed to load kext com.c0rk007hck.Super Link to comment Share on other sites More sharing options...
Recommended Posts