阿呆: changed trait impls

This commit is contained in:
Erin 2023-08-22 15:31:28 +02:00 committed by ondra05
parent f948e35e3f
commit 0f151fdd52
5 changed files with 38 additions and 17270 deletions

1
Cargo.lock generated
View file

@ -586,7 +586,6 @@ dependencies = [
"crossbeam-queue", "crossbeam-queue",
"derive_more", "derive_more",
"embedded-graphics", "embedded-graphics",
"error-stack",
"hashbrown 0.14.0", "hashbrown 0.14.0",
"hbvm", "hbvm",
"limine", "limine",

View file

@ -5,30 +5,29 @@ version = "0.2.0"
[dependencies] [dependencies]
limine = { version = "0.1", git = "https://github.com/limine-bootloader/limine-rs" } embedded-graphics = "0.7"
hbvm.git = "https://git.ablecorp.us/ableos/holey-bytes"
log = "0.4"
spin = "0.9"
uart_16550 = "0.2"
slab = { version = "0.4", default-features = false }
xml.git = "https://git.ablecorp.us/ableos/ableos_userland"
versioning.git = "https://git.ablecorp.us/ableos/ableos_userland"
able_graphics_library.git = "https://git.ablecorp.us/ableos/ableos_userland"
hashbrown = "*"
hbvm = { git = "https://git.ablecorp.us/ableos/holey-bytes" } [dependencies.limine]
# hbasm = { git = "https://git.ablecorp.us/ableos/holey-bytes" } version = "0.1"
git = "https://github.com/limine-bootloader/limine-rs"
embedded-graphics = "0.7.1"
error-stack = { version = "0.3", default-features = false }
log = "0.4"
spin = "0.9"
uart_16550 = "0.2"
slab = { version = "0.4", default-features = false }
xml = { git = "https://git.ablecorp.us/ableos/ableos_userland" }
clparse = { git = "https://git.ablecorp.us/ableos/ableos_userland", default-features = false }
versioning = { git = "https://git.ablecorp.us/ableos/ableos_userland" }
able_graphics_library = { git = "https://git.ablecorp.us/ableos/ableos_userland" }
hashbrown = "*"
[dependencies.crossbeam-queue] [dependencies.crossbeam-queue]
version = "0.3" version = "0.3"
default-features = false
features = ["alloc"]
[dependencies.clparse]
git = "https://git.ablecorp.us/ableos/ableos_userland"
default-features = false default-features = false
features = ["alloc"]
[dependencies.derive_more] [dependencies.derive_more]
version = "0.99" version = "0.99"

View file

@ -63,26 +63,28 @@ pub enum HostError {
// // pub fn rpc_register(_engine: &mut Engine) {} // // pub fn rpc_register(_engine: &mut Engine) {}
// // pub fn rpc_call(_engine: &mut Engine) {} // // pub fn rpc_call(_engine: &mut Engine) {}
use {hbvm::vm::mem::HandlePageFault, log::error}; use hbvm::mem::softpaging::HandlePageFault;
/// AbleOS HBVM traphandler /// AbleOS HBVM traphandler
pub struct TrapHandler; pub struct TrapHandler;
impl HandlePageFault for TrapHandler { impl HandlePageFault for TrapHandler {
fn page_fault( fn page_fault(
&mut self, &mut self,
reason: hbvm::vm::mem::MemoryAccessReason, reason: hbvm::mem::MemoryAccessReason,
memory: &mut hbvm::vm::mem::Memory, pagetable: &mut hbvm::mem::softpaging::paging::PageTable,
vaddr: u64, vaddr: hbvm::mem::Address,
size: hbvm::vm::mem::PageSize, size: hbvm::mem::softpaging::PageSize,
dataptr: *mut u8, dataptr: *mut u8,
) -> bool { ) -> bool
error!( where
"REASON: {} Self: Sized,
memory: {:?} {
vaddr: {} log::error!(
size: {:?} "REASON: {reason} \
Dataptr {:?}", vaddr: {vaddr} \
reason, memory, vaddr, size, dataptr size: {size:?} \
Dataptr {dataptr:p}",
); );
false false
} }
} }

View file

@ -3,7 +3,7 @@ use {
hbvm::validate::validate, hbvm::validate::validate,
}; };
use {crate::host::TrapHandler, hbvm::vm::Vm}; use {crate::host::TrapHandler, hbvm::Vm};
const TIMER_QUOTIENT: usize = 100; const TIMER_QUOTIENT: usize = 100;
pub struct Scheduler<'a> { pub struct Scheduler<'a> {
@ -51,18 +51,18 @@ impl Scheduler<'_> {
let ret = prog.run(); let ret = prog.run();
match ret { match ret {
Ok(oki) => match oki { Ok(oki) => match oki {
hbvm::vm::VmRunOk::End => { hbvm::VmRunOk::End => {
log::info!( log::info!(
"Program ended. {} programs remaining.", "Program ended. {} programs remaining.",
// Add one here because we pop a program // Add one here because we pop a program
self.data.len() + 1 self.data.len() + 1
) )
} }
hbvm::vm::VmRunOk::Timer => { hbvm::VmRunOk::Timer => {
log::info!("Timer exhausted. Scheduled program"); log::info!("Timer exhausted. Scheduled program");
self.data.push_back(prog); self.data.push_back(prog);
} }
hbvm::vm::VmRunOk::Ecall => { hbvm::VmRunOk::Ecall => {
// panic!(); // panic!();
log::info!("{:?}", prog.registers); log::info!("{:?}", prog.registers);
self.data.push_back(prog); self.data.push_back(prog);

17232
out.txt

File diff suppressed because it is too large Load diff