Home » OSX86 Basics

What is kext,Where is kext, how to Install kext.

1 February 2009 by Vinay 6 Comments

kexticon128Kext file is a kernel extension. They’re generally used for device drivers and other things that need to modify the system at the lowest level. They’re not the same as classic Mac OS extensions, as many of the things that classic Mac OS extensions did are done differently in Mac OS X.Since kernel extensions aren’t protected by Mac OS X’s memory protection, developers are encouraged to stay away from writing them unless they absolutely have to. Even then, Mac OS X can dynamically load them, so chances are you’d rarely have to add anything to Mac OS X’s Extensions folder.

What is KEXT?
KEXT stands for Kernel Extension, this means that whatever needs to run in the kernel (OS core) environment can be written as extension and then loaded, even after the OSX has finished loading, this mostly answer the needs for hardware drivers.

Where are kext located?
kext are not files rather a folder (disguised as a file),

Leopard holds kext files/folders in the /System/Library/Extensions folder,
at boot time the relevant kext are uploaded from Extensions.mkext this is a cachefolder that contains kext related to the installed hardware,

you can delete it, if Leopard can’t find it, it will create it again,

you can also state to rebuild it from darwin prompt at boot time using the switch -f see this post for further information.
How to Install a new Kext?


cd /System/Library/Extensions
mv KextName.kext KextName.old  (where kextName stands for the kext you want to replace)this will rename the kext and this way back it up, it is highly recommended, warmly advised, very important to follow this step, it saved my OS many times

cd /path/to/new/kext (put your downloaded kext path here)
cp -R KextName.kext /System/Library/Extensions

next you need to fix permissions so the kext can be executed by OS user (root/system)
cd /System/Library/Extensions
chmod -R 755 KextName.kext
chown -R 0:0 KextName.kext   (this will set the ownership on files to system user (root))
rm /System/Library/Extensions.mkext   (this will reset all kext caching done by OSX)

Blog Widget by LinkWithin

Related Posts

6 Comments »

  • Vishu said:

    Hi!

    Can u please tell me how to restore a old kext if i used a wrong kext??

    THANKS

  • Mellifluos said:

    Operate in Single Use mode:

    Reboot at Darwin Boot Loader and type -s and press enter.
    Now execute the following commands :

    mount - uw /
    cd /System/Library/Extensions
    rm -fr KextName.kext
    mv KextName.old KextName.kext
    (where kextName stands for the kext you want to replace)
    reboot

  • Flavio said:

    Is there any way to recover kexts manually? I mean, I just updated my hackintosh from 10.5.7 to 10.5.8 and unfortunaly I forget to backup my Extensions, so system is not booting. But of course I can access to the disk by InstallDVD-terminal procedure.

    I saw that only 8 files were changed in my Extension folder. One of them is IOPCIFamily and system. Before I resintall the system again, I don’t know if there is any other way to fixed or if can I do something manually, aka text edit,etc.

    Another alternative could be to install the same system (10.5.7) in an USB disk, make it functional and then move kexts manually from that disk to 10.5.8 disk. Is that could be possible? Can I mix 10.5.7 kext into 10.5.8 version? I understand that’s the idea of previous backup of Extension folder.

    Thanks.

    PD: My hardware is Asus P5K-VM (audio, LAN, GMA3000 video), Quad2Core 2.4GHz, 4Gb RAM OCZ-800Mhz, Nvidia MSI 8600GTS 256MB, 500Gb Samsung 7200

  • hackeron said:

    This page explains nothing.

    I came to this page to find out about where kexts can go, especially about the /Extra directory.

    1) Where in /Extra should I put a Disabler.kext?
    2) I’m not sure what installer I used but how did com.apple.boot.plist end up in /Extra?
    3) Guides I found say to put extensions in /Extra/Extensions/ – I don’t have that directory, should I create it?
    4) Is there an extensions search path I can specify somewhere?

    Currently this is what I have in /Extra:

    ./com.apple.boot.plist
    ./DSDT.aml
    ./smbios.plist
    ./Stored_Kexts
    ./Stored_Kexts/_For_System
    ./Stored_Kexts/_For_System/AppleIntelPIIXATA.kext
    ./Stored_Kexts/_For_System/AppleRTL8169Ethernet.kext
    ./Stored_Kexts/_For_System/fakesmc.kext
    ./Stored_Kexts/_For_System/JMicronATA.kext
    ./Stored_Kexts/_For_System/NullCPUPowerManagement.kext
    ./Stored_Kexts/_For_System/OpenHaltRestart.kext
    ./Stored_Kexts/_For_System/PlatformUUID.kext
    ./Stored_Kexts/_For_System/SleepEnabler.kext
    ./Stored_Kexts/AppleHDA.kext
    ./Stored_Kexts/ATY_Init.kext
    ./Stored_Kexts/HDAEnabler.kext
    ./Stored_Kexts/IOAHCIBlockStorageInjector.kext

  • adi5402 said:

    Hi I cant get past the boot : anything i load with just causes the system to restart

    any ideas whats going on

  • Toyminator said:

    Warning these instructions are incomplete. You must rebuild the Extensions.mkext file with the command:
    kextcache -m /Extensions.mkext /systems/extensions

    Your system will not reboot otherwise

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.