This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
OS_Project/Part4/10_scheduler/s_compile.sh

15 lines
1.0 KiB
Bash
Raw Normal View History

2023-11-29 19:16:15 +00:00
#!/bin/bash
### interrupt.asm has no .c counterpart so it needs to be built first
nasm ./cpu/interrupt.asm -f elf -o interrupt.o
### Alternatively to see assembly output -S
### Generate .s the assembly language output prior to generating .o machine files -S
gcc -g -m32 -fno-pie -ffreestanding -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs -Wall -Wextra -Werror ./libc/mem.c ./libc/string.c ./drivers/keyboard.c ./drivers/screen.c ./cpu/isr.c ./cpu/ports.c ./cpu/idt.c ./cpu/timer.c ./libc/globals.c -S hello.c
### Generate .o machine files but do not link -c
### gcc -g -m32 -fno-pie -ffreestanding -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs -Wall -Wextra -Werror ./libc/mem.c ./libc/string.c ./drivers/keyboard.c ./drivers/screen.c ./cpu/isr.c ./cpu/ports.c ./cpu/idt.c ./cpu/timer.c ./libc/globals.c -c --entry start_ hello.c
### Do the final link to create executable "final" and set entry to 0x10000
### ld -m elf_i386 -o hey_there -Ttext 0x10000 *.o --oformat binary --entry start_