update the compiler

This commit is contained in:
Able 2024-07-19 05:47:59 -05:00
parent 0f3c94c0c9
commit bb37de554f
9 changed files with 25 additions and 9 deletions

6
Cargo.lock generated
View file

@ -429,7 +429,7 @@ 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#efa7271a5917c9b78ed06563df2bea13f895f8ca" source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#654b7eb7af94c191a6ac9071e7efd56833966ad5"
[[package]] [[package]]
name = "hbbytecode" name = "hbbytecode"
@ -439,7 +439,7 @@ source = "git+https://git.ablecorp.us/ableos/holey-bytes#e494785f93dad2722ebd9e5
[[package]] [[package]]
name = "hblang" name = "hblang"
version = "0.1.0" 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 = [ dependencies = [
"hbvm 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)", "hbvm 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)",
] ]
@ -447,7 +447,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#efa7271a5917c9b78ed06563df2bea13f895f8ca" source = "git+https://git.ablecorp.us/AbleOS/holey-bytes.git#654b7eb7af94c191a6ac9071e7efd56833966ad5"
dependencies = [ dependencies = [
"hbbytecode 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)", "hbbytecode 0.1.0 (git+https://git.ablecorp.us/AbleOS/holey-bytes.git)",
] ]

View file

@ -78,7 +78,10 @@ impl Package {
// }, // },
// &mut bytes, // &mut bytes,
// ); // );
println!("Precompilation");
let _ = hblang::run_compiler(&path, Default::default(), &mut bytes); let _ = hblang::run_compiler(&path, Default::default(), &mut bytes);
println!("Post-compilation");
match std::fs::create_dir("target/programs") { match std::fs::create_dir("target/programs") {
Ok(_) => (), Ok(_) => (),
Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => (), Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => (),

View file

@ -1,7 +1,7 @@
string := @use("rel:string.hb"); string := @use("rel:string.hb");
receive_message := fn(buffer_id: int, memory_map_location: ^u8, length: int): ^u8 { 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 { send_message := fn(buffer_id: int): void {

View file

@ -45,7 +45,7 @@ reverse := fn(s: ^u8): void {
return; return;
} }
set := fn(change: ^int, new: int): void { set := fn(change: ^u8, new: int): void {
*(change) = new; *(change) = new;
return; return;
} }

View file

@ -0,0 +1,2 @@
# Framebuffer Driver
A simple framebuffer driver.

View file

@ -1,7 +1,7 @@
main := fn(): int { frame_buffer := @as(^u8, @bitcast(18446603339442421760));
frame_buffer := @as(^u8, @bitcast(18446603339442421760));
color := 17;
main := fn(): int {
color := 17;
loop { loop {
len := (786432 * 4)+1; len := (786432 * 4)+1;
loop if len == 0 break else { loop if len == 0 break else {

View file

@ -4,8 +4,19 @@ string := stn.string;
memory := stn.memory; memory := stn.memory;
buffer := stn.buffer; buffer := stn.buffer;
/*
service_search := fn(): void {
// a :=
return;
}
*/
main := fn(): int { main := fn(): int {
// Create a buffer // Create a buffer
buffer_id := buffer.create(); buffer_id := buffer.create();
buffer.send_message(buffer_id); buffer.send_message(buffer_id);

View file

@ -2,7 +2,7 @@ stn := @use("../../../libraries/stn/src/lib.hb");
log := stn.log; log := stn.log;
mem := stn.memory; mem := stn.memory;
s := stn.string; s := stn.string;
page := 0 page := 0;
main := fn(): void { main := fn(): void {
page += mem.request_page(1); page += mem.request_page(1);