iPhone bootloader changes 13

Posted by Jason Mon, 19 Nov 2007 14:14:03 GMT

For anyone thinking of purchasing an iPhone in the near future, be aware that Apple is now shipping iPhones with an updated bootloader (4.6_M3S2) which has seen the a number of unlocking avenues closed.

All iPhone’s shipped after week 45 are very likely to have 1.1.2 pre-installed with this new bootloader - you can check to see the week of manufacture by looking at the devices serial number (e.g. xxx45xxxxxx means it was manufactured during week 45) or by issuing the following command within a shell:

-sh-3.2# ./bbupdater -v
Resetting target...
pinging the baseband...
issuing +xgendata...
firmware: DEV_ICE_MODEM_04.02.13_G
eep version: EEP_VERSION:208
eep revision: EEP_REVISION:1
bootloader: BOOTLOADER_VERSION:4.6_M3S2
Done 

Thankfully (obviously) Apple has not seen fit to include a bootloader update with their firmware releases, so iphonesimfree users with their zero’d seczones should be okay for the foreseeable future. Updating the bootloader would create all kinds of headaches for all end users - upgrading a bootloader is always a risky proposition.

I hate paragraphs (and freedom) - Safari 3 & Wordpress 4

Posted by Jason Mon, 19 Nov 2007 14:01:56 GMT

A lot of Safari 3 users in Leopard (and now Tiger) are probably wondering why Wordpress’s TinyMCE editor seems to like destroying paragraphs, but there’s a quick fix.

Comment out line 33:

this.isSafari = ua.indexOf(’Safari’) != -1;

And add this line afterwards to remove all Safari 2.0x hacks:

this.isSafari = false;

Redesign - Grids 2

Posted by Jason Sun, 18 Nov 2007 22:10:57 GMT

Last weekend I started putting together a new theme for here. It was a pretty big design departure from my usual blog style, since I decided to splash out on some stock imagery to put something incredibly nice together. There’s only so much a designer can put together without having access to a decent stock repository. The initial mockups felt nice to work with initially, but there came a point (after playing around with blending modes for a coffee stain layer for the second hour) where I became frustrated and scrapped the whole thing. It looked like this:

test-1.jpg

I had a plan B, and it’s what you’re looking squinting at right now. It’s been inspired by all sorts of great grid based designs I’ve been exposed to over the past few weeks.

I come from a multimedia background - the creative information technology jerks - and any graphic design lecturers I’ve come across have always tried to hammer home the importance of grid based design. Grid-based design has been around for eons, particularly for desktop publishing. There’s been a resurgence in interest amongst web designers over the past few years, Khoi Vin being the technique’s current poster child in terms of web design. Make no mistake about it, though - grid based design for the web has always been around. It’s one of those common sense things which people have been applying to designs subconsciously for years - the principle just becomes more interesting with research and analysis.

The design is far from finished - I’ve added hardly any polish whatsoever so far. I’ll refine it more over the coming days.

Make Leopard's transparent menu bar opaque

Posted by Jason Sat, 17 Nov 2007 11:34:47 GMT

Here’s the best solution yet for changing Leopard’s menu bar from that horrible dysfunctional transparent atrocity to an opaque one. This makes the menu bar look as though quartz extreme and core image are disabled.

sudo defaults write /System/Library/LaunchDaemons/com.apple.WindowServer 'EnvironmentVariables' -dict 'CI_NO_BACKGROUND_IMAGE' 0.62

Building & installing your own OSx86 Leopard 24

Posted by Jason Sun, 04 Nov 2007 12:00:04 GMT

Over the past week I became curious as to how difficult it would be to develop my own Leopard DVD to install on a regular PC which has been gathering dust for the past few months, so I decided to give it a shot. I did it mostly out of curiosity, since I already own an iMac and a MacBook Pro - both with Leopard installed using a family pack (thus I had three licenses to spare). It wasn’t really all that difficult to put together, but your mileage will vary pretty wildly depending on the kind of hardware you’re using. I should probably start this out with an obnoxious disclaimer:

Installing Mac OS X onto hardware not manufactured by Apple is a violation of the software’s EULA:

2. Permitted License Uses and Restrictions.
A. This License allows you to install and use one copy of the Apple Software on a
single Apple-labeled computer at a time. This License does not allow the Apple
Software to exist on more than one computer at a time,and you may not make the
Apple Software available over a network where it could be used by multiple
computers at the same time. You may make one copy of the Apple Software
(excluding the Boot ROM code) in machine-readable form for backup purposes
only; provided that the backup copy must include all copyright or other
proprietary notices contained on the original.

Violating a EULA is not illegal in most countries. Installing a copy of Mac OS X which you have not purchased most definitely is illegal in most countries.

