5-SystemCalls

5-SystemCalls - USER MODE, KERNEL MODE, ITERRUPTS AND...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
USER MODE, KERNEL MODE, ITERRUPTS AND SYSTEM CALLS
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Computer Architecture Review Most modern computers use the Von Newman Architecture where both programs and data are stored in RAM. A computer has an address bus and a data bus that are used to transfer data from/to the CPU, RAM, ROM, and the devices. The CPU, RAM, ROM, and all devices are attached to this bus.
Background image of page 2
Computer Architecture Review CPU RAM ROM Ethernet Card USB Controler (mouse, kbd) Hard Drive CD/DVD Drive Address bus Data bus Interrupt Line
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Kernel and User Mode Kernel Mode When the CPU runs in this mode: It can run any instruction in the CPU It can modify any location in memory It can access and modify any register in the CPU and any device. There is full control of the computer. The OS Services run in kernel mode.
Background image of page 4
Kernel and User Mode User Mode When the CPU runs in this mode: The CPU can use a limited set of instructions The CPU can only modify only the sections of memory assigned to the process running the program. The CPU can access only a subset of registers in the CPU and it cannot access registers in devices. There is a limited access to the resources of the computer. The user programs run in user mode
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Kernel and User Mode When the OS boots, it starts in kernel mode. In kernel mode the OS sets up all the interrupt vectors and initializes all the devices. Then it starts the first process and switches to user mode. In user mode it runs all the background system processes (daemons or services). Then it runs the user shell or windows manager.
Background image of page 6
Kernel and User Mode User programs run in user mode. The programs switch to kernel mode to request OS services (system calls) Also user programs switch to kernel mode when an interrupt arrives. They switch back to user mode when interrupt returns. The interrupts are executed in kernel mode. The interrupt vector can be modified only in kernel mode. Most of the CPU time is spent in User mode
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Kernel and User Mode Kernel Mode User Mode
Background image of page 8
Kernel and User Mode Separation of user/kernel mode is used for: Security: The OS calls in kernel mode make sure that the user has enough privileges to run that call. Robustness: If a process that tries to write to an invalid memory location, the OS will kill the program, but the OS continues to run. A crash in the process will not crash the OS. > A bug in user mode causes program to crash, OS runs. A
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 29

5-SystemCalls - USER MODE, KERNEL MODE, ITERRUPTS AND...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online