Task switch runs into GPF or PF
Posted: Mon Apr 27, 2009 8:45 pm
With task switching (JM, chap. 9) from timer handler I get into GPF or PF:
Code: Select all
printf("task_switch before asm: eip: %x esp: %x ebp: %x cur_dir->phys: %x\n",eip,esp,ebp,current_directory->physicalAddr);
asm volatile(" \
cli; \
mov %0, %%ecx; \
mov %1, %%esp; \
mov %2, %%ebp; \
mov %3, %%cr3; \
mov $0x12345, %%eax; \
sti; \
jmp *%%ecx; "
: : "r"(eip), "r"(esp), "r"(ebp), "r"(current_directory->physicalAddr) : "ebx","edx" );
w/o clobbering ebx and edx I run into a GPF. Any advice?task_switch before asm: eip: 0000D4C2h esp: 0018FFD8h ebp: 0018FFF0h cur_dir->phys: 0041E000h
Page Fault (page not present) at 0040FCA0h - EIP: 0040FCA0h