Sunday, April 27, 2008

All About Kext


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 cache folder 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 Load and UnLoad Kext?
Kext can be loaded and unloaded during runtime using the kextload and kextunload command lines.

in order to load kext, from terminal write:
sudo kextload kextName (where kextName stands for the kext name you want to load)
enter your password and press enter
the system should reply with a success or fail message.
see the manual page for this command

in order to unload kext, from terminal write:
sudo kextunload kextName (where kextName stands for the kext name you want to unload)
enter your password and press enter
the system should reply with a success or fail message.
see the manual page for this command

you can also check the load status of your kext using kextstat, from terminal write:
sudo kextstat
the system will display a list of loaded kext and details on it
see the manual page for this command

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)

KextHelper


there is an easier method (not appropriate for all kext installs but works for 99% of them),
it is a little utility named KextHelper and can be downloaded here.

kext helper is a window that allow a drag and drop interface to install quickly a kext (including fix permissions).

in order to install new kext using KextHelper follow these steps:
1. launch KextHelper
2. drag and drop to the center of the application the kext you wish to install
3. enter your password in the bottom textfield
4. press the "Easy Install" button
5. wait for success reply
6. reboot

there are also advanced features such as backup, run script, etc.
if you are a developer you might want to read apple "Kernel Extension Programming"

Enjoy.

Hackintosh Drivers


Edie:
soon my site will be ready give it a try:
http://www.osx86driver.com/osx86driver


"Where can i find OSX86 / hackintosh drivers"
this post is for all the people that asked "where can i find a driver for..." well here is a link list that i will maintain:

for those of you that don't know a kext is mac kernel extension or as called in windows a driver.
access "All About Kext" post in order to find out how to install one.

links to the drivers is at the OSX86 Project HCL (Hardware Compatibility List) there is one for each OSX version released on the OSX86 Project:
Leopard 10.5.2
Leopard 10.5.1
Leopard 10.5.0
Tiger 10.4.9
Tiger 10.4.8

link lists and threads found on insanelymac:
a great compiled list of kext
Keyboard and trackpad/mouse
Video Cards
Ethernet
Wifi
CardBus/PCMCIA
Network Printers
Audio
Misc

here are some important kext that may get lost in the list:
NVInject - NVidea Injection kext that support nVidia video cards
Titan - Support for ATI and nVidia video cards
Natit - Open-Source Support for ATI and nVidia video cards
Natit - Natit releases by Netkas (better IMO)
PC_EFI - EFI support for PC, what makes OSX86 updates, and run native kernel possible
AppleSMBios - Apple System Management BIOS Driver

Enjoy.

Saturday, April 26, 2008

MultiBoot using Vista BootManager

I have promised to write these multi-boot procedures so here they are, this is the first of them, displaying how to multi boot OSX86 and Vista using the Vista Boot Manager.

in this procedure i assume that you have installed OSX86 first on a virgin computer and now you want to add Vista partition to it. (if you just want the procedure skipping, installing and fixing vista then jump to step 16)

1. Create a new partition that Vista will be Installed on using your favorite partition creation software (like Partition Manager, Partition Magic, GParted, etc.)


2. Install Vista as you normally do, just make sure you install it to the new created partition, identify it by its order number (first, second or third...) and by its size.


3. after vista is installed and working as you want it to (yea right), now its time to restore OSX partition to be bootable (so HFS+ Error will not appear), insert the Leopard/Tiger DVD and boot into single user from it (see here how)


4. mount your file system write : /sbin/mount -uw /


5. get into fdisk write: fdisk -e /dev/rdiskX (where X is the number of OSX HD starting from 0)


6. display the partitions table write: print or p for short


7. next make your OSX partition bootable (should be of type HFS+) write:
flag X (where X stands for your OSX partition number mine here is 2)
then write:
update or u press enter
write or w press enter
quit or q press enter
and reboot


8. you should be able to see the darwin boot loader and boot into OSX, if you get a blinking cursor, or HFS+ Error repeat the procedure.


9. now when you try to boot back to windows from the darwin menu you get error saying windows is missing winload.exe or corrupted.


10. repeat the procedure in steps 3 to 7 with one difference: flag the windows partition instead of the OSX like this:


11. now its time to fix vista partition, insert the Vista DVD and boot from it


12. in the next screen press next


13. press the link in the bottom "Repair your computer"


14. from the "system recovery options" dialog press "Repair and restart"


15. if it didn't help then you need a more advanced option, you can check this wonderful article on that issue.

16. next we add OSX86 Leopard to vista BootLoader menu from the vista start menu write cmd and right click it from the findings and choose "run as administrator"


17. at the dos box write: bcdedit /copy {current} /d Leopard this will cause the windows boot entry to be copied using the name leopard, it will reply with the GUID of the created partition entry, we will soon use it


18. you may see your entries by writing: bcdedit /enum active, it will reply with all entries like this:


19. next we set the new created leopard GUID to the OSX boot file write: bcdedit /set {YOUR_CREATED_GUID} PATH \chain0


20. lastly we copy the OSX boot file chain0 from the leopard DVD it is found in the root of the DVD to c:\ of Vista (in case you can't find it on your DVD download it here)


21. reboot, you should see the vista boot screen with Leopard entry that leads to booting OSX


you can find reference and information about bcdedit command line here.
tell me about problems that may occure and inconsistencies so i will update the post, i will also add more multi boot methods in next posts.

Enjoy.

Friday, April 25, 2008

Apple Mac vs Microsoft Windows History

I have read some articles on windows and mac history just to try and figure out if it was allways that good on the mac side and i was just MS windows adict without the ability to try other stuff, well guess what...

here is a very good and representative image that display the history quickly (thanks to lirent.net):



and here is an in depth article with screenshots (thanks to WillyHoops blog).
this is yet another good screenshot comparison of Mac OSX vs MS Windows.

Enjoy (your history).

 
the menu is from: Milonic DHTML menus