I think the problem lies there. Paging structures are required to be aligned on page boundaries as far as I know (check the Intel manuals to be sure), and the sum of 0xB8000+(80*25*2) is not divisible by 4096. Therefore the address will be off by a page and some reserved bits may be set. Probably this is what makes your emulator refuse the code.brodeur235 wrote:VBox is aborting when I try to actually enable paging by setting cr3 with the address of the page dir and turning on the last bit of cr0. The following asm is in my kernel's main:Code: Select all
;this part works fine mov eax,0x000B8000 add eax,(80*25*2) ;where to begin page directory (right after vid-mem)
Paging, yes I read the wiki
Re: Paging, yes I read the wiki
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Paging, yes I read the wiki
That and emulators are known to shoot you in the foot when you put data in video memory (or any other form of memory mapped I/O) - which is a Bad Idea(tm).
Re: Paging, yes I read the wiki
A. You're assuming the video memory is 80*25*2. Believe it or not, your monitor can do more then show a default console.
B. If you're using grub, you should be reading the memory map, not blindly assigning data structures to memory
C. System structures should always be page aligned (even if they don't need to be.) It takes two runs to access an un-aligned memory address, 1 for aligned.
B. If you're using grub, you should be reading the memory map, not blindly assigning data structures to memory
C. System structures should always be page aligned (even if they don't need to be.) It takes two runs to access an un-aligned memory address, 1 for aligned.