Fix LLVM build.
This commit is contained in:
parent
3c6578cd1b
commit
0d541cf179
4
Makefile
4
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
|
||||
|
||||
|
||||
28
mbr.S
28
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user