forked from AbleOS/ableos
merge work
This commit is contained in:
parent
a857253314
commit
0c1169adab
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,5 +5,6 @@ facepalm/target
|
|||
shadeable/target
|
||||
qprofiler
|
||||
userland/*/target
|
||||
kernel/target
|
||||
|
||||
kernel/target
|
|
@ -133,7 +133,7 @@ impl Write for Uart {
|
|||
// / RUST MACROS
|
||||
// ///////////////////////////////////
|
||||
#[macro_export]
|
||||
macro_rules! print
|
||||
macro_rules! sprint
|
||||
{
|
||||
($($args:tt)+) => ({
|
||||
use core::fmt::Write;
|
||||
|
@ -141,7 +141,7 @@ macro_rules! print
|
|||
});
|
||||
}
|
||||
#[macro_export]
|
||||
macro_rules! println
|
||||
macro_rules! sprintln
|
||||
{
|
||||
() => ({
|
||||
print!("\r\n")
|
||||
|
|
|
@ -4,58 +4,58 @@ pub fn colorify(eval: &str) {
|
|||
for z in y {
|
||||
match z {
|
||||
"BLACK" => {
|
||||
set_vga_color(Color::Black, Color::Black);
|
||||
// set_vga_color(Color::Black, Color::Black);
|
||||
}
|
||||
"RED" => {
|
||||
set_vga_color(Color::Red, Color::Black);
|
||||
// set_vga_color(Color::Red, Color::Black);
|
||||
}
|
||||
"GREEN" => {
|
||||
set_vga_color(Color::Green, Color::Black);
|
||||
// set_vga_color(Color::Green, Color::Black);
|
||||
}
|
||||
"BLUE" => {
|
||||
set_vga_color(Color::Blue, Color::Black);
|
||||
// set_vga_color(Color::Blue, Color::Black);
|
||||
}
|
||||
"CYAN" => {
|
||||
set_vga_color(Color::Cyan, Color::Black);
|
||||
// set_vga_color(Color::Cyan, Color::Black);
|
||||
}
|
||||
"MAGENTA" => {
|
||||
set_vga_color(Color::Magenta, Color::Black);
|
||||
// set_vga_color(Color::Magenta, Color::Black);
|
||||
}
|
||||
"BROWN" => {
|
||||
set_vga_color(Color::Brown, Color::Black);
|
||||
// set_vga_color(Color::Brown, Color::Black);
|
||||
}
|
||||
"LIGHTGRAY" => {
|
||||
set_vga_color(Color::LightGray, Color::Black);
|
||||
// set_vga_color(Color::LightGray, Color::Black);
|
||||
}
|
||||
"DARKGRAY" => {
|
||||
set_vga_color(Color::DarkGray, Color::Black);
|
||||
// set_vga_color(Color::DarkGray, Color::Black);
|
||||
}
|
||||
"LIGHTBLUE" => {
|
||||
set_vga_color(Color::LightBlue, Color::Black);
|
||||
// set_vga_color(Color::LightBlue, Color::Black);
|
||||
}
|
||||
"LIGHTGREEN" => {
|
||||
set_vga_color(Color::LightGreen, Color::Black);
|
||||
// set_vga_color(Color::LightGreen, Color::Black);
|
||||
}
|
||||
"LIGHTCYAN" => {
|
||||
set_vga_color(Color::LightCyan, Color::Black);
|
||||
// set_vga_color(Color::LightCyan, Color::Black);
|
||||
}
|
||||
"LIGHTRED" => {
|
||||
set_vga_color(Color::LightRed, Color::Black);
|
||||
// set_vga_color(Color::LightRed, Color::Black);
|
||||
}
|
||||
"PINK" => {
|
||||
set_vga_color(Color::Pink, Color::Black);
|
||||
// set_vga_color(Color::Pink, Color::Black);
|
||||
}
|
||||
"YELLOW" => {
|
||||
set_vga_color(Color::Yellow, Color::Black);
|
||||
// set_vga_color(Color::Yellow, Color::Black);
|
||||
}
|
||||
"WHITE" => {
|
||||
set_vga_color(Color::White, Color::Black);
|
||||
// set_vga_color(Color::White, Color::Black);
|
||||
}
|
||||
"RESET" => {
|
||||
set_vga_color(Color::White, Color::Black);
|
||||
// set_vga_color(Color::White, Color::Black);
|
||||
}
|
||||
elk => {
|
||||
kprint!("{}", elk);
|
||||
// kprint!("{}", elk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,13 +85,13 @@ pub fn colorify_2(eval: &str) {
|
|||
use Token::*;
|
||||
match token {
|
||||
Red => {
|
||||
set_vga_color(Color::Red, Color::Black);
|
||||
// set_vga_color(Color::Red, Color::Black);
|
||||
}
|
||||
Reset => {
|
||||
set_vga_color(Color::White, Color::Black);
|
||||
// set_vga_color(Color::White, Color::Black);
|
||||
}
|
||||
Text(text) => {
|
||||
kprint!("{}", text);
|
||||
// kprint!("{}", text);
|
||||
}
|
||||
err => {
|
||||
error!("Error parsing {:?}", err);
|
||||
|
@ -101,7 +101,7 @@ pub fn colorify_2(eval: &str) {
|
|||
}
|
||||
use logos::Lexer;
|
||||
|
||||
use crate::kprint;
|
||||
// use crate::kprint;
|
||||
fn parse_text(lex: &mut Lexer<Token>) -> Option<String> {
|
||||
let slice = lex.slice();
|
||||
Some(String::from(slice))
|
||||
|
|
|
@ -126,7 +126,7 @@ impl ScreenBuffer {
|
|||
|
||||
// TODO force clear
|
||||
pub fn force_redraw(&mut self) {
|
||||
VGAE.lock().clear_screen(vga::colors::Color16::Black);
|
||||
// VGAE.lock().clear_screen(vga::colors::Color16::Black);
|
||||
}
|
||||
|
||||
/// Draw a glyph on the screen at the given position
|
||||
|
|
|
@ -132,7 +132,7 @@ pub fn cpu_socket_startup() {
|
|||
}
|
||||
|
||||
pub fn log_version_data() {
|
||||
info!("{} v{}", RELEASE_TYPE, KERNEL_VERSION);
|
||||
info!("{} v{:?}", RELEASE_TYPE, KERNEL_VERSION);
|
||||
info!(
|
||||
"Brand String: ",
|
||||
// master().unwrap().brand_string().unwrap()
|
||||
|
@ -173,3 +173,7 @@ impl acpi::AcpiHandler for AcpiStruct {
|
|||
}
|
||||
}
|
||||
*/
|
||||
|
||||
use kernel::KERNEL_VERSION;
|
||||
|
||||
use crate::{boot_conf::KernelConfig, scheduler::SCHEDULER, systeminfo::RELEASE_TYPE};
|
||||
|
|
|
@ -34,10 +34,12 @@ pub mod arch;
|
|||
#[macro_use]
|
||||
pub mod print;
|
||||
pub mod devices;
|
||||
pub mod port_io;
|
||||
pub mod rhai_shell;
|
||||
pub mod wasm_jumploader;
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub mod port_io;
|
||||
|
||||
#[macro_use]
|
||||
pub extern crate log;
|
||||
|
||||
|
@ -85,8 +87,10 @@ pub use virtio::*;
|
|||
|
||||
// pub mod alias_table;
|
||||
// pub use alias_table::*;
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub mod tests;
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub use tests::*;
|
||||
|
||||
pub mod scratchpad;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use core::sync::atomic::Ordering;
|
||||
|
||||
use crate::network::socket::{SimpleSock, Socket};
|
||||
use crate::serial_println;
|
||||
// use crate::serial_println;
|
||||
|
||||
use kernel::TICK;
|
||||
use lliw::{Fg, Reset};
|
||||
|
@ -37,7 +37,9 @@ impl log::Log for SimpleLogger {
|
|||
time_float,
|
||||
record.args()
|
||||
);
|
||||
serial_println!(
|
||||
|
||||
// NOTE: This needs to be fixed before merge
|
||||
println!(
|
||||
"[{}{}{}][{}{}{}] {}",
|
||||
color.0,
|
||||
record.level(),
|
||||
|
|
|
@ -35,9 +35,9 @@ impl Externals for HostExternals {
|
|||
GET_TIME_INDEX => {
|
||||
use core::sync::atomic::Ordering::*;
|
||||
|
||||
x86_64::instructions::interrupts::disable();
|
||||
// x86_64::instructions::interrupts::disable();
|
||||
let tick_time = kernel::TICK.load(Relaxed);
|
||||
x86_64::instructions::interrupts::enable();
|
||||
// x86_64::instructions::interrupts::enable();
|
||||
|
||||
let ret = RuntimeValue::I64(tick_time.try_into().unwrap());
|
||||
Ok(Some(ret))
|
||||
|
|
Loading…
Reference in a new issue