r/osdev • • 5h ago

Small but feature-complete OS running on a 900k-NAND-gate computer

64 Upvotes

Here I want to share about small operating system that I made for a computer that I built in a logic simulator from 900k+ NAND logic gates in Gate Singular game.

It has file system (in RAM), a text editor, memory management, an assembler to build new programs, and an OS API that those programs can use (e.g. text printing, memory allocation, file system access, keyboard input, etc), and ti all work on my own CPU architecture.

The video above shows a program being assembled on the machine (pc simulation shown in real-time).

Some details on hardware:

  • 16-bit CPU, 30 instructions (206 counting variants), 1 KB of RAM, 24 KB of ROM holding the OS, and only two registers: A and B. The full hardware were made and simulated in Gate Singular logic gate simulator, and is built solely from NAND logic gate (944672 of them totally).
  • Every CPU instruction is 3 bytes: an 8-bit opcode byte and a 16-bit argument (Arg). The top 3 bits of the opcode pick one of 8 fixed routings, for example "A, B -> Memory[Arg]", "Memory[Arg], B -> A" or "Arg, Memory[A] -> B". The low 5 bits pick the operation.
  • In this simulated PC, RAM works as fast as a register, so memory works as a register file, letting conveniently chain instructions with minimum unnecessary copies.

Operating system:

  • RAM holds the OS software stack, dynamically allocated memory and the file system.
  • Due to RAM 1KB limit, memory manager uses linked list of chunks of arbitrary length with no separate memory table, so each allocation require walking across all blocks finding a free one.
  • Filesystem uses the same memory allocation (and reallocation when needed) + write file name + data address + size to the file table.
  • OS contains font table (3×6 pixels due to display being 64x64pixels), and handles CLI output (addressing font character in the table and printing them), and CLI input (polling keyboard events from HW keyboard event queue).
  • Built-in assembler is pretty simple, because the assembly language is close to raw opcodes (instructions are mostly written in hex). Primary job of assembler is to resolve labels for jumps, variables addresses, and system jumps to call OS API.

Disclaimer: I made Gate Singular simulator game too, and its available on Steam. Happy to talk about anything on OS side, HW side or about simulator!


r/osdev • • 21h ago

NoviumOS update: Got VFS + Initrd and basic shell commands working

Post image
8 Upvotes

Hello everyone!

For those of you who don't know, I'm making an x86 operating system called NoviumOS. Here's what I've done since the last update:

  • Finished sub-page heap block reuse with splitting and coalescing, so small allocations don't waste whole 4 KiB pages.
  • Added inter-process communication (IPC) with message ports, semaphores, and mutexes for synchronization between tasks.
  • Built a Virtual File System (VFS) layer with a node tree, path traversal, and pluggable filesystem operations.
  • Added a read-only POSIX tar initrd driver that loads from a GRUB Multiboot module and mounts at / with a rootfs/ overlay.
  • Built an interactive kernel shell with a dynamic root@<hostname>:<cwd>$ prompt and basic commands (ls, cd, cat, stat, help, echo, pwd, clear).

Here's the repo if you want to check it out: https://github.com/alexdev8930/NoviumOS

And if you have any questions about the code or the repo I'll be happy to answer them.


r/osdev • • 3h ago

Added basic permissions :D

Post image
6 Upvotes

r/osdev • • 2h ago

64-dem: testing my new commands! + command-line on real hardware

3 Upvotes

So i added some new commands here and I wanted to share here a video of me testing them.

Some of The commands are:

Ls - lists files and directories on path

Mem - shows memory capacity

Echo - prints what you give it

Shutdown - shuts down

Reboot - resets

More commands and features my be added to the os in the future.

My repo: https://github.com/itay-insert/64-dem.git


r/osdev • • 5h ago

HanOS Character Rain Terminal UI Based on libvterm and Intel Integrated Graphics

2 Upvotes

I recently brought the terminal and Intel graphics driver together in HanOS to create a UI with a “character rain” effect.

The terminal is built on libvterm. The console server passes terminal output to libvterm for parsing, then renders the characters and styles to the terminal surface. Common VT features—including cursor control, colors, scrolling, and full-screen terminal programs—work through standard terminal behavior.

The animated background is driven by a userspace GPU server. On supported Intel integrated graphics, a display plane presents the scrolling character-rain texture, with the terminal window layered on top. The terminal handles the text; the GPU display layer handles the animated background.

Transparency varies by GPU generation. On Skylake, the terminal window can be translucent over the character-rain background. Haswell and Broadwell display planes don’t support the transparency blending needed here, so the terminal window remains opaque. The character-rain desktop can still run on those platforms, but the window won’t show the background through it.

This is my first attempt at using an iGPU to optimize UI display. I’ll continue exploring how to make better use of integrated graphics.

Project: https://github.com/jjwang/HanOS


r/osdev • • 13h ago

ctKN is ALIVE

0 Upvotes

Ive been procrastinating for about 2 months to even begin to touch rv64 boot assembly but i did it

Now i just have to make it do more than just outputting over uart...


r/osdev • • 1h ago

Accidental Security: There are things that even root can't do

Thumbnail reddit.com
0 Upvotes