Monday, February 25, 2008

when you boot your hackintosh you can press "F8" before you see the gray apple boot screen.

then you should see a menu with all the partitions you have, at this time you may choose between the partitions using up/down arrows (it defines what partition to load from).

another thing you can do at this boot prompt is to specify boot options.

note that the last line says: "boot:" this is your prompt, you may write one of the next options:

[Kernel Name]

[Kernel Flags]

[Boot Flags]

-s

-v

-f

-x

[Parameters]

cpus=

"Graphics Mode"=

rd=

config=

platform=

idlehalt=

legacy

[Info]

?memory

?video

[UnKnown flags]

debug=0x144

Kernel Name this boot option state what kernel to use in order to load the system, for instance you may use mach_kernel or any other kernel you downloaded and want to try (new EFI supporting kernel or new version of kernel), the kernel must be in folder "/"

Kernel Flags you can enter kernel flags that should be used during this boot time, kernel flags examples: debug=0x144 io=0xffffffff (not so sure what these guys do, but read more on kernel)

-s mean you would like to enter "Single User" mode which doesn't load GUI and doesn't mount partitions but gives you a prompt so you can make system maintenance and recovery procedures.

-v loads the system in Verbose mode which display allot of log lines during boot time and does not display the apple gray boot screen, it is good to use this option if things go wrong, or if you get an error screen and you want to know the reason.

-f tells the hackintosh to reload all kext (Kernel Extensions = drivers) and dump the cache, not rely on it (kext cache found in: /System/Library/Extensions.mkext, you can delete it manually and the system will recreate it)

the kext cache is built of the necessary kext that needs to be loaded and it will be created whenever it does not exist.

you can use a command line utility (from terminal) named: "mkextunpack" to extract the content and see what kext are cached for example the command:

mkextunpack -d /111 /System/Library/Extensions.mkext

will extract the content to a folder (that must exist before runing this command) /111

you can also use the command line utility "kextcache" to create or update kextcache.

-x this option boot the system into safe mode ignoring kext cache and loads only necessary kext

cpus= this parameter tells the hackintosh how many cpus to use, for instance if you have dual CPU or dual Core then you can state cpus=2, so the system will use both cpus, and if you get reboot without loading GUI or boot screen then you may use cpus=1 to allow use of one cpu and avoid reboot

"Graphics Mode"= this parameter tells the hackintosh to use stated graphics resolution and color depth, the pattern to use is: WidthxHeightxDepth@RefreshRate for instance a resolution of 640x480 with 32 bit color depth and 60 hertz frequancy refresh rate will look like this:

"Graphics Mode"="640x480x32@60"

rd= this parameter state what is the boot disk to use (instead of using the boot menu appearing before the prompt) you state the drive and partition in the pattern: diskXsY where X stands for the disk number (first disk (usually primary master in IDE) 0 second disk is 1 etc.) and Y stands for the partition on that disk starting with 1 as the first partition, so if you have one disk and one partition the parameter will look like this: rd=disk0s1

config= this parameter tells the system to load using different copy of the boot config file, the default copy used is kept in:

/Library/Preferences/SystemConfiguration/com.apple.Boot.plist

the content of this file state boot options such as:

timeout (how much time to wait for user selection in boot prompt)

kernel (what kernel to use)

kernel flags (what kernel flags to use in each and every boot)

quiet boot (weather to display boot menu or not)

boot graphics (if to boot with apple spinning circle)

etc.

platform= this parameter sets the platform to use at this boot time, you may use:

platform=ACPI (ACPI support)

platform=X86PC (non ACPI support)

platform=ACPI|86PC (try to support ACPI if fails do not support it)

idlehalt gets two values ether 1 or 0 stating true or false, if set to true then at idle time the cpu will halt causing power saving and cooling of CPU, if set to 0 then the cpu will allways run even in idle time.

idlehalt=0

idlehalt=1

-legacy causes the system to load in 32 bit mode while running on 64 bit systems

?memory this info screen display information about the memory on the machine

by the way, a great news reader that uses this text-to-speech technology on the web is: Pimp My News, it is a news reader that can read them to you, you can also download the news as a separated files or playlist to your iphone or ipod.

Saturday, February 16, 2008

