feat: rename 'ZenithOS' => 'MontaukOS' and fix build system issues

This commit is contained in:
2026-02-28 12:06:18 +01:00
parent 1809ae55e5
commit 83016847b4
136 changed files with 1669 additions and 51769 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
.TH EDIT 1
.SH NAME
edit - text editor for ZenithOS
edit - text editor for MontaukOS
.SH SYNOPSIS
edit [filename]
+1 -1
View File
@@ -1,6 +1,6 @@
.TH FETCH 1
.SH NAME
fetch - HTTP/HTTPS client for ZenithOS
fetch - HTTP/HTTPS client for MontaukOS
.SH SYNOPSIS
fetch [-v] <url>
+18 -18
View File
@@ -3,14 +3,14 @@
open, read, getsize, close, readdir - file I/O system calls
.SH SYNOPSIS
.BI int zenith::open(const char* path);
.BI int zenith::read(int handle, uint8_t* buf, uint64_t offset, uint64_t size);
.BI uint64_t zenith::getsize(int handle);
.BI void zenith::close(int handle);
.BI int zenith::readdir(const char* path, const char** names, int max);
.BI int montauk::open(const char* path);
.BI int montauk::read(int handle, uint8_t* buf, uint64_t offset, uint64_t size);
.BI uint64_t montauk::getsize(int handle);
.BI void montauk::close(int handle);
.BI int montauk::readdir(const char* path, const char** names, int max);
.SH DESCRIPTION
ZenithOS provides a simple read-only Virtual File System (VFS)
MontaukOS provides a simple read-only Virtual File System (VFS)
backed by the boot ramdisk. Files are accessed via paths in the
format "<drive>:/<path>", where drive 0 is the ramdisk.
@@ -18,7 +18,7 @@
Opens a file and returns a non-negative handle on success, or a
negative value on error (file not found, no free handles).
int h = zenith::open("0:/os/hello.elf");
int h = montauk::open("0:/os/hello.elf");
.SS read
Reads up to 'size' bytes starting at 'offset' into 'buf'.
@@ -27,17 +27,17 @@
every call.
uint8_t buf[512];
int n = zenith::read(h, buf, 0, 512);
int n = montauk::read(h, buf, 0, 512);
.SS getsize
Returns the total size in bytes of the file.
uint64_t sz = zenith::getsize(h);
uint64_t sz = montauk::getsize(h);
.SS close
Closes the file handle and frees kernel resources.
zenith::close(h);
montauk::close(h);
.SS readdir
Lists entries in a directory. Up to 'max' entry names (max 64)
@@ -46,32 +46,32 @@
entries are returned with a trailing slash.
const char* entries[64];
int count = zenith::readdir("0:/", entries, 64);
int count = montauk::readdir("0:/", entries, 64);
// entries: "os/", "games/", "man/", "www/", "home/"
.SH READING PATTERN
The standard pattern for reading a file:
int h = zenith::open("0:/man/intro.1");
uint64_t size = zenith::getsize(h);
int h = montauk::open("0:/man/intro.1");
uint64_t size = montauk::getsize(h);
uint8_t buf[512];
uint64_t off = 0;
while (off < size) {
uint64_t chunk = size - off;
if (chunk > 511) chunk = 511;
int n = zenith::read(h, buf, off, chunk);
int n = montauk::read(h, buf, off, chunk);
if (n <= 0) break;
buf[n] = '\0';
zenith::print((const char*)buf);
montauk::print((const char*)buf);
off += n;
}
zenith::close(h);
montauk::close(h);
.SH WRITING FILES
Files can be created and written on the ramdisk:
.BI int zenith::fcreate(const char* path);
.BI int zenith::fwrite(int handle, const uint8_t* buf, uint64_t offset, uint64_t size);
.BI int montauk::fcreate(const char* path);
.BI int montauk::fwrite(int handle, const uint8_t* buf, uint64_t offset, uint64_t size);
fcreate creates a new file and returns a handle. fwrite writes
bytes at the given offset. Changes persist only until reboot --
+8 -8
View File
@@ -3,8 +3,8 @@
fb_info, fb_map - direct framebuffer access
.SH SYNOPSIS
.BI void zenith::fb_info(Zenith::FbInfo* info);
.BI void* zenith::fb_map();
.BI void montauk::fb_info(Montauk::FbInfo* info);
.BI void* montauk::fb_map();
.SH DESCRIPTION
These syscalls allow userspace programs to access the linear
@@ -13,8 +13,8 @@
.SS fb_info
Fills in an FbInfo structure with the framebuffer geometry:
Zenith::FbInfo fb;
zenith::fb_info(&fb);
Montauk::FbInfo fb;
montauk::fb_info(&fb);
// fb.width, fb.height, fb.pitch, fb.bpp
The pitch is the number of bytes per scanline (may be larger
@@ -24,7 +24,7 @@
Maps the physical framebuffer into the process address space at
a fixed virtual address (0x50000000) and returns that address.
uint32_t* pixels = (uint32_t*)zenith::fb_map();
uint32_t* pixels = (uint32_t*)montauk::fb_map();
Each pixel is a 32-bit value in 0xAARRGGBB format (blue in the
low byte). Writing to this memory directly updates the screen.
@@ -40,9 +40,9 @@
.SH EXAMPLE
Fill the screen with blue:
Zenith::FbInfo fb;
zenith::fb_info(&fb);
uint32_t* pixels = (uint32_t*)zenith::fb_map();
Montauk::FbInfo fb;
montauk::fb_info(&fb);
uint32_t* pixels = (uint32_t*)montauk::fb_map();
for (uint64_t y = 0; y < fb.height; y++) {
uint32_t* row = (uint32_t*)((uint8_t*)pixels + y * fb.pitch);
+2 -2
View File
@@ -1,12 +1,12 @@
.TH INIT 1
.SH NAME
init - ZenithOS init system
init - MontaukOS init system
.SH SYNOPSIS
Spawned automatically by the kernel as PID 0.
.SH DESCRIPTION
init is the first userspace process started by the ZenithOS
init is the first userspace process started by the MontaukOS
kernel. It chains system services in sequence, then launches
the interactive shell.
+6 -6
View File
@@ -1,9 +1,9 @@
.TH INTRO 1
.SH NAME
intro - introduction to ZenithOS userspace
intro - introduction to MontaukOS userspace
.SH DESCRIPTION
ZenithOS is a hobbyist 64-bit operating system written in C++20.
MontaukOS is a hobbyist 64-bit operating system written in C++20.
Userspace programs run in Ring 3, are loaded as static ELF64
binaries, and communicate with the kernel through the x86-64
SYSCALL/SYSRET mechanism.
@@ -11,7 +11,7 @@
Programs are compiled with a freestanding cross-compiler and
linked at virtual address 0x400000. There is no standard C
library for C++ programs -- all system interaction goes through
the zenith:: syscall wrappers.
the montauk:: syscall wrappers.
.SH GETTING STARTED
To write a new program, create a directory under programs/src/
@@ -19,8 +19,8 @@
extern "C" void _start() { ... }
There is no argc/argv. Use zenith::getargs() to retrieve any
arguments passed by the parent process. Include <zenith/syscall.h>
There is no argc/argv. Use montauk::getargs() to retrieve any
arguments passed by the parent process. Include <montauk/syscall.h>
for the full typed syscall API.
Build with:
@@ -41,7 +41,7 @@
.SH SHELL
The interactive shell is the primary way to interact with
ZenithOS. Commands are resolved by searching the PATH
MontaukOS. Commands are resolved by searching the PATH
directories (0:/os/, 0:/games/) for matching .elf binaries.
Type 'help' at the shell prompt for a list of commands.
Use 'man shell' for detailed shell documentation.
+1 -1
View File
@@ -1,6 +1,6 @@
.TH LEGAL 7
.SH NAME
ZenithOS legal/copyright information
MontaukOS legal/copyright information
.SH DESCRIPTION
Copyright (c) 2025-2026 Daniel Hammer, et al. All rights reserved.
+9 -9
View File
@@ -3,14 +3,14 @@
malloc, mfree, realloc - userspace heap allocation
.SH SYNOPSIS
.BI void* zenith::malloc(uint64_t size);
.BI void zenith::mfree(void* ptr);
.BI void* zenith::realloc(void* ptr, uint64_t size);
.BI void* montauk::malloc(uint64_t size);
.BI void montauk::mfree(void* ptr);
.BI void* montauk::realloc(void* ptr, uint64_t size);
.SH DESCRIPTION
The userspace heap provides dynamic memory allocation on top of
the kernel's page-mapping syscall (SYS_ALLOC). Include the
header <zenith/heap.h> to use these functions.
header <montauk/heap.h> to use these functions.
.SS malloc
Allocates 'size' bytes from the free list. Returns a 16-byte
@@ -18,21 +18,21 @@
empty, it requests more pages from the kernel via SYS_ALLOC
(minimum 16 KiB growth, initial seed of 64 KiB).
char* buf = (char*)zenith::malloc(1024);
char* buf = (char*)montauk::malloc(1024);
.SS mfree
Returns the block to the userspace free list. No syscall is
made -- the memory stays mapped and is immediately reusable.
Passing nullptr is a safe no-op.
zenith::mfree(buf);
montauk::mfree(buf);
.SS realloc
Resizes the allocation to 'size' bytes. Allocates a new block,
copies the smaller of old/new sizes, and frees the old block.
If ptr is nullptr, behaves like malloc.
buf = (char*)zenith::realloc(buf, 2048);
buf = (char*)montauk::realloc(buf, 2048);
.SH IMPLEMENTATION
The allocator uses a linked free-list with first-fit search.
@@ -47,8 +47,8 @@
.SH LOW-LEVEL PAGE API
For large allocations or when direct page control is needed:
void* zenith::alloc(uint64_t size); // SYS_ALLOC
void zenith::free(void* ptr); // SYS_FREE (no-op)
void* montauk::alloc(uint64_t size); // SYS_ALLOC
void montauk::free(void* ptr); // SYS_FREE (no-op)
alloc() maps zeroed pages starting at 0x40000000 and growing
upward. Size is rounded up to 4 KiB page boundaries.
+2 -2
View File
@@ -1,9 +1,9 @@
.TH SHELL 1
.SH NAME
shell - ZenithOS interactive command shell
shell - MontaukOS interactive command shell
.SH DESCRIPTION
The ZenithOS shell is a command interpreter launched by init
The MontaukOS shell is a command interpreter launched by init
after system services have started. It provides command
execution, file navigation, and command history.
+11 -11
View File
@@ -3,9 +3,9 @@
spawn, waitpid - create and wait for processes
.SH SYNOPSIS
.BI int zenith::spawn(const char* path, const char* args = nullptr);
.BI void zenith::waitpid(int pid);
.BI int zenith::getargs(char* buf, uint64_t maxLen);
.BI int montauk::spawn(const char* path, const char* args = nullptr);
.BI void montauk::waitpid(int pid);
.BI int montauk::getargs(char* buf, uint64_t maxLen);
.SH DESCRIPTION
@@ -13,11 +13,11 @@
Loads the ELF64 binary at the given VFS path and creates a new
process. The path must include the drive prefix, for example:
int pid = zenith::spawn("0:/os/hello.elf");
int pid = montauk::spawn("0:/os/hello.elf");
An optional second argument passes a string to the child:
int pid = zenith::spawn("0:/os/man.elf", "intro");
int pid = montauk::spawn("0:/os/man.elf", "intro");
The new process gets its own PML4 page table, a 16 KiB stack
(at 0x7FFFFEF000-0x7FFFFFF000), and begins executing at the
@@ -31,7 +31,7 @@
Blocks the calling process until the process with the given PID
has exited. Internally, this yields the CPU in a loop:
zenith::waitpid(pid);
montauk::waitpid(pid);
This is how the shell implements foreground process execution --
it spawns a child and waits for it to complete before showing
@@ -40,12 +40,12 @@
.SH EXAMPLES
Spawn a program and wait for it:
int pid = zenith::spawn("0:/os/hello.elf");
int pid = montauk::spawn("0:/os/hello.elf");
if (pid < 0) {
zenith::print("spawn failed\n");
montauk::print("spawn failed\n");
} else {
zenith::waitpid(pid);
zenith::print("child exited\n");
montauk::waitpid(pid);
montauk::print("child exited\n");
}
.SS getargs
@@ -54,7 +54,7 @@
-1 on error.
char args[256];
zenith::getargs(args, sizeof(args));
montauk::getargs(args, sizeof(args));
The argument string is set by the parent when calling spawn().
If no arguments were provided, the buffer will be empty.
+51 -51
View File
@@ -1,9 +1,9 @@
.TH SYSCALLS 2
.SH NAME
syscalls - overview of ZenithOS system calls
syscalls - overview of MontaukOS system calls
.SH DESCRIPTION
ZenithOS provides 46 system calls (numbers 0-45) for userspace
MontaukOS provides 46 system calls (numbers 0-45) for userspace
programs. Syscalls use the x86-64 SYSCALL instruction with the
following register convention:
@@ -15,119 +15,119 @@
R8 Argument 5
R9 Argument 6
Include <zenith/syscall.h> for typed wrappers in the zenith::
Include <montauk/syscall.h> for typed wrappers in the montauk::
namespace.
.SH PROCESS MANAGEMENT
.B SYS_EXIT (0)
Terminate the calling process.
void zenith::exit(int code = 0);
void montauk::exit(int code = 0);
.B SYS_YIELD (1)
Yield the remainder of the time slice.
void zenith::yield();
void montauk::yield();
.B SYS_SLEEP_MS (2)
Sleep for at least the given number of milliseconds.
void zenith::sleep_ms(uint64_t ms);
void montauk::sleep_ms(uint64_t ms);
.B SYS_GETPID (3)
Return the PID of the calling process.
int zenith::getpid();
int montauk::getpid();
.B SYS_SPAWN (20)
Spawn a new process from an ELF binary on the VFS.
int zenith::spawn(const char* path, const char* args = nullptr);
int montauk::spawn(const char* path, const char* args = nullptr);
.B SYS_WAITPID (23)
Block until the given process has exited.
void zenith::waitpid(int pid);
void montauk::waitpid(int pid);
.SH CONSOLE I/O
.B SYS_PRINT (4)
Write a null-terminated string to the terminal.
void zenith::print(const char* text);
void montauk::print(const char* text);
.B SYS_PUTCHAR (5)
Write a single character to the terminal.
void zenith::putchar(char c);
void montauk::putchar(char c);
.SH FILE I/O
.B SYS_OPEN (6)
Open a file. Returns a handle or negative on error.
int zenith::open(const char* path);
int montauk::open(const char* path);
.B SYS_READ (7)
Read bytes from a file at a given offset.
int zenith::read(int h, uint8_t* buf, uint64_t off, uint64_t sz);
int montauk::read(int h, uint8_t* buf, uint64_t off, uint64_t sz);
.B SYS_GETSIZE (8)
Get the size of an open file in bytes.
uint64_t zenith::getsize(int handle);
uint64_t montauk::getsize(int handle);
.B SYS_CLOSE (9)
Close a file handle.
void zenith::close(int handle);
void montauk::close(int handle);
.B SYS_READDIR (10)
List directory entries (max 64 per call).
int zenith::readdir(const char* path, const char** names, int max);
int montauk::readdir(const char* path, const char** names, int max);
.SH MEMORY
.B SYS_ALLOC (11)
Map zeroed pages into the process address space.
void* zenith::alloc(uint64_t size);
void* montauk::alloc(uint64_t size);
.B SYS_FREE (12)
Reserved (currently a no-op).
void zenith::free(void* ptr);
void montauk::free(void* ptr);
.SH TIMEKEEPING
.B SYS_GETTICKS (13)
Get APIC timer ticks since boot.
uint64_t zenith::get_ticks();
uint64_t montauk::get_ticks();
.B SYS_GETMILLISECONDS (14)
Get milliseconds elapsed since boot.
uint64_t zenith::get_milliseconds();
uint64_t montauk::get_milliseconds();
.B SYS_GETTIME (28)
Get the current wall-clock date and time (UTC).
Fills a Zenith::DateTime struct with Year, Month, Day,
Fills a Montauk::DateTime struct with Year, Month, Day,
Hour, Minute, and Second fields.
void zenith::gettime(Zenith::DateTime* out);
void montauk::gettime(Montauk::DateTime* out);
.SH SYSTEM
.B SYS_GETINFO (15)
Get OS name, version, and configuration.
void zenith::get_info(Zenith::SysInfo* info);
void montauk::get_info(Montauk::SysInfo* info);
.SH KEYBOARD
.B SYS_ISKEYAVAILABLE (16)
Check if a key event is pending (non-blocking).
bool zenith::is_key_available();
bool montauk::is_key_available();
.B SYS_GETKEY (17)
Get the next key event (press or release).
void zenith::getkey(Zenith::KeyEvent* out);
void montauk::getkey(Montauk::KeyEvent* out);
.B SYS_GETCHAR (18)
Block until a printable character is typed.
char zenith::getchar();
char montauk::getchar();
.SH NETWORKING
.B SYS_PING (19)
Send an ICMP echo request and wait for reply.
int32_t zenith::ping(uint32_t ip, uint32_t timeoutMs);
int32_t montauk::ping(uint32_t ip, uint32_t timeoutMs);
.B SYS_GETNETCFG (37)
Get the current network configuration (IP, mask, gateway, MAC,
DNS server).
void zenith::get_netcfg(Zenith::NetCfg* out);
void montauk::get_netcfg(Montauk::NetCfg* out);
.B SYS_SETNETCFG (38)
Set the network configuration (IP, mask, gateway, DNS server).
int zenith::set_netcfg(const Zenith::NetCfg* cfg);
int montauk::set_netcfg(const Montauk::NetCfg* cfg);
.B SYS_RESOLVE (44)
Resolve a hostname to an IPv4 address via DNS. Sends a UDP
@@ -135,106 +135,106 @@
for a reply. Returns the IP in network byte order, or 0 on
failure. IP address strings (e.g. "10.0.0.1") are detected
and returned directly without a DNS query.
uint32_t zenith::resolve(const char* hostname);
uint32_t montauk::resolve(const char* hostname);
.SH SOCKETS
.B SYS_SOCKET (29)
Create a socket. type=SOCK_TCP (1) or SOCK_UDP (2).
Returns fd or -1.
int zenith::socket(int type);
int montauk::socket(int type);
.B SYS_CONNECT (30)
Connect a TCP socket to a remote host.
int zenith::connect(int fd, uint32_t ip, uint16_t port);
int montauk::connect(int fd, uint32_t ip, uint16_t port);
.B SYS_BIND (31)
Bind a socket to a local port for listening.
int zenith::bind(int fd, uint16_t port);
int montauk::bind(int fd, uint16_t port);
.B SYS_LISTEN (32)
Start listening for incoming TCP connections.
int zenith::listen(int fd);
int montauk::listen(int fd);
.B SYS_ACCEPT (33)
Accept an incoming connection on a listening socket.
Returns a new socket fd for the client connection.
int zenith::accept(int fd);
int montauk::accept(int fd);
.B SYS_SEND (34)
Send data on a connected socket. Returns bytes sent.
int zenith::send(int fd, const void* data, uint32_t len);
int montauk::send(int fd, const void* data, uint32_t len);
.B SYS_RECV (35)
Receive data from a connected socket. Returns bytes
received, 0 if no data available, or -1 on close/error.
int zenith::recv(int fd, void* buf, uint32_t maxLen);
int montauk::recv(int fd, void* buf, uint32_t maxLen);
.B SYS_CLOSESOCK (36)
Close a socket and release its resources.
int zenith::closesocket(int fd);
int montauk::closesocket(int fd);
.B SYS_SENDTO (39)
Send a UDP datagram to a specific destination.
int zenith::sendto(int fd, const void* data, uint32_t len,
int montauk::sendto(int fd, const void* data, uint32_t len,
uint32_t destIp, uint16_t destPort);
.B SYS_RECVFROM (40)
Receive a UDP datagram. Returns the source address.
int zenith::recvfrom(int fd, void* buf, uint32_t maxLen,
int montauk::recvfrom(int fd, void* buf, uint32_t maxLen,
uint32_t* srcIp, uint16_t* srcPort);
.SH FILE WRITE
.B SYS_FWRITE (41)
Write bytes to a file at a given offset.
int zenith::fwrite(int handle, const uint8_t* buf,
int montauk::fwrite(int handle, const uint8_t* buf,
uint64_t offset, uint64_t size);
.B SYS_FCREATE (42)
Create a new file on the ramdisk. Returns a handle or negative
on error.
int zenith::fcreate(const char* path);
int montauk::fcreate(const char* path);
.SH FRAMEBUFFER
.B SYS_FBINFO (21)
Get framebuffer dimensions and format.
void zenith::fb_info(Zenith::FbInfo* info);
void montauk::fb_info(Montauk::FbInfo* info);
.B SYS_FBMAP (22)
Map the framebuffer into process memory at 0x50000000.
void* zenith::fb_map();
void* montauk::fb_map();
.SH TERMINAL
.B SYS_TERMSIZE (24)
Get terminal dimensions (columns and rows).
void zenith::termsize(int* cols, int* rows);
void montauk::termsize(int* cols, int* rows);
.B SYS_TERMSCALE (43)
Get or set the terminal font scale factor. When scale_x is 0,
returns the current scale as (scale_y << 32 | scale_x). When
scale_x is non-zero, sets the font scale and returns the new
terminal dimensions as (rows << 32 | cols).
void zenith::termscale(int scale_x, int scale_y);
void zenith::get_termscale(int* scale_x, int* scale_y);
void montauk::termscale(int scale_x, int scale_y);
void montauk::get_termscale(int* scale_x, int* scale_y);
.SH ARGUMENTS
.B SYS_GETARGS (25)
Get the argument string passed to this process at spawn time.
int zenith::getargs(char* buf, uint64_t maxLen);
int montauk::getargs(char* buf, uint64_t maxLen);
.SH RANDOM
.B SYS_GETRANDOM (45)
Fill a buffer with random bytes using RDTSC-seeded entropy.
Returns the number of bytes written.
int64_t zenith::getrandom(void* buf, uint32_t len);
int64_t montauk::getrandom(void* buf, uint32_t len);
.SH POWER MANAGEMENT
.B SYS_RESET (26)
Reboot the system.
[[noreturn]] void zenith::reset();
[[noreturn]] void montauk::reset();
.B SYS_SHUTDOWN (27)
Shut down the system (currently unimplemented).
[[noreturn]] void zenith::shutdown();
[[noreturn]] void montauk::shutdown();
.SH SEE ALSO
spawn(2), file(2), framebuffer(2), malloc(3)
+1 -1
View File
@@ -3,7 +3,7 @@
tls-errors - BearSSL TLS and X.509 error codes
.SH DESCRIPTION
ZenithOS uses BearSSL for TLS 1.2 connections. When a TLS
MontaukOS uses BearSSL for TLS 1.2 connections. When a TLS
operation fails, an integer error code is reported. This page
lists all possible error codes.
+1 -1
View File
@@ -1,6 +1,6 @@
.TH WIKI 1
.SH NAME
wiki - Wikipedia article viewer for ZenithOS
wiki - Wikipedia article viewer for MontaukOS
.SH SYNOPSIS
wiki <title>