Microkernels implement device drivers in User Mode, but swapping reqiures hard-disk access.
How do microkernels swap memory to disk if drivers are processes in user-space?
User Mode Swapping?
User Mode Swapping?
All a good OS needs to do is to run Linux inside QEMU
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: User Mode Swapping?
How about not swapping those drivers?
Re: User Mode Swapping?
I think he means "how does the page fault handler access the hard drive if the hard drive driver is in user mode?"
And I think the answer is something like "the kernel can call user mode code as often as it wants. Protected mode only prevents user code from calling kernel code, directly."
Application Code -> Page Fault -> Kernel Page Fault Handler -> User Mode Hard Disk Driver -> Hard Disk Controller -> Hard Disk
I don't see any problem with this sequence...
And I think the answer is something like "the kernel can call user mode code as often as it wants. Protected mode only prevents user code from calling kernel code, directly."
Application Code -> Page Fault -> Kernel Page Fault Handler -> User Mode Hard Disk Driver -> Hard Disk Controller -> Hard Disk
I don't see any problem with this sequence...
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Re: User Mode Swapping?
In my OS the sequence goes like this
1. Application Code
2. Page Fault
3. Kernel Page Fault Handler
At this point the kernel checks whether it has the page or not. If not it modifies the kernel state of the original app so that it appears that the app sent a message to the VFS asking for a page from the file that it is trying to load. It then adds the app to the message queue of the VFS. From the VFS point of view the message is a 'read' message from a file that was opened when mmap was originally called.
4. VFS.
5. User Mode Hard Disk Driver etc.
6. VFS replies with data
7. App is unblocked and resumes.
1. Application Code
2. Page Fault
3. Kernel Page Fault Handler
At this point the kernel checks whether it has the page or not. If not it modifies the kernel state of the original app so that it appears that the app sent a message to the VFS asking for a page from the file that it is trying to load. It then adds the app to the message queue of the VFS. From the VFS point of view the message is a 'read' message from a file that was opened when mmap was originally called.
4. VFS.
5. User Mode Hard Disk Driver etc.
6. VFS replies with data
7. App is unblocked and resumes.
If a trainstation is where trains stop, what is a workstation ?