From 631e1dc288832e425887605584d90dc8ad7b6f7c Mon Sep 17 00:00:00 2001 From: able Date: Thu, 2 Nov 2023 14:08:48 -0500 Subject: [PATCH] Panic rn --- kernel/src/arch/x86_64/graphics.rs | 5 +++++ kernel/src/holeybytes/mem.rs | 3 +++ .../holeybytes/limine_framebuffer_driver.rhai | 21 +++++++++++++------ repbuild/holeybytes/main.rhai | 3 +-- repbuild/holeybytes/vfs_test.rhai | 4 +++- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/kernel/src/arch/x86_64/graphics.rs b/kernel/src/arch/x86_64/graphics.rs index 2b8ca57..adb7c4d 100644 --- a/kernel/src/arch/x86_64/graphics.rs +++ b/kernel/src/arch/x86_64/graphics.rs @@ -18,6 +18,7 @@ pub static DISPLAY: Lazy> = Lazy::new(|| { disp.set_attribute("width", fb1.width); disp.set_attribute("height", fb1.height); 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]); } let _size: usize = (fb1.width * fb1.height).try_into().unwrap(); @@ -30,6 +31,10 @@ pub static DISPLAY: Lazy> = Lazy::new(|| { color: Rgb888::WHITE, }); log::info!("Graphics initialised"); + log::info!( + "Graphics front ptr {:?}", + fb1.address.as_ptr().unwrap() as *const u8 + ); m }); diff --git a/kernel/src/holeybytes/mem.rs b/kernel/src/holeybytes/mem.rs index 8c7fdd9..6be7c90 100644 --- a/kernel/src/holeybytes/mem.rs +++ b/kernel/src/holeybytes/mem.rs @@ -15,6 +15,7 @@ impl hbvm::mem::Memory for Memory { target: *mut u8, count: usize, ) -> Result<(), hbvm::mem::LoadError> { + log::info!("Loading memory"); core::ptr::copy(addr.get() as *const u8, target, count); Ok(()) } @@ -26,6 +27,8 @@ impl hbvm::mem::Memory for Memory { source: *const u8, count: usize, ) -> Result<(), hbvm::mem::StoreError> { + log::info!("Storing memory"); + core::ptr::copy(source, addr.get() as *mut u8, count); Ok(()) } diff --git a/repbuild/holeybytes/limine_framebuffer_driver.rhai b/repbuild/holeybytes/limine_framebuffer_driver.rhai index e172e4c..22b09f7 100644 --- a/repbuild/holeybytes/limine_framebuffer_driver.rhai +++ b/repbuild/holeybytes/limine_framebuffer_driver.rhai @@ -6,12 +6,21 @@ import "repbuild/hblib/std" as std; // Define main fn main(){ + std::Info("Starting the limine framebuffer driver."); + + li8(r1, 0x7); + li8(r2, 0); + li64(r3, 1000); + + label("start"); // store from a register to a local address - // https://git.ablecorp.us/AbleOS/holey-bytes/src/branch/trunk/spec.md#memory-access-operations - // st(r1, r2, 0x100, 0x100); + st(r1, r2, 0xFFFF8000C0000000, 1); + addi64(r2, r2, 1); + + jltu(r2, r3, "start"); + + // Terminate execution. + tx(); } -main(); - -// Terminate execution. -tx(); \ No newline at end of file +main(); \ No newline at end of file diff --git a/repbuild/holeybytes/main.rhai b/repbuild/holeybytes/main.rhai index c832874..d4e258a 100644 --- a/repbuild/holeybytes/main.rhai +++ b/repbuild/holeybytes/main.rhai @@ -7,8 +7,7 @@ fn main(){ std::Debug("XYZ"); std::Trace("Trace Deez"); - // let ret = std::open("/file.hbf"); - // std::Info("" + ret); + // std::open("/file.hbf"); tx(); } diff --git a/repbuild/holeybytes/vfs_test.rhai b/repbuild/holeybytes/vfs_test.rhai index 3a37b07..aa4b848 100644 --- a/repbuild/holeybytes/vfs_test.rhai +++ b/repbuild/holeybytes/vfs_test.rhai @@ -11,8 +11,10 @@ fn main(){ std::ipc_send(2, str, str.len); std::ipc_recv(2); + // load r2 + // loop through r3 - + // un(); tx(); }