Slides 3 Flashcards
define pipelining
Multiple steps of a process occur concurrently and then pass their results to the next step so less time is wasted as compared to waiting for every step to be finished.
i.e in fetch-decode cycle fetching takes longer than decoding and executing so while the nth instruction is being executed, instruction n+2 is being fetched and n+1 is being decoded.
what happens when in kernel mode
all instructions are allowed
• all I/O operations are allowed
• all memory can be accessed
• note: most of the kernel runs in kernel mode
what happens when in user mode
when a normal application is ran the CPU is in user mode and:
• eg. accessing the status register is disallowed (of course),
I/O instructions not allowed, access to some parts of memory not
allowed, …
• illegal instructions result in traps (exceptions)
what is a trap?
often a special instruction (SWI n, INT n, … )
• switches from user mode to kernel mode and invokes a predefined (system call)
routine
• think of it as ‘pausing’ the application and executing a kernel routine configured by the OS
• when the kernel routine is done, user mode is restored and application ‘resumes’
how to access hardware in user mode?
Not possible, in user mode one has to switch to kernel mode and run a predefined routine (system call) to do access hardware. These are called traps.