pr: Update part of the docs (#17)

* Add cursor rendering section to window manager documentation

* Add cursor scale system commands to syscalls.md

* Add settings documentation for BoredOS

* Document cross-compiler build instructions for Linux

* Create README.md for BoredOS architecture documentation

* Update Architecture Overview link in README

* Reorganize Color Settings section in settings.md
This commit is contained in:
Lluciocc 2026-05-11 00:12:54 +02:00 committed by GitHub
parent 8a4ddb9b1e
commit e48f3674c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 188 additions and 2 deletions

View file

@ -61,7 +61,7 @@
| Guide | Description |
|-------|-------------|
| [Documentation Index](docs/README.md) | Start here! |
| [Architecture Overview](docs/architecture/core.md) | Deep dive into the kernel |
| [Architecture Overview](docs/architecture/README.md) | Deep dive into the kernel |
| [Building and Running](docs/build/usage.md) | Set up your build environment |
| [AppDev SDK](docs/appdev/custom_apps.md) | Build your own apps for BoredOS |

View file

@ -94,6 +94,8 @@ Notes:
| 47 | `SYSTEM_CMD_SET_RESOLUTION` | Set display mode |
| 49 | `SYSTEM_CMD_SET_KEYBOARD_LAYOUT` | Set active keyboard layout ID |
| 51 | `SYSTEM_CMD_GET_KEYBOARD_LAYOUT` | Get current keyboard layout ID |
| 78 | `SYSTEM_GET_CURSOR_SCALE` | Get the current BoredWM cursor scale |
| 79 | `SYSTEM_SET_CURSOR_SCALE` | Set the BoredWM cursor scale |
### Time, power, and system state

View file

@ -0,0 +1,32 @@
# BoredOS Architecture
This folder gathers the architecture documentation that explains how BoredOS is built from the kernel up.
## Architecture roadmap
The documentation is split by area so you can go directly to the subsystem you want to understand.
| Area | Document | Description |
| --- | --- | --- |
| Graphics | [`graphics/window_manager.md`](architecture/graphics/window_manager.md) | Window manager design and display composition. |
| Hardware | [`hardware/input.md`](architecture/hardware/input.md) | Hardware-level input support and device wiring. |
| Hardware | [`hardware/pci.md`](architecture/hardware/pci.md) | PCI bus management and device enumeration. |
| Input | [`input/keyboard.md`](architecture/input/keyboard.md) | Keyboard input handling and key mapping. |
| Memory | [`memory/memory.md`](architecture/memory/memory.md) | Memory architecture, paging, and address space layout. |
| Memory | [`memory/memory_manager.md`](architecture/memory/memory_manager.md) | Memory allocation and management systems. |
| Network | [`network/network_stack.md`](architecture/network/network_stack.md) | TCP/IP stack design, protocol flow, and packet handling. |
| Network | [`network/network_drivers.md`](architecture/network/network_drivers.md) | Network driver architecture and interface support. |
| Storage | [`storage/filesystem.md`](architecture/storage/filesystem.md) | File system structure and storage access. |
| Storage | [`storage/ahci_drivers.md`](architecture/storage/ahci_drivers.md) | AHCI driver implementation and disk controller support. |
| System | [`system/core.md`](architecture/system/core.md) | Core kernel architecture and main subsystems. |
| System | [`system/interrupts.md`](architecture/system/interrupts.md) | Interrupt handling and low-level event dispatch. |
| System | [`system/processes.md`](architecture/system/processes.md) | Process management, scheduling, and execution model. |
| General | [`versioning.md`](architecture/versioning.md) | Release versioning and project numbering conventions. |
## Quick start
- **Read `system/core.md` first** for the kernel overview.
- Then explore the subsystem area you need: `memory/`, `network/`, `storage/`, `graphics/`, or `system/`.
- Use `versioning.md` to understand BoredOS version rules.
> Note: The links above point directly to the most important architecture documents in this folder.

View file

@ -42,6 +42,12 @@ With the introduction of Symmetric Multi-Processing (SMP), the Window Manager (W
2. **Per-CPU Rendering State**: To facilitate simultaneous GUI system calls across all CPU cores, the low-level rendering context (`g_render_target` array) is isolated per-CPU using the core ID. This allows completely lockless multi-core pixel rasterization, drastically reducing rendering bottlenecks.
3. **Deferred Compositing**: Final screen composition (`wm_paint`) is scheduled to the main kernel idle loop on the Bootstrap Processor (BSP). This enables application cores to continue processing logic seamlessly while the GUI asynchronously handles flipping the physical framebuffer.
## Cursor Rendering
The cursor is drawn by BoredWM rather than by userland. Its shape is a small bitmap mask where transparent cells are skipped, white cells draw the outline, and black cells draw the filled body. The WM expands each source cell by the active cursor scale before writing pixels into the back buffer.
The current scale is exposed to userland through `SYSTEM_GET_CURSOR_SCALE` and can be changed with `SYSTEM_SET_CURSOR_SCALE`. Settings uses those commands for the mouse panel, while the WM clamps the requested scale and forces a redraw so the new cursor size appears immediately.
> [!IMPORTANT]
> Because application rendering (rasterizing geometry into a window's backbuffer) is SMP-safe and lock-free across cores, GUI performance scales linearly with the number of CPUs active.

View file

@ -8,7 +8,7 @@ To build BoredOS, you need the following tools:
1. **x86_64 ELF GCC Cross-Compiler**:
- `x86_64-elf-gcc`: The C compiler targeting the freestanding overarching ELF environment.
- `x86_64-elf-ld`: The linker to combine object files into the final `boredos.elf` kernel binary and userland variables.
- `x86_64-elf-ld`: The linker to combine object files into the final `boredos.elf` kernel and userland binaries.
2. **NASM**:
- Required to compile the `.asm` files in `src/arch/` and `src/userland/crt0.asm`. It formats the output as `elf64` objects to be linked alongside the C code.
@ -19,3 +19,49 @@ To build BoredOS, you need the following tools:
4. **QEMU** (Optional but highly recommended for testing):
- `qemu-system-x86_64` is used to virtualize the OS for testing or to mess around.
## Building the Cross-Compiler on Linux
### Availability Issue
On most Linux distributions, the `x86_64-elf-gcc` cross-compiler binary is **not pre-packaged** in standard repositories. The only notable exception is **Arch Linux** and Arch-based distributions (Manjaro, EndeavourOS, etc.), where it can be installed via `pacman`:
```bash
pacman -S x86_64-elf-gcc x86_64-elf-binutils
```
For all other Linux distributions (Debian, Ubuntu, Fedora, openSUSE, etc.), you **must build the cross-compiler from source**.
### Building from Source
To build the x86_64-ELF GCC cross-compiler:
1. **Download prerequisites**:
- GNU Binutils source
- GCC source
2. **Configure and build Binutils**:
```bash
../binutils-*/configure --target=x86_64-elf --prefix=/usr/local/cross
make && make install
```
3. **Configure and build GCC**:
```bash
../gcc-*/configure --target=x86_64-elf --prefix=/usr/local/cross \
--without-headers --enable-languages=c
make all-gcc && make install-gcc
```
4. **Add to PATH**:
```bash
export PATH="/usr/local/cross/bin:$PATH"
```
Verify the installation:
```bash
x86_64-elf-gcc --version
```
> **Note**: Building the cross-compiler can take 20-30 minutes depending on system performance. This is a one-time setup cost.

100
docs/usage/settings.md Normal file
View file

@ -0,0 +1,100 @@
# Settings
Settings is a system configuration application providing a graphical interface to manage BoredOS preferences across multiple categories.
## Main Menu
The Settings application presents seven configuration categories, each with its own icon and panel:
- **Wallpaper** — Manage desktop background images and patterns
- **Network** — Configure network interfaces and connectivity
- **Desktop** — Control desktop layout and icon alignment
- **Mouse** — Adjust mouse speed and cursor appearance
- **Fonts** — Browse and select system fonts
- **Display** — Configure screen resolution
- **Keyboard** — Select keyboard layout
## Wallpaper
### Image Selection
- Browse wallpapers stored in `/Library/images/Wallpapers/`
- Supported formats: JPEG (`.jpg`)
- Thumbnails (80×50 pixels) are generated for preview
- Selected wallpaper is applied immediately to the desktop background
### Patterns
The Wallpaper panel provides built-in pattern options:
- **Lumberjack Pattern** — Checkered pattern with red, dark grey, and black colors
- **Blue Diamond Pattern** — Geometric diamond design
Patterns are rendered procedurally (128×128 pixels) and can be applied as alternatives to image wallpapers.
### Color Settings
Six color presets are available for quick selection, with RGB textbox inputs for custom color values.
## Network
### Configuration
- Set static IP address via textbox input
- Configure DNS server address
- Network status is displayed after initialization
- Settings are applied through the `NET_INIT`, `NET_SET_IP`, and `NET_SET_DNS` controls
## Desktop
### Layout Control
- **Snap to Grid** — Enable/disable automatic icon alignment to grid positions
- **Auto Align** — Automatically reorganize icons when enabled
- **Columns** — Adjust maximum number of columns for icon layout (configurable with +/- buttons)
- **Rows per Column** — Set maximum rows within each column
Desktop grid settings are stored as `desktop_max_rows_per_col` and `desktop_max_cols`.
## Mouse
### Cursor Control
- **Mouse Speed** — Adjust pointer movement sensitivity
- **Cursor Scale** — Increase or decrease cursor size using +/ buttons
- Settings communicates with the kernel WM using `SYSTEM_GET_CURSOR_SCALE` and `SYSTEM_SET_CURSOR_SCALE` syscalls
- Cursor changes are applied instantly and visibly in real-time
## Fonts
### System Fonts
- Browse available fonts from `/Library/Fonts/`
- Font list is dynamically loaded with scrollbar for navigation
- Each font displays an icon and name
- Fonts are listed with entry structures containing path and name information
## Display
### Resolution Selection
- Choose from dynamic resolution options based on physical screen size:
- 50% of screen resolution
- 75% of screen resolution
- Full screen resolution (100%)
- Custom resolution entry via textbox (width and height)
- Apply button commits the selected resolution change
## Keyboard
### Layout Selection
- Available keyboard layouts can be selected from a dropdown
- Layout state is maintained as `keyboard_layout`
- Selection applies to system-wide keyboard input
---
[Return to Documentation Index](../README.md)