Merge branch 'master' of ssh://git.ablecorp.us:20/AbleOS/ableos

This commit is contained in:
Able 2024-12-22 16:23:46 -06:00
commit b864463ad8
5 changed files with 16 additions and 7 deletions

6
Cargo.lock generated
View file

@ -213,12 +213,12 @@ dependencies = [
[[package]] [[package]]
name = "hbbytecode" name = "hbbytecode"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#9c4b84ce33ea6ac7fe0f1b00ee5c67718643a34a" source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#3491814b4f1723e6b1f3ae485ed5d3b5cad16df0"
[[package]] [[package]]
name = "hblang" name = "hblang"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#9c4b84ce33ea6ac7fe0f1b00ee5c67718643a34a" source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#3491814b4f1723e6b1f3ae485ed5d3b5cad16df0"
dependencies = [ dependencies = [
"hashbrown", "hashbrown",
"hbbytecode", "hbbytecode",
@ -229,7 +229,7 @@ dependencies = [
[[package]] [[package]]
name = "hbvm" name = "hbvm"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#9c4b84ce33ea6ac7fe0f1b00ee5c67718643a34a" source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#3491814b4f1723e6b1f3ae485ed5d3b5cad16df0"
dependencies = [ dependencies = [
"hbbytecode", "hbbytecode",
] ]

View file

@ -9,7 +9,7 @@ ktest = []
[dependencies] [dependencies]
# embedded-graphics = "0.8" # embedded-graphics = "0.8"
hbvm = { git = "https://git.ablecorp.us/AbleOS/holey-bytes.git", features = [ hbvm = { git = "https://git.ablecorp.us/AbleOS/holey-bytes.git", features = [
"nightly", "nightly", "alloc", "disasm"
] } ] }
ktest_macro = { path = "ktest_macro" } ktest_macro = { path = "ktest_macro" }
log = "0.4" log = "0.4"

View file

@ -15,8 +15,10 @@ fn calc_start_of_page(ptr: u64) -> u64 {
panic!("unaligned"); panic!("unaligned");
} }
#[derive(Default)]
pub struct Memory { pub struct Memory {
// TODO: map page aligned segments of memory into a table or some sort here // TODO: map page aligned segments of memory into a table or some sort here
logger: hbvm::mem::InstrLogger,
} }
impl Memory { impl Memory {
@ -56,4 +58,11 @@ impl hbvm::mem::Memory for Memory {
unsafe fn prog_read<T: Copy>(&mut self, addr: Address) -> T { unsafe fn prog_read<T: Copy>(&mut self, addr: Address) -> T {
(addr.get() as *const T).read() (addr.get() as *const T).read()
} }
#[inline(always)]
fn log_instr(&mut self, at: Address, regs: &[hbvm::value::Value]) {
//log::debug!("exec: [{:02x}] {}", at.get(), unsafe {
// self.logger.display_instr(at, regs)
//});
}
} }

View file

@ -36,7 +36,7 @@ impl ExecThread {
pub unsafe fn new(program: &[u8], entrypoint: Address) -> Self { pub unsafe fn new(program: &[u8], entrypoint: Address) -> Self {
let mut vm = Vm::new( let mut vm = Vm::new(
mem::Memory {}, mem::Memory::default(),
Address::new(program.as_ptr() as u64 + entrypoint.get()), Address::new(program.as_ptr() as u64 + entrypoint.get()),
); );

View file

@ -3,7 +3,7 @@
test := fn(): uint { test := fn(): uint {
target := "abcdefghijklmnop" target := "abcdefghijklmnop"
strings := .["abcdefshijklmnop", "abcdefghijklnnop", "abcdefshijklmnop", "abcdefghijklmnop", "abcdefghijflmnop", "dbcdefghijklmnop", "abcdefghijklmnop"] strings := .["abcdefshijklmnop", "abcdefghijklnnop", "abcdefshijklmnop", "abcdefghijklmnop", "abcdefghijflmnop", "dbcdefghijklmnop", "abcdefghijklmnop"]
len := @sizeof(@TypeOf(strings)) / @sizeof(^u8) len := @sizeof(@TypeOf(strings)) / @sizeof([]u8)
// hasher := hashers.foldhash.FoldHasher.new(1) // hasher := hashers.foldhash.FoldHasher.new(1)
hasher := hashers.foldhash.FoldHasher.default() hasher := hashers.foldhash.FoldHasher.default()