How does the kernel set register cr3?

Viewed 1613

I understand that the mmu of the processor uses register cr3 to translate linear addresses into physical ones, provided that cr3 is properly set to the physical address of the page directory. But after the kernel has allocated the page tables, how would it find the physical address of the tables and set cr3 to it?

EDIT: I'm talking about the linux kernel.

1 Answers
Related