From fb8a835926508ffa0d36b236f2ba8dfd6220c56b Mon Sep 17 00:00:00 2001 From: Able Date: Mon, 12 Aug 2024 08:21:31 -0500 Subject: [PATCH] this ia bad way to handle this but oh well --- .../kernel_services/service_definition_service.rs | 2 +- .../programs/{serial_driver => a_serial_driver}/README.md | 0 .../programs/{serial_driver => a_serial_driver}/meta.toml | 2 +- .../{serial_driver => a_serial_driver}/src/main.hb | 8 +++++--- sysdata/programs/diskio_driver/src/main.hb | 2 ++ sysdata/system_config.toml | 4 ++-- 6 files changed, 11 insertions(+), 7 deletions(-) rename sysdata/programs/{serial_driver => a_serial_driver}/README.md (100%) rename sysdata/programs/{serial_driver => a_serial_driver}/meta.toml (84%) rename sysdata/programs/{serial_driver => a_serial_driver}/src/main.hb (91%) diff --git a/kernel/src/holeybytes/kernel_services/service_definition_service.rs b/kernel/src/holeybytes/kernel_services/service_definition_service.rs index a7497bca..02f7c3ae 100644 --- a/kernel/src/holeybytes/kernel_services/service_definition_service.rs +++ b/kernel/src/holeybytes/kernel_services/service_definition_service.rs @@ -7,7 +7,7 @@ use { }, alloc::string::String, hashbrown::HashMap, - log::info, + log::{info, trace}, spin::{lazy::Lazy, Mutex}, }; pub struct Services(HashMap); diff --git a/sysdata/programs/serial_driver/README.md b/sysdata/programs/a_serial_driver/README.md similarity index 100% rename from sysdata/programs/serial_driver/README.md rename to sysdata/programs/a_serial_driver/README.md diff --git a/sysdata/programs/serial_driver/meta.toml b/sysdata/programs/a_serial_driver/meta.toml similarity index 84% rename from sysdata/programs/serial_driver/meta.toml rename to sysdata/programs/a_serial_driver/meta.toml index 33de7059..812e2972 100644 --- a/sysdata/programs/serial_driver/meta.toml +++ b/sysdata/programs/a_serial_driver/meta.toml @@ -1,5 +1,5 @@ [package] -name = "serial_driver" +name = "a_serial_driver" authors = ["Able"] [dependants.libraries] diff --git a/sysdata/programs/serial_driver/src/main.hb b/sysdata/programs/a_serial_driver/src/main.hb similarity index 91% rename from sysdata/programs/serial_driver/src/main.hb rename to sysdata/programs/a_serial_driver/src/main.hb index c4854b22..80f877fd 100644 --- a/sysdata/programs/serial_driver/src/main.hb +++ b/sysdata/programs/a_serial_driver/src/main.hb @@ -19,11 +19,13 @@ serial_println := fn(ptr: ^u8): void { } main := fn(): int { - serial_println("Starting Serial Driver.\0") - // Note that the first byte is reserved, pad accordingly. + // This must be done first and foremost to prevent racing a := buffer.create("XNumber\0") + serial_println("Starting Serial Driver.\0") + + // Note that the first byte is reserved, pad accordingly. b := buffer.search("XNumber\0") - + if a == b { serial_println("Stopping Serial Driver.\0") } diff --git a/sysdata/programs/diskio_driver/src/main.hb b/sysdata/programs/diskio_driver/src/main.hb index a90be03d..f8c3517d 100644 --- a/sysdata/programs/diskio_driver/src/main.hb +++ b/sysdata/programs/diskio_driver/src/main.hb @@ -8,5 +8,7 @@ main := fn(): int { a := memory.inb(0, 70) b := memory.inb(0, 71) + c := buffer.search("XNumber\0") + return 0 } \ No newline at end of file diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index 624b1ed4..f7242705 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -19,8 +19,8 @@ resolution = "1024x768x24" # [boot.limine.ableos.modules.tests] # path = "boot:///tests.hbf" -[boot.limine.ableos.modules.serial_driver] -path = "boot:///serial_driver.hbf" +[boot.limine.ableos.modules.a_serial_driver] +path = "boot:///a_serial_driver.hbf" [boot.limine.ableos.modules.diskio_driver]