forked from AbleOS/ableos
阿呆: changed trait impls
This commit is contained in:
parent
f948e35e3f
commit
0f151fdd52
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -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",
|
||||||
|
|
|
@ -5,31 +5,30 @@ 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"
|
||||||
hbvm = { git = "https://git.ablecorp.us/ableos/holey-bytes" }
|
|
||||||
# hbasm = { git = "https://git.ablecorp.us/ableos/holey-bytes" }
|
|
||||||
|
|
||||||
embedded-graphics = "0.7.1"
|
|
||||||
|
|
||||||
|
|
||||||
error-stack = { version = "0.3", default-features = false }
|
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
spin = "0.9"
|
spin = "0.9"
|
||||||
uart_16550 = "0.2"
|
uart_16550 = "0.2"
|
||||||
slab = { version = "0.4", default-features = false }
|
slab = { version = "0.4", default-features = false }
|
||||||
xml = { git = "https://git.ablecorp.us/ableos/ableos_userland" }
|
xml.git = "https://git.ablecorp.us/ableos/ableos_userland"
|
||||||
|
versioning.git = "https://git.ablecorp.us/ableos/ableos_userland"
|
||||||
clparse = { git = "https://git.ablecorp.us/ableos/ableos_userland", default-features = false }
|
able_graphics_library.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 = "*"
|
hashbrown = "*"
|
||||||
|
|
||||||
|
[dependencies.limine]
|
||||||
|
version = "0.1"
|
||||||
|
git = "https://github.com/limine-bootloader/limine-rs"
|
||||||
|
|
||||||
[dependencies.crossbeam-queue]
|
[dependencies.crossbeam-queue]
|
||||||
version = "0.3"
|
version = "0.3"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["alloc"]
|
features = ["alloc"]
|
||||||
|
|
||||||
|
[dependencies.clparse]
|
||||||
|
git = "https://git.ablecorp.us/ableos/ableos_userland"
|
||||||
|
default-features = false
|
||||||
|
|
||||||
[dependencies.derive_more]
|
[dependencies.derive_more]
|
||||||
version = "0.99"
|
version = "0.99"
|
||||||
default-features = false
|
default-features = false
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue