system calls and interrupts Flashcards

while trying to teach chatgpt about system calls and interrupts (13 cards)

1
Q

Are system calls from the OS to the process or from the process to the OS?

A

From the process to the OS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why a system call might be sent?

A

system call might be sent when a process need to do privileged functions, like file access, memory allocation, I/O…
So the OS can handle these requests in kernel mode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are 2 differences between system calls and interrupts

A
  1. Interrupts come from hardware or software and notify the OS that something needs attention.
    In the other hand, System calls come from a process requesting a service from the OS (e.g., file access, memory allocation).
  2. Interrupts are asynchronous, while system calls are synchronous (a process waits for the system call to complete).

2 in other words: interrupts should be handled immediately, while system calls might be handled after a while

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When an interrupt occurs, how does the OS decide what to do next? Does it always pause the running process, or are some interrupts handled differently?

A

Every interrupt causes the running process to pause, but depending on the type of interrupt, the OS might handle it in different ways.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the term ‘synchronous’

A

Synchronous: Happens in a predictable order and requires waiting. The process that initiates it must wait for it to complete before continuing.

Example: A system call (like reading a file) is synchronous because the process waits for the OS to return the requested data before proceeding.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the term ‘asynchronous’?

A

Asynchronous: Happens unpredictably and doesn’t require waiting. The event can occur at any time, and the process doesn’t necessarily have to wait for it.

Example: An interrupt (like a keyboard press or incoming network data) is asynchronous because it can happen while a process is running, and the OS handles it as needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How the OS decides which interrupt to handle first?

A

The OS decides which interrupt to handle first using an interrupt priority system, where interrupts are assigned different priority levels based on their importance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the objective of interrupt vector table?

A

The OS uses an interrupt vector table to manage interrupts efficiently

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What the interrupt vector table contain?

A

1.information about each interrupt.

2.How important each interrupt is.

3.The address of the Interrupt Service Routine (ISR), so the CPU knows where to jump to handle the interrupt.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is ISR (Interrupt Service Routine)?

A

It’s a special function or block of code that the OS executes when a specific interrupt occurs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the role of ISR?

A

Its role is to handle the interrupt, perform necessary actions (like reading data, completing a task, or signaling another process), and then return control to the interrupted process once the task is done.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How ISR is identified and triggered?

A

The ISR is identified and triggered based on the interrupt vector table, which stores the address of the ISR corresponding to each interrupt type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly