multitask and paging

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.
Post Reply
orb!t

multitask and paging

Post 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 ?
carbonBased

RE:multitask and paging

Post 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
orb!t

RE:multitask and paging

Post 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
Post Reply