Kernel data structure Flashcards

(20 cards)

1
Q

What is a kernel data structure?

A

It’s a data structure used by the OS kernel to manage system resources like processes, memory, files, and devices.

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

Why are kernel data structures important?

A

They let the kernel efficiently track, manage, and control system operations like scheduling, memory use, and device access.

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

Where are kernel data structures stored?

A

In kernel space, which is protected from user access for security and stability.

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

Name 4 key types of kernel data structures.

A

Process Control Block (PCB), Page Tables, File Descriptor Tables, Scheduler Queues.

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

What is a Process Control Block (PCB)?

A

A data structure that stores information about a process, such as its ID, state, registers, memory, and scheduling info.

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

What kind of information is stored in a PCB?

A

Process ID, process state, CPU registers, memory pointers, priority, I/O status.

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

When is a PCB created and destroyed?

A

Created when a process starts, and destroyed when the process terminates.

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

What is a page table in the OS kernel?

A

A data structure that maps virtual memory addresses to physical memory addresses.

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

Why are page tables necessary?

A

They allow the OS to implement virtual memory and isolate process memory spaces.

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

What happens if a page table entry is missing?

A

A page fault occurs, and the OS may load the missing page from disk into RAM.

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

What is a file descriptor table?

A

A data structure that maps open files to file descriptors for each process.

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

Who maintains the file descriptor table?

A

Each process has its own table, but the kernel maintains the actual file structures.

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

What happens when a file is opened?

A

The kernel assigns a file descriptor and adds an entry to the file descriptor table.

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

What are scheduler queues?

A

Kernel data structures that organize processes based on their state (e.g., ready, waiting).

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

What types of scheduler queues exist?

A

Ready queue, waiting queue, and device queues.

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

How does the scheduler use these queues?

A

To select the next process to run based on the scheduling algorithm.

17
Q

What is a device table?

A

A structure used by the kernel to manage hardware devices and their drivers.

18
Q

What does the device table store?

A

Information about device status, device IDs, and associated drivers.

19
Q

What’s the difference between kernel data structures and user-space data structures?

A

Kernel structures manage system-level operations and are protected; user-space structures are used by applications and have no access to kernel space.

20
Q

Why is it dangerous to let user processes access kernel data structures directly?

A

It can lead to system crashes, security vulnerabilities, or resource misuse.