build: partially transition userpsace build system to CMake

Replace the legacy userpsace Makefile with the CMake build system for the kernel

The userspace is the only one still utilizing manual Makefiles, it will eventually be CMakified

Signed-off-by: kaguya <vpshinomiya@protonmail.com>
This commit is contained in:
kaguya
2026-04-15 01:41:48 -04:00
parent 426ad76676
commit 95cc19fd1a
96 changed files with 264 additions and 481 deletions
+1
View File
@@ -0,0 +1 @@
build/
+18
View File
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "linux-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu11",
"cppStandard": "${default}",
"intelliSenseMode": "linux-gcc-x64",
"compilerArgs": [
""
]
}
],
"version": 4
}
+24
View File
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": false,
"cwd": "/home/kaguya/KirkOS/src",
"program": "/home/kaguya/KirkOS/src/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
+59
View File
@@ -0,0 +1,59 @@
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "gnu11",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
+142
View File
@@ -0,0 +1,142 @@
cmake_minimum_required(VERSION 3.16)
project(KirkOS C ASM)
set(VERSION 1)
set(PATCHLEVEL 0)
set(SUBLEVEL 0)
set(EXTRAVERSION "-rc1")
set(KIRKOS_VERSION_STRING
"${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}"
)
message(STATUS "Building KirkOS version: ${KIRKOS_VERSION_STRING}")
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
file(GLOB_RECURSE KIRKOS_SOURCES
"${CMAKE_SOURCE_DIR}/src/*.c"
"${CMAKE_SOURCE_DIR}/src/*.S"
)
set(ISO_ROOT "${CMAKE_BINARY_DIR}/iso_root")
set(DISK_IMG "${CMAKE_BINARY_DIR}/disk.img")
set(ISO "${CMAKE_BINARY_DIR}/image.iso")
set(EXT2_ROOT "${CMAKE_SOURCE_DIR}/ext2_root")
add_executable(KirkOS ${KIRKOS_SOURCES})
target_compile_definitions(KirkOS PRIVATE
KIRKOS_VERSION="${KIRKOS_VERSION_STRING}"
KIRKOS_VERSION_MAJOR=${VERSION}
KIRKOS_VERSION_PATCH=${PATCHLEVEL}
KIRKOS_VERSION_SUB=${SUBLEVEL}
)
add_custom_command(
OUTPUT ${ISO_ROOT}/boot/KirkOS
DEPENDS KirkOS
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_FILE:KirkOS>
${ISO_ROOT}/boot/KirkOS
)
add_custom_target(iso_kernel DEPENDS ${ISO_ROOT}/boot/KirkOS)
set(LIMINE_DIR "${CMAKE_SOURCE_DIR}/limine")
add_custom_target(limine_files
COMMAND ${CMAKE_COMMAND} -E make_directory ${ISO_ROOT}/boot/limine
COMMAND ${CMAKE_COMMAND} -E make_directory ${ISO_ROOT}/EFI/BOOT
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/limine.conf ${ISO_ROOT}/boot/limine/
COMMAND ${CMAKE_COMMAND} -E copy ${LIMINE_DIR}/limine-bios.sys ${ISO_ROOT}/boot/limine/
COMMAND ${CMAKE_COMMAND} -E copy ${LIMINE_DIR}/limine-bios-cd.bin ${ISO_ROOT}/boot/limine/
COMMAND ${CMAKE_COMMAND} -E copy ${LIMINE_DIR}/limine-uefi-cd.bin ${ISO_ROOT}/boot/limine/
COMMAND ${CMAKE_COMMAND} -E copy ${LIMINE_DIR}/BOOTX64.EFI ${ISO_ROOT}/EFI/BOOT/
COMMAND ${CMAKE_COMMAND} -E copy ${LIMINE_DIR}/BOOTIA32.EFI ${ISO_ROOT}/EFI/BOOT/
)
add_custom_target(iso
DEPENDS iso_kernel limine_files
COMMAND xorriso -as mkisofs -R -r -J
-b boot/limine/limine-bios-cd.bin
-no-emul-boot -boot-load-size 4 -boot-info-table
-hfsplus
-apm-block-size 2048
--efi-boot boot/limine/limine-uefi-cd.bin
-efi-boot-part --efi-boot-image
--protective-msdos-label
${ISO_ROOT}
-o ${ISO}
COMMAND ${LIMINE_DIR}/limine bios-install ${ISO}
)
add_custom_target(disk_img
COMMAND dd if=/dev/zero of=${DISK_IMG} bs=1M count=32
COMMAND mkfs.ext2 -F -L KIRKOS ${DISK_IMG}
COMMAND guestfish --rw -a ${DISK_IMG} run
COMMAND guestfish --rw -a ${DISK_IMG} -m /dev/sda mkdir /root
COMMAND guestfish --rw -a ${DISK_IMG} -m /dev/sda copy-in ${EXT2_ROOT}/. /
COMMENT "Creating ext2 disk image via guestfish"
)
add_custom_target(run
DEPENDS iso disk_img
COMMAND qemu-system-x86_64
-cdrom ${ISO}
-hda ${DISK_IMG}
-debugcon stdio
-m 8G
-smp 2
-device ich9-intel-hda
-device hda-duplex
)
add_custom_target(debug
DEPENDS iso disk_img
COMMAND qemu-system-x86_64
-cdrom ${ISO}
-hda ${DISK_IMG}
-s -S
-debugcon stdio
-d int,cpu_reset
-m 8G
-smp 2
-device ich9-intel-hda,id=hda
-device hda-duplex,id=codec0,bus=hda.0,cad=0
)
target_include_directories(KirkOS PRIVATE
"${CMAKE_SOURCE_DIR}/src"
)
# ----------------------------------------
# DEFAULT C FLAGS (cacheable overrides)
# ----------------------------------------
set(KIRKOS_CFLAGS "-g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fno-PIC -ffunction-sections -fdata-sections -m64 -march=x86-64 -mabi=sysv -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -mcmodel=kernel"
CACHE STRING "Default CFLAGS for KirkOS")
set(KIRKOS_LDFLAGS "-nostdlib -static -Wl,--gc-sections -Wl,-T,../linker.lds -Wl,-z,max-page-size=0x1000 -Wl,-m,elf_x86_64"
CACHE STRING "Default LDFLAGS for KirkOS")
# ----------------------------------------
# Apply flags
# ----------------------------------------
separate_arguments(_cflags UNIX_COMMAND "${KIRKOS_CFLAGS}")
separate_arguments(_ldflags UNIX_COMMAND "${KIRKOS_LDFLAGS}")
target_compile_options(KirkOS PRIVATE ${_cflags})
target_link_options(KirkOS PRIVATE ${_ldflags})
-207
View File
@@ -1,207 +0,0 @@
# Nuke built-in rules.
.SUFFIXES:
# This is the name that our final executable will have.
# Change as needed.
override OUTPUT := kirkos
# User controllable toolchain and toolchain prefix.
TOOLCHAIN :=
TOOLCHAIN_PREFIX :=
ifneq ($(TOOLCHAIN),)
ifeq ($(TOOLCHAIN_PREFIX),)
TOOLCHAIN_PREFIX := $(TOOLCHAIN)-
endif
endif
# User controllable C compiler command.
ifneq ($(TOOLCHAIN_PREFIX),)
CC := $(TOOLCHAIN_PREFIX)gcc
else
CC := cc
endif
# User controllable linker command.
LD := $(TOOLCHAIN_PREFIX)ld
# Defaults overrides for variables if using "llvm" as toolchain.
ifeq ($(TOOLCHAIN),llvm)
CC := clang
LD := ld.lld
endif
# User controllable C flags.
CFLAGS := -g -O2 -pipe
# User controllable C preprocessor flags. We set none by default.
CPPFLAGS :=
# User controllable nasm flags.
NASMFLAGS := -g
ISO_ROOT := iso_root
ISO := image.iso
EXT2_ROOT := ext2_root
DISK_IMG := disk.img
# User controllable linker flags. We set none by default.
LDFLAGS :=
# Check if CC is Clang.
override CC_IS_CLANG := $(shell ! $(CC) --version 2>/dev/null | grep -q '^Target: '; echo $$?)
# If the C compiler is Clang, set the target as needed.
ifeq ($(CC_IS_CLANG),1)
override CC += \
-target x86_64-unknown-none-elf
endif
# Internal C flags that should not be changed by the user.
override CFLAGS += \
-Wall \
-Wextra \
-std=gnu11 \
-ffreestanding \
-fno-stack-protector \
-fno-stack-check \
-fno-lto \
-fno-PIC \
-ffunction-sections \
-fdata-sections \
-m64 \
-march=x86-64 \
-mabi=sysv \
-mno-80387 \
-mno-mmx \
-mno-sse \
-mno-sse2 \
-mno-red-zone \
-mcmodel=kernel
# Internal C preprocessor flags that should not be changed by the user.
override CPPFLAGS := \
-I src \
$(CPPFLAGS) \
-MMD \
-MP
# Internal nasm flags that should not be changed by the user.
override NASMFLAGS := \
-f elf64 \
$(patsubst -g,-g -F dwarf,$(NASMFLAGS)) \
-Wall
# Internal linker flags that should not be changed by the user.
override LDFLAGS += \
-m elf_x86_64 \
-nostdlib \
-static \
-z max-page-size=0x1000 \
--gc-sections \
-T linker.lds
# Use "find" to glob all *.c, *.S, and *.asm files in the tree and obtain the
# object and header dependency file names.
override SRCFILES := $(shell find -L src -type f 2>/dev/null | LC_ALL=C sort)
override CFILES := $(filter %.c,$(SRCFILES))
override ASFILES := $(filter %.S,$(SRCFILES))
override NASMFILES := $(filter %.asm,$(SRCFILES))
override OBJ := $(addprefix obj/,$(CFILES:.c=.c.o) $(ASFILES:.S=.S.o) $(NASMFILES:.asm=.asm.o))
override HEADER_DEPS := $(addprefix obj/,$(CFILES:.c=.c.d) $(ASFILES:.S=.S.d))
# Default target. This must come first, before header dependencies.
.PHONY: all run clean-iso iso limine debug
all: bin/$(OUTPUT)
LIMINE_DIR := limine
# Include header dependencies.
-include $(HEADER_DEPS)
# Link rules for the final executable.
bin/$(OUTPUT): GNUmakefile linker.lds $(OBJ)
mkdir -p "$(dir $@)"
$(LD) $(LDFLAGS) $(OBJ) -o $@
# Compilation rules for *.c files.
obj/%.c.o: %.c GNUmakefile
mkdir -p "$(dir $@)"
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
# Compilation rules for *.S files.
obj/%.S.o: %.S GNUmakefile
mkdir -p "$(dir $@)"
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
# Compilation rules for *.asm (nasm) files.
obj/%.asm.o: %.asm GNUmakefile
mkdir -p "$(dir $@)"
nasm $(NASMFLAGS) $< -o $@
$(DISK_IMG): $(EXT2_ROOT)
@echo "Creating ext2 disk image from $(EXT2_ROOT)..."
dd if=/dev/zero of=$(DISK_IMG) bs=1M count=32
mkfs.ext2 -F -L KIRKOS $(DISK_IMG)
mkdir -p mnt
sudo mount -o loop $(DISK_IMG) mnt
sudo cp -r $(EXT2_ROOT)/* mnt/
sudo umount mnt
rmdir mnt
@echo "Done: $(DISK_IMG) created"
# Build ISO directory structure
$(ISO_ROOT):
mkdir -p $(ISO_ROOT)/boot
mkdir -p $(ISO_ROOT)/boot/limine
mkdir -p $(ISO_ROOT)/EFI/BOOT
# Copy kernel
$(ISO_ROOT)/boot/$(OUTPUT): bin/$(OUTPUT) | $(ISO_ROOT)
cp -v bin/$(OUTPUT) $(ISO_ROOT)/boot/
# Copy limine BIOS/UEFI files
limine-files: | $(ISO_ROOT)
cp -v limine.conf \
$(LIMINE_DIR)/limine-bios.sys \
$(LIMINE_DIR)/limine-bios-cd.bin \
$(LIMINE_DIR)/limine-uefi-cd.bin \
$(ISO_ROOT)/boot/limine
cp -v $(LIMINE_DIR)/BOOTX64.EFI $(ISO_ROOT)/EFI/BOOT/
cp -v $(LIMINE_DIR)/BOOTIA32.EFI $(ISO_ROOT)/EFI/BOOT/
# Build ISO
iso: all $(ISO_ROOT)/boot/$(OUTPUT) limine-files
xorriso -as mkisofs -R -r -J \
-b boot/limine/limine-bios-cd.bin \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-hfsplus \
-apm-block-size 2048 \
--efi-boot boot/limine/limine-uefi-cd.bin \
-efi-boot-part --efi-boot-image \
--protective-msdos-label \
$(ISO_ROOT) -o $(ISO)
./$(LIMINE_DIR)/limine bios-install $(ISO)
# Run in QEMU
run: $(DISK_IMG) iso
qemu-system-x86_64 -cdrom $(ISO) -hda $(DISK_IMG) -debugcon stdio -m 8G -smp 2 -device ich9-intel-hda -device hda-duplex
debug: iso $(DISK_IMG)
qemu-system-x86_64 \
-cdrom $(ISO) -hda $(DISK_IMG) \
-s -S -debugcon stdio -d int,cpu_reset -m 8G -smp 2 -device ich9-intel-hda,id=hda -device hda-duplex,id=codec0,bus=hda.0,cad=0
# Clean ISO artifacts
clean-iso:
rm -rf $(ISO_ROOT) $(ISO)
# Remove object files and the final executable.
.PHONY: clean
clean:
rm -rf bin obj $(DISK_IMG)
+15
View File
@@ -0,0 +1,15 @@
# KirkOS
i suppose
## how to build
uhh
```bash
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
cd ..
cmake --build build --target run
```
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -7,4 +7,4 @@ timeout: 5
protocol: limine
# Path to the kernel to boot. boot():/ represents the partition on which limine.conf is located.
path: boot():/boot/kirkos
path: boot():/boot/KirkOS
-5
View File
@@ -1,5 +0,0 @@
obj/src/arch/x86_64/ata.c.o: src/arch/x86_64/ata.c src/arch/x86_64/ata.h \
src/arch/x86_64/io.h src/stdio.h
src/arch/x86_64/ata.h:
src/arch/x86_64/io.h:
src/stdio.h:
Binary file not shown.
-4
View File
@@ -1,4 +0,0 @@
obj/src/arch/x86_64/e9.c.o: src/arch/x86_64/e9.c src/arch/x86_64/e9.h \
src/arch/x86_64/io.h
src/arch/x86_64/e9.h:
src/arch/x86_64/io.h:
Binary file not shown.
-6
View File
@@ -1,6 +0,0 @@
obj/src/arch/x86_64/gdt.c.o: src/arch/x86_64/gdt.c src/arch/x86_64/gdt.h \
src/mm/memory.h src/mm/slab.h src/mp/spinlock.h
src/arch/x86_64/gdt.h:
src/mm/memory.h:
src/mm/slab.h:
src/mp/spinlock.h:
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
obj/src/arch/x86_64/gdt_asm.S.o: src/arch/x86_64/gdt_asm.S
Binary file not shown.
-4
View File
@@ -1,4 +0,0 @@
obj/src/arch/x86_64/i8259.c.o: src/arch/x86_64/i8259.c \
src/arch/x86_64/pic.h src/arch/x86_64/io.h
src/arch/x86_64/pic.h:
src/arch/x86_64/io.h:
Binary file not shown.
-4
View File
@@ -1,4 +0,0 @@
obj/src/arch/x86_64/idt.c.o: src/arch/x86_64/idt.c src/arch/x86_64/idt.h \
src/util/binary.h
src/arch/x86_64/idt.h:
src/util/binary.h:
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
obj/src/arch/x86_64/idt_asm.S.o: src/arch/x86_64/idt_asm.S
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
obj/src/arch/x86_64/io_asm.S.o: src/arch/x86_64/io_asm.S
Binary file not shown.
-6
View File
@@ -1,6 +0,0 @@
obj/src/arch/x86_64/ioapic.c.o: src/arch/x86_64/ioapic.c \
src/arch/x86_64/ioapic.h src/stdio.h src/mm/vmm.h src/limine.h
src/arch/x86_64/ioapic.h:
src/stdio.h:
src/mm/vmm.h:
src/limine.h:
-11
View File
@@ -1,11 +0,0 @@
obj/src/arch/x86_64/irq.c.o: src/arch/x86_64/irq.c src/arch/x86_64/irq.h \
src/arch/x86_64/isr.h src/arch/x86_64/i8259.h src/arch/x86_64/pic.h \
src/arch/x86_64/io.h src/util/arrays.h src/stdio.h src/debug.h
src/arch/x86_64/irq.h:
src/arch/x86_64/isr.h:
src/arch/x86_64/i8259.h:
src/arch/x86_64/pic.h:
src/arch/x86_64/io.h:
src/util/arrays.h:
src/stdio.h:
src/debug.h:
Binary file not shown.
-7
View File
@@ -1,7 +0,0 @@
obj/src/arch/x86_64/isr.c.o: src/arch/x86_64/isr.c src/arch/x86_64/io.h \
src/debug.h src/stdio.h src/arch/x86_64/isr.h src/arch/x86_64/idt.h
src/arch/x86_64/io.h:
src/debug.h:
src/stdio.h:
src/arch/x86_64/isr.h:
src/arch/x86_64/idt.h:
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
obj/src/arch/x86_64/isr_asm.S.o: src/arch/x86_64/isr_asm.S
Binary file not shown.
-4
View File
@@ -1,4 +0,0 @@
obj/src/arch/x86_64/isrs_gen.c.o: src/arch/x86_64/isrs_gen.c \
src/arch/x86_64/idt.h src/arch/x86_64/gdt.h
src/arch/x86_64/idt.h:
src/arch/x86_64/gdt.h:
Binary file not shown.
-21
View File
@@ -1,21 +0,0 @@
obj/src/arch/x86_64/lapic.c.o: src/arch/x86_64/lapic.c \
src/arch/x86_64/lapic.h src/arch/x86_64/ioapic.h src/arch/x86_64/i8259.h \
src/arch/x86_64/pic.h src/mm/vmm.h src/limine.h src/arch/x86_64/pit.h \
src/arch/x86_64/irq.h src/arch/x86_64/isr.h src/arch/x86_64/io.h \
src/stdio.h src/arch/x86_64/e9.h src/arch/x86_64/rtc.h \
src/sched/scheduler.h src/sched/thread.h
src/arch/x86_64/lapic.h:
src/arch/x86_64/ioapic.h:
src/arch/x86_64/i8259.h:
src/arch/x86_64/pic.h:
src/mm/vmm.h:
src/limine.h:
src/arch/x86_64/pit.h:
src/arch/x86_64/irq.h:
src/arch/x86_64/isr.h:
src/arch/x86_64/io.h:
src/stdio.h:
src/arch/x86_64/e9.h:
src/arch/x86_64/rtc.h:
src/sched/scheduler.h:
src/sched/thread.h:
Binary file not shown.
-13
View File
@@ -1,13 +0,0 @@
obj/src/arch/x86_64/pit.c.o: src/arch/x86_64/pit.c src/arch/x86_64/pit.h \
src/arch/x86_64/irq.h src/arch/x86_64/isr.h src/arch/x86_64/io.h \
src/stdio.h src/arch/x86_64/e9.h src/arch/x86_64/rtc.h \
src/sched/scheduler.h src/sched/thread.h
src/arch/x86_64/pit.h:
src/arch/x86_64/irq.h:
src/arch/x86_64/isr.h:
src/arch/x86_64/io.h:
src/stdio.h:
src/arch/x86_64/e9.h:
src/arch/x86_64/rtc.h:
src/sched/scheduler.h:
src/sched/thread.h:
Binary file not shown.
-4
View File
@@ -1,4 +0,0 @@
obj/src/arch/x86_64/rtc.c.o: src/arch/x86_64/rtc.c src/arch/x86_64/rtc.h \
src/arch/x86_64/io.h
src/arch/x86_64/rtc.h:
src/arch/x86_64/io.h:
Binary file not shown.
-12
View File
@@ -1,12 +0,0 @@
obj/src/arch/x86_64/usermode.c.o: src/arch/x86_64/usermode.c src/string.h \
src/mm/pmm.h src/limine.h src/mm/vmm.h src/mp/spinlock.h src/mm/memory.h \
src/mm/slab.h src/stdio.h src/fs/elf.h
src/string.h:
src/mm/pmm.h:
src/limine.h:
src/mm/vmm.h:
src/mp/spinlock.h:
src/mm/memory.h:
src/mm/slab.h:
src/stdio.h:
src/fs/elf.h:
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
obj/src/debug.c.o: src/debug.c src/debug.h src/stdio.h
src/debug.h:
src/stdio.h:
BIN
View File
Binary file not shown.
-13
View File
@@ -1,13 +0,0 @@
obj/src/fs/elf.c.o: src/fs/elf.c src/fs/elf.h src/stdio.h src/string.h \
src/mm/pmm.h src/limine.h src/mm/vmm.h src/mp/spinlock.h src/mm/memory.h \
src/mm/slab.h src/fs/ext2.h
src/fs/elf.h:
src/stdio.h:
src/string.h:
src/mm/pmm.h:
src/limine.h:
src/mm/vmm.h:
src/mp/spinlock.h:
src/mm/memory.h:
src/mm/slab.h:
src/fs/ext2.h:
Binary file not shown.
-9
View File
@@ -1,9 +0,0 @@
obj/src/fs/ext2.c.o: src/fs/ext2.c src/fs/ext2.h src/arch/x86_64/ata.h \
src/mm/memory.h src/mm/slab.h src/stdio.h src/string.h src/mp/spinlock.h
src/fs/ext2.h:
src/arch/x86_64/ata.h:
src/mm/memory.h:
src/mm/slab.h:
src/stdio.h:
src/string.h:
src/mp/spinlock.h:
Binary file not shown.
-7
View File
@@ -1,7 +0,0 @@
obj/src/fs/vfs.c.o: src/fs/vfs.c src/fs/vfs.h src/fs/ext2.h \
src/video/render.h src/arch/x86_64/e9.h src/mp/spinlock.h
src/fs/vfs.h:
src/fs/ext2.h:
src/video/render.h:
src/arch/x86_64/e9.h:
src/mp/spinlock.h:
Binary file not shown.
-26
View File
@@ -1,26 +0,0 @@
obj/src/main.c.o: src/main.c src/limine.h src/video/render.h \
src/video/tga.h src/stdio.h src/arch/x86_64/gdt.h src/arch/x86_64/idt.h \
src/arch/x86_64/isr.h src/arch/x86_64/irq.h src/mm/memory.h \
src/mm/slab.h src/mm/pmm.h src/mm/vmm.h src/mp/spinlock.h \
src/arch/x86_64/ata.h src/fs/ext2.h src/string.h src/arch/x86_64/io.h \
src/arch/x86_64/usermode.h src/syscall/syscall.h src/fs/vfs.h
src/limine.h:
src/video/render.h:
src/video/tga.h:
src/stdio.h:
src/arch/x86_64/gdt.h:
src/arch/x86_64/idt.h:
src/arch/x86_64/isr.h:
src/arch/x86_64/irq.h:
src/mm/memory.h:
src/mm/slab.h:
src/mm/pmm.h:
src/mm/vmm.h:
src/mp/spinlock.h:
src/arch/x86_64/ata.h:
src/fs/ext2.h:
src/string.h:
src/arch/x86_64/io.h:
src/arch/x86_64/usermode.h:
src/syscall/syscall.h:
src/fs/vfs.h:
BIN
View File
Binary file not shown.
-7
View File
@@ -1,7 +0,0 @@
obj/src/mm/memory.c.o: src/mm/memory.c src/mm/pmm.h src/limine.h \
src/stdio.h src/mm/vmm.h src/mp/spinlock.h
src/mm/pmm.h:
src/limine.h:
src/stdio.h:
src/mm/vmm.h:
src/mp/spinlock.h:
Binary file not shown.
-9
View File
@@ -1,9 +0,0 @@
obj/src/mm/pmm.c.o: src/mm/pmm.c src/mm/pmm.h src/limine.h src/mm/vmm.h \
src/mp/spinlock.h src/mm/memory.h src/mm/slab.h src/stdio.h
src/mm/pmm.h:
src/limine.h:
src/mm/vmm.h:
src/mp/spinlock.h:
src/mm/memory.h:
src/mm/slab.h:
src/stdio.h:
Binary file not shown.
-11
View File
@@ -1,11 +0,0 @@
obj/src/mm/slab.c.o: src/mm/slab.c src/mm/memory.h src/mm/slab.h \
src/mp/spinlock.h src/mm/pmm.h src/limine.h src/mm/slab.h src/mm/vmm.h \
src/stdio.h
src/mm/memory.h:
src/mm/slab.h:
src/mp/spinlock.h:
src/mm/pmm.h:
src/limine.h:
src/mm/slab.h:
src/mm/vmm.h:
src/stdio.h:
Binary file not shown.
-9
View File
@@ -1,9 +0,0 @@
obj/src/mm/vmm.c.o: src/mm/vmm.c src/mm/vmm.h src/limine.h \
src/mp/spinlock.h src/mm/pmm.h src/mm/memory.h src/mm/slab.h src/stdio.h
src/mm/vmm.h:
src/limine.h:
src/mp/spinlock.h:
src/mm/pmm.h:
src/mm/memory.h:
src/mm/slab.h:
src/stdio.h:
Binary file not shown.
-12
View File
@@ -1,12 +0,0 @@
obj/src/mp/mp.c.o: src/mp/mp.c src/mp/mp.h src/mp/percpu.h \
src/sched/thread.h src/arch/x86_64/gdt.h src/arch/x86_64/lapic.h \
src/limine.h src/arch/x86_64/idt.h src/mm/memory.h src/stdio.h
src/mp/mp.h:
src/mp/percpu.h:
src/sched/thread.h:
src/arch/x86_64/gdt.h:
src/arch/x86_64/lapic.h:
src/limine.h:
src/arch/x86_64/idt.h:
src/mm/memory.h:
src/stdio.h:
BIN
View File
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
obj/src/mp/mp_asm.S.o: src/mp/mp_asm.S
Binary file not shown.
-6
View File
@@ -1,6 +0,0 @@
obj/src/mp/mutex.c.o: src/mp/mutex.c src/mp/mutex.h src/mp/spinlock.h \
src/sched/scheduler.h src/sched/thread.h
src/mp/mutex.h:
src/mp/spinlock.h:
src/sched/scheduler.h:
src/sched/thread.h:
Binary file not shown.
-5
View File
@@ -1,5 +0,0 @@
obj/src/mp/percpu.c.o: src/mp/percpu.c src/mp/percpu.h src/sched/thread.h \
src/arch/x86_64/gdt.h
src/mp/percpu.h:
src/sched/thread.h:
src/arch/x86_64/gdt.h:
Binary file not shown.
-6
View File
@@ -1,6 +0,0 @@
obj/src/mp/semaphore.c.o: src/mp/semaphore.c src/mp/semaphore.h \
src/mp/spinlock.h src/sched/scheduler.h src/sched/thread.h
src/mp/semaphore.h:
src/mp/spinlock.h:
src/sched/scheduler.h:
src/sched/thread.h:
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
obj/src/mp/spinlock.c.o: src/mp/spinlock.c src/mp/spinlock.h
src/mp/spinlock.h:
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
obj/src/sched/context.S.o: src/sched/context.S
Binary file not shown.
-9
View File
@@ -1,9 +0,0 @@
obj/src/sched/scheduler.c.o: src/sched/scheduler.c src/sched/scheduler.h \
src/sched/thread.h src/mp/spinlock.h src/mm/memory.h src/stdio.h \
src/string.h
src/sched/scheduler.h:
src/sched/thread.h:
src/mp/spinlock.h:
src/mm/memory.h:
src/stdio.h:
src/string.h:
Binary file not shown.
-7
View File
@@ -1,7 +0,0 @@
obj/src/sched/thread.c.o: src/sched/thread.c src/sched/thread.h \
src/sched/scheduler.h src/mm/memory.h src/string.h src/stdio.h
src/sched/thread.h:
src/sched/scheduler.h:
src/mm/memory.h:
src/string.h:
src/stdio.h:
Binary file not shown.
-7
View File
@@ -1,7 +0,0 @@
obj/src/stdio.c.o: src/stdio.c src/stdio.h src/debug.h src/video/render.h \
src/arch/x86_64/e9.h src/mp/spinlock.h
src/stdio.h:
src/debug.h:
src/video/render.h:
src/arch/x86_64/e9.h:
src/mp/spinlock.h:
BIN
View File
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
obj/src/string.c.o: src/string.c src/string.h
src/string.h:
Binary file not shown.
-5
View File
@@ -1,5 +0,0 @@
obj/src/syscall/syscall.c.o: src/syscall/syscall.c src/stdio.h \
src/fs/vfs.h src/fs/ext2.h
src/stdio.h:
src/fs/vfs.h:
src/fs/ext2.h:
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
obj/src/syscall/syscall_entry.S.o: src/syscall/syscall_entry.S
Binary file not shown.
-6
View File
@@ -1,6 +0,0 @@
obj/src/video/render.c.o: src/video/render.c src/video/font.h \
src/video/render.h src/mm/memory.h src/mm/slab.h
src/video/font.h:
src/video/render.h:
src/mm/memory.h:
src/mm/slab.h:
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
obj/src/video/tga.c.o: src/video/tga.c src/mm/memory.h src/mm/slab.h
src/mm/memory.h:
src/mm/slab.h:
Binary file not shown.
+1
View File
@@ -324,6 +324,7 @@ void kmain(void) {
}
VFS_Close(fd);
printf("\nKirkOS %s\n", KIRKOS_VERSION);
x86_64_EnableInterrupts();
syscall_init();
+3 -1
View File
@@ -3,6 +3,8 @@ LD = ld
BUILD = build
EXT2_ROOT = ../ext2_root
CFLAGS = \
-m64 \
-O2 \
@@ -42,7 +44,7 @@ $(BUILD)/init.elf: $(OBJ)
$(LD) $(LDFLAGS) $^ -o $@
install: $(BUILD)/init.elf
cp $(BUILD)/init.elf /home/kaguya/testOS/ext2_root/init.elf
cp $(BUILD)/init.elf $(EXT2_ROOT)/init.elf
clean:
rm -rf $(BUILD)
BIN
View File
Binary file not shown.