]>
wirehaze git hosting - BOS.git/blob - mac-install.sh
3 # BOS MacOS X Installer version 0.2
4 # You must be root to run this script because of the floppy/loopback device
7 echo " BOS - MacOS X installer"
8 echo "-------------------------"
9 echo "Requires: Homebrew mtools"
12 if [ `id -u` != "0" ]; then
13 echo "You must be root to use this installer!"
19 echo "$0 image - Creates a floppy image called bos.img"
20 echo "$0 floppy - Install BOS into a floppy ( must be inserted )"
22 echo "Note: this installer will create a bootable image/floppy."
23 echo "Floppy creation is not tested ( I don't have a floppy reader ) and it should be already formatted"
27 echo "Compiling BOS..."
28 .
/utils
/osxfasm kernel
/kernel.asm kernel
/kernel.sys
29 .
/utils
/osxfasm boot
/BOS_boot.asm boot
/BOS_boot.bin
31 if [ "$1" = "floppy" ]; then
32 echo "Starting floppy installation..."
34 #Install BOS_boot.bin as bootsector into bos.img
35 dd if=boot
/BOS_boot.bin of
=/dev
/fd0 bs
=1 count
=512
38 #Insert kernel.sys into image
39 cp kernel
/kernel.sys
/mnt
/floppy
47 echo "Starting image creation..."
51 mformat
-C -f 1440 -v BOS
-i bos.img
::
53 #Erhm, it isn't pretty....
54 DISKNAME
=`hdiutil attach -nomount bos.img`
55 diskutil mount
$DISKNAME
56 MOUNTNAME
=`diskutil info $DISKNAME | grep 'Mount Point' | cut -d : -f 2 | sed 's/^ *//g' | sed 's/ *$//g';`
58 #Mounted, copy kernel.sys
59 cp kernel
/kernel.sys
$MOUNTNAME
61 #Install BOS_boot.bin as bootsector into bos.img
63 dd if=boot
/BOS_boot.bin of
=$DISKNAME bs
=1 count
=512
66 hdiutil detach
$DISKNAME
69 echo "BOS image created!"