1
0
Fork 0
forked from AbleOS/ableos

slowly adding alloc features

This commit is contained in:
Able 2021-11-22 04:10:07 -06:00
parent aea13d428f
commit b3817c0bd3
5 changed files with 52 additions and 51 deletions

View file

@ -3,7 +3,7 @@ target = "./json_targets/x86_64-ableos.json"
[unstable] [unstable]
build-std-features = ["compiler-builtins-mem"] build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins"] build-std = ["core","alloc", "compiler_builtins"]
[target.'cfg(target_arch = "x86_64")'] [target.'cfg(target_arch = "x86_64")']

View file

@ -31,3 +31,11 @@ Memory: {}
return x; return x;
} }
*/ */
pub const KERNEL_VERSION: &str = env!("CARGO_PKG_VERSION");
#[cfg(debug_assertions)]
/// A constant to check if the kernel is in debug mode
pub const RELEASE_TYPE: &str = "debug";
#[cfg(not(debug_assertions))]
/// A constant to check if the kernel is in release mode
pub const RELEASE_TYPE: &str = "release";

View file

@ -2,10 +2,13 @@
use crate::{ use crate::{
arch::{drivers::graphics::GraphicsBuffer, init}, arch::{drivers::graphics::GraphicsBuffer, init},
driver_traits::{graphics::Graphics, serial::Serial}, driver_traits::{graphics::Graphics, serial::Serial},
experiments::systeminfo::{KERNEL_VERSION, RELEASE_TYPE},
keyboard::DecodedKey,
relib::math::rand::{linearshift::LinearShiftRegister, prand::PRand, RAND_HANDLE, RNG}, relib::math::rand::{linearshift::LinearShiftRegister, prand::PRand, RAND_HANDLE, RNG},
serial_print, serial_println, serial_print, serial_println,
}; };
use lazy_static::lazy_static; use lazy_static::lazy_static;
#[no_mangle] #[no_mangle]
#[allow(unconditional_recursion)] #[allow(unconditional_recursion)]
pub extern "C" fn stack_overflow() -> u8 { pub extern "C" fn stack_overflow() -> u8 {
@ -13,8 +16,6 @@ pub extern "C" fn stack_overflow() -> u8 {
69 // NOTE: Any specific reason for this number asside from memes? 69 // NOTE: Any specific reason for this number asside from memes?
} }
use crate::keyboard::DecodedKey;
lazy_static! { lazy_static! {
pub static ref KEY_BUFFER: [DecodedKey; 256] = [DecodedKey::RawKey(123); 256]; pub static ref KEY_BUFFER: [DecodedKey; 256] = [DecodedKey::RawKey(123); 256];
pub static ref KEY_BUFFER_POINTER: u8 = 0; pub static ref KEY_BUFFER_POINTER: u8 = 0;
@ -33,8 +34,8 @@ pub extern "C" fn kernel_main() {
AES::init_rng(); AES::init_rng();
*/ */
#[cfg(not(target_arch = "riscv64"))]
println!("init"); println!("{} v{}", RELEASE_TYPE, KERNEL_VERSION);
{ {
use crate::experiments::mail::MailBoxes; use crate::experiments::mail::MailBoxes;

View file

@ -40,10 +40,3 @@ mod panic;
pub use experiments::server; pub use experiments::server;
pub mod keyboard; pub mod keyboard;
pub mod relib; pub mod relib;
pub const KERNEL_VERSION: &str = env!("CARGO_PKG_VERSION");
#[cfg(debug_assertions)]
/// A constant to check if the kernel is in debug mode
pub const RELEASE_TYPE: &str = "debug";
#[cfg(not(debug_assertions))]
/// A constant to check if the kernel is in release mode
pub const RELEASE_TYPE: &str = "release";

View file

@ -2,7 +2,6 @@
pub mod linearshift; pub mod linearshift;
pub mod prand; pub mod prand;
pub mod wichmanhillrand; // FIXEME: Reimplement pub mod wichmanhillrand; // FIXEME: Reimplement
use crate::serial_println;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use linearshift::LinearShiftRegister; use linearshift::LinearShiftRegister;
use prand::PRand; use prand::PRand;