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 =