aboutsummaryrefslogtreecommitdiff
path: root/i686/test
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-10-29 11:26:44 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-10-29 11:26:44 +0300
commitc4fcc92183c55db868d0d6ae53e6009fb2e53ee5 (patch)
treead5ef50aa07465e11f779c4482e20e6071182e9c /i686/test
parentmakefile: add libk target (diff)
downloadkernel-c4fcc92183c55db868d0d6ae53e6009fb2e53ee5.tar.xz
makefile: add i686/arch.a target
Diffstat (limited to 'i686/test')
-rw-r--r--i686/test/gdt.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/i686/test/gdt.c b/i686/test/gdt.c
new file mode 100644
index 0000000..2947b42
--- /dev/null
+++ b/i686/test/gdt.c
@@ -0,0 +1,20 @@
+#include "gdt.h"
+#include <assert.h>
+#include <stdlib.h>
+
+int
+main()
+{
+ assert(*(uint8_t *)&null_access == 0x00);
+ assert(*(uint8_t *)&ktext_access == 0x9a);
+ assert(*(uint8_t *)&kdata_access == 0x92);
+
+ struct SegmentDescriptor_t d;
+ SegmentDescriptor(&d, 0, 0, 0);
+ assert(*(uint64_t *)&d == 0);
+
+ assert(ktextDescriptor == 0x10);
+ assert(kdataDescriptor == 0x18);
+
+ return EXIT_SUCCESS;
+}