page directories for tasks

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
Adek336

page directories for tasks

Post by Adek336 »

Hello, I´ve got a simple scheduler, which can run some kernel level funcs. the kernel is mapped in pages 0 and above. So when a new process has it´s own cr3, how will it be able to run the scheduler or a syscall? One option is to put at page0 a func which loads the kernel cr3. Then all programs would need to be linked -Ttext 0x1000, would this work?

Cheers,
Adrian.
Jamethiel

RE:page directories for tasks

Post by Jamethiel »

Why not just map the user tasks to use a code segment descriptor with a different base and handle syscalls through an entry in the IDT?
Adek336

RE:page directories for tasks

Post by Adek336 »

I will try to use it. Just one more thing: the user task will start let´s say at 2Mb, so malloc would have to allocate above 2Mb and then substract 2Mb from the pointer value to make user_DS:ptr point at the place?

Cheers,
Adrian.
Post Reply