Fixed everything to work with the new libc

This commit is contained in:
2024-10-26 14:40:18 +02:00
parent 21c59b28f7
commit 5d420b0d68
14 changed files with 43 additions and 27 deletions
+2
View File
@@ -1,4 +1,6 @@
/* Third stage "prekernel" */
OUTPUT_FORMAT("binary")
SECTIONS {
.text 0x50000 : {
*(entry);
+22 -8
View File
@@ -4,12 +4,26 @@
include make.defaults
bootloader: $(BOOT_DIR)/stage1.asm $(BOOT_DIR)/stage2.asm $(BOOT_DIR)/stage3.c $(LIBC) $(LIBK)
@echo "Assembling $(BOOT_DIR)/stage1.asm..."
$(AS) -fbin -o $(BIN)/stage1.bin $(BOOT_DIR)/stage1.asm $(ASFLAGS)
@echo "Assembling $(BOOT_DIR)/stage2.asm..."
$(AS) -fbin -o $(BIN)/stage2.bin $(BOOT_DIR)/stage2.asm $(ASFLAGS)
@echo "Compiling $(BOOT_DIR)/stage3.c..."
$(CC) $(CFLAGS) -I$(LIBK_INC) -I$(LIBC_INC) -o $(BIN)/boot/stage3.o -c $(BOOT_DIR)/stage3.c
$(LD) $(LDFLAGS) -T$(BOOT_DIR)/stage3.ld --oformat binary -o $(BIN)/stage3.bin $(BIN)/boot/stage3.o $(LIBC) $(LIBK)
STAGE1 = $(BIN)/stage1.bin
STAGE2 = $(BIN)/stage2.bin
STAGE3 = $(BIN)/stage3.bin
STAGE1_SRC = $(BOOT_DIR)/stage1.s
STAGE2_SRC = $(BOOT_DIR)/stage2.s
STAGE3_SRC = $(BOOT_DIR)/stage3.c
STAGE3_OBJ = $(BIN)/boot/stage3.o
bootloader: $(STAGE1) $(STAGE2) $(STAGE3)
$(STAGE1): $(STAGE1_SRC)
@echo "Assembling $<..."
$(AS) -fbin -o $@ $< $(ASFLAGS)
$(STAGE2): $(STAGE2_SRC)
@echo "Assembling $<..."
$(AS) -fbin -o $@ $< $(ASFLAGS)
$(STAGE3): $(STAGE3_SRC)
@echo "Compiling $(STAGE3_SRC)..."
$(CC) $(CFLAGS) -I$(LIBK_INC) -I$(LIBC_INC) -o $(STAGE3_OBJ) -c $<
$(LD) $(LDFLAGS) -T$(BOOT_DIR)/linker.ld -o $@ $(STAGE3_OBJ) $(LIBK)
View File
View File
-1
View File
@@ -7,7 +7,6 @@
#include <disk/disk.h>
#include <fs/impl.h>
#include <fs/fs.h>
#include <stdio.h>
__attribute__ ((section("entry")))
void main() {