What elements constitute the context of a process in Linux, and how does the kernel duplicate this context for the child process during the `fork()` system call?
The context of a process includes various elements such as the CPU registers, program counter, stack pointer, and more. When fork is called, the kernel needs to create a duplicate context for the child process, with certain modifications to ensure both processes can run independently. The key modifications include setting the return values of fork appropriately: 0 for the child process and the child's PID for the parent process.