Files
x86-bare-metal-examples/c_hello_world/run

8 lines
298 B
Plaintext
Raw Normal View History

2018-12-03 00:08:47 +00:00
#!/usr/bin/env bash
set -eux
as -ggdb3 --32 -o entry.o entry.S
2018-12-04 07:49:38 +00:00
gcc -c -ggdb3 -m16 -ffreestanding -fno-PIE -nostartfiles -nostdlib -o main.o -std=c99 main.c
2018-12-03 00:08:47 +00:00
ld -m elf_i386 -o main.elf -T linker.ld entry.o main.o
objcopy -O binary main.elf main.img
qemu-system-x86_64 -drive file=main.img,format=raw