71 lines
2.4 KiB
Groff
71 lines
2.4 KiB
Groff
.TH INTRO 1
|
|
.SH NAME
|
|
intro - introduction to ZenithOS userspace
|
|
|
|
.SH DESCRIPTION
|
|
ZenithOS 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.
|
|
|
|
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.
|
|
|
|
.SH GETTING STARTED
|
|
To write a new program, create a directory under programs/src/
|
|
with a main.cpp file. The entry point is:
|
|
|
|
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>
|
|
for the full typed syscall API.
|
|
|
|
Build with:
|
|
|
|
cd programs && make
|
|
|
|
The resulting ELF binary appears in programs/bin/os/.
|
|
|
|
.SH RAMDISK LAYOUT
|
|
The boot ramdisk is mounted as drive 0 with the following
|
|
directory structure:
|
|
|
|
0:/os/ System binaries (shell, init, man, etc.)
|
|
0:/games/ Games (doom)
|
|
0:/man/ Manual pages
|
|
0:/www/ Web server content
|
|
0:/home/ User home directory
|
|
|
|
.SH SHELL
|
|
The interactive shell is the primary way to interact with
|
|
ZenithOS. 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.
|
|
|
|
.SH MAN PAGES
|
|
The following man pages are available:
|
|
|
|
intro(1) This page
|
|
shell(1) Shell commands reference
|
|
init(1) Init system
|
|
dhcp(1) DHCP client
|
|
fetch(1) HTTP client
|
|
ping(1) ICMP ping
|
|
nslookup(1) DNS lookup
|
|
fontscale(1) Terminal font scaling
|
|
edit(1) Text editor
|
|
man(1) The man command itself
|
|
legal(7) Copyright and legal information
|
|
syscalls(2) Overview of all syscalls
|
|
spawn(2) Process spawning
|
|
file(2) File I/O syscalls
|
|
framebuffer(2) Framebuffer access
|
|
malloc(3) Memory allocation
|
|
|
|
.SH SEE ALSO
|
|
shell(1), syscalls(2), malloc(3)
|