1
0
Fork 0
forked from AbleOS/ableos

Fixed memory bug

This commit is contained in:
Erin 2023-11-03 09:04:22 +01:00
parent bda8659747
commit fd575a17c9
2 changed files with 10 additions and 3 deletions

View file

@ -35,6 +35,6 @@ impl hbvm::mem::Memory for Memory {
#[inline]
unsafe fn prog_read<T: Copy>(&mut self, addr: Address) -> T {
(addr.get() as *const T).read()
(addr.get() as *const T).read_unaligned()
}
}

View file

@ -11,9 +11,16 @@ fn main(){
std::ipc_send(2, str, str.len);
std::ipc_recv(2);
// load r2
// loop through r3
li8(r1, 0x7);
li8(r2, 0);
li64(r3, 128821000);
let start = label();
st(r1, r2, 0xFFFF8000C0000000, 1);
addi64(r2, r2, 1);
jltu(r2, r3, start);
std::Info("VFS Test done!");
// un();
tx();
}