PageSourceSearch

https://0xc0ffee.netlify.app/osdev/

html 0xc0ffee.netlify.app collected 2026-10-03 10:22:11 UTC 16,253 bytes, 43 lines download raw bytes

1<!doctype html>
2<html lang="en-US">
3  <head>
4    <meta charset="utf-8" />
5    <meta name="viewport" content="width=device-width,initial-scale=1" />
6    <meta name="generator" content="VuePress 2.0.0-rc.15" />
7    <style>
8      :root {
9        --vp-c-bg: #fff;
10      }
11
12      [data-theme='dark'] {
13        --vp-c-bg: #22272e;
14      }
15
16      html,
17      body {
18        background-color: var(--vp-c-bg);
19      }
20    </style>
21    
21<script>
22      const userMode = localStorage.getItem('vuepress-color-scheme')
23      const systemDarkMode =
24        'matchMedia' in window
25          ? window.matchMedia('(prefers-color-scheme: dark)').matches
26          : false
27
28      if (userMode === 'light') {
29        document.documentElement.dataset.theme = 'light'
30      } else if (userMode === 'dark' || systemDarkMode) {
31        document.documentElement.dataset.theme = 'dark'
32      }
33    </script>
33
34    <title>Fusion OS | Khaled Hammouda</title><meta name="description" content="Building a 64-bit operating system from scratch in Nim">
35    <link rel="preload" href="/assets/style-B7U2h345.css" as="style"><link rel="stylesheet" href="/assets/style-B7U2h345.css">
36    <link rel="modulepreload" href="/assets/app-CjUkjRdW.js"><link rel="modulepreload" href="/assets/index.html-D7J2hPaW.js">
37    <link rel="prefetch" href="/assets/index.html-BJndIscF.js" as="script"><link rel="prefetch" href="/assets/index.html-B3F2r-6x.js" as="script"><link rel="prefetch" href="/assets/01-mm.html-BybuIMYA.js" as="script"><link rel="prefetch" href="/assets/index.html-C5v7Enbg.js" as="script"><link rel="prefetch" href="/assets/01-intro.html-CjL1Ma2W.js" as="script"><link rel="prefetch" href="/assets/02-setup.html-B_Ck-bwI.js" as="script"><link rel="prefetch" href="/assets/03-filetype.html-BfGFhv94.js" as="script"><link rel="prefetch" href="/assets/04-lexer.html-B9r7uFOk.js" as="script"><link rel="prefetch" href="/assets/05-parser.html-DCayDLd5.js" as="script"><link rel="prefetch" href="/assets/06-parser-p2.html-Ddsnj8_P.js" as="script"><link rel="prefetch" href="/assets/07-grammarkit.html-BDkIyID6.js" as="script"><link rel="prefetch" href="/assets/08-go-to-decl.html-6yGkj0-L.js" as="script"><link rel="prefetch" href="/assets/09-scopes.html-BoxbdbQl.js" as="script"><link rel="prefetch" href="/assets/10-rename-refactoring.html-CpZs_ikc.js" as="script"><link rel="prefetch" href="/assets/11-indentation.html-YCyyVUoO.js" as="script"><link rel="prefetch" href="/assets/12-decl-sections.html-D0orR6fv.js" as="script"><link rel="prefetch" href="/assets/13-comments.html-Bu_OrH5M.js" as="script"><link rel="prefetch" href="/assets/14-numeric-lit.html-Bg-wlSrc.js" as="script"><link rel="prefetch" href="/assets/15-expressions.html-InucCq93.js" as="script"><link rel="prefetch" href="/assets/99-tmp.html-Stxichax.js" as="script"><link rel="prefetch" href="/assets/index.html-ChR8aTWx.js" as="script"><link rel="prefetch" href="/assets/01-intro.html-B8REUuKx.js" as="script"><link rel="prefetch" href="/assets/02-environment-setup.html-BS0R6F3x.js" as="script"><link rel="prefetch" href="/assets/03-targeting-uefi-p1.html-CnyKZpcU.js" as="script"><link rel="prefetch" href="/assets/04-targeting-uefi-p2.html-D3YDc-Vq.js" as="script"><link rel="prefetch" href="/assets/05-bootloader-p1.html-DaLJCVWJ.js" as="script"><link rel="prefetch" href="/assets/06-bootloader-p2.html-Bvk_BiUf.js" as="script"><link rel="prefetch" href="/assets/07-kernel-image.html-DG9Rm9nz.js" as="script"><link rel="prefetch" href="/assets/08-loading-the-kernel-p1.html-UtPlGg2v.js" as="script"><link rel="prefetch" href="/assets/09-loading-the-kernel-p2.html-BQxll9jI.js" as="script"><link rel="prefetch" href="/assets/10-loading-the-kernel-p3.html-CSLLJX_1.js" as="script"><link rel="prefetch" href="/assets/11-physical-memory.html-CKV721lv.js" as="script"><link rel="prefetch" href="/assets/12-virtual-memory.html-D6VNaT34.js" as="script"><link rel="prefetch" href="/assets/13-higher-half-kernel.html-BSFc-GAk.js" as="script"><link rel="prefetch" href="/assets/14-memory-segments.html-DzJfJwBM.js" as="script"><link rel="prefetch" href="/assets/15-interrupts.html-BFO7ftAR.js" as="script"><link rel="prefetch" href="/assets/16-user-mode.html-BqZI-MIg.js" as="script"><link rel="prefetch" href="/assets/17-tss.html-6UGcg5Fv.js" as="script"><link rel="prefetch" href="/assets/18-system-calls.html-RIPJ6D2L.js" as="script"><link rel="prefetch" href="/assets/19-tasks.html-Do41fZil.js" as="script"><link rel="prefetch" href="/assets/20-position-independent-code.html-deBWIlCT.js" as="script"><link rel="prefetch" href="/assets/21-elf-loader-p1.html-DBmIgnJQ.js" as="script"><link rel="prefetch" href="/assets/22-elf-loader-p2.html-Cz9FyAGT.js" as="script"><link rel="prefetch" href="/assets/23-coop-multitasking.html-BBjp3YAJ.js" as="script"><link rel="prefetch" href="/assets/24-system-library.html-DtU8yhpi.js" as="script"><link rel="prefetch" href="/assets/25-interrupt-controller.html-DVN3VObb.js" as="script"><link rel="prefetch" href="/assets/404.html-CtMulo7P.js" as="script"><link rel="prefetch" href="/assets/SearchResult-rhVGE6O_.js" as="script">
38  </head>
39  <body>
40    <div id="app"><!--[--><div class="vp-theme-container external-link-icon" vp-container><!--[--><header class="vp-navbar" vp-navbar><div class="vp-toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a class="route-link" href="/"><!----><span class="vp-site-name" aria-hidden="true">Khaled Hammouda</span></a></span><div class="vp-navbar-items-wrapper" style=""><!--[--><!--]--><nav class="vp-navbar-items vp-hide-mobile" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="Home"><!---->Home<!----></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/osdev/" aria-label="Fusion OS"><!---->Fusion OS<!----></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/acronyms/" aria-label="Computing Acronyms"><!---->Computing Acronyms<!----></a></div><!--]--></nav><!--[--><!--]--><button type="button" class="vp-toggle-color-mode-button" title="toggle color mode"><svg class="light-icon" viewbox="0 0 32 32" style=""><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg class="dark-icon" viewbox="0 0 32 32" style="display:none;"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!--[--><button type="button" class="search-pro-button" aria-label="Search"><svg xmlns="http://www.w3.org/2000/svg" class="icon search-icon" viewB
40ox="0 0 1024 1024" fill="currentColor" aria-label="search icon" name="search"><path d="M192 480a256 256 0 1 1 512 0 256 256 0 0 1-512 0m631.776 362.496-143.2-143.168A318.464 318.464 0 0 0 768 480c0-176.736-143.264-320-320-320S128 303.264 128 480s143.264 320 320 320a318.016 318.016 0 0 0 184.16-58.592l146.336 146.368c12.512 12.48 32.768 12.48 45.28 0 12.48-12.512 12.48-32.768 0-45.28"></path></svg><div class="search-pro-placeholder">Search</div><div class="search-pro-key-hints"><kbd class="search-pro-key">Ctrl</kbd><kbd class="search-pro-key">K</kbd></div></button><!--]--></div></header><!--]--><div class="vp-sidebar-mask"></div><!--[--><aside class="vp-sidebar" vp-sidebar><nav class="vp-navbar-items" aria-label="site navigation"><!--[--><div class="vp-navbar-item"><a class="route-link auto-link" href="/" aria-label="Home"><!---->Home<!----></a></div><div class="vp-navbar-item"><a class="route-link route-link-active auto-link" href="/osdev/" aria-label="Fusion OS"><!---->Fusion OS<!----></a></div><div class="vp-navbar-item"><a class="route-link auto-link" href="/acronyms/" aria-label="Computing Acronyms"><!---->Computing Acronyms<!----></a></div><!--]--></nav><!--[--><!--]--><ul class="vp-sidebar-items"><!--[--><li><a class="route-link route-link-active auto-link vp-sidebar-item vp-sidebar-heading active" href="/osdev/" aria-label="Fusion OS"><!---->Fusion OS<!----></a><ul style="" class="vp-sidebar-children"><!--[--><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/01-intro" aria-label="Writing an OS in Nim"><!---->Writing an OS in Nim<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/02-environment-setup" aria-label="Environment Setup"><!---->Environment Setup<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/03-targeting-uefi-p1" aria-label="Targeting UEFI (Part 1)"><!---->Targeting UEFI (Part 1)<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/04-targeting-uefi-p2" aria-label="Targeting UEFI (Part 2)"><!---->Targeting UEFI (Part 2)<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/05-bootloader-p1" aria-label="UEFI Bootloader (Part 1)"><!---->UEFI Bootloader (Part 1)<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/06-bootloader-p2" aria-label="UEFI Bootloader (Part 2)"><!---->UEFI Bootloader (Part 2)<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/07-kernel-image" aria-label="Kernel Image"><!---->Kernel Image<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/08-loading-the-kernel-p1" aria-label="Loading the Kernel (Part 1)"><!---->Loading the Kernel (Part 1)<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/09-loading-the-kernel-p2" aria-label="Loading the Kernel (Part 2)"><!---->Loading the Kernel (Part 2)<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/10-loading-the-kernel-p3" aria-label="Loading the Kernel (Part 3)"><!---->Loading the Kernel (Part 3)<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/11-physical-memory" aria-label="Physical Memory"><!---->Physical Memory<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/12-virtual-memory" aria-label="Virtual Memory"><!---->Virtual Memory<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/13-higher-half-kernel" aria-label="Higher Half Kernel"><!---->Higher Half Kernel<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/14-memory-segments" aria-label="Memory Segments"><!---->Memory Segments<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/15-interrupts" aria-label="Interrupts"><!---->Interrupts<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/16-user-mode" aria-label="User Mode"><!---->User Mode<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/17-tss" aria-label="Task State Segment"><!---->Task State Segment<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/18-system-calls" aria-label="System Calls"><!---->System Calls<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/19-tasks" aria-label="Tasks"><!---->Tasks<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/20-position-independent-code" aria-label="Position Independent Code"><!---->Position Independent Code<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/21-elf-loader-p1" aria-label="ELF Loader (Part 1)"><!---->ELF Loader (Part 1)<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/22-elf-loader-p2" aria-label="ELF Loader (Part 2)"><!---->ELF Loader (Part 2)<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/23-coop-multitasking" aria-label="Cooperative Multitasking"><!---->Cooperative Multitasking<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/24-system-library" aria-label="System Library"><!---->System Library<!----></a><!----></li><li><a class="route-link auto-link vp-sidebar-item" href="/osdev/25-interrupt-controller" aria-label="Interrupt Controller"><!---->Interrupt Controller<!----></a><!----></li>
40<!--]--></ul></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="vp-page"><!--[--><!--]--><div class="theme-default-content" vp-content><!--[--><!--]--><div><h1 id="fusion-os" tabindex="-1"><a class="header-anchor" href="#fusion-os"><span>Fusion OS</span></a></h1><p>This is both a documentation and a tutorial for building an operating system, Fusion OS, from scratch in Nim. You can find the source code on GitHub at <a href="https://github.com/khaledh/fusion" target="_blank" rel="noopener noreferrer">https://github.com/khaledh/fusion</a>.</p><blockquote><p>Note: The source for this documentation is on GitHub at <a href="https://github.com/khaledh/khaledh.github.io" target="_blank" rel="noopener noreferrer">https://github.com/khaledh/khaledh.github.io</a>. Comments and contributions are welcome through GitHub issues and pull requests.</p></blockquote><h2 id="screenshots" tabindex="-1"><a class="header-anchor" href="#screenshots"><span>Screenshots</span></a></h2><p><strong>UEFI Bootloader</strong></p><p><img src="/assets/boot-exitbootservices-Dt2Rlx1o.png" alt="UEFI Bootloader"></p><p><strong>GUI</strong> (<em>Note: This screenshot is from the <code>graphics</code> branch, which is still a work-in-progress.</em>)</p><p><img src="/assets/screenshot-graphics-DH5ICI7A.png" alt="Screenshot from the graphics branch"></p><p><strong>Booting and Running the Kernel</strong></p><p><img src="/assets/screenshot-kernel-booting-DtYqTorQ.png" alt="Booting and Running Fusion Kernel"></p><h2 id="features" tabindex="-1"><a class="header-anchor" href="#features"><span>Features</span></a></h2><p>The following features are currently implemented:</p><ul><li>UEFI Bootloader</li><li>Memory Management <ul><li>Single Address Space</li><li>Physical Memory Manager</li><li>Virtual Memory Manager</li><li>Higher Half Kernel</li></ul></li><li>Task Management <ul><li>Kernel Tasks</li><li>User Mode Tasks</li><li>Preemptive Multitasking</li><li>Priority-based Scheduling</li><li>ELF Loader</li></ul></li><li>System Calls <ul><li>System Call Interface</li><li>SYSCALL/SYSRET</li><li>User Mode Library</li></ul></li><li>IPC <ul><li>Synchronization Primitives</li><li>Channel-based IPC</li><li>Message Passing</li></ul></li><li>Hardware <ul><li>Timer Interrupts</li><li>PCI Device Enumeration</li><li>Bochs Graphics Adapter Driver</li></ul></li></ul><h4 id="planned" tabindex="-1"><a class="header-anchor" href="#planned"><span>Planned</span></a></h4><ul><li>Capability-based Security</li><li>Event-based Task State Machines</li><li>Demand Paging</li><li>Disk I/O</li><li>File System</li><li>Keyboard/Mouse Input</li><li>Shell</li><li>GUI</li><li>Networking</li></ul></div><!--[--><!--]--></div><footer class="vp-page-meta"><!----><div class="vp-meta-item git-info"><div class="vp-meta-item last-updated"><span class="meta-item-label">Last Updated: </span><!----></div><!----></div></footer><!----><!--[--><!--]--></main><!--]--></div><!--[--><!----><!----><!--]--><!--]--></div>
41    
41<script type="module" src="/assets/app-CjUkjRdW.js" defer></script>
41
42  </body>
43</html>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.