diff --git a/Makefile.inc b/Makefile.inc index e18d7f77..4abc1818 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -1,5 +1,5 @@ CC = gcc LD = ld -m elf_i386 -CFLAGS = -Wall -m32 -O0 -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin +CFLAGS = -Wall -Wextra -pedantic -m32 -O0 -std=c99 -finline-functions -nostdinc -ffreestanding NASM = nasm -f elf diff --git a/bootdisk.img b/bootdisk.img index 18148ac8..8ada6bdd 100644 Binary files a/bootdisk.img and b/bootdisk.img differ diff --git a/start.asm b/start.asm index 1d21b460..946094f5 100644 --- a/start.asm +++ b/start.asm @@ -1,32 +1,21 @@ [BITS 32] -global start -start: - mov esp, _sys_stack - jmp stublet - ALIGN 4 mboot: MULTIBOOT_PAGE_ALIGN equ 1<<0 MULTIBOOT_MEMORY_INFO equ 1<<1 - MULTIBOOT_AOUT_KLUDGE equ 1<<16 MULTIBOOT_HEADER_MAGIC equ 0x1BADB002 - MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_AOUT_KLUDGE + MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) EXTERN code, bss, end ; GRUB Multiboot header, boot signature dd MULTIBOOT_HEADER_MAGIC dd MULTIBOOT_HEADER_FLAGS dd MULTIBOOT_CHECKSUM - ; AOUT kludge (must be physical addresses) - ; Linker script fills these in - dd mboot - dd code - dd bss - dd end - dd start ; Main entrypoint -stublet: +global start +start: + mov esp, _sys_stack extern main call main jmp $