RAID (Redundant Array of Independent Disks) combines several physical drives into one logical volume to gain speed, redundancy, or both. Different RAID levels trade capacity against protection.
Fig. 01 — RAID
Swipe sideways to see the whole diagram →
Step by step
RAID 0 — striping
Data is split across all disks, so reads and writes run in parallel. Fastest, but one disk failure loses everything.
RAID 1 — mirroring
Every disk holds an identical copy. You lose half your capacity but survive a disk failure with no data loss.
RAID 5 — striping with parity
Data plus a parity block are spread across at least three disks. Any one disk can fail and its contents are rebuilt from the rest.
RAID 6 — double parity
Two parity blocks, so two disks can fail simultaneously. Important with large drives where a rebuild takes many hours.
RAID 10 — mirrored stripes
Mirrored pairs that are then striped. Excellent speed and resilience, at the cost of half the raw capacity.
Rebuild
After replacing a failed disk, the array reconstructs the missing data. Performance drops during this window and a second failure here is the real danger.
Real-world example
A small business server runs RAID 5 across four drives. A drive fails on a Tuesday; staff keep working while a hot spare rebuilds in the background. Nobody loses a file — but the nightly backup still runs, because RAID is not a backup.
Where people get this wrong
The single most expensive misunderstanding in storage: RAID is not a backup. A deleted file is deleted on every disk instantly, and ransomware encrypts a mirrored array just as quickly as a single drive.
Common interview questions
Is RAID a backup?
No. It protects against hardware failure only. Deleted files, ransomware and corruption are replicated instantly across the array.
How much usable capacity does RAID 5 give?
The total minus one disk. Four 1 TB drives give 3 TB usable.
Why is RAID 5 discouraged with very large drives?
Rebuild times run into many hours, and the heavy read load raises the chance of a second failure before the rebuild finishes. RAID 6 or 10 is safer.
What is the difference between hardware and software RAID?
Hardware RAID uses a dedicated controller with its own cache. Software RAID is handled by the operating system — cheaper and more portable, but it uses host CPU.
Inside the Druvexaa simulation
The lab lets you pull a disk out of a running array and watch the rebuild start, along with the performance drop while it runs — the window in which a second failure becomes genuinely dangerous.
Memory allocation is how the operating system decides which free region of RAM to give a process. The strategy chosen affects both speed and how much memory is wasted as unusable gaps.
Fig. 02 — An OS allocate memory
Swipe sideways to see the whole diagram →
Step by step
First fit
Take the first hole large enough. Fast, because the search usually ends early.
Best fit
Search all holes and take the smallest one that fits. Wastes the least space per allocation but leaves many tiny unusable gaps.
Worst fit
Take the largest hole, on the theory that the leftover piece will still be useful. In practice it performs poorly.
External fragmentation
Free memory exists but is scattered in small pieces, so a large request fails even though the total free space is sufficient.
Internal fragmentation
A process is given a slightly larger fixed block than it asked for, and the unused remainder inside that block is wasted.
Paging solves it
Splitting memory into fixed-size pages removes external fragmentation entirely, which is why every modern OS uses paging with virtual memory.
Real-world example
Ask any system to allocate a large contiguous buffer after hours of uptime and it may fail even with plenty of free RAM. The free space is there, just broken into pieces too small to use — classic external fragmentation.
Where people get this wrong
Fragmentation is treated as a rounding error. It is why a system with gigabytes free can still refuse a large allocation. The total number tells you almost nothing; the shape of the free space tells you everything.
Common interview questions
Which is faster, first fit or best fit?
First fit, because it stops at the first suitable hole instead of scanning the entire free list.
What is the difference between internal and external fragmentation?
Internal is wasted space inside an allocated block. External is free space between blocks that is too fragmented to use.
What is compaction?
Relocating allocated blocks so free space becomes contiguous. It works but is expensive, since processes must be paused and pointers updated.
How does paging eliminate external fragmentation?
Every frame is the same fixed size, so any free frame can satisfy any page request. There are no awkwardly shaped gaps.
Inside the Druvexaa simulation
Allocate and free blocks in any order in the simulation and watch the memory map fill with gaps, then try a large request and watch it fail while the free total still looks healthy.
Process scheduling is how the operating system decides which ready process gets the CPU next. Since a core can run only one process at a time, the scheduler creates the illusion that everything runs at once.
Fig. 03 — Process Scheduling
Swipe sideways to see the whole diagram →
Step by step
FCFS
First Come First Served runs processes in arrival order. Simple, but one long job delays everything behind it — the convoy effect.
SJF
Shortest Job First gives the best average waiting time, but it requires knowing burst lengths in advance and can starve long jobs.
Round Robin
Each process gets a fixed time slice, then goes to the back of the queue. This is what makes interactive systems feel responsive.
Priority scheduling
Higher-priority processes run first. Ageing gradually raises the priority of waiting processes to prevent starvation.
Preemptive vs non-preemptive
A preemptive scheduler can take the CPU away mid-execution. A non-preemptive one waits for the process to yield.
Multilevel queues
Real systems use several queues with different policies — interactive tasks get quick slices, background jobs get longer ones.
Real-world example
You drag a window while a video encodes in the background. Round-robin style scheduling with priority boosting hands the CPU to the interface repeatedly, so the drag stays smooth even though the encoder wants every cycle it can get.
Where people get this wrong
Scheduling is taught as an algorithm comparison exercise. Real systems use several at once, in layers, and the interesting question is not which algorithm is best but which one should apply to which kind of work.
Common interview questions
What is the difference between preemptive and non-preemptive scheduling?
Preemptive scheduling can interrupt a running process; non-preemptive waits until it blocks or finishes. Preemption is what makes a system responsive.
What is the convoy effect?
Short processes stuck waiting behind one long process under FCFS, which badly inflates average waiting time.
How is the time quantum chosen in Round Robin?
Too large and it degrades into FCFS; too small and context-switch overhead dominates. It is tuned to sit comfortably above the switch cost.
What is starvation, and how is it fixed?
A low-priority process never getting CPU time. Ageing fixes it by increasing priority the longer a process waits.
Inside the Druvexaa simulation
The simulation runs the same set of processes under FCFS, SJF and Round Robin, then shows the resulting Gantt charts side by side with average waiting times calculated for each.
A context switch is the act of saving one process's CPU state and loading another's, so the CPU can move between processes. It is the mechanism that makes multitasking possible on a single core.
Fig. 04 — Context Switching
Swipe sideways to see the whole diagram →
Step by step
A trigger occurs
A timer interrupt fires, the process blocks on I/O, or a higher-priority process becomes ready.
Save the context
The CPU registers, program counter, stack pointer and memory mapping details are written into the Process Control Block.
Update the process state
The outgoing process moves from Running to Ready or Waiting.
Pick the next process
The scheduler selects the next process from the ready queue.
Restore its context
That process's saved registers and program counter are loaded back into the CPU.
Resume
Execution continues from exactly where it left off. The process is unaware it was ever paused.
Real-world example
A modern desktop performs thousands of context switches per second. Each one costs a few microseconds of pure overhead — no useful work happens during a switch, which is why excessive switching hurts throughput.
Where people get this wrong
Switching is assumed to be free because it is fast. It is fast and it is pure waste — no user work happens during it, and the incoming process starts with a cold cache, which costs more than the switch itself.
Common interview questions
What is stored in a Process Control Block?
Process ID, state, program counter, CPU registers, memory management information, open file list and accounting data.
Why is context switching considered pure overhead?
No user work is done during the switch, and the CPU cache and TLB are often left cold for the incoming process.
Is switching between threads cheaper than between processes?
Yes. Threads in one process share an address space, so the memory mapping does not have to be swapped out.
What triggers a context switch?
Timer interrupts, I/O requests, system calls, higher-priority processes arriving, or a process terminating.
Inside the Druvexaa simulation
The simulation shows the CPU registers being written into one process control block and read out of another, with a counter tracking how much time was spent switching rather than computing.
A critical section is the part of a program that accesses shared data. If two processes execute their critical sections at the same time, the shared data can be corrupted — this is a race condition.
Fig. 05 — Critical Section Problem
Swipe sideways to see the whole diagram →
Step by step
Identify shared data
Any variable, file or device touched by more than one process or thread is a candidate.
Mutual exclusion
At most one process may be inside the critical section at any moment.
Progress
If nobody is inside, a waiting process must eventually be allowed in. The decision cannot be postponed indefinitely.
Bounded waiting
There must be a limit on how many times others can enter before a waiting process gets its turn — this prevents starvation.
Enforce with a lock
A mutex allows exactly one holder. A semaphore is a counter that allows up to n holders, useful for a pool of resources.
Avoid new problems
Careless locking creates deadlock, where each process holds what another needs, and priority inversion, where a low-priority holder blocks a high-priority waiter.
Real-world example
Two threads increment the same counter from 100. Without a lock, both may read 100, both write 101, and one increment silently disappears. With a mutex, the result is reliably 102 every time.
Where people get this wrong
Race conditions are assumed to be rare because the timing window is small. Small windows are hit constantly at machine speed, and the resulting bugs are intermittent, unreproducible, and among the hardest to find in software.
Common interview questions
What are the three requirements of a critical section solution?
Mutual exclusion, progress and bounded waiting.
What is the difference between a mutex and a semaphore?
A mutex is a lock with an owner, allowing one holder. A counting semaphore permits up to n concurrent holders and has no ownership.
What is a race condition?
When the result depends on the unpredictable order in which processes access shared data.
What are the four conditions for deadlock?
Mutual exclusion, hold and wait, no preemption, and circular wait. Breaking any one of them prevents deadlock.
Inside the Druvexaa simulation
Run two processes without a lock in the simulation and watch the shared counter produce a wrong result, then add a mutex and run the identical scenario again.
Booting is the sequence that takes a machine from powered-off silence to a usable desktop. Firmware tests the hardware, finds a bootable device, and hands control to the operating system kernel.
Fig. 06 — When you power on a computer
Swipe sideways to see the whole diagram →
Step by step
Power good signal
The power supply stabilises and signals the motherboard that voltages are within tolerance.
POST
Firmware runs the Power-On Self Test, checking CPU, RAM and essential devices. Failures are reported by beep codes or LEDs.
Firmware initialises
UEFI (or legacy BIOS) sets up hardware and reads the configured boot order.
Find the boot device
UEFI reads the EFI System Partition; legacy BIOS reads the Master Boot Record in the first sector of the disk.
Bootloader runs
GRUB, systemd-boot or the Windows Boot Manager presents any choices and loads the selected kernel into memory.
Kernel takes over
It initialises memory management, mounts the root filesystem and loads drivers.
Init starts services
systemd or an equivalent brings up services and the display manager, and you get a login screen.
Real-world example
A machine that beeps and shows nothing on screen usually failed POST — often a reseating problem with the RAM. A machine that reaches the bootloader but hangs afterwards points at the operating system, not the hardware. The boot sequence tells you where to look.
Where people get this wrong
Booting is treated as one opaque event. It is a chain, and knowing where it stopped tells you what to fix — a POST failure is hardware, a bootloader failure is configuration, and a hang after the kernel loads is the operating system.
Common interview questions
What is the difference between BIOS and UEFI?
UEFI is the modern replacement: it supports drives over 2 TB with GPT, boots faster, has a graphical interface, and supports Secure Boot.
What is POST?
Power-On Self Test — the firmware's hardware check before any operating system code runs.
What does the bootloader do?
Locates the kernel, loads it into memory with the right parameters, and transfers control. It also lets you choose between installed systems.
What is the difference between MBR and GPT?
MBR is the legacy partition scheme, limited to 2 TB and four primary partitions. GPT supports far larger disks, many partitions, and stores redundant headers.
Inside the Druvexaa simulation
The simulation walks the sequence stage by stage and lets you break any stage deliberately, so you can learn to read the symptom and name the stage that failed.
Deadlock is a state where a set of processes are all waiting for resources held by each other, so none of them can ever proceed. Nothing crashes — the system simply stops making progress.
Fig. 07 — Deadlock
Swipe sideways to see the whole diagram →
Step by step
Mutual exclusion
At least one resource can be held by only one process at a time. Without this, there is nothing to fight over.
Hold and wait
A process holds one resource while requesting another, instead of asking for everything at once.
No preemption
A resource cannot be forcibly taken from the process holding it — it must be released voluntarily.
Circular wait
A closed chain exists where each process waits for a resource held by the next.
All four together
Deadlock requires every one of these conditions simultaneously. Break any single one and it becomes impossible.
Prevention, avoidance, detection
Prevention removes a condition by design. Avoidance uses algorithms like Banker's to refuse unsafe allocations. Detection lets it happen and then kills or rolls back a process.
Real-world example
Two bank transfers run at once. One locks account A then reaches for B; the other locks B then reaches for A. Both wait forever. Forcing every transfer to lock accounts in numerical order removes the circular wait and the bug disappears.
Where people get this wrong
Deadlock is assumed to be a crash, so people look for an error message. A deadlocked system looks alive — threads exist, memory is allocated, nothing is logged. It is diagnosed by noticing that work stopped completing, not by an exception, which is why it survives testing and appears in production.
Common interview questions
What are the four Coffman conditions?
Mutual exclusion, hold and wait, no preemption, and circular wait. All four must hold at once for deadlock to occur.
What is the difference between deadlock and starvation?
Deadlock means no process in the set can ever proceed. Starvation means a process could proceed but keeps being passed over indefinitely.
How does lock ordering prevent deadlock?
If every process acquires locks in the same global order, a circular wait cannot form, which removes one of the four required conditions.
What does the Banker's algorithm do?
It checks whether granting a resource request would leave the system in a safe state, and refuses the request if it would not.
Inside the Druvexaa simulation
The synchronisation simulation lets you assign resources in an order that creates a circular wait and watch both processes freeze, then re-run it with an enforced lock ordering so the same workload completes cleanly.
Virtual memory gives every process its own private address space that is larger than the physical RAM installed. The operating system and hardware translate those virtual addresses to real ones, moving rarely used pages out to disk when memory runs short.
Fig. 08 — Virtual Memory and Paging
Swipe sideways to see the whole diagram →
Step by step
Split everything into pages
Virtual memory is divided into fixed-size pages, and physical memory into frames of the same size, typically 4 KB.
Keep a page table
Each process has a table mapping its pages to physical frames, or marking them as not present.
Translate in hardware
The Memory Management Unit performs the lookup on every access. A small cache called the TLB holds recent translations so this stays fast.
Demand paging
Pages are loaded only when first touched. A program can start before most of it is in memory.
Page fault
Accessing a page that is not resident traps to the operating system, which fetches it from disk, updates the table and resumes the instruction.
Replacement and thrashing
When RAM is full, an algorithm such as LRU chooses a victim page to evict. If the working set exceeds RAM, the system spends more time paging than computing — that is thrashing.
Real-world example
A machine with 8 GB of RAM runs applications whose combined address space is far larger. It works because at any moment each program is actively touching only a small fraction of its pages, and the rest sit on disk unnoticed.
Where people get this wrong
Virtual memory is often described as simply using disk as extra RAM. Swapping is the emergency behaviour, not the purpose. The real purposes are isolation — one process cannot see another's memory — and the removal of external fragmentation, both of which apply even on a machine that never swaps a single page.
Common interview questions
What is a page fault?
A trap raised when a process accesses a page that is not currently in physical memory, prompting the OS to load it and retry the access.
What does the TLB do?
It caches recent virtual-to-physical translations so the MMU can avoid walking the page table on every memory access.
What is thrashing?
A state where the active working set exceeds physical memory, so the system spends most of its time swapping pages instead of executing instructions.
How does paging eliminate external fragmentation?
Every frame is identical in size, so any free frame satisfies any page request and no unusable gaps form between allocations.
Inside the Druvexaa simulation
The memory simulation shows the page table alongside physical frames, so you can touch a page that is not resident, watch the page fault trap, see the fetch from disk and see the table entry update before the instruction resumes.
Multithreading lets one process run several independent sequences of execution at the same time. Threads share the process's memory, which makes communication between them fast and mistakes between them dangerous.
Fig. 09 — Multithreading
Swipe sideways to see the whole diagram →
Step by step
What a thread owns
Its own program counter, registers and stack. That is the entire private state of a thread.
What a thread shares
The heap, global variables, open files and code — everything else belongs to the process and is visible to every thread in it.
Concurrency versus parallelism
Concurrency is several tasks in progress at once. Parallelism is several genuinely executing at the same instant, which needs multiple cores.
Cheaper switching
Switching between threads of one process does not change the memory map, so it costs noticeably less than a full process switch.
Shared state needs protection
Because the heap is shared, two threads writing the same variable will corrupt it unless a lock enforces order.
Thread pools
Creating a thread per task does not scale. Real systems keep a fixed pool of threads and hand them work from a queue.
Real-world example
A file upload runs on a background thread while the interface stays responsive on the main thread. Both live in the same process and share the same progress variable — which is exactly why that variable needs a lock.
Where people get this wrong
Adding threads is treated as a way to make code faster. On a single core, threads that are all CPU-bound make things slower, because the switching overhead is added to the same total work. Threads help when tasks spend time waiting — on disk, network or user input — which is a completely different situation from needing more computation.
Common interview questions
What is the difference between a process and a thread?
A process has its own address space. Threads live inside a process and share that address space, keeping only their stack and registers private.
Why is thread switching cheaper than process switching?
The memory mapping does not change, so the page tables and much of the cache remain valid for the incoming thread.
What is a race condition in a multithreaded program?
Two threads accessing shared data concurrently where the result depends on which one happens to run first.
Why use a thread pool instead of creating threads on demand?
Thread creation is expensive and unbounded creation exhausts memory. A pool caps concurrency and reuses threads across many tasks.
Inside the Druvexaa simulation
The context switching simulation lets you compare switching between threads of one process against switching between separate processes, with the saved and restored state shown in each case so the cost difference is visible rather than asserted.
A mutex is a lock with an owner — whoever locked it must be the one to unlock it, and only one holder is allowed. A semaphore is a counter that permits up to a set number of holders and has no concept of ownership.
Fig. 10 — Difference between a Semaphore and a Mutex
Swipe sideways to see the whole diagram →
Step by step
A mutex enforces exclusivity
One thread locks it, does its work in the critical section, and unlocks it. Everyone else waits.
Ownership matters
Because the mutex knows its owner, the runtime can detect a thread trying to unlock a mutex it never locked.
A semaphore counts permits
Initialised to n, it allows n threads through. Each wait decrements the count; each signal increments it.
A binary semaphore is not a mutex
It also allows one holder, but any thread may signal it. That difference is what makes it useful for signalling between threads.
Producer and consumer
The classic use: one semaphore counts filled slots, another counts empty slots, and a mutex protects the buffer itself.
Choose by intent
Protecting shared data means a mutex. Limiting concurrent access to a pool, or waking one thread from another, means a semaphore.
Real-world example
A download manager allows three simultaneous connections. A semaphore initialised to 3 enforces that limit. The shared list of completed downloads is separately protected by a mutex — two different problems, two different tools.
Where people get this wrong
A binary semaphore is treated as interchangeable with a mutex because both allow one holder. The difference is ownership, and it matters: a thread can signal a semaphore it never waited on, which is a feature when signalling between threads and a serious bug when you meant to protect data. Choosing the wrong one produces code that works in testing and fails unpredictably in production.
Common interview questions
Can a semaphore be released by a thread that did not acquire it?
Yes, and that is the defining difference from a mutex. It is what allows a semaphore to signal between threads.
When would you use a counting semaphore?
To limit concurrent access to a pool of identical resources — database connections, download slots, worker permits.
What is priority inversion?
A low-priority thread holding a lock blocks a high-priority thread. Priority inheritance temporarily raises the holder's priority to resolve it.
What are the two semaphore operations called?
Wait and signal, historically P and V. Wait decrements and blocks at zero; signal increments and may wake a waiter.
Inside the Druvexaa simulation
The synchronisation simulation runs the same producer-consumer workload three ways — with no protection, with a mutex only, and with the correct semaphore plus mutex combination — so you can watch the buffer corrupt, then stall, then run correctly.
An operating system is the layer between hardware and applications. It manages the processor, memory, storage and devices, and gives every program a consistent interface so it does not need to know what hardware it is running on.
Fig. 11 — An Operating System
Swipe sideways to see the whole diagram →
Step by step
Process management
It creates processes, schedules them onto cores, and cleans up when they end.
Memory management
It allocates memory, maps virtual addresses to physical ones, and keeps processes from reading each other's data.
File system
It turns raw blocks on a disk into named files and directories with permissions.
Device management
Drivers hide the differences between hardware, so a program writes to a file the same way regardless of the drive underneath.
Protection
It enforces the boundary between programs and between users, which is the reason one crashing application does not take the machine with it.
Real-world example
A text editor saving a file never touches the disk directly. It makes a system call, and the operating system handles permissions, buffering, the file system layout and the driver — which is why the same editor works on an SSD, a hard disk or a network share.
Where people get this wrong
The operating system is thought of as the desktop you see. The visible interface is an application. The real operating system is the kernel underneath, which is why a server with no screen at all is still running a full one.
Common interview questions
What are the main functions of an operating system?
Process management, memory management, file system management, device management, and protection between users and programs.
What is the kernel?
The core of the operating system that runs in privileged mode and directly controls hardware, memory and scheduling.
Why do applications not access hardware directly?
Protection and portability. Going through the OS prevents programs interfering with each other and lets the same program run on different hardware.
Inside the Druvexaa simulation
The CPU, RAM and OS simulation follows a program from storage into memory and onto the processor, showing where the operating system steps in at each stage rather than leaving it as an invisible middle layer.
These topics are written to the same depth. A dedicated Druvexaa simulation is planned for each — until then, every one links to the closest existing simulation and quiz.
The processor runs in two privilege levels. Kernel mode can execute any instruction and touch any memory; user mode cannot. This single hardware boundary is what keeps one badly written program from destroying the whole system.
Fig. 12 — Difference between Kernel Mode and User Mode
Swipe sideways to see the whole diagram →
Step by step
Two privilege levels in hardware
The CPU itself enforces this. On x86 they are called ring 0 and ring 3, and the distinction is not something software can bypass.
User mode is deliberately limited
Applications cannot execute privileged instructions, address hardware, or read memory belonging to another process.
System calls cross the boundary
When a program needs something privileged it makes a system call, which traps into the kernel at a controlled entry point.
The kernel validates everything
It checks permissions and arguments before acting, then returns to user mode with the result.
Why crashes stay contained
A fault in user mode kills one process. A fault in kernel mode has nothing above it to catch the error, which is why it takes down the whole machine.
Real-world example
A blue screen or kernel panic is a failure in kernel mode. An application that simply closes with an error was a user mode fault — the operating system caught it, cleaned up, and kept running.
Where people get this wrong
Running as administrator is confused with running in kernel mode. Administrator is a permissions setting inside user mode; the CPU privilege level is unchanged. This is why a program with full admin rights still cannot corrupt the kernel directly, and why a driver — which does run in kernel mode — is far more dangerous than any ordinary application.
Common interview questions
Why do we need two processor modes?
To enforce isolation in hardware. Without it, any program could touch any memory or device and no protection would be possible.
What happens during a system call?
The CPU traps into kernel mode at a defined entry point, the kernel validates and performs the request, then returns control and the result to user mode.
Why is a kernel crash fatal but an application crash is not?
Nothing sits above the kernel to catch its fault or clean up after it, whereas the kernel can terminate a faulty process and continue.
Inside the Druvexaa simulation
No dedicated simulation yet. The context switching simulation shows the moment control transfers to the operating system, which is the same mechanism a system call uses to cross this boundary.
A system call is the controlled request an application makes when it needs the operating system to do something it is not allowed to do itself — open a file, send data on the network, or create a process.
Fig. 13 — System Calls
Swipe sideways to see the whole diagram →
Step by step
The program asks
Application code calls a normal-looking library function such as read or open.
The library sets it up
Arguments and a call number are placed in registers, then a special instruction triggers the trap.
Privilege changes
The CPU switches to kernel mode and jumps to a fixed handler. The application cannot choose where it lands.
Validation and execution
The kernel checks permissions and argument validity, performs the operation, and prepares a return value.
Return to user mode
Control returns to the program with the result or an error code. The switch in both directions costs time, which is why heavy system call use is slow.
Common categories
Process control, file operations, device management, information, and communication between processes.
Real-world example
Reading a file one byte at a time performs one system call per byte and crawls. Reading in 64 KB blocks does the same total work with a fraction of the crossings — which is exactly why buffered I/O exists in every language's standard library.
Where people get this wrong
Library functions and system calls are treated as the same thing. Most library calls never reach the kernel at all — they work from a buffer in user space. Confusing the two leads people to blame the operating system for performance problems that are actually in their own buffering strategy.
Common interview questions
Why are system calls expensive?
Each one changes privilege level, saves and restores state, and disturbs the cache — overhead that dwarfs the work of a small operation.
Name the main categories of system calls.
Process control, file management, device management, information maintenance, and inter-process communication.
What is the difference between a system call and a library function?
A library function is ordinary user-space code. It only becomes a system call when it needs the kernel to do something privileged.
Inside the Druvexaa simulation
No dedicated simulation yet. The context switching simulation shows the state save and restore that a system call performs when it crosses into the kernel and back.
A file system is the structure that turns a flat array of storage blocks into named files and folders. It tracks where each file's data lives, who may access it, and how free space is managed.
Fig. 14 — File System
Swipe sideways to see the whole diagram →
Step by step
Names map to records
A directory is itself a file, holding a list of names and the record number each one points to.
The record holds the metadata
An inode on Linux or an MFT record on Windows stores size, owner, permissions, timestamps and the list of data blocks.
Data lives in blocks
Files occupy whole blocks, typically 4 KB. A 1 KB file still consumes a full block, and the remainder is slack space.
Free space tracking
The file system maintains a map of which blocks are in use so it can allocate new ones quickly.
Journaling
Before making a change, the file system records its intent. After a power loss it replays or discards the journal instead of scanning the entire disk.
Different designs
NTFS on Windows, ext4 and XFS on Linux, APFS on macOS, exFAT for cross-platform removable drives.
Real-world example
Deleting a large file is instant because only the directory entry and the free-space map are updated. The data blocks are untouched, which is exactly why recovery tools can often bring the file back.
Where people get this wrong
Formatting is believed to erase data. A quick format rewrites the file system structures and leaves nearly every data block intact. Selling or discarding a drive after a quick format is one of the most common ways personal data leaks — secure erasure has to overwrite the blocks themselves.
Common interview questions
What is an inode?
A structure holding a file's metadata and the location of its data blocks. The file name lives in the directory, not in the inode.
What is journaling and why does it matter?
The file system logs its intended changes before making them, so an interrupted write can be replayed or rolled back rather than leaving corruption.
Why does a small file still consume a full block?
Allocation happens in whole blocks. The unused remainder is internal fragmentation, or slack space.
Inside the Druvexaa simulation
No dedicated simulation yet. The RAID lab shows the storage layer beneath the file system, including how blocks are distributed across disks and reconstructed after a failure.