forked from koniifer/ableos
Panic rn
This commit is contained in:
parent
b7f9b071bf
commit
631e1dc288
|
@ -18,6 +18,7 @@ pub static DISPLAY: Lazy<Mutex<Display>> = Lazy::new(|| {
|
||||||
disp.set_attribute("width", fb1.width);
|
disp.set_attribute("width", fb1.width);
|
||||||
disp.set_attribute("height", fb1.height);
|
disp.set_attribute("height", fb1.height);
|
||||||
disp.set_attribute("bits per pixel", fb1.bpp);
|
disp.set_attribute("bits per pixel", fb1.bpp);
|
||||||
|
// disp.set_attribute("fb ptr", fb1.address.as_ptr().unwrap());
|
||||||
dt.devices.insert("Displays".to_string(), alloc::vec![disp]);
|
dt.devices.insert("Displays".to_string(), alloc::vec![disp]);
|
||||||
}
|
}
|
||||||
let _size: usize = (fb1.width * fb1.height).try_into().unwrap();
|
let _size: usize = (fb1.width * fb1.height).try_into().unwrap();
|
||||||
|
@ -30,6 +31,10 @@ pub static DISPLAY: Lazy<Mutex<Display>> = Lazy::new(|| {
|
||||||
color: Rgb888::WHITE,
|
color: Rgb888::WHITE,
|
||||||
});
|
});
|
||||||
log::info!("Graphics initialised");
|
log::info!("Graphics initialised");
|
||||||
|
log::info!(
|
||||||
|
"Graphics front ptr {:?}",
|
||||||
|
fb1.address.as_ptr().unwrap() as *const u8
|
||||||
|
);
|
||||||
m
|
m
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ impl hbvm::mem::Memory for Memory {
|
||||||
target: *mut u8,
|
target: *mut u8,
|
||||||
count: usize,
|
count: usize,
|
||||||
) -> Result<(), hbvm::mem::LoadError> {
|
) -> Result<(), hbvm::mem::LoadError> {
|
||||||
|
log::info!("Loading memory");
|
||||||
core::ptr::copy(addr.get() as *const u8, target, count);
|
core::ptr::copy(addr.get() as *const u8, target, count);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -26,6 +27,8 @@ impl hbvm::mem::Memory for Memory {
|
||||||
source: *const u8,
|
source: *const u8,
|
||||||
count: usize,
|
count: usize,
|
||||||
) -> Result<(), hbvm::mem::StoreError> {
|
) -> Result<(), hbvm::mem::StoreError> {
|
||||||
|
log::info!("Storing memory");
|
||||||
|
|
||||||
core::ptr::copy(source, addr.get() as *mut u8, count);
|
core::ptr::copy(source, addr.get() as *mut u8, count);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,21 @@ import "repbuild/hblib/std" as std;
|
||||||
|
|
||||||
// Define main
|
// Define main
|
||||||
fn main(){
|
fn main(){
|
||||||
// store from a register to a local address
|
std::Info("Starting the limine framebuffer driver.");
|
||||||
// https://git.ablecorp.us/AbleOS/holey-bytes/src/branch/trunk/spec.md#memory-access-operations
|
|
||||||
// st(r1, r2, 0x100, 0x100);
|
|
||||||
}
|
|
||||||
|
|
||||||
main();
|
li8(r1, 0x7);
|
||||||
|
li8(r2, 0);
|
||||||
|
li64(r3, 1000);
|
||||||
|
|
||||||
|
label("start");
|
||||||
|
// store from a register to a local address
|
||||||
|
st(r1, r2, 0xFFFF8000C0000000, 1);
|
||||||
|
addi64(r2, r2, 1);
|
||||||
|
|
||||||
|
jltu(r2, r3, "start");
|
||||||
|
|
||||||
// Terminate execution.
|
// Terminate execution.
|
||||||
tx();
|
tx();
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
|
@ -7,8 +7,7 @@ fn main(){
|
||||||
std::Debug("XYZ");
|
std::Debug("XYZ");
|
||||||
std::Trace("Trace Deez");
|
std::Trace("Trace Deez");
|
||||||
|
|
||||||
// let ret = std::open("/file.hbf");
|
// std::open("/file.hbf");
|
||||||
// std::Info("" + ret);
|
|
||||||
|
|
||||||
tx();
|
tx();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,10 @@ fn main(){
|
||||||
std::ipc_send(2, str, str.len);
|
std::ipc_send(2, str, str.len);
|
||||||
|
|
||||||
std::ipc_recv(2);
|
std::ipc_recv(2);
|
||||||
|
// load r2
|
||||||
|
// loop through r3
|
||||||
|
|
||||||
|
// un();
|
||||||
tx();
|
tx();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue