So i know there is such a thread just a few post below, but my issue is a bit other.
Please take a look at my code:
Code:
org 0x7c00
use16
jmp 0x0000:stage2_start
include 'INC/a20.inc'
include 'INC/gdt.inc'
include 'INC/vesa.inc'
include 'INC/mmap.inc'
stage2_start:
call a20_activation
call zero_his
call run_in_vesa
call memory_map
call create_gdt
cli
mov eax, cr0
or eax, 1
mov cr0, eax
jmp dword 0x8:e_o_s2
zero_his:
cld
mov di, 0x500
mov al, 0
mov cx, 0x1000
rep stosb
ret
e_o_s2:
jmp stage3
include 'INC/gdt64.inc'
stage3:
use32
mov ax, 0x10
mov ds, ax
mov es, ax
mov ss, ax
mov eax, [0x500+8]
mov ecx, 1280*720
.l:
mov dword [eax+4*ecx], 0x00ff00
dec ecx
cmp ecx, 0
jg .l
mov eax, PAGING_LAYER4
mov cr3, eax
mov eax, cr4
or eax, 0x20
mov cr4, eax
mov ecx, 0xC0000080
rdmsr
or eax, 0x100
wrmsr
mov eax, cr0
or eax, 0x80000000
mov cr0, eax
;;<<------triple fault here
jmp $
call gdt64_install
jmp dword 0x8:longmode
align 4096
PAGING_LAYER4:
dq 0 or 10b or (PAGING_LAYER3)
times 511 dq 0
PAGING_LAYER3:
times 512 dq 0
longmode:
use64
jmp $
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
jmp $
So the paging is at 0x9000 which is divisable by 4096 and is set up rather correctly. Whats the problem then?