diff --git a/Cargo.lock b/Cargo.lock index 34e1501..fd41e07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -689,7 +689,6 @@ version = "0.1.0" dependencies = [ "arch", "devices", - "irq_safety 0.1.1", "log", "sync", ] diff --git a/Makefile b/Makefile index 846b9e4..6e43cb3 100644 --- a/Makefile +++ b/Makefile @@ -106,7 +106,8 @@ fdt: @qemu-system-riscv64 -M 128m -machine virt,dumpdtb=virt.out fdtdump virt.out -justrun: build +justrun: fs-img + rust-objcopy --binary-architecture=$(ARCH) $(KERNEL_ELF) --strip-all -O binary $(KERNEL_BIN) $(QEMU_EXEC) cv1811h-build: build diff --git a/kernel/src/main.rs b/kernel/src/main.rs index c0cfba5..3d6a37f 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -155,10 +155,6 @@ impl ArchInterface for ArchInterfaceImpl { fn main(hart_id: usize) { disable_irq(); if hart_id == 0 { - // if hart_id != 0 { - // loop {} - // } - extern "C" { fn start(); fn end(); @@ -225,7 +221,7 @@ impl ArchInterface for ArchInterfaceImpl { // enable_irq(); loop { - // info!("aux core"); + info!("aux core"); } } } diff --git a/modules/executor/src/task.rs b/modules/executor/src/task.rs index 421251f..e4d8daa 100644 --- a/modules/executor/src/task.rs +++ b/modules/executor/src/task.rs @@ -6,14 +6,15 @@ use alloc::{ sync::{Arc, Weak}, vec::Vec, }; -use arch::addr::{PhysPage, VirtAddr, VirtPage}; -use arch::pagetable::{MappingFlags, MappingSize, PageTableWrapper}; -use arch::{TrapFrame, TrapFrameArgs, PAGE_SIZE}; +use arch::{ + addr::{PhysPage, VirtAddr, VirtPage}, + pagetable::{MappingFlags, MappingSize, PageTableWrapper}, + {TrapFrame, TrapFrameArgs, PAGE_SIZE} +}; use frame_allocator::{ceil_div, frame_alloc_much, FrameTracker}; use fs::File; use log::{debug, warn}; -use signal::REAL_TIME_SIGNAL_NUM; -pub use signal::{SigAction, SigProcMask, SignalFlags}; +use signal::{REAL_TIME_SIGNAL_NUM, SigAction, SigProcMask, SignalFlags}; use sync::{Mutex, MutexGuard, RwLock}; use vfscore::OpenFlags; diff --git a/modules/logging/Cargo.toml b/modules/logging/Cargo.toml index afdf298..af1680c 100644 --- a/modules/logging/Cargo.toml +++ b/modules/logging/Cargo.toml @@ -10,4 +10,3 @@ log = "0.4" arch = { path = "../../arch" } devices = { path = "../devices" } sync = { path = "../sync" } -irq_safety = { path = "../../crates/irq_safety" } diff --git a/modules/logging/src/lib.rs b/modules/logging/src/lib.rs index 5ecf3ff..c41eac1 100644 --- a/modules/logging/src/lib.rs +++ b/modules/logging/src/lib.rs @@ -1,13 +1,10 @@ #![no_std] -#[macro_use] extern crate alloc; use arch::{console_getchar, console_putchar}; use core::fmt::{self, Write}; use devices::MAIN_UART; -use irq_safety::MutexIrqSafe; - use log::{self, info, Level, LevelFilter, Log, Metadata, Record}; pub struct Logger; @@ -22,9 +19,6 @@ impl Log for Logger { return; } - static LOG_LOCK: MutexIrqSafe<()> = MutexIrqSafe::new(()); - LOG_LOCK.lock(); - let file = record.file(); let line = record.line();