<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eric-Octavian </title>
    <description>The latest articles on DEV Community by Eric-Octavian  (@ionablokchain).</description>
    <link>https://dev.to/ionablokchain</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3983797%2Fa952416d-441a-4bbc-b1a9-b3be15bafb0c.png</url>
      <title>DEV Community: Eric-Octavian </title>
      <link>https://dev.to/ionablokchain</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ionablokchain"/>
    <language>en</language>
    <item>
      <title>Writing an OS in Rust: 5 Hard Problems You'll Face (And How to Solve Them)</title>
      <dc:creator>Eric-Octavian </dc:creator>
      <pubDate>Sun, 14 Jun 2026 15:53:25 +0000</pubDate>
      <link>https://dev.to/ionablokchain/writing-an-os-in-rust-5-hard-problems-youll-face-and-how-to-solve-them-5bbo</link>
      <guid>https://dev.to/ionablokchain/writing-an-os-in-rust-5-hard-problems-youll-face-and-how-to-solve-them-5bbo</guid>
      <description>&lt;p&gt;Rust promises memory safety without garbage collection. That's why many of us dream of writing a kernel in it. After several years of building a from‑scratch operating system in Rust, I've collected the real — not theoretical — challenges that will make you question your life choices.&lt;/p&gt;

&lt;p&gt;Here are the five hardest problems, and the pragmatic solutions that actually work.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The &lt;code&gt;unsafe&lt;/code&gt; Infection: Your Core is Not Safe
&lt;/h2&gt;

&lt;p&gt;The kernel's job is to manage memory, poke hardware registers, and handle interrupts. That means &lt;code&gt;unsafe&lt;/code&gt; is not an exception — it's the norm.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;: A single &lt;code&gt;unsafe&lt;/code&gt; block can corrupt state that safe code depends on. In userspace, you isolate &lt;code&gt;unsafe&lt;/code&gt; behind a small API. In the kernel, the entire bottom layer is &lt;code&gt;unsafe&lt;/code&gt;. A bug in the page fault handler trashes everything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What doesn't work&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
Pretending that "only 5% of the code is &lt;code&gt;unsafe&lt;/code&gt;". In practice, the scheduler, the memory allocator, the interrupt handlers — they all need &lt;code&gt;unsafe&lt;/code&gt;. You can't push it to the edges.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What works&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
Treat &lt;code&gt;unsafe&lt;/code&gt; as a &lt;em&gt;capability&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every &lt;code&gt;unsafe&lt;/code&gt; function must have a &lt;code&gt;// SAFETY:&lt;/code&gt; comment explaining &lt;em&gt;why&lt;/em&gt; it's sound.&lt;/li&gt;
&lt;li&gt;Use static assertions (&lt;code&gt;const_assert!&lt;/code&gt;) to validate invariants at compile time.&lt;/li&gt;
&lt;li&gt;Isolate hardware access behind a &lt;code&gt;hal&lt;/code&gt; crate where &lt;code&gt;unsafe&lt;/code&gt; is contained, but don't cheat — the rest of the kernel still needs &lt;code&gt;unsafe&lt;/code&gt; for core operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example — writing to a memory-mapped register:&lt;/p&gt;

