incorperate axel

pls-build-on-my-machine
Able 2022-03-26 06:35:33 -05:00
parent 48751a9d78
commit d69282dffa
Signed by untrusted user: able
GPG Key ID: D164AF5F5700BE51
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 = [
"ab_glyph",
"acpi",
"axel",
"bootloader",
"cpuio",
"ext2",
@ -108,6 +109,17 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
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]]
name = "bare-metal"
version = "1.0.0"

View File

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

View File

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

View File

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

View File

@ -97,6 +97,7 @@ impl Style {
}
#[derive(Debug)]
pub struct VTerm {
/// Internal ID of the vterm
iid: u32,
pub characters: [[VtermCharacter; VTERM_WIDTH as usize]; VTERM_HEIGHT as usize],
/// 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::time::fetch_time;
use core::sync::atomic::Ordering;
use kernel::TICK;
use lliw::{Fg, Reset};
@ -38,17 +39,18 @@ impl log::Log for SimpleLogger {
);
// kprint!("{}", msg);
// NOTE: This needs to be fixed before merge
serial_println!(
"[{}{}{}][{}{}{}] {}",
color.0,
record.level(),
Fg::Reset,
Fg::Green,
time_float,
Reset,
record.args()
);
if KERNEL_CONF.logging.log_to_serial {
serial_println!(
"[{}{}{}][{}{}{}] {}",
color.0,
record.level(),
Fg::Reset,
Fg::Green,
time_float,
Reset,
record.args()
);
}
let log_socket_id = SimpleSock::grab_socket("Logger".to_string());
match log_socket_id {

View File

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

View File

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

View File

@ -10,6 +10,20 @@ use crate::devices::Device::Vterm;
/// Experimental scratchpad for testing.
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();
}