Skip to content

Instantly share code, notes, and snippets.

@tokkenno
Created September 2, 2016 11:13
Show Gist options
  • Select an option

  • Save tokkenno/219e53c61ca91e2ed2dd31b9c4be2fcd to your computer and use it in GitHub Desktop.

Select an option

Save tokkenno/219e53c61ca91e2ed2dd31b9c4be2fcd to your computer and use it in GitHub Desktop.
Compile an assambler file to be booted from a floppy or cdrom (ISO file).
#! /bin/bash
nasm -f bin -o os.bin src/os.asm
dd if=/dev/zero of=floppy.img bs=1024 count=1440
dd if=os.bin of=floppy.img seek=0 count=1 conv=notrunc
rm os.bin
mkdir iso
cp floppy.img dist/floppy.img
mv floppy.img iso/floppy.img
genisoimage -quiet -V 'MYOS' -input-charset iso8859-1 -o dist/cdrom.iso -b floppy.img -hide floppy.img iso/
rm -R iso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment