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",
|
||||
"derive_more",
|
||||
"embedded-graphics",
|
||||
"error-stack",
|
||||
"hashbrown 0.14.0",
|
||||
"hbvm",
|
||||
"limine",
|
||||
|
|
|
@ -5,31 +5,30 @@ version = "0.2.0"
|
|||
|
||||
|
||||
[dependencies]
|
||||
limine = { version = "0.1", git = "https://github.com/limine-bootloader/limine-rs" }
|
||||
|
||||
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 }
|
||||
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" }
|
||||
|
||||
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" }
|
||||
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 = "*"
|
||||
|
||||
[dependencies.limine]
|
||||
version = "0.1"
|
||||
git = "https://github.com/limine-bootloader/limine-rs"
|
||||
|
||||
[dependencies.crossbeam-queue]
|
||||
version = "0.3"
|
||||
default-features = false
|
||||
features = ["alloc"]
|
||||
|
||||
[dependencies.clparse]
|
||||
git = "https://git.ablecorp.us/ableos/ableos_userland"
|
||||
default-features = false
|
||||
|
||||
[dependencies.derive_more]
|
||||
version = "0.99"
|
||||
default-features = false
|
||||
|
|
|
@ -63,26 +63,28 @@ pub enum HostError {
|
|||
// // pub fn rpc_register(_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
|
||||
pub struct TrapHandler;
|
||||
impl HandlePageFault for TrapHandler {
|
||||
fn page_fault(
|
||||
&mut self,
|
||||
reason: hbvm::vm::mem::MemoryAccessReason,
|
||||
memory: &mut hbvm::vm::mem::Memory,
|
||||
vaddr: u64,
|
||||
size: hbvm::vm::mem::PageSize,
|
||||
reason: hbvm::mem::MemoryAccessReason,
|
||||
pagetable: &mut hbvm::mem::softpaging::paging::PageTable,
|
||||
vaddr: hbvm::mem::Address,
|
||||
size: hbvm::mem::softpaging::PageSize,
|
||||
dataptr: *mut u8,
|
||||
) -> bool {
|
||||
error!(
|
||||
"REASON: {}
|
||||
memory: {:?}
|
||||
vaddr: {}
|
||||
size: {:?}
|
||||
Dataptr {:?}",
|
||||
reason, memory, vaddr, size, dataptr
|
||||
) -> bool
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
log::error!(
|
||||
"REASON: {reason} \
|
||||
vaddr: {vaddr} \
|
||||
size: {size:?} \
|
||||
Dataptr {dataptr:p}",
|
||||
);
|
||||
|
||||
false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ use {
|
|||
hbvm::validate::validate,
|
||||
};
|
||||
|
||||
use {crate::host::TrapHandler, hbvm::vm::Vm};
|
||||
use {crate::host::TrapHandler, hbvm::Vm};
|
||||
const TIMER_QUOTIENT: usize = 100;
|
||||
|
||||
pub struct Scheduler<'a> {
|
||||
|
@ -51,18 +51,18 @@ impl Scheduler<'_> {
|
|||
let ret = prog.run();
|
||||
match ret {
|
||||
Ok(oki) => match oki {
|
||||
hbvm::vm::VmRunOk::End => {
|
||||
hbvm::VmRunOk::End => {
|
||||
log::info!(
|
||||
"Program ended. {} programs remaining.",
|
||||
// Add one here because we pop a program
|
||||
self.data.len() + 1
|
||||
)
|
||||
}
|
||||
hbvm::vm::VmRunOk::Timer => {
|
||||
hbvm::VmRunOk::Timer => {
|
||||
log::info!("Timer exhausted. Scheduled program");
|
||||
self.data.push_back(prog);
|
||||
}
|
||||
hbvm::vm::VmRunOk::Ecall => {
|
||||
hbvm::VmRunOk::Ecall => {
|
||||
// panic!();
|
||||
log::info!("{:?}", prog.registers);
|
||||
self.data.push_back(prog);
|
||||
|
|
Loading…
Reference in a new issue