mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-25 16:52:29 +00:00
feat(rust): Implement Rust-for-SUB-OS kernel layer, ChaCha20 crypto, HWMON thermal governor, and lazybox applets
- Add freestanding no_std Rust kernel layer compiled with rustc - Implement memory-safe ChaCha20 RFC-8439 stream cipher and CSPRNG in Rust - Implement intelligent thermal fan speed governor in Rust - Add printk macro bridge (kprint!, kprintln!) for Rust - Register 'rustinfo' and 'chacha20' LazyBox applets - Enable x86_64 hardware FPU & SSE (CR4.OSFXSR/OSXMMEXCPT) - Add cross-architecture C-bridge for ARM targets - Update stage2.asm kernel sector copy bounds to 448 KB
This commit is contained in:
1 parent
20bd992876
commit
24deed8ead
13 files changed
+433
-10
No files matched your search
@@ -283,15 +283,19 @@ endif
|
||||
# Deduplicate
|
||||
CONFIG_SRCS-y := $(sort $(CONFIG_SRCS-y))
|
||||
|
||||
ALL_C_SRCS = $(ARCH_C_SRCS) $(CONFIG_SRCS-y)
|
||||
|
||||
# Object Files Mapping
|
||||
C_OBJS = $(patsubst %.c, $(BUILD_DIR)/%.o, $(ALL_C_SRCS))
|
||||
|
||||
# Rust Layer Configuration
|
||||
ifeq ($(ARCH), x86_64)
|
||||
RUSTC ?= rustc
|
||||
RUST_SRCS = $(shell find rust/src -name '*.rs' 2>/dev/null)
|
||||
RUST_LIB = $(BUILD_DIR)/rust/librust_kernel.a
|
||||
ALL_C_SRCS = $(ARCH_C_SRCS) $(CONFIG_SRCS-y)
|
||||
C_OBJS = $(patsubst %.c, $(BUILD_DIR)/%.o, $(ALL_C_SRCS))
|
||||
ASM_OBJS = $(patsubst %.asm, $(BUILD_DIR)/%.o, $(ARCH_ASM_SRCS))
|
||||
OTHER_OBJS = $(filter-out $(ENTRY_OBJ), $(ASM_OBJS) $(C_OBJS))
|
||||
OTHER_OBJS = $(filter-out $(ENTRY_OBJ), $(ASM_OBJS) $(C_OBJS)) $(RUST_LIB)
|
||||
else
|
||||
CONFIG_SRCS-y += rust/rust_fallback.c
|
||||
ALL_C_SRCS = $(ARCH_C_SRCS) $(CONFIG_SRCS-y)
|
||||
C_OBJS = $(patsubst %.c, $(BUILD_DIR)/%.o, $(ALL_C_SRCS))
|
||||
S_OBJS = $(patsubst %.S, $(BUILD_DIR)/%.o, $(ARCH_S_SRCS))
|
||||
OTHER_OBJS = $(filter-out $(ENTRY_OBJ), $(S_OBJS) $(C_OBJS))
|
||||
endif
|
||||
@@ -336,6 +340,12 @@ $(BUILD_DIR)/%.o: %.S
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
# Rust Source Compilation
|
||||
$(RUST_LIB): rust/src/lib.rs $(RUST_SRCS)
|
||||
@mkdir -p $(dir $@)
|
||||
$(RUSTC) --crate-type staticlib -C panic=abort -C relocation-model=static -C opt-level=2 -C no-redzone=y -o $@ rust/src/lib.rs
|
||||
|
||||
|
||||
# Header Generation Fallback
|
||||
include/config/autoconf.h:
|
||||
@mkdir -p include/config
|
||||
|
||||
Reference in new issue
Block a user