Fix LLVM build.

This commit is contained in:
Alexander Myltsev 2025-01-18 15:57:47 +04:00
parent 3c6578cd1b
commit 0d541cf179
3 changed files with 3 additions and 31 deletions

View File

@ -26,14 +26,14 @@ ASMFLAGS = -m32 -ffreestanding -c -g -I.
ifeq ($(LLVM),on) ifeq ($(LLVM),on)
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
LD=PATH=/usr/local/opt/llvm/bin:$(PATH) ld.lld LD=PATH=/usr/local/opt/llvm/bin:"$(PATH)" ld.lld
else else
LD=ld.lld LD=ld.lld
endif endif
CC=clang CC=clang
CFLAGS += -target elf-i386 CFLAGS += -target elf-i386
ASMFLAGS = -target elf-i386 -ffreestanding -c -g ASMFLAGS += -target elf-i386
LDKERNELFLAGS = --script=script.ld LDKERNELFLAGS = --script=script.ld
endif endif

28
mbr.S
View File

@ -3,16 +3,6 @@
.code16 .code16
.global _start .global _start
_start: _start:
mov $banner, %si
call print_string
call switch_to_32bit
hlt
jmp . // loop forever
switch_to_32bit:
mov $2, %al mov $2, %al
out %al, $0x92 // enable A20 out %al, $0x92 // enable A20
@ -39,24 +29,6 @@ init_32bit:
call bootmain // 7. load and run kernel call bootmain // 7. load and run kernel
jmp . // 8. loop forever 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 .balign 4
gdt_start: gdt_start:
.quad 0x0 // null descriptor .quad 0x0 // null descriptor

2
proc.c
View File

@ -23,8 +23,8 @@ struct kstack {
struct task { struct task {
struct taskstate tss; struct taskstate tss;
struct kstack stack;
pde_t *pgdir; pde_t *pgdir;
struct kstack stack;
}; };
struct vm { struct vm {