Following are the constants, of load addr and virtual addr,
Code: Select all
#define KERNEL_VIRTUAL_ADDR 0xC0000000 /* This is 3 GB */
#define KERNEL_LOAD_ADDR 0x01000000 /* This is 16 MB */
#define PAGE_SIZE 4096
#define SCREEN_MAX_X 80
#define SCREEN_MAX_Y 24
#define SCREEN_MEM_ADDR (0xB8000 )
I thought because of TLB there may be problem, so after removing mapping of 4 table and added mapping to 0 table I reloaded cr3 with same dir address. but still its not working. there is no page fault Identity map was successful. following is clear screen function.
Code: Select all
void kcls()
{
int i;
volatile char *v = (volatile char *) SCREEN_MEM_ADDR;
for(i = 0; i < (SCREEN_MAX_X * SCREEN_MAX_Y * 2); i++)
{
v[i] = 0;
}
screen_x = screen_y = 0;
update_curssor();
}