summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-05-01 16:45:04 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-05-01 16:45:04 +0200
commit8d675a7201780c1ef18c7cd22c3e53cfefe98285 (patch)
tree67a656c25b7fea2b15460dd13f8cdd241d56b5bd /src/Makefile
parent081dc76440b114fd7033868bc858710091e115d2 (diff)
downloadabaos-8d675a7201780c1ef18c7cd22c3e53cfefe98285.tar.gz
abaos-8d675a7201780c1ef18c7cd22c3e53cfefe98285.tar.bz2
playing with vga struct, fixed some boot loading issues
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/Makefile b/src/Makefile
index 94fb3f1..fcde58d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,5 +1,5 @@
CC := gcc
-CFLAGS := -std=c99 -m32 -ffreestanding -Os -g -Wall -Werror
+CFLAGS := -std=c99 -m32 -ffreestanding -O0 -g -Wall -Werror
LD := ld
all: image.bin
@@ -7,26 +7,30 @@ all: image.bin
image.bin: boot.bin kernel.bin
cat boot.bin kernel.bin > image.bin
# truncate to correct number of sectors, we have
- # 512 (boot) + N * 1024 (N currenty is 2)
- truncate -s 2560 image.bin
+ # 512 (boot, first stage) + N * 512 (N currenty is 3) + M * 512 (M is currently 2)
+ truncate -s 3072 image.bin
boot.bin: boot.asm gdt.asm stage1_functions.asm stage2_functions.asm switch_mode.asm
nasm boot.asm -f bin -o boot.bin
-kernel.bin: kernel.o
- $(LD) -o kernel.bin -Ttext 0x8000 kernel.o --oformat binary
+kernel.bin: kernel.o vga.o string.o
+ $(LD) -o kernel.bin -Ttext 0x8000 -m elf_i386 --oformat binary \
+ kernel.o vga.o string.o
kernel.o: kernel.c
$(CC) $(CFLAGS) -O0 -c -o kernel.o kernel.c
+vga.o: vga.c
+ $(CC) $(CFLAGS) -O0 -c -o vga.o vga.c
+
+string.o: string.c
+ $(CC) $(CFLAGS) -O0 -c -o string.o string.c
+
clean:
-rm -f boot.bin kernel.bin image.bin *.o
run-qemu: image.bin
- qemu-system-i386 -m 16 -drive "file=image.bin,if=ide,format=raw"
+ qemu-system-i386 -m 32 -drive "file=image.bin,if=ide,format=raw"
run-bochs:
bochs -q -f bochs.config 'boot:floppy' 'floppya: 1_44=image.bin, status=inserted'
-
-functions.o: functions.c
- $(CC) $(CFLAGS) -c -o functions.o functions.c