PrajnaEdge
A curiosphere for curious minds who want to understand, experiment with, and experience technology.
To continue exploring
Technology, made tangible.

Where does intelligence run?

Explore AI that moves inference closer to the data — from the edge to the device itself.

AI inference runs at or near the point where data is generated, rather than relying on a remote cloud.
Edge AI Computer Vision

Image Classification

Can this image classifier maintain its intelligence while becoming small enough for the edge?

// Coming soon
Edge AI Playground

Image Classification

Can this image classifier maintain its intelligence while becoming small enough for the edge?

Choose an image

Upload an image
Supports JPG, JPEG, PNG
This classifier recognizes only Apple, Banana, and Orange. Other objects may be incorrectly classified as one of these classes.

Choose the model

Model size
4.91 MiB
Largest activation
~625 KiB
Test accuracy
99.11%
Measured model accuracy
Your image is processed locally in your browser.
On-Device AI
On-Device AI Playground
// Coming soon

Explore the ideas, systems and connections that shape technology — choose any node to begin your journey.

PrajnaEdge Navigation Tree
Embedded Systems Tree

Edge AI Demonstrations

Deploying neural networks and intelligent decision loops on raw silicon targets.

Sort:
Operating Systems

When the Power Goes Out

Exploring crash consistency, write-ahead journaling, metadata synchronization, and system recovery.

Operating SystemsDisk ManagementCrash ConsistencyJournalingDurability

1. The Apparently Simple Write

To an application developer, saving data seems like a single, atomic operation:

Application ↓ write() ↓ Filesystem ↓ Storage

You open a file, call write(), close the file, and assume your changes are safely written to disk.

But underneath that simple API, the filesystem must update multiple complex internal records to keep its structural mapping intact. Changing even a tiny file requires writing to multiple locations:

notes.txt ↓ File Metadata (Inode size, timestamps, block references) ↓ Data Blocks (Actual text content bytes) ↓ Directory / Allocation Metadata (Directory indexes, free block bitmaps)

2. The Dangerous Moment

Let's analyze a simple append operation. Suppose we have a file:

File: notes.txt Size: 4 KB Data Blocks: [Block A]

The application appends another 4 KB of text, intending to achieve this new state:

New desired state: File: notes.txt Size: 8 KB Data Blocks: [Block A] [Block B]

To complete this append, the filesystem must perform a sequence of coordinate actions: 1. Write new data: Write the 4 KB payload to the newly allocated Block B. 2. Allocate block: Mark Block B as used in the filesystem's block allocation bitmap. 3. Update metadata: Update notes.txt Inode record to reflect the new size (8 KB) and add the pointer referencing Block B.

This illustrates the core problem: one logical file operation can involve multiple persistent changes.

3. What If Power Disappears?

Because storage drives write blocks sequentially rather than all at once, there is a delay between these operations. If a sudden crash or power outage interrupts the write sequence, the filesystem can be left in an inconsistent state:

Application ↓ write ↓ Filesystem ↓ Data + Metadata updates × POWER LOSS

Depending on exactly what reached the storage media before the crash, we might find: * Orphaned Block: Block B was marked as used in the bitmap, but the Inode was never updated to point to it. The block is locked but unreachable. * Corrupt Reference: The Inode was updated to size 8 KB referencing Block B, but the system crashed before Block B's payload finished writing. The file now points to junk or uninitialized data.

The core challenge of storage engineering is: a crash can interrupt a sequence of filesystem updates and leave persistent state inconsistent unless the filesystem has mechanisms to maintain crash consistency.

4. Buffering and Caching

The problem is compounded by performance optimizations. To prevent slow storage hardware from bottlenecking applications, the operating system does not send writes directly to physical storage.

Instead, data travels through volatile memory layers:

Application ↓ Kernel / Filesystem ↓ Memory Cache / Write Buffer (Page Cache) ↓ Storage Device Cache ↓ Storage Media (Non-volatile)

By buffering writes in memory, the OS can: * Respond to the application immediately (asynchronous write). * Batch writes to the same sectors to reduce physical disk operations. * Reorder operations to optimize disk head travel or sequential flash writes.

But this speed optimization introduces an important trade-off: a successful write request does not automatically mean every byte has already reached non-volatile storage.

5. Flush / Sync

If power fails while data is still sitting in a volatile RAM cache, that data is permanently lost, even if the application was told the write succeeded.

To mitigate this, operating systems provide synchronization calls such as: * fsync(fd): Forces all dirty data and metadata associated with a file descriptor to be flushed to the storage device. * sync(): Commits all buffered filesystem changes in memory to the storage controller.

These APIs allow applications (like databases) to request that pending changes be pushed toward stable storage according to the guarantees provided by the platform.

6. Crash Consistency

This brings us to a fundamental system property: Crash Consistency.

Simply defined:

The filesystem should remain in a valid, structurally coherent state even if the system crashes in the middle of an update.

Note that crash consistency is not the same as guaranteeing that no application data is lost. It guarantees that the filesystem structure (directory trees, inode indexes, block allocation maps) remains uncorrupted and can be successfully mounted without manual reconstruction.

7. Journaling

One of the most common designs used to achieve crash consistency is Journaling (also called Write-Ahead Logging).

Instead of writing changes directly to the main filesystem structures, the filesystem first writes a summary of the intended updates to a dedicated sequential log called the Journal:

Application ↓ Filesystem change ↓ Journal (Write transaction intent) ↓ Commit (Write commit record) ↓ Filesystem structures (Checkpoint updates to main drive)

Because the journal is written sequentially, it is extremely fast. Once the intent is fully written and a "Commit" record is appended to the journal, the transaction is safe. The filesystem then writes the changes to their actual locations (checkpointing).

