aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNic Gaffney <gaffney_nic@protonmail.com>2023-12-10 09:48:53 -0600
committerNic Gaffney <gaffney_nic@protonmail.com>2023-12-10 09:48:53 -0600
commit8fcd0cf7d6a2c891422c7101840778043207a60d (patch)
tree5527b605fdaee1ad4404bef6418f1a5e34e31d52 /tests
parent87d1e83a0ea5e20e535e3378e57f1fe0e9818a64 (diff)
downloadgftos-8fcd0cf7d6a2c891422c7101840778043207a60d.tar.gz
Changed to the based ASM syntax and implemented a rudementary GDT
Diffstat (limited to 'tests')
-rw-r--r--tests/compile_flags.txt1
-rwxr-xr-xtests/testbin0 -> 20752 bytes
-rw-r--r--tests/test_gdt.c21
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/compile_flags.txt b/tests/compile_flags.txt
new file mode 100644
index 0000000..f8a2c60
--- /dev/null
+++ b/tests/compile_flags.txt
@@ -0,0 +1 @@
+-I../src/include/
diff --git a/tests/test b/tests/test
new file mode 100755
index 0000000..f2cb106
--- /dev/null
+++ b/tests/test
Binary files differ
diff --git a/tests/test_gdt.c b/tests/test_gdt.c
new file mode 100644
index 0000000..938e709
--- /dev/null
+++ b/tests/test_gdt.c
@@ -0,0 +1,21 @@
+#include "gdt.h"
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+int main() {
+
+ uint16_t code_info = make_code(0, 0, 1);
+ uint16_t data_info = make_data(0, 0, 1);
+ Segment_Descriptor_t null = make_descriptor(0, 0, 0);
+ Segment_Descriptor_t code = make_descriptor(0, 0xFFFFF, code_info);
+ Segment_Descriptor_t data = make_descriptor(0, 0xFFFFF, data_info);
+ GDT_t *table = malloc(sizeof(GDT_t));
+ *table = (GDT_t){null, code, data};
+ GDTR_t gdtr = {(table + sizeof(GDT_t) - table - 1), (uint32_t)table};
+
+ printf("%zu\n", sizeof(GDT_t));
+ printf("0x%.16llX\n", null);
+ printf("0x%.16llX\n", code);
+ printf("0x%.16llX\n", data);
+ printf("0x%.24llX\n", table);
+}