|
1 | 1 | # xdv-os |
2 | 2 |
|
3 | | -Complete XDV Operating System - Bootable for VirtualBox |
| 3 | +XDV Operating System integration workspace. |
4 | 4 |
|
5 | | -xdv-os is an operating system built with the **Dust Programming Language (DPL)** toolchain. The kernel is **compiled from DPL** using the **dust** compiler; the build loads and validates **xdv-kernel**, **xdv-runtime**, **xdv-shell**, **xdv-boot**, **xdv-xdvfs**, **dustlib**, **dustlib_k**, and **dust_runtime**. The bootable image is produced by: `dust obj kernel_entry.ds --bare-metal` (kernel) plus a minimal MBR in assembly (required by the BIOS). |
| 5 | +## Build |
6 | 6 |
|
7 | | -## Overview |
| 7 | +Windows: |
8 | 8 |
|
9 | | -xdv-os combines all XDV components into a fully functional operating system that boots in VirtualBox: |
10 | | - |
11 | | -- **xdv-boot** - Bootloader (MBR, GDT, IDT, Paging, Disk I/O, XDVFS mount, Kernel load) |
12 | | -- **xdv-kernel** - 13-sector kernel |
13 | | -- **xdv-xdvfs** - Native file system |
14 | | -- **xdv-runtime** - User space runtime |
15 | | -- **xdv-shell** - Command line shell |
16 | | - |
17 | | -## Quick Start |
18 | | - |
19 | | -### Build on Linux/Mac |
20 | | -```bash |
21 | | -cd src |
22 | | -chmod +x build.sh |
23 | | -./build.sh |
24 | | -``` |
25 | | - |
26 | | -### Build on Windows |
27 | 9 | ```cmd |
28 | | -cd src |
| 10 | +cd xdv-os\src |
29 | 11 | build.bat |
30 | 12 | ``` |
31 | 13 |
|
32 | | -### Run in VirtualBox |
33 | | -1. Download `xdv-os.img` from CI artifacts |
34 | | -2. Open VirtualBox |
35 | | -3. Create new VM: Type=Other, Version=64-bit |
36 | | -4. Set RAM to 64MB |
37 | | -5. Add xdv-os.img as hard disk (or use vmkfdimg for live CD) |
38 | | -6. Start VM |
39 | | - |
40 | | -## Boot Process |
41 | | - |
42 | | -``` |
43 | | -BIOS -> MBR (0x7C00) -> Load kernel to 0x10000 -> Protected mode -> DPL kernel (VGA output, then halt) |
44 | | -``` |
45 | | - |
46 | | -1. **BIOS** loads MBR at 0x7C00 |
47 | | -2. **Boot sector** (assembly) loads the DPL-built kernel from sector 2 to 0x10000, enables protected mode, jumps to kernel |
48 | | -3. **Kernel** (from `dust obj kernel_entry.ds --bare-metal`) runs at 0x10000: prints boot messages to VGA, then halts |
49 | | - |
50 | | -## Expected Boot Output (VirtualBox) |
51 | | - |
52 | | -When the OS boots in VirtualBox you should see (then the system halts): |
53 | | - |
54 | | -``` |
55 | | -XDV Kernel starting... |
56 | | -Initializing XDV Kernel v0.2.0 |
57 | | -Build date: 2026-02-12 |
58 | | -Booting on K-Domain (x64/Intel/AMD) |
59 | | -K-Domain (x64): ONLINE |
60 | | -XDV: Probing for Q-Domain hardware... |
61 | | -XDV: Q-Domain hardware not detected - disabled |
62 | | -XDV: Probing for Phi-Domain hardware... |
63 | | -XDV: Phi-Domain hardware not detected - disabled |
64 | | -XDV Kernel: Initializing process management |
65 | | -Entering kernel main loop |
66 | | -``` |
67 | | - |
68 | | -## Memory Layout |
| 14 | +Linux/macOS: |
69 | 15 |
|
| 16 | +```bash |
| 17 | +cd xdv-os/src |
| 18 | +./build.sh |
70 | 19 | ``` |
71 | | -0x00000 - 0x9FFFF : Real mode memory |
72 | | -0x07C00 : Boot sector load address |
73 | | -0x10000 (64KB) : Kernel load address (0x1000:0) |
74 | | -0xB8000 : VGA text memory |
75 | | -0x90000 : Stack |
76 | | -``` |
77 | | - |
78 | | -## Components |
79 | | - |
80 | | -### xdv-boot |
81 | | -- MBR boot sector |
82 | | -- Stage 1 loader |
83 | | -- GDT, IDT |
84 | | -- Paging setup |
85 | | -- Disk I/O |
86 | | -- Kernel loading |
87 | | - |
88 | | -### xdv-kernel (13 sectors) |
89 | | -1. xdv_boot - Boot integration |
90 | | -2. xdv_memory - Memory management |
91 | | -3. xdv_cpu - CPU control |
92 | | -4. xdv_drivers - Hardware drivers |
93 | | -5. xdv_kernel - Core kernel |
94 | | -6. xdv_dal - Device Abstraction Layer |
95 | | -7. xdv_qdomain - Q-Domain support (stubbed) |
96 | | -8. xdv_phidomain - Φ-Domain support (stubbed) |
97 | | -9. xdv_cds - Core Data Structures |
98 | | -10. xdv_umf - User Mode Facilities |
99 | | -11. xdv_hypervisor - Hypervisor support |
100 | | -12. xdv_sdbm - Simple Database Manager |
101 | | -13. xdv_odt - Object Dispatch Table |
102 | | - |
103 | | -### xdv-xdvfs |
104 | | -- Superblock, Inodes, Block allocation |
105 | | -- Directory operations |
106 | | -- File operations (K-domain only) |
107 | | - |
108 | | -### xdv-runtime |
109 | | -- I/O, Memory, String, Process |
110 | | -- Scheduler, FS interface, Console, Init |
111 | | - |
112 | | -### xdv-shell |
113 | | -- Lexer, Parser, Executor |
114 | | -- Builtins: cd, ls, cat, mkdir, rm, echo, ps, help, exit |
115 | | -- Tab completion |
116 | | - |
117 | | -## Architecture |
118 | | - |
119 | | -K-Domain only (classical x86-64 hardware). Q/Φ domains stubbed. |
120 | | - |
121 | | -## Directory Structure |
122 | | - |
123 | | -``` |
124 | | -xdv-os/ |
125 | | -├── State.toml |
126 | | -├── src/ |
127 | | -│ ├── boot_sector.asm # MBR (loads kernel, switches to protected mode) |
128 | | -│ ├── kernel_entry.ds # DPL kernel entry (dust obj --bare-metal -> kernel.bin) |
129 | | -│ ├── build.sh # Linux/Mac build (dust + NASM -> xdv-os.img) |
130 | | -│ └── build.bat # Windows build |
131 | | -├── xdv-boot/ |
132 | | -├── xdv-kernel/ |
133 | | -├── xdv-xdvfs/ |
134 | | -├── xdv-runtime/ |
135 | | -├── xdv-shell/ |
136 | | -└── .github/workflows/ |
137 | | - └── ci.yml # Builds xdv-os.img with dust |
138 | | -``` |
139 | | - |
140 | | -## Build (dust + NASM) |
141 | | - |
142 | | -The build uses the **dust** compiler and validates all DPL components: |
143 | 20 |
|
144 | | -1. **dust** compiler: built from repo root `dust/` if not in PATH |
145 | | -2. **dust check** on: dustlib, dustlib_k, dust_runtime, xdv-boot, xdv-kernel, xdv-runtime, xdv-shell, xdv-xdvfs |
146 | | -3. **dust obj** `kernel_entry.ds` **--bare-metal** → `kernel.bin` (32-bit code, VGA output) |
147 | | -4. **NASM** assembles `boot_sector.asm` → MBR |
148 | | -5. Image: 1 MB disk with MBR + kernel at sector 2 |
| 21 | +## Artifacts |
149 | 22 |
|
150 | | -## CI Build |
| 23 | +The build now emits partitioned 64MB disk images: |
151 | 24 |
|
152 | | -GitHub Actions: build dust, run full build (dust obj + NASM), produce `xdv-os.img` artifact. |
| 25 | +- `xdv-os/src/xdv-os-mbr-64m.img` - BIOS/MBR boot image. |
| 26 | +- `xdv-os/src/xdv-os-uefi-64m.img` - GPT image with ESP and xdvfs partition. |
| 27 | +- `xdv-os/src/xdv-os.img` - compatibility alias to the MBR image. |
153 | 28 |
|
154 | | -## Version |
| 29 | +## Image Contents |
155 | 30 |
|
156 | | -0.2.0 |
| 31 | +- `xdv-boot` boot path metadata and BIOS stage machine code. |
| 32 | +- `xdv-kernel` + `xdv-runtime` combined bare-metal kernel binary. |
| 33 | +- `xdvfs` superblock and layout markers. |
| 34 | +- preload payload with `xdv-core`, `xdv-edx`, and `xdv-shell`. |
0 commit comments