From b66488781fe10292962a6c85881c329dcbafd0ba Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 30 Apr 2017 21:34:51 +0200 Subject: accomodated for bigger bootloader stage2 fixed printing of rotating bar --- src/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 9132a1b..041a029 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,20 +1,23 @@ CC := gcc +CFLAGS := -std=c99 -m32 -ffreestanding LD := ld all: image.bin image.bin: boot.bin kernel.bin cat boot.bin kernel.bin > image.bin - truncate -s 1536 image.bin + # truncate to correct number of sectors, we have + # 512 (boot) + N * 1024 (N currenty is 2) + truncate -s 2560 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 -m elf_i386 --oformat binary + $(LD) -o kernel.bin -Ttext 0x8000 kernel.o --oformat binary kernel.o: kernel.c - $(CC) -m32 -ffreestanding -c -o kernel.o kernel.c + $(CC) $(CFLAGS) -O0 -c -o kernel.o kernel.c clean: -rm -f boot.bin kernel.bin image.bin *.o @@ -26,4 +29,4 @@ run-bochs: bochs -q -f bochs.config 'boot:floppy' 'floppya: 1_44=image.bin, status=inserted' functions.o: functions.c - gcc -m32 -ffreestanding -c -o functions.o functions.c + $(CC) $(CFLAGS) -c -o functions.o functions.c -- cgit v1.2.3-54-g00ecf