From bb37de554f420e8df3ce53d2343353f88c5c8a8e Mon Sep 17 00:00:00 2001 From: Able Date: Fri, 19 Jul 2024 05:47:59 -0500 Subject: [PATCH] update the compiler --- Cargo.lock | 6 +++--- repbuild/src/dev.rs | 3 +++ sysdata/libraries/stn/src/buffer.hb | 2 +- sysdata/libraries/stn/src/string.hb | 2 +- sysdata/programs/fb_driver/README.md | 2 ++ sysdata/programs/fb_driver/src/main.hb | 4 ++-- sysdata/programs/tests/src/main.hb | 11 +++++++++++ sysdata/programs/time_driver/src/main.hb | 2 +- sysdata/system_config.toml | 2 +- 9 files changed, 25 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 46efea3..4638a89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -429,7 +429,7 @@ dependencies = [ [[package]] name = "hbbytecode" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#efa7271a5917c9b78ed06563df2bea13f895f8ca" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#654b7eb7af94c191a6ac9071e7efd56833966ad5" [[package]] name = "hbbytecode" @@ -439,7 +439,7 @@ source = "git+https://git.ablecorp.us/ableos/holey-bytes#e494785f93dad2722ebd9e5 [[package]] name = "hblang" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#efa7271a5917c9b78ed06563df2bea13f895f8ca" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#654b7eb7af94c191a6ac9071e7efd56833966ad5" dependencies = [ "hbvm 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)", ] @@ -447,7 +447,7 @@ dependencies = [ [[package]] name = "hbvm" version = "0.1.0" -source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#efa7271a5917c9b78ed06563df2bea13f895f8ca" +source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#654b7eb7af94c191a6ac9071e7efd56833966ad5" dependencies = [ "hbbytecode 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)", ] diff --git a/repbuild/src/dev.rs b/repbuild/src/dev.rs index 967e84c..d91c6d1 100644 --- a/repbuild/src/dev.rs +++ b/repbuild/src/dev.rs @@ -78,7 +78,10 @@ impl Package { // }, // &mut bytes, // ); + println!("Precompilation"); let _ = hblang::run_compiler(&path, Default::default(), &mut bytes); + println!("Post-compilation"); + match std::fs::create_dir("target/programs") { Ok(_) => (), Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => (), diff --git a/sysdata/libraries/stn/src/buffer.hb b/sysdata/libraries/stn/src/buffer.hb index 81cb995..1fd18ba 100644 --- a/sysdata/libraries/stn/src/buffer.hb +++ b/sysdata/libraries/stn/src/buffer.hb @@ -1,7 +1,7 @@ string := @use("rel:string.hb"); receive_message := fn(buffer_id: int, memory_map_location: ^u8, length: int): ^u8 { - return @eca(void, 4, buffer_id, memory_map_location, length); + return @eca(^u8, 4, buffer_id, memory_map_location, length); } send_message := fn(buffer_id: int): void { diff --git a/sysdata/libraries/stn/src/string.hb b/sysdata/libraries/stn/src/string.hb index 8abed24..52145ab 100644 --- a/sysdata/libraries/stn/src/string.hb +++ b/sysdata/libraries/stn/src/string.hb @@ -45,7 +45,7 @@ reverse := fn(s: ^u8): void { return; } -set := fn(change: ^int, new: int): void { +set := fn(change: ^u8, new: int): void { *(change) = new; return; } diff --git a/sysdata/programs/fb_driver/README.md b/sysdata/programs/fb_driver/README.md index e69de29..b354f04 100644 --- a/sysdata/programs/fb_driver/README.md +++ b/sysdata/programs/fb_driver/README.md @@ -0,0 +1,2 @@ +# Framebuffer Driver +A simple framebuffer driver. \ No newline at end of file diff --git a/sysdata/programs/fb_driver/src/main.hb b/sysdata/programs/fb_driver/src/main.hb index 4233b2c..783cd94 100644 --- a/sysdata/programs/fb_driver/src/main.hb +++ b/sysdata/programs/fb_driver/src/main.hb @@ -1,7 +1,7 @@ +frame_buffer := @as(^u8, @bitcast(18446603339442421760)); + main := fn(): int { - frame_buffer := @as(^u8, @bitcast(18446603339442421760)); color := 17; - loop { len := (786432 * 4)+1; loop if len == 0 break else { diff --git a/sysdata/programs/tests/src/main.hb b/sysdata/programs/tests/src/main.hb index 942f927..49da3f1 100644 --- a/sysdata/programs/tests/src/main.hb +++ b/sysdata/programs/tests/src/main.hb @@ -4,8 +4,19 @@ string := stn.string; memory := stn.memory; buffer := stn.buffer; +/* +service_search := fn(): void { + // a := + + return; +} +*/ + + + main := fn(): int { // Create a buffer + buffer_id := buffer.create(); buffer.send_message(buffer_id); diff --git a/sysdata/programs/time_driver/src/main.hb b/sysdata/programs/time_driver/src/main.hb index 91d2d7e..e8eb06d 100644 --- a/sysdata/programs/time_driver/src/main.hb +++ b/sysdata/programs/time_driver/src/main.hb @@ -2,7 +2,7 @@ stn := @use("../../../libraries/stn/src/lib.hb"); log := stn.log; mem := stn.memory; s := stn.string; -page := 0 +page := 0; main := fn(): void { page += mem.request_page(1); diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index a7060f8..f5101e8 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -28,4 +28,4 @@ path = "boot:///tests.hbf" path = "boot:///fb_driver.hbf" [boot.limine.ableos.modules.time_driver] -path = "boot:///time_driver.hbf" \ No newline at end of file +path = "boot:///time_driver.hbf"