Not logged inTalkContributionsCreate accountLog in

nexOS

From nexOS Wiki
A 32-bit protected-mode kernel with paging, FAT32, RTL8139 networking, HTTP browser, and Alpine Linux theme.
nexOS
Yazeed Omari, creator of nexOS
Yazeed Omari, creator of nexOS
TypeHobby operating system
CPUi386, 32-bit protected mode
KernelMonolithic, ring 0 only
MemoryPaging + bitmap allocator
StorageATA/IDE PIO + FAT32
NetworkRTL8139, ARP/TCP/HTTP
DisplayVESA framebuffer, 800×600, VMware VGA
ThemeAlpine Linux dark (#1E1E2E, #89B4FA)
Imagenexos.img, 64 sectors (32 KiB raw)
Sourceboot.asm, kernel_entry.asm, kernel.c, ata.c, fat32.c, net.c, io.h
AuthorYazeed Omari

This article documents the current tree (paging + ATA/FAT32 + RTL8139 phases). The old “v1.8, no paging, no filesystem” description is obsolete. See Build for how to build nexos.img and nexOS on GitHub for source.

Contents

[hide]

Summary

nexOS is a hobby operating system kernel written in C and x86 assembly. It boots via BIOS, initializes a VESA framebuffer, enables paging, and renders a graphical desktop with windows, Paint, a terminal, and a browser. It includes a FAT32 file system over ATA/IDE PIO, a 32-bit paging memory manager, an RTL8139 Ethernet driver with TCP/IP networking, and an HTTP client.

This is a hobby project. It is not a production operating system.

What nexOS is not

There is no userspace, no privilege separation, and no system-call interface. Everything — window manager, drivers, terminal, browser — runs in ring 0 as C functions called from main(). There is no scheduler in the Unix sense; there is a 100 Hz PIT tick used for polling and redraw timing (see Interrupts). There is no VFS layer beyond FAT32, no USB, no SMP, no power management beyond a QEMU ACPI shutdown port.

System overview

nexOS subsystems
ComponentImplementationDetails
BootNASM MBR bootloaderBIOS INT 13h, 60 sectors to 0x8000, VESA probe, GDT, CR0.PE
Kernel32-bit protected-mode C + asmkernel_entry.asm _start → _main → main(), kernel.c ~1098 lines
PagingPage directory + tables, CR0.PGIdentity map 0–16 MiB + LFB, bitmap allocator, kmalloc/kfree
GraphicsVESA framebuffer, VMware VGA800×600, 24bpp preferred, double-buffered at 0x200000
Disk I/OATA/IDE PIO (ata.c)LBA28 PIO, ports 0x1F0–0x1F7
File SystemFAT32 BPB parsing (fat32.c)FAT traversal, LS/CAT, 1 MiB disk buffer
NetworkRTL8139, ARP/TCP/HTTP (net.c)I/O base 0x300, IRQ11, 4×1536 packet buffers
BrowserBrowser window + URL barHTML-lite tag stripper, 44×8 text view
DesktopWindow manager, Paint, terminalAlpine theme, START menu, PS/2 input
InputPS/2 mouse + keyboard, IDTVectors 32/33/44, 8259 remap, PIT 100 Hz
BuildGCC -m32 -ffreestanding, NASM, ld, objcopyMake + QEMU with rtl8139

Terminal commands

Open the terminal from the START menu and type a command. Classic commands (HELP, ABOUT, CLEAR, ECHO, CREDITS, SUDO, YAZEED, OMARI, NEXOS, HELLO, SECRET, GOD) still reply with canned text. New disk and net commands are wired to real drivers:

CommandDescription
HELPDisplay available commands
ABOUTAbout nexOS
CLEARClear terminal
ECHOEcho text
CREDITSProject credits
SUDOSudo command (joke reply)
LSList files (ATA disk via FAT32)
CAT FILEDisplay file contents (fat32_read_file)
PINGSend ARP request to gateway
FETCHExecute HTTP GET, load result into browser
BROWSEROpen/close the browser window
YAZEED / OMARI / NEXOS / HELLO / SECRET / GODEaster-egg replies

Desktop features

  • START menu (bottom-left): Terminal, Notepad, About, Browser, Shutdown.
  • Paint: draw with the left mouse button (80×50 cell canvas).
  • Terminal: type commands and press Enter; 6-line scrollback.
  • Browser: HTTP browser with URL bar (click BROWSER in START menu or type BROWSER).
  • Notepad: text input buffer.
  • Mouse: PS/2 mouse with 2× gain, edge-clamped, 4-deep press queue.
  • File Manager: browse ATA disk files via FAT32 (NAME/TYPE list).

File layout

boot.asm              # MBR bootloader (BIOS int 0x13)
kernel_entry.asm      # Protected-mode entry (_start, _isr32/_isr33/_isr44)
kernel.c              # Desktop, terminal, paging, drivers, browser (~1098 lines)
ata.c / ata.h         # ATA/IDE PIO disk access
fat32.c / fat32.h     # FAT32 file system
net.c / net.h         # RTL8139, TCP/IP, HTTP client, DNS
io.h                  # I/O primitives + string functions
link.ld               # ELF linker script (. = 0x8000)
Makefile              # Build system
nexos.img             # Bootable disk image (built, 64 sectors)

See also