I am trying to implement Paging and for so far the paging works. I have paging enabled and there arent any errors so far.
It is also no problem to map a page to the virtual address, but now i get a strange problem. I can give a pointer the address so far, but when i am accessing the content, it is making strange things. I can write to the address, but after i looked what is written in it, the accessed memory is written full with 1. For example:
Code: Select all
//Maps a page
map_page(paging.get_kernel_directory(), (u32int*)0x10000000, (u32int*)memory.get_page(NMEMORY::UPPER_MEM), FPAGING_IS_WRITEABLE);
//a Pointer
u32int* tmp;
//gives the pointer an address of the new mapped virtual space
tmp = (u32int*)0x10000010;
//prints the given address, it is correct
std::cout<<"Addr: "<<std::HEX<<(u32int)tmp<<"\n";
//prints the content of the address space, it should be 0x0, because it is a new page, but it is 0xFFFFFFFF
std::cout<<"inhalt: "<<std::HEX<<*tmp<<"\n";
//Now i am writing into the memory
*tmp = 10;
//It worked he prints 0xA
console.writeint_hex(*tmp);
//It stoped working it prints 0xFFFFFFFF, why the hell?
console.writeint_hex(*tmp);
//Now i could make the thing over and over^^
I dont know where the problem is and what the problem is. I hope someone of you knows maybe the problem, or has an idea what to do. The code itself ended up being pretty much the same as the new code of JamesM's paging code, but if you want i can post it.
MfG Tarrox.