Gigaboy wrote:
SeeSoftware wrote:
did you verify that you have set cr3 and the page directories to point at the PHYSICAL memory location (not the virtual adress location)
(my english is not very good but i hope you understand what i mean)
(or do you have problems with the data structure?)
Yes, I can understand you fine.
And I don't know what the problem is. It triple faults everytime I try to implement it.
ok (if you are using a struct (for page entries/dirs) in C/C++) you have to make SURE that structure packing is 1 BYTE
GCC: struct __attribute__ ((packed)) {...}
MSVC: #pragma pack(push, 1)
struct { .... }
#pragma pack(pop)
2. make sure those Data structures (like a Array holding Entries etc...) are 4096 byte aligned
eg:
GCC: uint32_t MyStructure[1024] __attribute__ ((aligned (4096)));
MSVC: __declspec(align(4096)) uint32_t MyStructure[1024];
3. make sure you have enough stack space for those data structures (because i didnt i just had 1mib stack (and you need 4mib if you want to have 1024*1024 entries (whole table (4GIB) (4k paging))