diff options
| author | Nic Gaffney <gaffney_nic@protonmail.com> | 2023-12-10 09:48:53 -0600 |
|---|---|---|
| committer | Nic Gaffney <gaffney_nic@protonmail.com> | 2023-12-10 09:48:53 -0600 |
| commit | 8fcd0cf7d6a2c891422c7101840778043207a60d (patch) | |
| tree | 5527b605fdaee1ad4404bef6418f1a5e34e31d52 /tests | |
| parent | 87d1e83a0ea5e20e535e3378e57f1fe0e9818a64 (diff) | |
| download | gftos-8fcd0cf7d6a2c891422c7101840778043207a60d.tar.gz | |
Changed to the based ASM syntax and implemented a rudementary GDT
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/compile_flags.txt | 1 | ||||
| -rwxr-xr-x | tests/test | bin | 0 -> 20752 bytes | |||
| -rw-r--r-- | tests/test_gdt.c | 21 |
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 Binary files differnew file mode 100755 index 0000000..f2cb106 --- /dev/null +++ b/tests/test 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); +} |
