增加了timekeeping模块 (#106)

* 增加了timekeeping模块

* 格式化文档和细节更改

Co-authored-by: longjin <longjin@RinGoTek.cn>
This commit is contained in:
Gou Ngai
2022-12-14 15:13:54 +08:00
committed by GitHub
parent 728aca3089
commit 01876902fb
4 changed files with 78 additions and 6 deletions

View File

@ -3,7 +3,7 @@
#![feature(core_intrinsics)] // <2>
#![feature(alloc_error_handler)]
#![feature(panic_info_message)]
#![feature(drain_filter)]// 允许Vec的drain_filter特性
#![feature(drain_filter)] // 允许Vec的drain_filter特性
#[allow(non_upper_case_globals)]
#[allow(non_camel_case_types)]
@ -18,18 +18,22 @@ mod ipc;
#[macro_use]
mod libs;
mod driver;
mod mm;
mod process;
mod sched;
mod smp;
mod driver;
mod time;
extern crate alloc;
use mm::allocator::KernelAllocator;
// <3>
use crate::{include::bindings::bindings::{process_do_exit, BLACK, GREEN}, arch::x86_64::asm::current::current_pcb};
use crate::{
arch::x86_64::asm::current::current_pcb,
include::bindings::bindings::{process_do_exit, BLACK, GREEN},
};
// 声明全局的slab分配器
#[cfg_attr(not(test), global_allocator)]
@ -68,9 +72,7 @@ pub fn panic(info: &PanicInfo) -> ! {
unsafe {
process_do_exit(u64::MAX);
};
loop {
}
loop {}
}
/// 该函数用作测试在process.c的initial_kernel_thread()中调用了此函数