You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.2 KiB

#![feature(lang_items)]
#![feature(alloc)]
#![feature(naked_functions)]
#![feature(untagged_unions)]
#![feature(asm)]
#![feature(optin_builtin_traits)]
#![feature(panic_info_message)]
#![feature(global_asm)]
#![no_std]
// just keep it ...
#[macro_use]
extern crate alloc;
6 years ago
#[macro_use]
extern crate log;
#[macro_use]
extern crate lazy_static;
pub use crate::process::{processor, new_kernel_context};
use rcore_thread::std_thread as thread;
use linked_list_allocator::LockedHeap;
#[macro_use] // print!
mod logging;
mod memory;
mod lang;
mod util;
7 years ago
mod consts;
mod process;
7 years ago
mod syscall;
mod fs;
mod sync;
mod trap;
mod shell;
mod drivers;
mod net;
mod backtrace;
#[allow(dead_code)]
#[cfg(target_arch = "x86_64")]
#[path = "arch/x86_64/mod.rs"]
pub mod arch;
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
#[path = "arch/riscv32/mod.rs"]
pub mod arch;
#[cfg(target_arch = "aarch64")]
#[path = "arch/aarch64/mod.rs"]
pub mod arch;
pub fn kmain() -> ! {
processor().run();
}
/// Global heap allocator
///
/// Available after `memory::init()`.
///
/// It should be defined in memory mod, but in Rust `global_allocator` must be in root mod.
#[global_allocator]
static HEAP_ALLOCATOR: LockedHeap = LockedHeap::empty();