In: Computer Science
1.
a. Explain why modern Operating Systems don’t allow the user to access the hardware directly.
b. System calls pass parameters to the kernel using one of three methods: in registers, in a block or table and the address of the block passed as parameter in a register, on the stack. Discuss the advantages and disadvantages of each.
1: Modern OS don't allow the user to acess the hardware directly because the OS must have to hide the computer's hardware, and it has to manage the hardware resources,it needs to prevent the application software from accessing the hardware directly .Without this protection the os would not be able to its job.
The CPU provides two modes of operation which enforce
this protection. The software package runs in kernel mode, also
called supervisor mode or privileged mode. In kernel mode, the
software has complete access to all of the computer hardware, and
control the switching between the CPU modes. Interrupts are
received within the kernel mode software.
The rest of software runs in the user mode. during this mode, the
direct access to hardware is prohibited, and then it's not possible
to switch to kernel mode. Any attempts to violate these
restrictions are reported to the kernel mode software: in other
words, to the software system itself. Programs running in user mode
are given an address space, visible only to themselves, which
contains enough memory for them to try to to their job.
By having two modes of operation which are enforced by the
computer's own hardware, the software package can force application
programs to use the operating system's abstract services, rather
than circumventing any resource allocations by direct hardware
access.
2: