From 1b5cb54a2be24baf886b364ec8ea36b0966554ec Mon Sep 17 00:00:00 2001 From: Able Date: Fri, 13 Sep 2024 20:17:47 -0500 Subject: [PATCH] ignim work --- sysdata/libraries/ignim/src/errors.hb | 16 ++++++++++++++++ sysdata/libraries/ignim/src/lib.hb | 12 +++++++----- sysdata/libraries/ignim/src/results.hb | 7 +++++++ sysdata/programs/dt_buffer_test/src/main.hb | 10 ++++++++-- .../programs/horizon_testing_program/src/main.hb | 10 ++++++++++ 5 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 sysdata/libraries/ignim/src/errors.hb create mode 100644 sysdata/libraries/ignim/src/results.hb diff --git a/sysdata/libraries/ignim/src/errors.hb b/sysdata/libraries/ignim/src/errors.hb new file mode 100644 index 0000000..57ef5e9 --- /dev/null +++ b/sysdata/libraries/ignim/src/errors.hb @@ -0,0 +1,16 @@ +// the 0- thing is scuffed + +OutOfHostMemory := 0 - 1 +OutOfDeviceMemory := 0 - 2 +InitializationFailed := 0 - 3 +DeviceLost := 0 - 4 +MemoryMapFailed := 0 - 5 + +LayerNotPresent := 0 - 6 +ExtensionNotPresent := 0 - 7 +FeatureNotPresent := 0 - 8 +IncompatibleDriver := 0 - 9 +TooManyObjects := 0 - 10 +FormatNotSupported := 0 - 11 +FragmentedPool := 0 - 12 +Unknown := 0 - 13 \ No newline at end of file diff --git a/sysdata/libraries/ignim/src/lib.hb b/sysdata/libraries/ignim/src/lib.hb index 161d851..c6c015c 100644 --- a/sysdata/libraries/ignim/src/lib.hb +++ b/sysdata/libraries/ignim/src/lib.hb @@ -1,7 +1,9 @@ -VK_VERSION_MAJOR := 1; -VK_VERSION_MINOR := 0; +results := @use("rel:results.hb") +errors := @use("rel:errors.hb") -init_vulkan := fn(): void { - - return +VK_VERSION_MAJOR := 1 +VK_VERSION_MINOR := 0 + +init_vulkan := fn(): int { + return errors.IncompatibleDriver } \ No newline at end of file diff --git a/sysdata/libraries/ignim/src/results.hb b/sysdata/libraries/ignim/src/results.hb new file mode 100644 index 0000000..9b00940 --- /dev/null +++ b/sysdata/libraries/ignim/src/results.hb @@ -0,0 +1,7 @@ +// NonErrors +Success := 0 +NotReady := 1 +Timeout := 2 +EventSet := 3 +EventReset := 4 +Incomplete := 5 \ No newline at end of file diff --git a/sysdata/programs/dt_buffer_test/src/main.hb b/sysdata/programs/dt_buffer_test/src/main.hb index dbc27b4..4d4d14c 100644 --- a/sysdata/programs/dt_buffer_test/src/main.hb +++ b/sysdata/programs/dt_buffer_test/src/main.hb @@ -1,8 +1,14 @@ -dt_api := @use("../../../libraries/dt_api/src/lib.hb") +dt_api := @use("../../../libraries/dt_api/src/lib.hb"); +.{dt_get} := dt_api main := fn(): int { dt_api.dt_get("framebuffer/fb0/width\0") - dt_api.dt_get("cpu/architecture\0") + dt_api.dt_get("cpu/cpu0/architecture\0") + + // Checking if the first detected serial port is memory mapped or port mapped + // 0 -> memory mapped + // 1 -> port mapped + dt_get("serial_ports/sp0/mapping\0") return 0 } \ No newline at end of file diff --git a/sysdata/programs/horizon_testing_program/src/main.hb b/sysdata/programs/horizon_testing_program/src/main.hb index f665ae4..15ebc3f 100644 --- a/sysdata/programs/horizon_testing_program/src/main.hb +++ b/sysdata/programs/horizon_testing_program/src/main.hb @@ -4,9 +4,19 @@ stn := @use("../../../libraries/stn/src/lib.hb"); horizon_api := @use("../../../libraries/horizon_api/src/lib.hb"); .{create_window} := horizon_api +ignim := @use("../../../libraries/ignim/src/lib.hb"); +.{init_vulkan} := ignim + main := fn(): int { windowing_system_buffer := buffer.create("XHorizon\0") create_window(windowing_system_buffer) + // TODO: get WindowID + + vk_state := init_vulkan() + if vk_state == ignim.errors.IncompatibleDriver { + stn.log.info("Incompatible Vulkan Driver\0") + } + return 0 } \ No newline at end of file