Jump to content

How to compile a driver from Source


  • Please log in to reply
15 replies to this topic

#1
Black_Spider

Black_Spider

    InsanelyMac Protégé

  • Members
  • Pip
  • 10 posts
Is there any soft to compile mac driver from linux source?

If ans is not then plz tell me the easiest way to make driver from source.

I need to build a driver for my chrome9 integrated agp.

I have driver of all version of linux and the source.

#2
guruk

guruk

    InsanelyMac Protégé

  • Members
  • Pip
  • 25 posts
hi man,
it looks u are the man if u can build drivers :) i am looking for to have driver for a alc889 sound that works in xp also now several linux users posted success. can u help to make that driver run for a acer 6920g .. the funny thing.. the usual alc889 are not working.. and i dont know how and whom i can ask.

thanks
chris

#3
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 2,530 posts
  • Gender:Male
  • Location:Moscow
OK! If you are programmer I can get you small guide.
HOW TO CREATE GRAPHICS DRIVER FOR MACOSX USING LINUX SOURCES.
1. Linux sources written in C. Rewrite it to C++ and create new class MyDriver with all Linux sources.
2. Some Linux system procedure must be rewritten to MacOSX system calls. Consult Apple or opensources.
For example
Linux
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
		   "%s: CP resume %d\n", __FUNCTION__, _ret);
MacOSX
IOLog("ERROR: %s: CP resume %d\n", __FUNCTION__, _ret);
3. You must change access to PCI bus, to BIOS and to GPU registers.
How to you can find in project RadeonPCI
4. Take IOGraphics project.
You can find classes
IONDRV - base superclass
IOBootNDRV - small subclass with fixed settings
IOPEFNDRV - supposing that graphics driver located in ROM
You need to use your class MyDriver instead of them. Main member is doDriverIO(...).
Then create your own kext with subclass of IONDRVFramebuffer that override it's member doDriverIO to use your class. How to - for example OpenATI at http://sf.net.
In this way you can get switch resolution.
5. What about QE/CI and hardwareOpenGL?
You may subclass of IOAccelerator in the project IOGraphics but I still don't know details. If you would work I am ready to speak.

#4
kingoffright

kingoffright

    InsanelyMac Protégé

  • Members
  • Pip
  • 15 posts
a little bit complex~ he.

#5
kexik

kexik

    InsanelyMac Protégé

  • Members
  • Pip
  • 9 posts
Can anybody give me as smallest as possible sample of graphics driver? I need to make "dummy display driver" which will do nothing but will behave like normal driver for GPU allowing to use all resolutions when using VNC without monitor attached to host OSX machine.

Can anybody help? Apple docs are very small at this topic, I tried to subclass IOFramebuffer and IONDRVFramebuffer but with no success.

Thanks much in advance!

kexik

#6
Skaz

Skaz

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 131 posts
  • Gender:Male
  • Location:France
  • Interests:Graphisme - WebDesign - MAO
Hi,

I need to convert a 32bits kext to 64bits, somebody can help me please?

Sorry to post here but i havn't permission to make new topic.

#7
Gringo Vermelho

Gringo Vermelho

    The Jan Bird fix

  • Supervisors
  • 5,860 posts
  • Gender:Male
  • Location:Brazil
Do you have the source code?

#8
Skaz

Skaz

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 131 posts
  • Gender:Male
  • Location:France
  • Interests:Graphisme - WebDesign - MAO
I have the original kext.
I need the source code absolutly?

#9
Gringo Vermelho

Gringo Vermelho

    The Jan Bird fix

  • Supervisors
  • 5,860 posts
  • Gender:Male
  • Location:Brazil
Yes of course. Without source code there is nothing to modify let alone compile.

Why don't you post what kernel extension it is, maybe there is another way.

Are you aware that OS X can run 64-bit apps and use up to 32GB RAM when running in 32-bit kernel and drivers mode?
The only real limitation compared to full 64-bit mode is that each process can only use up to 4GB RAM.

If your sig is accurate, you only have 4GB RAM, which means you will see no benefit from running in 64-bit kernel and drivers mode.

#10
Skaz

Skaz

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 131 posts
  • Gender:Male
  • Location:France
  • Interests:Graphisme - WebDesign - MAO
Hi,

It's for a Genius graphic tablet, USBPenTablet.kext , then non-free driver, I can't find the source code.

I tried to boot in 32bits but my system don't start like this, AppleIntelCPUPM make a KP, and in 64bits the kext isn't loaded.

Do you think i can find a generic driver? Or maybe edit IOUSBfamilly or other for make it working?
With nothing installed the stylus work, I can open files with a stylus touch and right click open the contextual menu but it don't move. Also the tablet appear sometimes in System Profiler.

#11
Skaz

Skaz

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 131 posts
  • Gender:Male
  • Location:France
  • Interests:Graphisme - WebDesign - MAO
I found that this tablet work on Linux with Wizardpen driver
https://help.ubuntu....izardpen-driver

Here there are the source code, do you think it can be a solution?

#12
Gringo Vermelho

Gringo Vermelho

    The Jan Bird fix

  • Supervisors
  • 5,860 posts
  • Gender:Male
  • Location:Brazil
It's a good start. Read more about what you can do with it in Slice's post up above.

#13
Skaz

Skaz

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 131 posts
  • Gender:Male
  • Location:France
  • Interests:Graphisme - WebDesign - MAO
Ok I will do this, as kingoffright said it's a little bit complex but i will try to understand... sure, as far as i can.

Thanks

#14
Skaz

Skaz

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 131 posts
  • Gender:Male
  • Location:France
  • Interests:Graphisme - WebDesign - MAO
Hi,

I read the Slice's guide, and it's for graphic driver, i can follow it nevertheless?

#15
Gringo Vermelho

Gringo Vermelho

    The Jan Bird fix

  • Supervisors
  • 5,860 posts
  • Gender:Male
  • Location:Brazil
No idea, last time I programmed something was in BASIC in the late 80's.

It sounds like you are scared! :) Why don't you just jump in and see how far you get. You might learn something.

#16
Skaz

Skaz

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 131 posts
  • Gender:Male
  • Location:France
  • Interests:Graphisme - WebDesign - MAO
it's true... I'm little scared because I never programmed (chinese should be easier for me...).
But I'm interested by try and learn... then as you said... I will jump in! :D

thanks





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   Web hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy