I'm working on my kernel that is running in single address space for now. For mapping pages I use this function: https://pastebin.com/LPwYrkcp
This function successfully maps (physical) memory between 0x200000 and 0x8000000 (first 512 pages are mapped in boot.asm when I'm entering long mode), but it fails to map anything above.
I.e. After running this function and touching cr3 I don't get #PF, but for example when I access this memory it always returns zero and qemu says:
Since this function looks good to me I thought maybe my paging structure overlaps some other structures in memory. Root of my paging structure (PML4) is at 0x1000. So entry for 0x8000000 is at ps_root[34304] = 0x1000 + 34304 * 8 = 0x44000.(gdb) x/b 0x8000000
0x8000000: Cannot access memory at address 0x8000000
I wonder if there is something there.