Jump to content
VirtualGuitarist

MLWrapper: a 64bits wrapper to load incompatible kexts in ML (Exemple code included!)

11 posts in this topic

Recommended Posts

Hello, happy developers! :)

 

I hiope this topic will not be just a waste of time for you, but following this topic and the release by Netkas of a 32 bits ML kernel, came to my mind a strange idea, i''m just a noob but following my message someone encouraged me to submit my idea to Slice, just in case...

 

Here's the message i sent to him, it exposes my idea, but the answer from Slice is far better in the sense in that it opens a practical way to make this simple noob idea an eventual reality, it doesn't implies that Slice is supporting or approve my idea in any way, it just explains things better:

 

Hi!

 

I hope this message will not be a waste of time for you, i would be very sorry about that because i as i said elsewhere i'm really admirative and respectful about the work of developers like you, without humans like you there's simply no osx86 and no community, just a massive bunch of newbies and wannabes that try to convince themselves that they are interesting.... lol!

 

Here is the facts: with the release of ML, a lot of people (including regular apple users) feel angry, frustrated and/or abandoned by apple because their hardware is simply too old or incompatible with the last release. Their hardware are incompatible because the drivers are 32 bits only, or because they have 32 bits efi, etc... As an exemple amongst many, many others you could read this article of blog, it have beaten some records of frequentation since the publication of this tutorial! So my conclusion is that a LOT of people is concerned, not just osx86 community.

 

So here's my idea: instead of creating legacy kernels that will soon be rendered obsolete by future updates (apple says they will release one major update per year!), is it possibe to imagine a 64 bits wrapper, in the form of a generic kext, capable of loading 32 bits (old or incompatible) kexts?

 

What i call a "wrapper" in my noob language could play the role of a proxy between the kernel and an incompatible kext, with it we could be able to load a 32 bit kext in a 64 bit "space".

 

The result could take the form of a kext where we could put our 32 bits kexts inside a folder called, for exemple, "plugins", because in fact the 32 bit kext becomes a plugin of the 64 bit wrapper kext.

 

Here's the post i've written about it, you will see that i'm deeply interested by the subject, because i'm stuck with my incompatible nvidia 7600 gs, so for now there's no way for me to really play with and enjoy ML with QE/CI...

 

I'm just a noob and perhaps this is only a stupid idea, if this is the case please accept my apologies!

 

And (with his permission) here's the Slice's answer:

 

Hello!

 

Yes, your idea is entitled to be. As far as I understand there is some workaround in the kernel to start 32-bit application with 64-bit kernel. Why not a kext?

Such wrapper should have multiple instances, one for each superclass you want to execute as 32bit.

For example, if some application calls IOEthernetControllerClass it should calls wrapper and it calls your driver.

In terms of C++ you have to create subclass instances.

 

About 7600GS it is strange why NVidia do not produce 32-bit drivers. I checked in Lion with 7300LE. Version 270 works in 64bit, but crashes in 32bit. So I understand you. It is only reason why you can't use ML. Mmmm.... another reason is Attansic? Twice bad.

 

This is very complex subject and I feel my skill is not enough to do something here. Anybody else? I can help if I'll see that I can help.

 

(/Off-topic note: about the Attansic/Atheros L1, the problem can be solved by using AttansicL1Ethernet.kext from SL and PCIRootUID=1)

 

So what's your thoughts about this?

 

About nvidia incompatibilities with ML, you could read also this article, interesting in the sense that we can see that the problem with nvidia is more complex than just a 32bits/64bits issue.

 

In any case, i'm available for testing/anything, but of course i can't help for programming, because i'm only a dumb and useless musician, sorry... :afro:

 

The goal is to find a global and sustainable solution, not just for me or for osx86 but also for regular apple users who suffer of incompatibilities between their (not so old, after all!) hardware and Mountain Lion.

 

- - - - - - -

 

EDIT 09-12-12:

 

I have EXCELLENT news! :) I've found an actual exemple of what a wrapper could look like: it's called nspluginwrapper (see attached file), and it's used to load 32bits plugiins, like flash for exemple, in 64 bits browsers! Of course it is really focused on NPAPI, so it could not be usable "as is", but... but... this is for me a "proof of concept", and i'm sure we could find other examples in the Linux world... A good start point for possible genius developers?

 

 

:superman::superman::superman:

 

- - - - - - -

nspluginwrapper-1.4.4.tar.gz

Share this post


Link to post
Share on other sites
Advertisement

Here is some complementary ideas, perhaps totally crazy, but perhaps also, in some way, will inspire you?

 

1°) Make the MLWrapper a part of Chameleon.

 

- The incompatible kexts are put in a special folder, the bootloader detects them, and loads them in a ram disk. Then the MLWrapper creates virtual 64 bits modified instances of the kexts in memory and inserts them into the kernel tree,

 

- or intercepts all communication between the kernel and the incompatible kexts and not only translates 64 bits messages to 32 bits and vice-versa, but also helps to prevent compatibility problems by canceling, translating or transforming some kernel "calls" / "functions"/ "orders"/ "events" (sorry i don't know how you call that), and the response to them, that otherwise could provoke a kernel panic.

 

2°) A special version of kextcache, that will create a cached 64 bits modified version of the incompatible 32 bits kexts.

Share this post


Link to post
Share on other sites

Here is a new idea for you dear developers:

 

- A 32 bits legacy sub-kernel. A sub-kernel could be a simplified 32 bis kernel structure wich have the ability to handle all communication to/from legacy/32 bits kexts, and, why not? legacy incompatible libraries and binaries (and here, of course i think strongly about Rosetta, wich have been (cowardly?) abandoned by apple).

 

(Please note that any time i say "incompatible / legacy, i talk about all that's incompatible with Mountain Lion (and its future udaptes too!). That's the very reason of this thread, to find a solution for harware and software incompatibilities).

 

If we could represent the main kernel by a tree, the sub-kernel could be a like a second simplified tree (a sub-tree) connected to the main tree, in fact becoming a simple branch amongst many others. Or, another imaginary representation, like an interpreter which translates a language to another. Of course, following the choices you make, it could have a big impact on performances. It's why i imagine that it could be a very simplified kernel structure, connected to the main kernel by a continuous stream of data.

 

What i call "a continuous stream of data" is the way a Core Audio driver communicates in real-time priority with the kernel. In professional audio, we need a very minimum of latency between the moment of a sound (let's say a guitar note for exemple) enter in the sound card, and the moment when it is heard. It's this delay wich is called latency, and it could be a real nightmare when you're a sound engineer and have to mix 48 instruments and voices tracks with tons of effects loaded in, all perfectly synchronized with a video, and all that in real time!

 

To accomplish successfully this herculean task, the audio driver establishes a continuous channel of communication (real-rime streaming) with the kernel witch have a very high (real-time) priority above any other event. The result is that the latency is no more a software issue, but only depends on your hardware. More powerful your CPU and your soundcard are, less is the latency.

 

So i imagine that a sub-kernel could exploit this possibility, to establish a very fast communication with the main kernel, so the performance issues could be minimized.

Share this post


Link to post
Share on other sites

hello

 

is a nice idea, not sure if can be implemented.. but the idea is good

 

another problem is with x3100 only solutions in 32 bit, but the graphics card is in 64 bit notebooks

 

good hack

Share this post


Link to post
Share on other sites

hello

 

is a nice idea, not sure if can be implemented.. but the idea is good

 

Hi, Artur-pt!

 

Thank you very, very much to have taken the time to read my prose! :)

I'm happy that you have a positive impression about my ideas!

 

This topic is like a bottle in the sea, it's why i asked for your advice, because as you i'm not sure that it can become a reality, but... who knows?

 

Few years ago, installing osx on pcs was considered completely crazy, because on real macs apple have implemented a TPM chip which prohibits that

And what happened? Crazy developers created a kext (fake SMC, which at first was called r2d2.kext) which emulates the tpm and decrypts apple libraries in real time! Say hello to Netkas and Maxxuss, hero members at the very origin of the osx86 project... I was thinking about them when i opened this topic.

 

another problem is with x3100 only solutions in 32 bit, but the graphics card is in 64 bit notebooks

 

good hack

 

Old graphics cards in notebooks are a real true problem, because they can't be changed or upgraded as we can in a desktop... But i have faith in our developers, i'm sure they can find a solution, perhaps this solution will be completely different that those i try to imagine with my non-existent knowledge, so perhaps this topic will be completely useless, but perhaps some of them will realize there is a real need here, not for a "simple" legacy kernel, but for something radically different, so...why not?

Share this post


Link to post
Share on other sites

I have been following this thread as I would like to see ML graphics work with the X3100 GPU. However, it occurs to me that the X3100 only supports OpenGL 2.0 and ML uses OpenGL 4. Would a wrapper be able to address this factor?

Share this post


Link to post
Share on other sites

Hi Mnfesq, unfortunately i haven't enough knowledge to really discuss about it, but this is an excellent question and i hope that someone more skilled than me will take the time to answer.

 

Though what i can say is that nvidia 8x and 9x series (nv50) works very well with ML, aren't they opengl 2.0 also ? Is it implying that there is some retro-compatibility between opengl versions ?

 

Of course, if this is the case now, this isn't mean that this will be the case in the future...

 

(Edit:geforce 8 and 9 series are in fact opengl 3.3 source: wikipedia. I need more investigation to know if there is actual retro-compatibility with the opengl 2.0 impemented in previous generations of ATI and Intel "X" series chipsets, if you have some infos about this, and how opengl are handled by osx, please share)

 

Thank you for following this thread, i hope to see my wish becomes reality one day, why not for christmas?! :)

