Skip to content

Instantly share code, notes, and snippets.

@VardanGrigoryan
Created May 3, 2014 15:18
Show Gist options
  • Save VardanGrigoryan/e2bdb2b6039254d3079f to your computer and use it in GitHub Desktop.
Save VardanGrigoryan/e2bdb2b6039254d3079f to your computer and use it in GitHub Desktop.
compile
rm -rf *.o *.bin *.img
nasm -f bin bootsect.asm -o bootsect.bin
gcc -ffreestanding -c main.c -o main.o
gcc -c video.c -o video.o
gcc -c ports.c -o ports.o
ld -e main -Ttext 0x1000 -o kernel.o main.o video.o ports.o
ld -i -e main -Ttext 0x1000 -o kernel.o main.o video.o ports.o
objcopy -R .note -R .comment -S -O binary kernel.o kernel.bin
./makeboot a.img bootsect.bin kernel.bin
echo " Running OS... ! "
qemu-system-i386 -fda a.img -no-fd-bootchk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment