Each process, each instance of a running program, has a
virtual memory space, known more formally as the process address space, of 4GB (under most
32-bit processor architectures, as 4GB is 232, or two raised to the thirty-second power). Under
most circumstances, the kernel gets 1GB of this space, while user space gets the other 3GB. (There
are other options for the layout of memory in Linux??”this is just the most common.)
User space programs are not permitted to access kernel memory directly. As with CPU and peripheral
protection, the motivation for strict memory partitioning is to prevent ill-behaved (or even
deliberately malicious) programs from modifying kernel data structures, which can create system
instability or even crash the system.
The distinction between kernel and user space is another fundamental feature of the Linux development
environment that gives developers considerable flexibility to write almost any code they
want with reasonable assurance that if their program crashes, it won??™t also crash the system. At
the same time, the syscall interface that serves as the gateway between user mode code and kernel
mode code enables user mode programs to access kernel features and services in a safe, controlled
manner.
Moreover, the kernel can perform tasks that ordinarily might be executed by user space programs
without needing a different programming model.
Pages:
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372