summaryrefslogtreecommitdiff
path: root/src/gdt.c
diff options
context:
space:
mode:
authorSimponic <loganthebean222@gmail.com>2021-03-08 23:31:08 -0700
committerSimponic <loganthebean222@gmail.com>2021-03-08 23:31:08 -0700
commitfe3d7ad8322df67abd4255b9d377d8bab0007c04 (patch)
tree01f5b3eb9c6512d5fa88d0a739627ef9810f677a /src/gdt.c
parentc1beac8b2174e0bdc333b69deb92bce5a2c33fd9 (diff)
parentdede7fa93eb4d19c6290355af0c5cb342e47e2f6 (diff)
downloadsimponicos-fe3d7ad8322df67abd4255b9d377d8bab0007c04.tar.gz
simponicos-fe3d7ad8322df67abd4255b9d377d8bab0007c04.zip
Merge branch 'interrupts'HEADmaster
Diffstat (limited to 'src/gdt.c')
-rw-r--r--src/gdt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gdt.c b/src/gdt.c
index fa52f38..5f597fd 100644
--- a/src/gdt.c
+++ b/src/gdt.c
@@ -1,4 +1,5 @@
#include "gdt.h"
+#include "print.h"
extern void reloadSegments();
@@ -11,6 +12,10 @@ void encodeGDT(uint8_t* gdtEntry, struct GDT source) {
// Size: 1 (32 bit protected mode)
gdtEntry[6] = 0xC0;
}
+ else if (source.limit == 0) {
+ // Don't set any granularity for null entry
+ gdtEntry[6] = 0;
+ }
else {
// Granularity: 0 (1 byte segments)
// Size: 1