Share this post


Link to post
Share on other sites

Today i have really, really great news... :D ! Please see the "EDIT" in the first message with exemple code included!

 

I'm happy because it is a proof that my noob concept really exists, and is actually used, in a daily basis... in our browsers! Please read!

 

Of course if you are a developer and read this, this is old news for you, but when i started this thread i was really not sure that something like that really existed.... So from my humble POV, this is simply great!

 

EDIT: If ever you find other examples like that, which illustrate different ways to translate 32 bits binaries into 64 bits, please share!

Share this post


Link to post
Share on other sites

Another example comes to my mind, a library that is used daily in windows machines all around the world: Wow64.

 

This compatibility layer is able to run 32 bits apps in 64 bits versions of windows. As far as i can understand, it exploits a compatibility mode of 64 bits (Intel EMT64 and AMD64) processors, and takes care of environment too, redirecting paths to the registry and system folders (exemple: references to HKLM/Software are redirected to HKLM/Software/WOW6432, "\Windows\System32" is redirected to "\Windows\SysWoW64", etc...).

 

Though WoW64 have a down side: it don't takes care of drivers, so all 32 bits apps that include 32 bits drivers can't run on the 64 bits versions of windows.

 

But the important information here for me is that there is a "compatibility mode" included in our modern 64 bits processors. A good lead to elaborate a fast MLWrapper?

Share this post


Link to post
Share on other sites

with the coming out of yosemite I've thinked that we can "reverse engineer" the gmax3100 and gma950 kext with the gdb debugger and recompile them to 64 bit with some changes

 

the requirement is to have 2 macs: 1 to debug and 1 to run, as said by apple. I would have done that if I've had 2 macs but I only have one.. if someone has 2 macs to do that will be awesome :D

 

here is some guidelines

use gdb to inspect the assembly code of a kernel extension

