Skip to content

Instantly share code, notes, and snippets.

@mafice
Created May 27, 2012 15:31
Show Gist options
  • Save mafice/2814771 to your computer and use it in GitHub Desktop.
Save mafice/2814771 to your computer and use it in GitHub Desktop.
convert Mach-O to plain binary
#
# install GNU Binutils
#
# cd /tmp
# curl -O http://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.gz
# tar vxf binutils-2.22.tar.gz
# cd binutils-2.22
# ./configure
# sudo make install
#
clang -arch i386 -c kernel.c
ld -arch i386 -e _startup -o kernel.macho kernel.o
objcopy -Obinary kernel.macho kernel.bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment