build: add a "user" arch to allow the kernel to run as a program on the host machine

This commit is contained in:
2023-02-25 17:58:23 +00:00
parent 8c87e78797
commit eed73e2414
21 changed files with 286 additions and 26 deletions

13
arch/user/extra.mk Normal file
View File

@@ -0,0 +1,13 @@
run: $(BUILD_DIR)/$(KERNEL_EXEC)
@printf " \033[1;93mEXEC\033[0m $<\n"
@$(BUILD_DIR)/$(KERNEL_EXEC)
debug: $(BUILD_DIR)/$(KERNEL_EXEC)
@if command -v gdb &> /dev/null; then \
gdb -tui $(BUILD_DIR)/$(KERNEL_EXEC) \
elif commad -v lldb &> /dev/null; then \
lldb -- $(BUILD_DIR)/$(KERNEL_EXEC) \
else \
printf "No debuggers available." \
endif