5 questions to test your understanding
A user-mode application tries to directly write to an I/O port to control a hardware device, bypassing the OS. What happens?
When an application executes a system call, it provides the system call number and its arguments. Why can't the application also specify which address in the kernel to jump to?
User-mode applications are restricted from directly accessing hardware because the operating system has configured software rules they are expected to follow — a well-behaved application respects these rules, but a malicious one could bypass them.
The timer interrupt is essential for a preemptive operating system because it gives the kernel a way to regain control from a running user process even when that process has not voluntarily made a system call.
Why does the kernel mediate all hardware interactions rather than letting applications interact with hardware directly? What would go wrong without this separation?