Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
#include<paging.h>
#include<io.h>
#include<textmode.h>
#include<types.h>
unsigned long *page_directory = (unsigned long *) 0xAA0000;
unsigned long *page_table = (unsigned long *) 0xAB0000; // the page table comes right after the page directory
void paging_install()
{
unsigned long address=0; // holds the physical address of where a page is
unsigned int i,j,d;
// write_cr3, read_cr3, write_cr0, and read_cr0 all come from the assembly functions
write_cr3(cast_ulong(page_directory)); // put that page directory address into CR3
write_cr0(read_cr0() | 0x80000000); // set the paging bit in CR0 to 1
kprint(" DONE\n");
}
(1) Use [ code] tags, not quote tags, so your indentation is kept.
(2) Why the if (i==0), if (i==1) special cases?
(3) in the if(i==1) special case, page_directory[1] is undefined.
(4) Where's your bochs dump?