INTRO(1)

NAME
    intro - introduction to MontaukOS userspace

DESCRIPTION
    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.
    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 montauk:: syscall wrappers.

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 montauk::getargs() to retrieve any
    arguments passed by the parent process. Include <montauk/syscall.h>
    for the full typed syscall API.
    Build with:
        cd programs && make
    The resulting ELF binary appears in programs/bin/os/.

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

SHELL
    The interactive shell is the primary way to interact with
    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.

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

SEE ALSO
    shell(1), syscalls(2), malloc(3)