Skip to content

Commit

Permalink
refactor: prepare for review
Browse files Browse the repository at this point in the history
  • Loading branch information
Yttehs-HDX committed Dec 11, 2024
1 parent f2d1e0e commit 04aff50
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ kernel/.gdb_history

# pycache
test/check_result/__pycache__

# build
kernel-qemu
sbi-qemu
sdcard.img
2 changes: 1 addition & 1 deletion kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ spin = "0.9.8"
debug = true

[features]
default = []
default = ["test"]
test = []
9 changes: 7 additions & 2 deletions kernel/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY : all build run test debug connect fmt clean
.PHONY : all build run test submit debug connect fmt clean

ARCH := riscv64gc-unknown-none-elf
BUILD_TYPE := release
Expand Down Expand Up @@ -33,7 +33,7 @@ GDB_FLAGS := -ex "file $(TARGET)" \
-ex "target remote :1234" \
-ex "set arch riscv:rv64"

all: run
all: submit

build:
@$(CARGO) build $(CARGO_FLAGS)
Expand All @@ -48,6 +48,11 @@ test: test-build
@cp $(TEST_IMG) $(TEST_IMG_COPY)
@$(QEMU) $(TEST_FLAGS) | tee $(OUTPUT)

submit: build
cp $(TARGET) ../kernel-qemu
cp ../bootloader/$(BIOS) ../sbi-qemu
cp $(TEST_IMG) ../sdcard.img

debug:
@echo -e "\033[33m[+] Run 'make connect' in another terminal at the same dir\033[0m"
@$(QEMU) $(TEST_FLAGS) -S -s
Expand Down
2 changes: 1 addition & 1 deletion user/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FS_IMG = sdcard.img
FS_PATH = $(TARGET_DIR)/sdcard.img
FS_MOUNT = $(TARGET_DIR)/mnt

all: fs
all: build

build:
@$(CARGO) build $(CARGO_FLAGS)
Expand Down

0 comments on commit 04aff50

Please sign in to comment.