Most of this guide is made using information supplied from all manner of places, this thread on the OSx86 Scene forums in particular. Why not just use the guide there you ask? Well, there are some things which are not explained very well and one or two things which are slightly inaccurate so hopefully this should be easier to follow. The files/shell scripts provided by BrazilMAC work great and form the basis for the scripts supplied with this guide. It should be noted that these files and shell scripts are largely taken from a Leopard patch which was leaked some months ago for earlier Leopard builds. I make no claim for having created these shell scripts, I’ve just made some minor changes and included some files necessary for making the drive bootable way easier. These files also originally came with assembler source to decrypt Leopard’s encrypted kernel - this can be found if you look hard enough (but is not required for what we’re doing here). With that out of the way and my shrink-wrapped copy of Leopard in hand, lets start.

Note: this entire guide assumes you have a Mac OS X installation available to you prior to actually installing Leopard on a regular home PC.

The files you’ll need - patch.zip

1. Preparing a disc image

Before we begin, we need to create a disc image of our original Leopard DVD. The Leopard DVD is a dual-layer DVD and since dual-layer media is still hideously expensive, we’re going to do some fiddling to reduce the size of our installer DVD down to 4.7GB so it will fit on a single layer DVD. Creating a disc image is really easy:

  • Open up Disk Utility
  • Select “Mac OS X Install Disc”
  • Click the New Image button, leave the settings as they are, and save this disc image to your Desktop

This will take a little bit of time, so go grab a coffee while it’s doing its thing.

2. Patching our disc image

Right, we now have a disc image. Put this image on your Desktop if it isn’t there already.

  • Place the contents “patch” (3 folders, 2 files) directory in the zip you downloaded earlier onto your Desktop
  • Time for a little shell script editing. Open patch.sh in a text editor of your choice.
  • APDIR=/Users/YOUR_USERNAME/Desktop
    
    DMG="/Users/YOUR_USERNAME/Desktop/YOUR_DISC_IMAGE.dmg"
  • Change YOUR_USERNAME to your account username under the Mac OS X install you’re currently in and change YOUR_DISC_IMAGE.dmg to the filename of your newly created Leopard image.
  • We’re now ready to patch our disc image. Open up a terminal window.
  • Run cd Desktop (you did remember to place the contents of the patch folder from the zip on your Desktop, right?)
  • Run sudo ./patch.sh and enter your password.
  • This will take a while, the shell script is going to first of all copy the contents of the DMG to an editable image for us, then it’ll remove unnecessary stuff to squeeze our DVD down to 4.7GB. It will also replace some kernel extensions as well as the installer DVD’s kernel itself. It’s worth noting that the kernel and kernel extensions the script is replacing are the ones used by the installer DVD itself to boot into its installation environment. The kernel extensions and kernel which is actually installed by the installer to your HD are unpatched - hence why we’ll need to do a little fiddling prior to our first boot after installation.
  • You may see some binding error messages regarding frameworks, but this is normal.
  • After patching, we’re left with a nice 4.7GB DVD image (Leo_Patched_DVD.iso - should be 4,698,669,056 bytes but if it’s a little out relax, it’s probably fine) which we can fit onto a regular DVD.
  • Burn this image to DVD and grab another a coffee.

3. Installing Leopard

Pop your DVD into your regular PC and boot using it - either change your boot device priority to place a CD-ROM/DVD-ROM prior to any hard drives or (usually) hit F12 to get a boot menu in which you can select a device to boot using.

When you see the Darwin bootloader, it will ask you to either press any key to begin installation or to press F8 to enter startup options. You’re probably going to want to become familiar with verbose boot mode for troubleshooting later so why not start now. Hit F8 and type -v and press return. This will boot OS X in verbose mode so we can see what’s happening.

All going well, the installer should eventually land us at a language selection screen in a few minutes. Once in the installer we need to setup the hard drive we’re going to install OS X onto. For simplicity’s sake I’m going to assume you’ve got an entire disk to dedicate to installing OS X upon. Go into the disk utilty and select the disk you wish to install OS X onto. Go to the partition tab and using the drop down menu select “1 Partition” and use a Macintosh Journaled filesystem (HFS+). Give your partition a name (and take note of it, we’ll use this later). Now, there’s something which is really important to do here so please don’t skip this. You wouldn’t believe the amount of people who miss this step and then wonder why in the hell they can’t boot OS X after installation. Click Options and select Master Boot Record since regular PC’s use a BIOS instead of EFI and so can’t boot using a GUID disk. Click partition and then close the disk utility.

Within the installer wizard, on the screen with the “customize” button, click it and de-select everything you can (you won’t be able to de-select the base system of course). Failing to do this will cause the installer to fail since we removed a lot of stuff when we patched our DVD.

