From 0d541cf17963f4452e3d3e25fe33779d902da7f7 Mon Sep 17 00:00:00 2001 From: Alexander Myltsev Date: Sat, 18 Jan 2025 15:57:47 +0400 Subject: [PATCH] Fix LLVM build. --- Makefile | 4 ++-- mbr.S | 28 ---------------------------- proc.c | 2 +- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index eedb0fe..df2407a 100644 --- a/Makefile +++ b/Makefile @@ -26,14 +26,14 @@ ASMFLAGS = -m32 -ffreestanding -c -g -I. ifeq ($(LLVM),on) ifeq ($(OS),Darwin) - LD=PATH=/usr/local/opt/llvm/bin:$(PATH) ld.lld + LD=PATH=/usr/local/opt/llvm/bin:"$(PATH)" ld.lld else LD=ld.lld endif CC=clang CFLAGS += -target elf-i386 -ASMFLAGS = -target elf-i386 -ffreestanding -c -g +ASMFLAGS += -target elf-i386 LDKERNELFLAGS = --script=script.ld endif diff --git a/mbr.S b/mbr.S index 227677c..9c3e018 100644 --- a/mbr.S +++ b/mbr.S @@ -3,16 +3,6 @@ .code16 .global _start _start: - mov $banner, %si - call print_string - - call switch_to_32bit - - hlt - jmp . // loop forever - - -switch_to_32bit: mov $2, %al out %al, $0x92 // enable A20 @@ -39,24 +29,6 @@ init_32bit: call bootmain // 7. load and run kernel jmp . // 8. loop forever - -.code16 -print_string: - mov $0x0e, %ah // "teletype output" -repeat: - lodsb // equivalent to mov (%si), %al; inc %si - - test %al, %al - je done - - int $0x10 // bios interrupt - jmp repeat -done: - ret - -banner: - .asciz "Loader \n" - .balign 4 gdt_start: .quad 0x0 // null descriptor diff --git a/proc.c b/proc.c index 4bacc84..ecfd065 100644 --- a/proc.c +++ b/proc.c @@ -23,8 +23,8 @@ struct kstack { struct task { struct taskstate tss; - struct kstack stack; pde_t *pgdir; + struct kstack stack; }; struct vm {