mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-24 13:13:24 +00:00
使用rust重写了apic的驱动 (#425)
* 使用rust重写了apic的驱动。 * 修正signal和调度器的部分加锁逻辑,增加回退策略。 * 把pcb的flags字段替换为无锁的 * 使用cargo管理apic的编译 * 删除makefile中指定PIC的变量 --------- Co-authored-by: Gou Ngai <ymd7823@outlook.com> Co-authored-by: 櫻井桃華 <89176634+TihayaKousaka@users.noreply.github.com>
This commit is contained in:
@ -8,9 +8,6 @@ lib_patterns := *.a
|
||||
LIB_FILES := $(foreach DIR,$(DIR_LIB),$(addprefix $(DIR)/,$(lib_patterns)))
|
||||
|
||||
|
||||
# 控制操作系统使用的中断控制器 _INTR_8259A_ _INTR_APIC_
|
||||
PIC := _INTR_APIC_
|
||||
|
||||
# unwind/backtrace related
|
||||
UNWIND_ENABLE ?= yes
|
||||
CFLAGS_UNWIND =
|
||||
@ -22,14 +19,14 @@ ifeq ($(UNWIND_ENABLE), yes)
|
||||
RUSTFLAGS_UNWIND = -Cforce-unwind-tables -Clink-arg=-Wl,eh_frame.ld
|
||||
endif
|
||||
|
||||
CFLAGS = $(GLOBAL_CFLAGS) -fno-pie $(CFLAGS_UNWIND) -D $(PIC) -I $(shell pwd) -I $(shell pwd)/include -I $(shell pwd)/arch/x86_64/include
|
||||
CFLAGS = $(GLOBAL_CFLAGS) -fno-pie $(CFLAGS_UNWIND) -I $(shell pwd) -I $(shell pwd)/include -I $(shell pwd)/arch/x86_64/include
|
||||
|
||||
export ASFLAGS := --64
|
||||
|
||||
LD_LIST := head.o
|
||||
|
||||
|
||||
kernel_subdirs := common driver debug arch exception smp sched syscall ktest libs time
|
||||
kernel_subdirs := common driver debug arch exception smp syscall ktest libs time
|
||||
|
||||
|
||||
head.o: head.S
|
||||
@ -43,9 +40,8 @@ main.o: main.c
|
||||
$(CC) $(CFLAGS) -c main.c -o main.o
|
||||
|
||||
kernel_rust:
|
||||
rustup default nightly
|
||||
|
||||
RUSTFLAGS="$(RUSTFLAGS_UNWIND)" cargo +nightly-2023-01-21 build --release --target ./arch/x86_64/x86_64-unknown-none.json
|
||||
|
||||
all: kernel
|
||||
|
||||
@echo "Linking kernel..."
|
||||
@ -78,7 +74,7 @@ ECHO:
|
||||
|
||||
$(kernel_subdirs): ECHO
|
||||
|
||||
$(MAKE) -C $@ all CFLAGS="$(CFLAGS)" ASFLAGS="$(ASFLAGS)" PIC="$(PIC)" kernel_root_path="$(shell pwd)"
|
||||
$(MAKE) -C $@ all CFLAGS="$(CFLAGS)" ASFLAGS="$(ASFLAGS)" kernel_root_path="$(shell pwd)"
|
||||
|
||||
kernel: head.o main.o $(kernel_subdirs) kernel_rust
|
||||
|
||||
|
Reference in New Issue
Block a user