A part of OsX : Kext


  • Monday, 2 August 2010




  • Kext 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 extensionsdid are done differently in Mac OS X.Since kernel extensions aren’t protected byMac 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’sExtensions 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.

    in chameleon bootloader, it will be located on Extra/Extension or just Extra folder


    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)

    or 

    use OsX86Tools and Kextutility ... just drag and drop your kext. simple


    How to Remove/Uninstall Kext?

    Just drag from folder Extra/Extension or /System/Library/Extension to Trash and repair permission with diskutility

    or

    from terminal ( as same as with boot mode : -s ), type per line below

    sudo -s 
    and type password ( nothing if use boot : -s )
    mount -uw /
    cd /System/Library/Extensions
    rm -fr nameofkext.kext
    exit
    reboot 
    ---
    if there any windows version, can use macdrive and then boot again to MacOS with bootflag -v -f 

    0 comments:

    Post a Comment