I have a toy core that I work with under x86 on bochs. When I turn on paging, bochs is reset with a triple error error. Each and every memory access seems to be causing an error. So, I assume that I had an error with swap settings, and the problem is not in my interrupt handler. Here is the code.
paging.c
#include "paging.h" #include "lib.h" #include "screen.h" #include "descriptor_tables.h" typedef struct page_dir_entry_s{ bool present:1; bool writeable:1; bool user_access:1; bool write_through:1; bool cache_disabled:1; bool accessed:1; bool unused0:1; bool use_mb:1;
paging_asm.s
[global enable_paging] enable_paging: mov eax,[esp+4] mov cr3,eax mov eax,cr0 or eax,0x80000000 mov cr0,eax ret
source share