From dce59cc08a6f1fc8c13b3728542a209d626f1b73 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Tue, 17 Apr 2018 19:28:25 +0100 Subject: [PATCH] Fixed some GDT ints not being converted to the right length. --- kernel/arch/i386/gdt.nim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/arch/i386/gdt.nim b/kernel/arch/i386/gdt.nim index e2ebb82..8a5dafe 100644 --- a/kernel/arch/i386/gdt.nim +++ b/kernel/arch/i386/gdt.nim @@ -38,13 +38,13 @@ proc gdtFlush(){.inline,asmNoStackFrame.} = proc gdtSetGate(num: int, base: uint16, limit: uint32, access: AccessByte, flags: Flags) = # Setup the descriptor base address - gdt.entries[num].base_low = (base and 0xFFFF) - gdt.entries[num].base_middle = (base shr 16) and 0xFF - gdt.entries[num].base_high = (base shr 24) and 0xFF + gdt.entries[num].base_low = uint16(base and 0xFFFF) + gdt.entries[num].base_middle = uint8((base shr 16) and 0xFF) + gdt.entries[num].base_high = uint8((base shr 24) and 0xFF) # Setup the descriptor limits - gdt.entries[num].limit_low = (limit and 0xFFFF) - gdt.entries[num].flags_and_limit_mid = ((limit shr 16) and 0x0F) or flags + gdt.entries[num].limit_low = uint16(limit and 0xFFFF) + gdt.entries[num].flags_and_limit_mid = uint8(((limit shr 16) and 0x0F) or flags) gdt.entries[num].access = access proc createAccessByte(priv: range[0..3], directionConform: bool, readWrite: bool): AccessByte =