Install OS X and grab several coffees.

4. Leopard post patching

Leopard is now (hopefully) installed, but before we can actually boot into it we need to do some post patching (replacing the kernel and some kernel extensions). We also need to flag our partition as bootable and install the Darwin bootloader. There’s a few ways of doing this including booting into a prior OSx86 installation of Tiger but I’m going to assume that such an installation isn’t available to you. So to do all of this we’re going to copy the files we need to a portable USB hard drive or thumb drive, whichever is available to you.

  • Extract the contents of the “patch” (3 folders, 2 files) folder within the zip you downloaded earlier into the root directory of your USB drive.
  • Time for more shell script editing. Open postpatch.sh in a text editor of your choice.
  • PATCH="/Volumes/YOUR_USB_VOLUME_NAME/leopatch/"
    LEO="/Volumes/Leopard"
  • Take note of the volume name for your USB drive and place it where YOUR_USB_VOLUME_NAME appears.
  • Remember when you took note of the volume name you installed Leopard onto earlier? Change /Volumes/Leopard to reflect the name of the volume where you installed Leopard to.
  • Boot into your Leopard installer once more. Plug your USB drive in at any time.
  • While in the installer, open up a terminal.
  • Run cd /Volumes/YOUR_USB_VOLUME_NAME
  • Run ./postpatch.sh
  • This should execute pretty quickly and may throw some errors regarding unfound kexts but that’s usually okay.
  • Assuming all went well you should now have a good Leopard install, now all we need to do is make it bootable.

5. Making it bootable

This bit is/was annoying as hell and pretty much every guide out there was either completely wrong or was worded incorrectly, so this is my own explanation of how to do it.

  • Open a terminal within the installer DVD once more
  • Run diskutil list
  • You’ll see a list of things like this:
  • /dev/disk0   #:                       TYPE NAME                    SIZE       IDENTIFIER
    
    0:     FDisk_partition_scheme                        *69.2 Gi    disk0
    
    1:                  Apple_HFS Macintosh HD            69.2 Gi    disk0s1
  • Take note of /dev/disk0 - the 0 is our disk number. Also take note of the # of the partition corresponding to where we installed Leopard, in this case 1. With this in mind we know we can access our Leopard partition, in this case, through /dev/disk0s1 - disk 0, partition 1.
  • Unmount your Leopard partition before you do anything else - either by going into disk utility and pressing the unmount button or by running ”diskutil unmount /dev/diskXsx” replacing diskXsx with the disk and partition number where Leopard is installed.
  • Run “fdisk -e /dev/rdiskX” where X is our disk number
  • Run update
  • Run flag 1
  • Run w
  • Run q
  • Right, that should see our partition active. Now to install the darwin bootloader.
  • Use cd to move into the makebootable folder in our USB drive, e.g. ”cd /Volume/MyUSBDrive/makebootable”
  • Lets put the bootloader, boot1h, at the start of our partition
  • Run “dd if=boot1h of=/dev/rdiskXsx bs=512 count=1” with rdiskXsx being replaced with the disk and partition number where Leopard is installed.
  • Enable the bootloader using startupfiletool
  • Run “./startupfiletool -v /dev/rdiskXsx boot” again, replacing rdiskXsx with where Leopard is installed
  • Now, lets bless the drive: “./bless24 -device /dev/diskXsx -setBoot –verbose”
  • Almost there! Mount the drive: “diskutil mount /dev/diskXsx”
  • Finally, bless the mount: “./bless24 -mount /Volumes/YOUR_VOLUME_NAME -setBoot -verbose”

Congratulations if you made it this far, we should now be good to go. Reboot your machine and it should (hopefully) boot into Leopard.

6. In closing

If everything works right away, fantastic! If not, there’s plenty of help at hand from the helpful folk at the OSx86 Scene Forums. Please please please don’t ask me to troubleshoot any problems you come across - there’s way too much that can go wrong with a regular OSx86 installation for me to know how to fix everything. Use the OSx86 forum’s search feature or chat to some of the people from there on IRC. If you spot something wrong in the guide, please let me know. I wrote in parts so I may have left something out or made a mistake or two here and there.

Hopefully after installing Leopard and having used it for a time you’ll do the right (and sane) thing and just buy a Mac. It’s easier and you won’t have to rely on a bunch of third party hackers to cobble together support. That said, it is an interesting thing to do and in doing so you will learn tons about Mac OS X’s innards - this alone was reason enough for me to give it a shot.

Now here's a guy I could stand behind. 4

Posted by Jason Thu, 01 Nov 2007 11:19:00 GMT

jobsforpresidentcopy.jpg