&lt;p&gt;/// SAFETY: &lt;code&gt;addr&lt;/code&gt; must be a valid MMIO address for this device,&lt;br&gt;
/// aligned to 4 bytes, and the caller must hold the device lock.&lt;br&gt;
pub unsafe fn mmio_write(addr: *mut u32, value: u32) {&lt;br&gt;
    addr.write_volatile(value);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;The comment doesn't make it safe — it documents the contract so the caller knows what they must guarantee.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Memory Allocation Before alloc
You want Vec, Box, Arc. But alloc requires a global allocator. The allocator requires a lock. The lock requires a working scheduler. The scheduler requires memory allocation. Classic chicken‑and‑egg.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The problem: You can't allocate memory to create the structures that manage memory allocation.&lt;/p&gt;

&lt;p&gt;What doesn't work:&lt;br&gt;
Waiting until "later" to set up the allocator. You need dynamic data structures early in boot (e.g., to build the initial free list).&lt;/p&gt;

&lt;p&gt;What works:&lt;br&gt;
Two‑phase allocation:&lt;/p&gt;

&lt;p&gt;Phase 1 — Bootstrap allocator: A simple bump allocator (just increment a pointer) that runs before any locks or scheduler. It can allocate but never free.&lt;/p&gt;

&lt;p&gt;Phase 2 — Real allocator: After you have a working scheduler and a spinlock, you replace the bootstrap allocator with a proper buddy allocator or slab allocator.&lt;/p&gt;

&lt;p&gt;// Bootstrap: just move a pointer&lt;br&gt;
static mut BOOT_HEAP_START: usize = 0;&lt;br&gt;
static mut BOOT_HEAP_OFFSET: usize = 0;&lt;/p&gt;

&lt;p&gt;pub unsafe fn boot_alloc(size: usize) -&amp;gt; *mut u8 {&lt;br&gt;
    let ptr = (BOOT_HEAP_START + BOOT_HEAP_OFFSET) as *mut u8;&lt;br&gt;
    BOOT_HEAP_OFFSET += size;&lt;br&gt;
    ptr&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Later, you replace it via #[global_allocator] and the alloc crate.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Interrupts: The Stack is a Hostile Environment
Interrupt handlers run between instructions. They can't block, they can't allocate, and they must be extremely fast. In Rust, they also can't panic (kernel panic is fine, but unwinding is not).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The problem: Normal Rust code assumes it can panic and unwind. In an interrupt handler, unwinding would corrupt the interrupted context.&lt;/p&gt;

&lt;p&gt;What doesn't work:&lt;br&gt;
Using unwrap() or expect() anywhere near an interrupt. Even debug assertions that may panic are dangerous.&lt;/p&gt;

&lt;p&gt;What works:&lt;/p&gt;

&lt;p&gt;Mark interrupt handlers with #[naked] or assembly wrappers that save/restore registers and call a Rust extern "C" fn that never panics.&lt;/p&gt;

&lt;p&gt;Use #![feature(naked_functions)] for raw handlers.&lt;/p&gt;

&lt;p&gt;For the non‑naked portion, use #![deny(unsafe_op_in_unsafe_fn)] to force careful review.&lt;/p&gt;

&lt;p&gt;Example — IDT entry wrapper (x86_64):&lt;/p&gt;

&lt;h1&gt;
  
  
  [naked]
&lt;/h1&gt;

&lt;p&gt;extern "C" fn double_fault_handler() {&lt;br&gt;
    unsafe {&lt;br&gt;
        asm!("push rax; push rcx; push rdx; ...", &lt;br&gt;
             options(noreturn));&lt;br&gt;
        // call the actual handler in safe Rust&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Inside the safe handler, you log and halt. No unwinding.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Concurrency Without a Scheduler (Yet)
Spinlocks seem simple: while lock.is_locked() { hint::spin_loop(); }. But this fails as soon as you have multiple cores and a scheduler that can preempt the lock holder.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The problem:&lt;br&gt;
On a single core, a spinlock that spins forever blocks the entire system. You need to disable interrupts. On multiple cores, a spinlock is fine if the lock holder cannot be preempted (i.e., you disable preemption on that core).&lt;/p&gt;

&lt;p&gt;What doesn't work:&lt;br&gt;
Using a plain spinlock from spin crate without disable_irq. If an interrupt handler tries to acquire the same lock, deadlock.&lt;/p&gt;

&lt;p&gt;What works:&lt;/p&gt;

&lt;p&gt;Phase 1 (single‑core, no scheduler): Use a spinlock that disables interrupts. lock() = disable_irq() + spin.&lt;/p&gt;

&lt;p&gt;Phase 2 (multi‑core, scheduler running): Use proper Mutex that parks the thread if the lock is held.&lt;/p&gt;

&lt;p&gt;The turning point is when you have a working scheduler. Before that, all locks are effectively just disabling interrupts.&lt;/p&gt;

&lt;p&gt;Example — interrupt‑safe spinlock for early boot:&lt;/p&gt;

&lt;p&gt;pub struct IrqSpinlock {&lt;br&gt;
    lock: AtomicBool,&lt;br&gt;
    data: UnsafeCell,&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;impl IrqSpinlock {&lt;br&gt;
    pub fn lock(&amp;amp;self) -&amp;gt; IrqGuard {&lt;br&gt;
        let flags = disable_interrupts();&lt;br&gt;
        while self.lock.swap(true, Ordering::Acquire) {&lt;br&gt;
            enable_and_wait(flags);&lt;br&gt;
            flags = disable_interrupts();&lt;br&gt;
        }&lt;br&gt;
        IrqGuard { lock: self, flags }&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Allocator‑Scheduler‑Lock Tango
You want a Vec. But Vec needs the allocator. The allocator needs a lock. The lock needs the scheduler to yield if contested. The scheduler needs a Vec of runnable processes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The problem: Cyclic dependency between core kernel components.&lt;/p&gt;

&lt;p&gt;What doesn't work:&lt;br&gt;
Trying to implement them independently. They are coupled by design.&lt;/p&gt;

&lt;p&gt;What works:&lt;br&gt;
Layer your dependencies explicitly and accept temporary bootstrap stubs:&lt;/p&gt;

&lt;p&gt;Bootstrap phase: No scheduler, no proper locks. Use a bump allocator (no locking needed) and a &amp;amp;'static mut array for the process list (fixed capacity).&lt;/p&gt;

&lt;p&gt;Initialization phase: Create a simple round‑robin scheduler that works with the bump allocator. Locks are still just disable_irq spinlocks.&lt;/p&gt;

&lt;p&gt;Transition phase: Build the real allocator using the bootstrap allocator to allocate its own metadata. Then replace the global allocator.&lt;/p&gt;

&lt;p&gt;Scheduler replacement: Build the proper Vec‑based scheduler using the real allocator. Swap it in atomically.&lt;/p&gt;

&lt;p&gt;The key insight: it's okay to have a "good enough" stub for a short period. You don't need a perfect scheduler before you have an allocator. You just need something that doesn't crash.&lt;/p&gt;

&lt;p&gt;The Bottom Line&lt;br&gt;
Writing an OS in Rust is harder than writing one in C — not because Rust is bad, but because Rust forces you to be explicit about the unsafety that C hides. The problems above are not bugs in Rust; they are fundamental constraints of kernel development. Rust just makes you face them up front.&lt;/p&gt;

&lt;p&gt;If you survive the unsafe infection, the allocator deadlock, and the interrupt unwinding nightmares, what you get is a kernel where most panics are real bugs, not null dereferences, and where memory safety violations are rare enough to be shocking.&lt;/p&gt;

&lt;p&gt;Would I do it again? Yes. But I'd keep this list on my wall.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>IONA OS: Building a sovereign operating system in Rust from scratch – No token, no ICO</title>
      <dc:creator>Eric-Octavian </dc:creator>
      <pubDate>Sun, 14 Jun 2026 11:32:27 +0000</pubDate>
      <link>https://dev.to/ionablokchain/iona-os-building-a-sovereign-operating-system-in-rust-from-scratch-no-token-no-ico-1kig</link>
      <guid>https://dev.to/ionablokchain/iona-os-building-a-sovereign-operating-system-in-rust-from-scratch-no-token-no-ico-1kig</guid>
      <description>&lt;p&gt;I started writing IONA OS on a random night, 13 years ago. Back then, as now, I had no team. I never took money from venture capital funds. And I never launched a token.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IONA is not a crypto project. It is a sovereign operating system written in Rust that includes its own blockchain protocol, programming language, GUI, and AI.&lt;/strong&gt; Everything starts at the kernel and builds upward.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔐 What does "sovereign" mean?
&lt;/h2&gt;

&lt;p&gt;It means IONA doesn't depend on any existing ecosystem. It doesn't use Linux. It doesn't rely on third‑party security libraries. It doesn't run a VM just to be "compatible".&lt;/p&gt;

&lt;p&gt;I wrote my own scheduler, my own drivers (NVMe, GPU, USB, audio), my own filesystem (&lt;code&gt;ionafs&lt;/code&gt;), my own P2P stack, and my own language (&lt;code&gt;Flux&lt;/code&gt;) to describe intentions and causal mosaics. &lt;strong&gt;I turned down funding offers from VCs because I didn't want the vision to be dictated by return‑on‑capital.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The numbers I care about are simple: 0 tokens issued, 0 ICOs, 0 compromises.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ What IONA OS looks like today
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rust kernel&lt;/strong&gt; (234,000 lines in &lt;code&gt;src/&lt;/code&gt; alone). Supports x86_64 and AArch64.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Native drivers&lt;/strong&gt; for AMD DCN, Intel i915, NVMe, xHCI (USB 3.0), Intel HDA audio, Intel e1000e, RTL8168, and Intel WiFi.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compatibility layer&lt;/strong&gt; for Linux (syscall translation) and Windows binaries (Win32, DXVK) – not emulation, real syscall forwarding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full GUI&lt;/strong&gt; – glass compositor, desktop, applications (browser, terminal, wallet, validator), themes, widgets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrated AI agent&lt;/strong&gt; (&lt;code&gt;Cunatic AI&lt;/code&gt;) – self‑modifying, written in Flux, with mood matrix and long‑term memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hardware support dating back to 2008&lt;/strong&gt; – runs on laptops from 2008 onward (audio, video, network).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The source code is public on GitHub, and the official website is &lt;a href="https://iona.zone" rel="noopener noreferrer"&gt;https://iona.zone&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⛓️ IONA Protocol – native L1 with no token
&lt;/h2&gt;

&lt;p&gt;The blockchain protocol isn't a separate daemon. &lt;strong&gt;It runs as a kernel subsystem.&lt;/strong&gt; Key features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DAG consensus&lt;/strong&gt; (Narwhal + Bullshark) – parallel transaction processing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Encrypted mempool&lt;/strong&gt; – transactions are encrypted before they enter the pool. Front‑running is structurally impossible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Post‑quantum cryptography&lt;/strong&gt; – Dilithium, Kyber, and SPHINCS+ integrated at the OS level.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EVM‑compatible&lt;/strong&gt; – existing Solidity contracts run unmodified.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"No token, no ICO"&lt;/strong&gt; – the protocol has no native token. It's an infrastructure component, not a speculation vehicle.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I didn't build IONA Protocol to "make quick money". I built it because a sovereign operating system needs a consensus layer that is equally sovereign.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧪 Flux – a language of intentions, not functions
&lt;/h2&gt;

&lt;p&gt;Flux looks different because it was designed for a world where the OS can understand intent, not just execute instructions. It introduces:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;intention&lt;/code&gt; blocks – declarative goals with triggers and priorities.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;causal_mosaic&lt;/code&gt; – a weighted, time‑aware memory structure.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;collapse&lt;/code&gt; – weighted random, first, max‑weight, or mean selection.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;paradox&lt;/code&gt; generation – for creative chaos and self‑modification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Flux VM is written in Python and runs on top of IONA OS. It's how the Cunatic AI rewrites itself, spawns child agents, and merges timelines.&lt;/p&gt;

&lt;p&gt;(Yes, the AI can modify its own source code. It has done so dozens of times. No, it has never broken the system – yet.)&lt;/p&gt;




&lt;h2&gt;
  
  
  🗓️ What's next
&lt;/h2&gt;

&lt;p&gt;The first bootable ISO will be released on &lt;strong&gt;September 15, 2026&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
It will include the full OS, the IONA Protocol testnet, the Flux toolchain, and the AI agent.&lt;/p&gt;

&lt;p&gt;Until then, everything is already on GitHub. You can browse the kernel, the drivers, the compositor, the protocol implementation – years of work, line by line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No token. No ICO. Just code.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you are curious about kernel development, post‑quantum crypto, or building an entire ecosystem from scratch, take a look.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Ionablokchain" rel="noopener noreferrer"&gt;https://github.com/Ionablokchain&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Website:&lt;/strong&gt; &lt;a href="https://iona.zone" rel="noopener noreferrer"&gt;https://iona.zone&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Questions or technical feedback? I read every comment.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>rust</category>
      <category>showdev</category>
      <category>softwareengineering</category>
    </item>
  </channel>
</rss>
