I am very much confused of the linux memory map of a process and its internals. In general what is mentioned in books or articles is that in linux (4gb -address space),
3gb address spaces is mapped to userspace for a process and 1gb is mapped to kernelspace of a process.
Since virtual memory support is there in linux, each process will have a separate 4gb virtual address space.And through paging the virtual to physical address conversion takes place for a memory access and userspace pages are swappable so no problem here.
what happens for the kernel address space, how the above said things works, when a process enter the kernel space through system calls. My understanding is that kernel pages are non-swappable, so how things work here when different process enters the kernel space. Say i have 10 process running in my system , when one process executes a system call , how the kernel switches to the corresponding process's kernel address space(since kernel memory is not going to change-correct me if i am wrong) and how it return back to user space.
If drivers also running in kernel space and how particular driver code is mapped to particular kernel address space(with in 1gb) and what happens if there is page fault in kernel space.
Please provide any article on links on this particular topic.