incorperate axel

This commit is contained in:
Able 2022-03-26 06:35:33 -05:00
parent b1eaea239e
commit 6bf591a313
9 changed files with 57 additions and 15 deletions

12
ableos/Cargo.lock generated
View file

@ -28,6 +28,7 @@ version = "0.1.1"
dependencies = [ dependencies = [
"ab_glyph", "ab_glyph",
"acpi", "acpi",
"axel",
"bootloader", "bootloader",
"cpuio", "cpuio",
"ext2", "ext2",
@ -108,6 +109,17 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "axel"
version = "0.1.0"
source = "git+https://git.ablecorp.us/able/axel.git#2bd44d47d94158a85505581abbe526085ee62fb8"
dependencies = [
"hashbrown 0.12.0",
"log",
"logos",
"versioning",
]
[[package]] [[package]]
name = "bare-metal" name = "bare-metal"
version = "1.0.0" version = "1.0.0"

View file

@ -57,6 +57,9 @@ rhai = "1.5"
libwasm = {git="https://git.ablecorp.us:443/able/libwasm.git"} libwasm = {git="https://git.ablecorp.us:443/able/libwasm.git"}
acpi = "4.1.0" acpi = "4.1.0"
axel = { git = "https://git.ablecorp.us:443/able/axel.git" }
[dependencies.logos] [dependencies.logos]
version = "0.12.0" version = "0.12.0"
default-features = false default-features = false

View file

@ -5,6 +5,7 @@ user_processes = ["shell"]
[logging] [logging]
enabled = true enabled = true
level = "Trace" level = "Trace"
log_to_serial = true
[tests] [tests]
run_tests = false run_tests = false

View file

@ -46,6 +46,7 @@ impl KernelConfig {
#[derive(Serialize, Debug, Deserialize)] #[derive(Serialize, Debug, Deserialize)]
pub struct LoggingConfig { pub struct LoggingConfig {
pub enabled: bool, pub enabled: bool,
pub log_to_serial: bool,
pub level: LogLevel, pub level: LogLevel,
} }
#[derive(Serialize, Debug, Deserialize)] #[derive(Serialize, Debug, Deserialize)]

View file

@ -97,6 +97,7 @@ impl Style {
} }
#[derive(Debug)] #[derive(Debug)]
pub struct VTerm { pub struct VTerm {
/// Internal ID of the vterm
iid: u32, iid: u32,
pub characters: [[VtermCharacter; VTERM_WIDTH as usize]; VTERM_HEIGHT as usize], pub characters: [[VtermCharacter; VTERM_WIDTH as usize]; VTERM_HEIGHT as usize],
/// The internal representation of the vterm /// The internal representation of the vterm

View file

@ -1,7 +1,8 @@
use core::sync::atomic::Ordering; use crate::boot_conf;
use crate::kmain::KERNEL_CONF;
use crate::network::socket::{SimpleSock, Socket}; use crate::network::socket::{SimpleSock, Socket};
use crate::time::fetch_time; use crate::time::fetch_time;
use core::sync::atomic::Ordering;
use kernel::TICK; use kernel::TICK;
use lliw::{Fg, Reset}; use lliw::{Fg, Reset};
@ -38,17 +39,18 @@ impl log::Log for SimpleLogger {
); );
// kprint!("{}", msg); // kprint!("{}", msg);
// NOTE: This needs to be fixed before merge // NOTE: This needs to be fixed before merge
if KERNEL_CONF.logging.log_to_serial {
serial_println!( serial_println!(
"[{}{}{}][{}{}{}] {}", "[{}{}{}][{}{}{}] {}",
color.0, color.0,
record.level(), record.level(),
Fg::Reset, Fg::Reset,
Fg::Green, Fg::Green,
time_float, time_float,
Reset, Reset,
record.args() record.args()
); );
}
let log_socket_id = SimpleSock::grab_socket("Logger".to_string()); let log_socket_id = SimpleSock::grab_socket("Logger".to_string());
match log_socket_id { match log_socket_id {

View file

@ -1,6 +1,6 @@
,-""""-. OS: AbleOS ,-""""-. OS: AbleOS
,' _ `. Host: {} ,'\ _ _`. Host: {}
/ )_) \ Kernel: AKern-{}-v{} / \)_)-)_)-\ Kernel: AKern-{}-v{}
: : Uptime: {} : : Uptime: {}
\ / Packages: None \ / Packages: None
\ / Shell: RhaiShell \ / Shell: RhaiShell

View file

@ -23,6 +23,14 @@ pub fn shell() {
Some('\u{0008}') => { Some('\u{0008}') => {
buf.pop(); buf.pop();
} }
Some('\u{0009}') => {
buf.push(' ');
buf.push(' ');
buf.push(' ');
buf.push(' ');
}
Some(chr) => buf.push(chr), Some(chr) => buf.push(chr),
None => (), None => (),
} }

View file

@ -10,6 +10,20 @@ use crate::devices::Device::Vterm;
/// Experimental scratchpad for testing. /// Experimental scratchpad for testing.
pub fn scratchpad() { pub fn scratchpad() {
let axel_raw = "
kernel{
vals=
time: 123
fn|
print: (None) -> (None);
foo: (None) -> (Num);
}
";
let axel = axel::parse(axel_raw.to_string());
for node in axel {
info!("{:?}", node);
}
shell(); shell();
} }