you can use the kextload tool to create a symbols file that you can load into gdb. this will let you see decoded symbol names for functions, &c. there's atutorial here:http://praveenmatanam.wordpress.com/...ugging-on-mac/ 

Share this post


Link to post
Share on other sites

with the coming out of yosemite I've thinked that we can "reverse engineer" the gmax3100 and gma950 kext with the gdb debugger and recompile them to 64 bit with some changes

 

the requirement is to have 2 macs: 1 to debug and 1 to run, as said by apple. I would have done that if I've had 2 macs but I only have one.. if someone has 2 macs to do that will be awesome :D

 

here is some guidelines

use gdb to inspect the assembly code of a kernel extension

you can use the kextload tool to create a symbols file that you can load into gdb. this will let you see decoded symbol names for functions, &c. there's atutorial here:http://praveenmatanam.wordpress.com/...ugging-on-mac/

How about a Virtual Machine?

The physical for the kext and the virtual for the debugging?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By bcuraboy3
      Good morning everyone. I have a HP Pavillion with the following specs
      I have managed to install MOjave on it, using Rehabman's config for Intel HD5500. 
      But I need some help with a DSDT for it.
      Would anyone be kind enough to have a look at the zip file, which contains the EFI folder, a IOREG, and some screenshots from DPCI Manager,
      and help me with a good DSDT patched and a correct config.plist for it?   
      Thank you very much.  Highly appreciated 
      I have also included a report from Aida64 in case anyone needs it 
       
      15-p200np
       
      Número do equipamento
      L5Z67EA
      Microprocessador
      Intel Core i7-5500U com placa gráfica Intel HD 5500 (2,4 GHz, 4 MB de cache, 2 núcleos);
      Memória
      SDRAM DDR3L de 4 GB a 1600 MHz (1 x 4 GB)
      Placa de vídeo
      NVIDIA GeForce 840M (DDR3 dedicada de 2 GB) >>  disabled already using the config.plist provided 
      Disco rígido
      SATA 1 TB 5400 rpm
      Unidade multimédia
      Gravador de DVD SuperMulti
      Visor
      HD BrightView com retroiluminação WLED de 39,6 cm (15,6 pol.) na diagonal (1366 x 768)
      Placa de rede
      Ethernet LAN Base-T 10/100 integrada
      Conectividade sem fio
      Combo 802.11b/g/n (1x1) e Bluetooth 4.0 (compatível com Miracast) >> It's not supported, but a DW1550 it's on it's way 
      Som
      BeatsAudio com 2 altifalantes >>  it's a ALC 290 
      Teclado
      Tamanho completo tipo ilha com teclado numérico
      Dispositivo
      HP Imagepad com suporte de gestos multi-toque
      Portas externas
      1 leitor de cartões multimédia SD multi-formato
      1 HDMI
      1 combinação auscultadores/microfone
      1 USB 2.0
      2 USB 3.0
      1 RJ-45
      Dimensões
      38,45 x 26,02 x 2,39 cm
      Peso
      2,27 kg
      Alimentação
      Transformador de alimentação CA de 65 W
      Polímero de iões de lítio 4 cél. 41 Wh
      Câmara
      Câmara Web HP TrueVision HD (frontal) com microfone digital de matriz dupla integrado
      Mac-Pro-Noi.zip
      Report.htm
    • By JhonneR
      Good morning, everyone, I'm sorry if I was wrong in choosing the topic but I need help.
      I have found it extremely difficult to mount a Hackintosh in my acer.
      Setup;
      I5 2430m 2.4 6GB RAM
      Mobo P5we0 - Intel intel Graphics 3000
      At the moment I have not found out what my audio codecs are.
      but I'll leave the link on the motherboard.
      however, my real problem is several.
      I have already used the itakos image, I have already used several images that could be installed normally and that after installing the image I do not have internet via cable or wireless.
      And another, I already looked in other forums and I know that I will be called a donkey in the logical question but I have not been able to install the [url="http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/"]#####[/url] or clover to start from the Hard Disk, so I do not know what to do.At the moment I still do not know if there has already been someone who has already installed the High Sierra or just the Sierra in this notebook model and obtained permanent success.
      If anyone can help me, I'll be grateful.
      Installations without success, but with the system already installed in ACER;
      SIERRA
      HIGH SIERRA
      MOJAVE
      All with the same symptom. Starting only by the bootable USB stick and without internet connection via cable and wireless.
      Appreciate ! Acer 5750 Official Page
    • By corbrink
      Hi,
      I have the following system:
      - Gigabyte Z370M-D3H M-ATX
      - Core i7-8700K Coffee Lake
      - Gigabyte Radeon RX 560 4GB
      - Crucial Ballistix 16GB DDR4
      - 960 EVO 1TB NVMe SSD
      - 850 EVO 500GB SSD
      - Crucial 500GB SSD
      - The 2 500GB SSD's run in Raid for data storage.
      - Western Digital 3TB HDD - Time machine
      - EFI here (too large to attach): EFI.zip

      Questions:
      1. I have a dual screen running from Radeon card, 1 on DP and 1 on HDMI. The one screen on DP goes randomly blank from time to time. Any ideas?
      2. I've read that the kexts should preferably be installed in /library/extensions. I would like to know what kexts should remain in the EFI. I read that you should install FakeSMC in both locations (EFI and L/E). If I follow this route must I change something in the config.plist?
      3. USB info in System Information (attached does not seem correct. I've followed the changes suggested but I'm not sure if this is the best it can be.
      4. Are there something in the EFI and config.plist I don't need or doing wrong?

      Feedback will be appreciated.


    • By Drovosek
      As practice shows with the installation of macOS 10.14 Mojave, official cakes from previous, previous versions of the OS sometimes help. So, I pulled out folders /System/Library/Extensions /Library/Extensions from different versions of MacOSX and uploaded on Yandex.Disk and Mediafire. I hope someone will help.   ► 10.4.11
      https://yadi.sk/d/amCPgnkJ3ZMsA7
      http://www.mediafire.com/file/2eap86ny46gjavj/
      ► 10.5.8
      https://yadi.sk/d/XoY70G8K3ZMsBZ
      http://www.mediafire.com/file/a1z7wgizukcrum4/
      ► 10.6.7
      https://yadi.sk/d/8nY0c0ry3ZMsC7
      http://www.mediafire.com/file/rn5n5wt5mw6fzcm/
      ► 10.7.5
      https://yadi.sk/d/8ew7KMbL3ZMsCt
      http://www.mediafire.com/file/9akne1f446j75d5/
      ► 10.8.5
      https://yadi.sk/d/p49F9lZw3ZMsDd
      http://www.mediafire.com/file/xksxbr4gg5ara86/
      ► 10.9.5
      https://yadi.sk/d/LtwMSo3A3ZMsEG
      http://www.mediafire.com/file/6cl3m1dq7068axh/
      ► 10.10.5
      https://yadi.sk/d/ID8QtILY3ZMsEe
      http://www.mediafire.com/file/aefgwlvx696ixmd/
      ► 10.11.6
      https://yadi.sk/d/_KeYANJP3ZMsFN
      http://www.mediafire.com/file/58snknt7x78iubu/
      ► 10.12.6
      https://yadi.sk/d/Nl2Y257v3ZMsMr
      http://www.mediafire.com/file/35924ldz1bb64iu/
      ► 10.13.6
      https://yadi.sk/d/yvoYgqt73ZMsNo
      http://www.mediafire.com/file/ofpa3skypc9e292/
      ► 10.14.1
      https://yadi.sk/d/O3Up1EUAqkMrpQ
      https://www.mediafire.com/file/q6kp3ha5u7rgakx/
×