Page 1 of 1

multitask and paging

Posted: Mon Nov 10, 2003 12:00 am
by orb!t
i got working multitasking and want to enaple paging
i made two page tbl's and page dir's
one for kernel and one for task ( in PL=3 )
load cr3 with addr of page dir for kernel
in task tss cr3 = addr of page dir for task
when kernel switch to task i got 'CS not valid executable segment' ( in bochs )

what i could do wrong ?

RE:multitask and paging

Posted: Tue Nov 11, 2003 12:00 am
by carbonBased
I'm not aware of Bochs errors, but the first thing that comes to mind is that, perhaps, the task's page table/directory aren't 100% correct, and that CS is actually pointed to an unmapped page?

How have you got your page tables and directories set up?  If both TSSs aren't available and mapped, in memory, at the time of the task switch, this will cause an exception of some sort, as well.

Lastly, I'm sure you've done this, but you don't mention it; you've enabled paging through CR0, right?

Cheers,
Jeff

RE:multitask and paging

Posted: Wed Nov 12, 2003 12:00 am
by orb!t
both ( for kernel & task ) page tbl & dir are identical, exept attr bits
and they maps first 4MB of ram
GDT apears somwhere in kernel data in 1'st MB