If a crash happens mid-write, recovery is straightforward:

POWER LOSS × ↓ System Restart ↓ Scan Journal ↓ Restore filesystem consistency (Replay or Rollback)

During restart, the OS scans only the journal: * If a transaction is marked as committed, the recovery system replays the changes to the main structures. * If a transaction is uncommitted (broken by the power loss), the recovery system rolls back the partial updates.

Crucially, journaling primarily helps maintain filesystem consistency. It does not automatically mean that every application data byte is guaranteed to survive a crash. (For example, in "metadata-only" journaling, only filesystem structural updates are journaled, while user data writes are not, leaving open the possibility of stale file contents).

8. EdgeCase — Crash During a Write

Use the interactive simulator below to trace the timeline of a file append operation during a sudden power outage, contrasting recovery without a journal against recovery with a write-ahead journal:

9. Recovery / Journal Comparison

By re-running the simulation, we see how the two recovery systems handle the crash:

Recovery Without Journaling Without a journal, the filesystem cannot know which write was interrupted. It must perform a complete structural scan (like fsck on Unix or chkdsk on Windows) on reboot, checking every directory and block pointer. If it finds a file size representing 8 KB but Block B has no valid data, it has to guess—often forcing it to truncate the file or salvage corrupt nodes into orphan directories.

Recovery With Journaling With a journal, the recovery manager immediately finds the uncommitted transaction log Tx1. It knows exactly which metadata updates were left hanging. In seconds, it discards the incomplete transaction, marks Block B as free, and restores the inode size to 4 KB. The structure is immediately consistent and clean.

10. Real Operating-System Connection

Modern operating systems employ various crash consistency mechanisms depending on their target architecture:

* ext4 (Linux): Uses journaling, offering options like data=journal (full journaling of data and metadata) or data=ordered (flushes data blocks to storage before journaling the metadata). * NTFS (Windows): Employs a transaction log to secure structural metadata consistency, though it does not journal user data. * APFS (macOS/iOS): Uses a redirect-on-write design (copy-on-write) that writes new metadata to a fresh location before updating index pointers, avoiding the need for traditional journaling logs.

11. Important Distinction: Consistency vs. Durability

For engineers designing resilient systems, understanding this boundary is critical:

Crash Consistency Focuses on whether the filesystem can recover to a valid, mountable state after an unexpected shutdown without structural corruption.

Durability Focuses on whether the application's actual payload data has successfully reached non-volatile storage gates and will survive a power outage.

A filesystem can maintain structural consistency without guaranteeing that every recently written application byte survives.

12. The Next Step

The operating system has now shown us how it manages processes, memory, files, and storage — but how does it safely connect software to the many other devices surrounding the CPU?

System Tree Node Operating Systems

PrajnaEdge

Engineering concepts you don't just read — you experience.
Founded in 2026.

PrajnaEdge is a technology company exploring the space between understanding technology, experimenting with ideas, and turning them into things that can be experienced.

Our Mission

To make technology easier to explore, deeper to understand, and more exciting to experience.

Our Vision

To build a technology ecosystem where curiosity, experimentation and creation continuously lead to one another.

Where it began

Embedded Systems

PrajnaEdge began with Embedded Systems — exploring the foundations that connect hardware, software and intelligent computation.

The first technology universe is built around that foundation. The journey will expand as new ideas, experiments and products emerge.

PrajnaEdge is a technology company created by Devaharsha Meesarapu.

CREATOR PROFILE

Devaharsha Meesarapu

Embedded Systems • Firmware • Edge AI

I am the engineer behind the design, development, and content of PrajnaEdge. I build low-level systems where code directly controls hardware, bridging the gap between register-level silicon behavior and intelligent edge decision loops.

View Resume →

ABOUT ME

I am an Embedded Firmware Engineer focused on developing software for resource-constrained systems. My experience spans bare-metal firmware, device drivers, microcontroller peripherals, and communication protocols, working across the boundary between hardware and software.

My work has involved microcontroller-based systems, real-time behaviour, hardware interfaces, and communication technologies such as CAN, CAN FD, UART, SPI, and I²C. I am particularly interested in understanding systems from the lowest level upward—from registers and peripherals to intelligent edge systems.

ENGINEERING PHILOSOPHY

Engineering is not just about writing code; it is about managing constraints, timings, and physical hardware characteristics. True mastery of complex systems comes from understanding the interactions across different layers of the stack.

This conviction is why I built PrajnaEdge—to bridge the gap between conceptual theory and direct, register-level physical reality.

CONNECT

LinkedIn → GitHub →

Interactive Career Journey

Let's Connect
Interested in embedded systems, AI, or building something meaningful? I'd love to hear from you.
Open to collaborations, research, and interesting engineering conversations.
Help Improve PrajnaEdge
Found something to improve? I'd love to hear your thoughts.

Bare Metal

Software that runs directly on hardware without an operating system.

Applications
Operating Systems
YOU ARE HERE
Bare Metal
Processor
Hardware

"Every embedded application begins long before main()."

Operating Systems

An Operating System manages hardware and software resources so complex applications can work efficiently.

Applications
YOU ARE HERE
Operating Systems
Bare Metal
Processor
Hardware

"When one loop is no longer enough to carry the burden."

Support PrajnaEdge

PrajnaEdge is an independent education platform built to make knowledge freely accessible.

If you find PrajnaEdge useful, you can support its continued development.

Your support helps fund the time, tools, infrastructure, and experimentation that go into building and maintaining PrajnaEdge.

Select Region
Select Amount
Select an amount to support PrajnaEdge.