Home > OS >  Question about the kernel mode and user mode
Question about the kernel mode and user mode

Time:11-20

Recently in the Linux user mode and kernel mode, see a confused, now have a few questions, want to ask:
1. Check it on the website, "every user process, mapping in the 0 to 3 gb of user address, and the upper 4 gb, is mapping the kernel address",
As a process, the kernel mode and user mode is contradictory? That is to say, when the process is called OS interrupted, to enter the kernel mode processing, the process will jump out from user mode, into the kernel mode? Or, original code is mapping in a 0 to 3 gb, this time into the kernel, address mapping to 4 gb of space, the 0 to 3 gb is no the process , in 4 gb kernel space after the execution, the process map back again, is that right?
2. Check the online "all user mode process, corresponding to the same kernel period", also can say so a kernel space, and the user space is for each user mode process some virtual 0 to 3 gb, and if it is, so suppose there are 100 processes, interrupted to into the kernel, all that is blocked, processed a, next again into the kernel mode? That such a cycle, kernel mode not in handling interrupts, kernel mode was supposed to do, not to do?
3. When not handling interrupts, kernel mode doing?
4. From user mode to kernel mode, there are several ways, for instance by calling the ioctl function, when using this function, the corresponding module in fd, and then read the kernel mode, processing, according to this way of communication, the makes me feel user mode and kernel mode like another independent , maybe all user mode is through the interrupt written ioctl file, the kernel constantly read ioctl , when read, go to perform the corresponding requirements, is that right?

All 4 question, actually the main rival is the nature of the kernel mode and user mode, whether they are opposing or coexist?

CodePudding user response:

1. User mode and kernel mode is the state of the process, you need to call the operation of the operating system, is the kernel mode, call the user program, it is the user mode, 0 to 4 gb virtual address space is the process, so don't say in the kernel code run 3 to 4 g, 0 to 3 g, there is no process, the understanding is wrong,
2. Seeing you is what, in general the interrupt highest priority, all your so-called 100 interrupt interrupted, one for CPU is a process, due to the fast CPU, users are typically less than experience delays,
3. No handling interrupts, run the operating system in listening
  • Related