another feature that is absent (i don't really need it) from mac but exist in windows is the right-click "New some_file_type..."

for instnce "New Text File",

well come to think of it thats about it! i never used the other file types, pictures? there are too many types to put there and i always used photoshop/msPaint etc in order to create one and even if i did create one i then go right away and open the application that edit them so what is the use? the same goes to word, power point and excel what ever.

so for the sake of argument lets assume we want the new txt file ability, so there is another add on utility that adds it self to the context menu More sub menu and allow create new document types from templates and it allows you to add templates and types of your own, and edit the one that exists, its really good and quite simple (as most good things are) it only copy the template to the place you clicked.

to undo this simply execute the same lines only this time replace the value 1 with 0 like this:

defaults write com.apple.finder AllowCutForItems 0

killall Finder

but when you try it you find its just another "move to trash" menu item, well that didn't help,

that was when i decided to download the add on to context menu FileCutter

it gives you the option to cut paste, move to... etc. but the annoying part is that it is a sub menu inside a sub menu, in leopard all add ons to context menu is added to the More sub Menu, and file cutter is a sub menu in its own, so in order to cut you go 3 levels deep - yuc! i wish there was a way to add cut directly to the context menu next to copy feature without any mess

Friday, February 15, 2008

when you install your hackintosh you get a leopard OS X of a certain version i got mine from uphack iAtkos 10.5.1 yours might be different, check what version you have using the "About" dialog (from the menu bar apple press "About this Mac")

it will check every 1 second if a file named: "AppleIntelCPUPowermanagement.kext " is found in the extension folder and when it appears it will delete it, the script will run and not return to prompt (do not kill/close it yet), if you wish to verify it is working, create new folder and rename it to: "AppleIntelCPUPowermanagement.kext " and then copy it to /System/Library/Extensions, it should be immediately deleted

4. install the downloaded package and let it finish

5. when the install end DO NOT press restart yet!

6. now stop the script by pressing control and C (ctrl+C)

7. next you need to edit the apple restart script that checks if this is a hackintosh and decides if to start the system or display and error screen, you will tell the system to load directly to leopard, do this by:

cd /System/InstallAtStartup/scripts

and edit the script named '1'

vi 1

8. now the console will display the content of the file, using arrows scroll down to the end there you will find a line like this near the end:

kextload /System/Library/Extensions/Dont Steal Mac OS X.kext

press I (stands for insert) to enter edit mode

9. delete the value:

/System/Library/Extensions/Dont Steal Mac OS X.kext

and replace it with this value:

/System/Library/Extensions/dsmos.kext

press Esc to exit edit mode and press : to enter vi prompt and then write !w (stands for write changes to disk even if file is read only) and press enter, after that press : and write q (stands for quit) and by that you exit the vi.

10. now if you see any changed kext (in the /System/Library/Extensions folder, you can sort by date and see the latest from the update), if you want to change them back to your kext then you may restore them from previous backup step and finally press the Restart button on the install screen.

after restart it will boot to boot screen and perform another restart (without loading the leopard GUI), then it will boot into the blue screen (before login window) and will stay there for 3-4 minutes then the login window will appear and now you have 10.5.2 installed.

check the about dialog should look similar to this:

you should be also seeing the 10.5.2 trademark feature in the stacks (list view):

you can find fix and fatures list for this version here, and original Netkas post here.

hackintosh comes in two flavors of install types: one with EFI emulation (A.K.A PC_EFI) and another without,

EFI is intel "Extensible Firmware Interface", it is an interface that abstract the hardware from the software, so no matter what hardware the OS is running on it will always "talk" to the hardware in the same manner and it wont have to find out on what intel configuration it reside on.

EFI supply the OS with services that until today only BIOS would supply (IO,IRQ,rates on board, access to memory, machine clock etc.) it conform to the firmware on the EFI module residing on the board and have part in the boot process and kext (drivers) loading process, see more detail here and here.

your hackintosh will not have the first file installed, the second might be in the path (but not in use), since we don't have the supporting hardware and firmware version to support this spec in our PC then there is a workaround (a hack) that was made by Netkas and its idea is to mimic the EFI abilities,

the EFI retain a table of data parts and when the OS request a data part or to store a data part the PC_EFI return the proper response. this way the leopard/tiger thinks they are installed on a Mac and allow correct behavior including updates.

there are 3 ways to find out if you have an EFI emulation:

1. if during install you went to a "Darwin Boot" menu and specified to install PC_EFI in the console window, then you got PC_EFI emulation,

the PC_EFI install screen look like this:

2. another way to find out: is if you made a successful update using the menu bar apple -> "Software Update", if so then you you have EFI emulation installed, although i was talled that there might me some installations that can update without EFI.

3. last and the safest way is to write in the terminal the command:

sudo ioreg -l -w0 -p IODeviceTree | grep efi

and make sure you are getting this as an output:

+-o efi

| | "name" =

b.t.w if you don't have PC_EFI installed you can install it, please refer to this post.

the way application/kext/bundle/pkg etc. is built in mac OS X is actually a folder displayed as a file with icon and double click abilities etc. but if you go to terminal you can cd into it, also from Finder you can right click it and choose "Show Package Contents" and a new Finder window will open containing that folders content, every folder usually have the format of single folder ("Content") that contains parameters and config files such as Version.plist and Info.plist and a folder "Resources" that as its name contains the resources of the package or application etc. there you may find images sounds video strings windows and dialog definitions and you can change them (copy them to a different location edit them save them replace them with the backedup original and fix permission and ownership).

lets do this on the About dialog that has an image named MacOSX.tif mine displays iAtkos logo and i want it to look more like a mac so i edited it in photoshop and saved it,

before change it looked like this:

and now it looks like this:

now i am searching for the strings turk team 10.5.1 etc. when i will change it i will update this post, - i dont need it anymore, after updating to 10.5.2 (see next post) my about dialog looks like this:

thats it, if you need a better details on how to copy, move change ownership etc. you can reference this post.

Wednesday, February 13, 2008

there is yet another problem with hackintosh and bluetooth (at least one i experience), the symptoms are: when you finished booting the bluetooth icon in the icon bar is disabled

enabled icon looks like this:

disabled icon looks like this (but this is a good disabled (initiated by user and can be reversed)

another one that display an X in the middle of the icon to indicate the bluetooth could not be started there it is:

so if you are experiencing such error then it comes with a side effect:

the cpu is at 100% all the time since the bluetooth demon keep on trying to initiate it and it fails (so its kind of an infinite loop that will never end due to bluetooth crashes).

to validate if your CPU is 100% or not you may see it in the icon bar as well it looks like this:

you may have a different set of icons and if the percentage is showing something else (like memory or network IO) or not displayed at all then:

goto System Preferences...,

at the "other" section click on Menu Meters

at the CPU tab select the checkbox that say "Display CPU Menu Meter"

and thats it, if you do not have the Menu Meter option at all you may download it from here and install it.

lets move on:

if the CPU is really in the 100% zone (or near it) then it means you suffer from bluetooth (or any other hardware) crash and retry effect, next we need to find out if it indeed crash or something else is causing the 100% (for instance another hardware process crash - not bluetooth), for this we need to open the system console (that is the GUI that allows you to see all mac logs) to open it use one of these methods:

1. open Finder, Goto Application, there you will see a folder named Utilities, and in it the icon for Console (Double click it)

4. go to Finder process (alt tab or click on the dock icon or click on the desktop so no process is selected...) and then use keyboard shortcut: Shift+Command+U (in hackintosh: Shift+Winkey+U or Shift+Alt+U), and then double click the Console icon

there are several more options such as from terminal and spotlight... but you get the point (mac is awesome)

so after Console is up you should see screen looking like this:

note that i have highlighted the CrashReporter tree node, if you have any processed crashed it will leave a log file with the process name and the crash date under this node, so if you have a log file starting with the word: "blued" that means the blued process crashed (it is the bluetooth demon process name b.t.w. demon is mac equivalent to windows service).

so if this is the case then you should be seeing a lot of them (they crash and retry every 2-5 sec), you may see other crash report logs as well for this post purpose ignore them.

inside that log you may see info regarding why the process has crashed (thread dump, memory maps, exception type and description) you can google for it and you may be lucky enough to find the reason and the solution, if you don't understand it then leave it alone and try my suggestions:

solutions (kind of):

1. you may try to reboot several times eventually it will get it up and running (lame but works)

2. another flavor of this solution is a kind of voodoo but it has tech explanation, while rebooting press enter several times (you may also hold it until boot finished but do it in bursts), this will work since one of the main reasons for the bluetooth or any device not being initialized at boot time is the PC power managements system it is automated and during boot it decide if to transfer power to a certain device or not depending on the use of it (if the address is used if the IRQ is called etc.) sometimes the mac OS has short fuse and if the device does not respond in time it will think the device is not available, the process will crash and relaunch it self retrying, but the BIOS power management system will not power up the device after boot time and that is why the problem occurs, so the enter (or any key) put interrupts for the console which kind of slows down things allowing the power management to power up the device.

3. if you have the option disable the auto power management from the BIOS i don't have that option but i have the wake up event so i disabled it hoping that it will cause the power to be always on (laptop tries to save power this way).

4. one other option is to rename the plist (config) file of the bluetooth process it reside in ether:

/Library/Preferences

or:

~/Library/Preferences

and the file name is:

com.apple.Bluetooth.plist

and reboot, leopard will re-create it when the bluetooth try to start.

*** Edit *** Disregard solution 5 it made me tons of problem (i am trying to finilize it so it would work and only then i will say it is a stable solution or not)

5. another solution is to remove the bluetooth installation and reinstall it, the way to do it is to rename/remove/move the files related to bluetooth (long list) and download the package from apple and install it.

we need to remove the files since the package will not install if there is a driver installed already (unless apple site version is newer), the file list you can get from the package content using Pacifist (an application to extract and browse install packages),

i suggest to use pacifist to extract all folders to some easy to access folder for instance: ~/temp and manually install (mining copy and overwrite existing files from single user) this is the way to do it:

reboot

before apple gray boot screen appears press:

F8

at the prompt write:

-s

this will boot into a shell (A.K.A single user mode) then write:

/sbin/fsck -fy

press enter (this will check the disk before mounting it - this is not mandatory but a good practice)

then write:

/sbin/mount -uw /

this will mount your disk and now you may copy all extracted files from the package and replace existing ones on the disk using a cp command like this:

cp -R ~/temp/Application /Application

cp -R ~/temp/System /System

cp -R ~/temp/usr /usr

it is important to do it in single user mode so kext and process won't be loaded and the files can be overwritten. after you finish write: