Commit 7de0adfc by malcolm

fixed crashes, mapping, and corrected return address in switch

parent 8e231276
Showing with 13 additions and 2 deletions
......@@ -62,7 +62,9 @@ void load_elf(elf_header* elf_start)
}
// Map the kernel 1:1 in memory
page_region(pgdir, 0x0, &_kernel_end);
//page_region(pgdir, 0x0, &_kernel_end);
for(int i=0;i<7;i++)
pgdir[i]=kernel_page_directory[i];
// Allocate two more pages for stack
page_map(pgdir, highest_vpage + 0x1000);
......
......@@ -48,7 +48,13 @@ void default_handler(trapframe reg)
{
settf(&reg);
if(reg.trap<32)
reg.eip+=2;
{
serial_writestring("exception from address: ");
serial_hexword(reg.eip);
serial_writestring("\n");
//reg.eip+=2;
}
if(handlers[reg.trap]!=NULL)
{
handlers[reg.trap](reg.err);
......
......@@ -2,6 +2,9 @@ global context_switch
context_switch:
mov eax, [esp+4]
mov edx, [esp+8]
mov ecx, [esp]
mov [edx+20], ecx
push ebp
push ebx
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment