Virtual Memory Question: Does the kernel ever switch to physical memory?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

This is my first message to the group. I am glad there is a community to help linux kernel newbies.
I hope to learn much from all of you.

Here is my first question.

I have read various linux documents but could not find the answer to my question.

Does the kernel ever switch to use the physical address?

Let me give an example (to make sure i understand things correctly)

1 - A process in the user space is running (in virtual memory)

2- Process requests something  from kernel and issues an interrupt (lets say that process wants to read from a file).

3- The 'int' assembly instruction switches from the user space to kernel space (switch from ring 5 to ring 0, and stack pointer changes to point kernel stack)

4- The process is now running in the kernel space and still with the SAME VIRTUAL MEMORY(?) as the caller process. (not sure if this is correct)

5- Now the kernel has to issue an I/O operation to make the hdd copy the information to memory.

I have a question at this point. If everything i said is correct and all. How does the kernel get the information from hdd controller and move it to user space?
Does it switch to physcal memory? Does it find a page which is empty, pass address of that page to hdd controller, and mark that page in the VM table of current process?

I would be glad if you could enlighten me about the adress transitions between physical and virtual memory.
I am sorry my question was a bit long. But I would really appreciate any information regarding this problem.
Sincerely Yours.





[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux