235 Commits

Author SHA1 Message Date
boreddevnl
e738041020 Merge branch 'main' of https://github.com/boreddevnl/BoredOS 2026-04-17 11:25:51 +02:00
boreddevnl
9830b6ad96 VER: 26.4.2 --> 26.4.2.1 2026-04-17 11:25:45 +02:00
Chris
a09103e40d PR: Snake game - Lluciocc
Add a Snake game
2026-04-17 11:12:39 +02:00
Lluciocc
aff3e99ab2 Implement adjustable game speed for Snake game 2026-04-17 11:10:09 +02:00
boreddevnl
93bf2e1734 RM: commented-out button draw calls
Clean up src/userland/games/2048.c by removing a block of commented-out draw_button calls in game_paint(). This eliminates unrecommended UI code and tidies the rendering function; no functional behavior changes.
2026-04-17 09:52:37 +02:00
boreddevnl
eaa02c9a5d Fix Task Manager CPU usage math 2026-04-17 09:42:43 +02:00
boreddevnl
0ad151d7fc OPTIMIZATION: Throttle terminal/Bsh idle polling 2026-04-17 09:42:27 +02:00
Lluciocc
b54e371f3f Add snake.c 2026-04-17 09:32:42 +02:00
boreddevnl
79eeaa73d9 DOC: new screenshot in README.md 2026-04-17 09:31:08 +02:00
boreddevnl
481eb42268 FIX: Make /root/* folders 2026-04-17 09:28:44 +02:00
boreddevnl
feb0d6ffbf DOC: Add a contributors section to the README.md file 2026-04-17 09:25:11 +02:00
boreddevnl
67ebcb98d1 Merge branch 'main' of https://github.com/boreddevnl/BoredOS 2026-04-17 09:20:41 +02:00
boreddevnl
957c74365c DOC: Reference .bashrc in terminal docs 2026-04-17 09:20:39 +02:00
boreddevnl
31b6f48a2c DOC: Added supported media types in README.md and added a smaller BMAC link at the top of the README 2026-04-17 09:19:53 +02:00
Chris
67b7bb1a97 Merge pull request #4 from Lluciocc/fix-input 2026-04-17 07:58:21 +02:00
Lluciocc
e05ff65f92 Update 2048.c with new input ref 2026-04-17 01:16:57 +02:00
Lluciocc
40f63097e1 Fix missing newline at end of input.h 2026-04-17 01:12:20 +02:00
Lluciocc
d677d37b1c Add keylog.c 2026-04-17 01:05:18 +02:00
Lluciocc
9b6297c917 Add input.h 2026-04-17 01:02:07 +02:00
boreddevnl
dd6cbf1fe0 DOC: Update usage.md with new make flags 2026-04-17 00:06:09 +02:00
boreddevnl
7e123b6429 VER: 4.0.1-stable --> v1.0-stable 2026-04-16 23:54:29 +02:00
boreddevnl
4177484366 VER: 26.4 --> 26.4.2 2026-04-16 23:53:50 +02:00
boreddevnl
8dc5ee5867 CREDIT: re-added original credit in 2048. Fixes #2
Co-authored-by: Lluciocc <Lluciocc@users.noreply.github.com>
2026-04-16 22:41:00 +02:00
boreddevnl
884c2f8980 FIX: update explorer spawns for new process_create_elf signature 2026-04-16 22:34:36 +02:00
boreddevnl
36d61e3b7b FEAT: Seperate run parameters for windows, mac and linux 2026-04-16 22:28:31 +02:00
boreddevnl
013f0b513f Merge branch 'main' of https://github.com/boreddevnl/BoredOS 2026-04-16 22:14:22 +02:00
boreddevnl
28108adde3 FIX: Retry to stop false application launch failures 2026-04-16 22:14:18 +02:00
boreddevnl
62ac2ab849 FIX: Redraw menubar upon application start 2026-04-16 22:13:21 +02:00
boreddevnl
7f510c6aa5 FIX: Race condition causing applications to print to serial out instead of the CLI 2026-04-16 22:12:20 +02:00
boreddevnl
7116de4152 TWEAK: rename TOPBAR --> MENUBAR 2026-04-16 22:11:44 +02:00
boreddevnl
049d67e821 FIX: Redraw menubar upon application launch 2026-04-16 22:10:58 +02:00
Chris
0f3971bb1c MERGE: Add 2048 game - LLuciocc
Add 2048 game
2026-04-16 22:03:06 +02:00
Lluciocc
66f55242a7 Update man_entries.h 2026-04-16 18:39:21 +02:00
Lluciocc
8a8fb7de27 Remove credit 2026-04-16 18:06:47 +02:00
Lluciocc
914c60e1f1 Adding 2048.c 2026-04-16 17:58:08 +02:00
boreddevnl
5141eaea60 FEAT: uname 2026-04-15 23:36:42 +02:00
boreddevnl
6e90c3e197 TWEAK: sysfetch added in startup.bsh 2026-04-15 23:36:11 +02:00
boreddevnl
bdd43f43cd FEATURE: add Bsh + userspace terminal, remove legacy cmd/cli utils 2026-04-15 22:47:24 +02:00
boreddevnl
a8866da3cb FEAT: mute terminal output from applications not launched via cli 2026-04-15 20:10:53 +02:00
boreddevnl
14decdd705 DOC: Update README.md 2026-04-15 11:00:06 +02:00
boreddevnl
ed73b88ec1 enable verbose by default 2026-04-15 10:59:44 +02:00
boreddevnl
f9bc6c7c38 FIX: FAT32 cluster management, allocation performance, and AHCI safety 2026-04-14 14:29:19 +02:00
boreddevnl
bb187faf79 DOC: small user manual 2026-04-14 10:59:52 +02:00
boreddevnl
fd7fa4f16e FIX: man entries 2026-04-14 10:59:28 +02:00
boreddevnl
5bd9e537c5 FEAT: bootfs 2026-04-13 16:04:47 +02:00
boreddevnl
e4603792b6 FEAT: Verbose boot 2026-04-13 12:17:39 +02:00
boreddevnl
a27b2c6423 RN: Renamed spotlight to lumos for legal reasons :kek: 2026-04-12 21:51:24 +02:00
boreddevnl
bb176f2193 FEAT: Lumos file searcher 2026-04-12 21:46:28 +02:00
boreddevnl
8dd756f25b FIX: cpuinfo stack overflow and add GUI tab character support 2026-04-12 19:07:08 +02:00
boreddevnl
d13fca2d4a CHECKP: vfs 2026-04-12 18:23:38 +02:00
boreddevnl
a1b6d58b77 Tweak: os_codename = Voyager 2026-04-12 17:59:10 +02:00
boreddevnl
cbc196a4b1 tweak: add -stable after kernel_version 2026-04-12 17:57:54 +02:00
boreddevnl
b4c14af48d TWEAK: kernel_version = 3.2.3 --> 4.0.0 2026-04-12 17:56:35 +02:00
boreddevnl
700839e6be FEAT: VFS overhaul 2026-04-12 17:53:31 +02:00
boreddevnl
921e8a5658 RM: Legacy drive selector in explorer 2026-04-12 00:34:22 +02:00
boreddevnl
437d57312f FIX: remove accidentally copied code 2026-04-12 00:28:03 +02:00
boreddevnl
afc4e16fcf STABILITY: SMP improvements 2026-04-12 00:26:04 +02:00
boreddevnl
38ed0b5ffa CHECKP: semi-stable vfs 2026-04-11 23:08:33 +02:00
boreddevnl
5933483009 CHECKP: shitty VFS 2026-04-11 21:41:11 +02:00
boreddevnl
6b6a22d518 OPT: use ui_draw_image in paint.c 2026-04-11 16:14:39 +02:00
boreddevnl
85427041de FEAT: Caps lock support in ps2 driver 2026-04-11 16:12:37 +02:00
boreddevnl
8b77e8c48e doc: update grapher with tri-axis marching 2026-04-04 19:39:49 +02:00
boreddevnl
1ce08c70b0 FEAT: add tri-axis marching pipeline and atomic depth-color updates to Grapher 2026-04-04 18:05:04 +02:00
boreddevnl
fca67f68a9 NEW: math.h/libmath.c 2026-04-03 23:28:29 +02:00
boreddevnl
c330382436 DOCS: math.h 2026-04-03 23:27:45 +02:00
boreddevnl
f0c2963793 CHECKPOINT: polygon rendering 2026-04-03 23:16:03 +02:00
boreddevnl
3b24bc882c FEAT: Add grapher to dock 2026-04-03 13:32:38 +02:00
boreddevnl
2b44e59e9f TWEAK: Adjust window size 2026-04-03 13:32:23 +02:00
boreddevnl
7a2769e8e3 UI: New main wallpaper (bored.jpg) 2026-04-03 13:23:52 +02:00
boreddevnl
1a6e30b52e Docs: Clean up README.md 2026-04-03 11:53:57 +02:00
boreddevnl
69847adee6 DOCS: Refine and add documentation for libwidget.c 2026-04-03 11:52:06 +02:00
boreddevnl
f402e5e4f0 Merge branch 'main' of https://github.com/boreddevnl/BoredOS 2026-04-03 11:47:05 +02:00
boreddevnl
684ed774ee TWEAK: Balanced resolution and cpu usage with GRID_3D resolution 2026-04-03 11:46:33 +02:00
Chris
9ed8eac3e5 Update Buy Me A Coffee link in README 2026-04-03 00:08:05 +02:00
boreddevnl
c6d512b0f2 FIX: Flickering of colors with 3D graphs 2026-04-02 22:00:04 +02:00
boreddevnl
0b7a134282 TWEAK: Update version.c to 26.4 "Geometry" 2026-04-02 21:59:25 +02:00
boreddevnl
91b67bd8d5 OPT: Multithreaded WM rendering 2026-04-02 21:36:00 +02:00
boreddevnl
e60f232812 OPTIMIZATION: Bytecode engine 2026-04-02 20:21:58 +02:00
boreddevnl
3169ec51cb FEAT: SYSTEM_CMD_PARALLEL_RUN 2026-04-02 20:21:06 +02:00
boreddevnl
beb2c724ff FEAT: ROTATE variable to toggle auto rotate in 3d graphs. 2026-04-02 17:58:33 +02:00
boreddevnl
bf3c2cb578 FEAT: always rotate 3d graph 2026-04-02 17:51:43 +02:00
boreddevnl
823e9c0ce7 FIX: autofit when adjusting graph not shooting into outer space (LOL) 2026-04-02 15:58:56 +02:00
boreddevnl
0ddb1e7610 FEAT: Measurements on graph, fixed overflow and ctrl + r to reset zoom 2026-04-02 15:55:27 +02:00
boreddevnl
32a6bb4d72 FEAT: Pass ctrl pressed through syscall 2026-04-02 15:51:16 +02:00
boreddevnl
d8e680604c FIX: gpf when closing boredword.c 2026-04-01 23:33:25 +02:00
boreddevnl
2e28f860cb FEAT: resizing of window in viewer.c 2026-04-01 23:27:49 +02:00
boreddevnl
9634ebb086 FIX: Fixed framebuffer freeze upon screenshot 2026-04-01 23:05:52 +02:00
boreddevnl
d7d97b5a97 MV: graphing.c --> grapher.c 2026-04-01 22:19:57 +02:00
boreddevnl
4a3752583c FEAT: graphing.c a graphing calculator app. 2026-04-01 22:19:10 +02:00
boreddevnl
9de8ee143c OPT: Reduce render calls when zooming 2026-04-01 22:18:57 +02:00
boreddevnl
8d5fa53d3e FEAT: Cursor nav in text box 2026-04-01 22:18:26 +02:00
boreddevnl
ad8db32305 RM: broken .gif 2026-03-24 19:35:56 +01:00
boreddevnl
92928e55fb fix wm freeze explorer 2026-03-24 19:34:47 +01:00
boreddevnl
31eb7afdc6 fix: better parsing in browser.c 2026-03-23 21:25:46 +01:00
boreddevnl
ad9fac3e28 fix: scrollbar functionality 2026-03-23 20:40:38 +01:00
boreddevnl
70cd296d19 BFIX: Fix gpf's in .elf applications 2026-03-23 17:26:41 +01:00
boreddevnl
b7020152c1 feat: .tar application loading 2026-03-23 09:10:17 +01:00
boreddevnl
63749b8734 FEAT: libwidget.c 2026-03-22 22:07:30 +01:00
boreddevnl
4e8ea5acd2 perf: fix core starvation 2026-03-22 21:04:50 +01:00
boreddevnl
5c199e028a OPTIMIZATION: Network and browser optimizations 2026-03-22 19:26:05 +01:00
boreddevnl
ec2a9d1883 OPTIMIZATION: Browser loading optimization 2026-03-22 18:55:55 +01:00
boreddevnl
4c46650c64 OPTIMIZATION: use mem_mcpy in display buffer 2026-03-22 18:50:29 +01:00
boreddevnl
1ee2fcad9e DOC: Remove unneccessary word readme.md 2026-03-21 17:55:56 +01:00
boreddevnl
5c29ac1473 RM: Deletion unnecessary .vcxproj files 2026-03-20 00:02:01 +01:00
boreddevnl
81743261bf tweak: file cleanup 2026-03-19 12:19:41 +01:00
boreddevnl
4eeb907342 TWEAK: rename DOOM window 2026-03-19 10:43:48 +01:00
boreddevnl
e527f63af7 TWEAK: version.c update for BoredOS Syncwave 2026-03-18 18:18:24 +01:00
boreddevnl
1e19963a8d DOC: Adjust filesystem documentation 2026-03-18 18:14:56 +01:00
boreddevnl
60ab70a49d DOC: Missing space in README.md 2026-03-18 18:10:58 +01:00
boreddevnl
d9bcc4aff7 DOC: Update documentation with multi-threading support 2026-03-18 18:09:46 +01:00
boreddevnl
5604866882 FIX: Mouse trailing with single core CPU's 2026-03-18 18:09:24 +01:00
boreddevnl
e95c82b162 CHECKP: multi-thread applications 2026-03-18 17:04:10 +01:00
boreddevnl
9fb307e603 CHECKP: multi core scheduling 2026-03-17 22:11:32 +01:00
boreddevnl
a7c3cccce7 CheckP: smp support 2026-03-17 21:44:21 +01:00
boreddevnl
7eb55f3a59 FEAT: Unicode support using NotoEmoji 2026-03-17 19:46:48 +01:00
boreddevnl
72baf6506d FEAT: sorting from A->Z in explorer.c 2026-03-17 19:20:53 +01:00
boreddevnl
2817ad51da DOC: Example applications in documentation 2026-03-17 18:52:03 +01:00
boreddevnl
5b10127e02 Tweak: Improved Documentation and README.MD 2026-03-17 17:40:00 +01:00
boreddevnl
1404a6ae4f TWEAK: Rename word.c to boredword.c 2026-03-17 16:24:40 +01:00
boreddevnl
7b7f134e27 feat: centralize OS version info in kernel syscall 2026-03-17 16:06:00 +01:00
boreddevnl
0491c4ad0f TWEAK: change version number for V1.72 and 3.1.2 2026-03-17 15:50:25 +01:00
boreddevnl
c6fe9971d8 BFIX: export bugs in word.c and fixed explorer always ZTop in wm 2026-03-17 15:48:42 +01:00
boreddevnl
88f178e368 checkpoint: BoredWord application 2026-03-17 14:41:13 +01:00
boreddevnl
d824b4610a FIX: Replace blocking k_beep with an asynchronous k_beep 2026-03-16 17:22:42 +01:00
boreddevnl
a4f16b0604 RM: remove broken file artifact 2026-03-16 17:19:06 +01:00
boreddevnl
83413fdd2b fix: Broken script in documentation 2026-03-16 17:16:20 +01:00
boreddevnl
2a918bc7ba Tweak: Updatedscreenshot.jpg and fixed boredos.svg alignment 2026-03-16 15:59:37 +01:00
boreddevnl
2624b4f8df update LICENSE 2026-03-16 15:21:17 +01:00
boreddevnl
be67c27f58 fix makefile to include doom1.wad 2026-03-16 15:06:14 +01:00
boreddevnl
65f362feab seperate net folder 2026-03-16 15:00:24 +01:00
boreddevnl
6b18d44fab markdown viewer massive update 2026-03-16 14:50:47 +01:00
boreddevnl
8b172a69a1 Docs included in iso + explorer corruption fix 2026-03-16 14:28:45 +01:00
boreddevnl
0846ed27b2 exclude .o binaries .gitignore 2026-03-16 14:11:22 +01:00
boreddevnl
1cb8425653 .DS_Store added to .gitignore 2026-03-16 14:09:04 +01:00
boreddevnl
f403816acf stop stracking build artifacts 2026-03-16 14:04:56 +01:00
boreddevnl
5af6b8ec5c deletion old log 2026-03-16 10:47:14 +01:00
boreddevnl
cea0b59c93 deletion old log 2026-03-16 10:46:44 +01:00
boreddevnl
c5111cdcb5 virtio net nic driver fix 2026-03-16 10:45:49 +01:00
boreddevnl
803ebdaefa add link to net/nic drivers in usage documentation 2026-03-16 10:29:02 +01:00
boreddevnl
884af3857f docs: Update admonition syntax for caution block in usage documentation. 2026-03-16 10:26:54 +01:00
boreddevnl
b427b1d4ac DOCS 2026-03-16 10:23:40 +01:00
boreddevnl
d01c309166 updated readme 2026-03-16 00:34:24 +01:00
boreddevnl
fc83d7941b src/kernel --> src/ 2026-03-16 00:30:47 +01:00
boreddevnl
3da1496e4f missed files in organization 2026-03-16 00:27:27 +01:00
boreddevnl
90e5125913 Folder organization 2026-03-16 00:24:47 +01:00
boreddevnl
30f1b66b05 stupid code fix 2026-03-15 17:04:55 +01:00
boreddevnl
6c273e0f2f k_shutdown() fix 2026-03-15 16:53:38 +01:00
boreddevnl
4bab8949e7 revamped network settings 2026-03-15 16:49:56 +01:00
boreddevnl
df73f00efd rtl8111 NIC driver 2026-03-15 16:32:52 +01:00
boreddevnl
b05b221c41 Network Virtio and RTL8139 NIC support 2026-03-14 16:52:52 +01:00
boreddevnl
95c465ca39 task manager fix 2026-03-13 14:48:58 +01:00
boreddevnl
569adabf10 limine 2026-03-13 09:24:33 +01:00
boreddevnl
43a9735f81 V1.70 2026-03-12 21:58:07 +01:00
boreddevnl
93b59064c7 graphics settings 2026-03-12 21:57:26 +01:00
boreddevnl
d19075750b memory leak fix userspace 2026-03-12 19:15:09 +01:00
boreddevnl
8ba03fac72 disk fix 2026-03-12 12:16:32 +01:00
boreddevnl
071f8339bf screenshot util 2026-03-12 12:16:01 +01:00
boreddevnl
dbaff43c6f Update boredos.iso 2026-03-12 10:44:03 +01:00
boreddevnl
624db9ec9c browser fixes 2026-03-11 23:12:15 +01:00
boreddevnl
512912c821 cleanup 2026-03-11 22:09:04 +01:00
boreddevnl
989ef019d4 semi bug fix 2026-03-11 09:29:15 +01:00
boreddevnl
6a41be2437 task manager and major memory stability fixes 2026-03-10 18:12:57 +01:00
boreddevnl
1639b09cb5 extra wallpaper 2026-03-10 11:08:07 +01:00
boreddevnl
1b181772a1 drastic image loading optimization 2026-03-09 14:31:24 +01:00
boreddevnl
6d7f9870f3 doom render fix 2026-03-09 10:33:10 +01:00
boreddevnl
b40d3c050d terminal fixes 2026-03-08 21:17:40 +01:00
boreddevnl
3fbcf3d4fd New image decoder 2026-03-08 19:23:22 +01:00
boreddevnl
032b154f41 Times font by default browser 2026-03-07 17:02:18 +01:00
boreddevnl
bfac4bf65c browser improvement 2026-03-06 14:11:32 +01:00
boreddevnl
41d1e3960b html 2.0 compliance update browser 2026-03-06 00:27:57 +01:00
boreddevnl
b708ad7e45 fun apps and inclusion of stb_image.h for future work 2026-03-05 20:27:10 +01:00
boreddevnl
4b8fdde06d path fix 2026-03-05 09:44:39 +01:00
boreddevnl
690413045d .gitignore 2026-03-05 09:34:26 +01:00
boreddevnl
e5cfab37dc quick fix 2026-03-04 22:28:00 +01:00
boreddevnl
d49d082712 DOOM!!!! 2026-03-04 21:41:58 +01:00
boreddevnl
9bb62a5ade mem optimization browser 2026-03-04 20:28:53 +01:00
boreddevnl
903d4e0510 basic telnet 2026-03-04 09:54:57 +01:00
boreddevnl
cc752052dc browser fixes and optimization 2026-03-03 22:36:46 +01:00
boreddevnl
4083b8a563 better font rendering browser 2026-03-03 21:22:05 +01:00
boreddevnl
3c7d36a50f .ttf fonts (beta) 2026-03-03 20:34:50 +01:00
boreddevnl
8b3ca448ed Improve site loading 2026-03-03 19:16:30 +01:00
boreddevnl
36219f5828 browser parsing 2026-03-03 14:12:39 +01:00
boreddevnl
10ca6ef345 update IP parsing 2026-03-03 13:35:02 +01:00
boreddevnl
80fce3d0e9 browser 2026-03-02 21:27:44 +01:00
boreddevnl
d38e8b97e2 bug fix 2026-03-02 17:17:53 +01:00
boreddevnl
48ad5470ee update command operator 2026-03-02 12:24:43 +01:00
boreddevnl
659feee6f7 LwIP 2026-03-02 12:12:23 +01:00
boreddevnl
01345ba2b6 update sysfetch 2026-03-01 18:53:53 +01:00
boreddevnl
22dd21c580 limine update 2026-03-01 18:51:54 +01:00
boreddevnl
67640ec8db Update svg 2026-03-01 18:22:12 +01:00
boreddevnl
c0eaf4c89b logo 2026-03-01 17:35:21 +01:00
boreddevnl
35f3a5410a Edit readme.md 2026-03-01 17:32:33 +01:00
boreddevnl
42bcc1ad7c new wallpaper 2026-03-01 17:29:43 +01:00
boreddevnl
5cf552fd14 Disk improvements 2026-03-01 17:10:41 +01:00
boreddevnl
8bd70faa89 Clock app 2026-03-01 16:08:26 +01:00
boreddevnl
8d3c0486ff logo 2026-03-01 06:37:36 +01:00
boreddevnl
05c1f37a86 sysfetch 2026-03-01 06:06:43 +01:00
boreddevnl
c5c77ce734 memory fixes 2026-03-01 04:21:04 +01:00
boreddevnl
a4e0a42042 Memory bug fix 2026-03-01 00:52:25 +01:00
boreddevnl
8afb488539 Network fix 2026-02-28 23:58:33 +01:00
boreddevnl
cb4edb6264 gitignore 2026-02-28 23:12:03 +01:00
boreddevnl
81d60f144c terminal bug fix 2026-02-28 23:11:13 +01:00
boreddevnl
4c0d9886aa bug fix 2026-02-28 22:54:02 +01:00
boreddevnl
74bdb89ad3 CMD config 2026-02-28 22:09:33 +01:00
boreddevnl
fbd0bf880e License headers 2026-02-28 00:19:00 +01:00
boreddevnl
857b11220c READ THIS!!! 2026-02-28 00:05:57 +01:00
Chris
981d2cb4f4 READ THIS!! 2026-02-28 00:04:02 +01:00
Chris
f299ae6f23 Delete asciiart.png 2026-02-28 00:03:27 +01:00
boreddevnl
ed0535b822 update HELP 2026-02-28 00:02:34 +01:00
boreddevnl
9ae0b16b71 BEEP fix 2026-02-27 23:31:13 +01:00
boreddevnl
8a6928b5c9 Network commands port to userspace 2026-02-27 23:24:43 +01:00
boreddevnl
304c2e1383 CLI apps transfer to Userspace 2026-02-27 22:13:53 +01:00
boreddevnl
8c6d751254 FS fix 2026-02-27 16:19:11 +01:00
boreddevnl
f9d84d434e BSoD 2026-02-26 22:31:54 +01:00
boreddevnl
a34aaa1070 Fancier limine and WAY faster boot 2026-02-26 22:11:46 +01:00
boreddevnl
34ceff4290 Rendering fix in apps 2026-02-26 21:56:50 +01:00
boreddevnl
fcc290f3f9 Stability improvements 2026-02-26 21:45:57 +01:00
boreddevnl
2801dbc21f Memory fixes userspace 2026-02-26 21:09:18 +01:00
boreddevnl
786eac0345 Porting of apps to userspace 2026-02-26 20:07:21 +01:00
boreddevnl
c2ead0d6a7 Notepad port to userspace and bug fixes 2026-02-26 16:21:20 +01:00
boreddevnl
23ec181f29 update readme.md 2026-02-25 23:02:36 +01:00
boreddevnl
616ff8084b gitignore 2026-02-25 23:01:00 +01:00
boreddevnl
73a34edd0e Kernel V3.0.0 2026-02-25 22:59:50 +01:00
boreddevnl
ca997072ce Ring 3 multitasking 2026-02-25 19:09:32 +01:00
boreddevnl
cc950974e8 V1.63 bug fixes 2026-02-25 15:27:29 +01:00
Chris
6e2f0d8c1a V1.62 bug fixes 2026-02-24 22:45:24 +01:00
Chris
106adf1ac8 V1.61 feature update: JPEG image viewer and JPEG wallpaper setting. 2026-02-24 21:51:41 +01:00
Chris
f694c490a6 V1.60 2026-02-24 18:07:05 +01:00
Chris
f6e53fa7c6 V1.60 2026-02-24 17:49:54 +01:00
Chris
b4cccb0eb3 Major redesign 1.60 2026-02-24 12:17:20 +01:00
Chris
6f68538b86 Update README.md 2026-02-18 15:37:34 +01:00
Chris
2ca2809904 V1.51/2.5.0
This update adds support for IDE and SATA drives (that are formatted to fat32) this allows for persistent storage over drives and gives the system some use other than just a showcase :D The user can switch between drives in the explorer by clicking on the dropdown and then clicking any drive letter ( A:, B: .. C:) this list dynamically expands on how many drives there are in the system. In the cmd the user just types A:, B:, C: etc to switch to that drive.
2026-02-18 15:36:31 +01:00
Chris
22b99e051d V1.51
You can now delete folders with rm -r >folder< and the restart and shutdown commands now work again :D
2026-02-13 14:17:21 +01:00
Chris
60ea9defc0 Merge branch 'main' of https://github.com/boreddevnl/BoredOS 2026-02-11 00:07:01 +01:00
Chris
658c5eb0ed BoredOS 1.50 Panda 2026-02-11 00:06:39 +01:00
818 changed files with 232227 additions and 13048 deletions

BIN
.DS_Store vendored

Binary file not shown.

2
.gitattributes vendored
View File

@@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto

13
.gitignore vendored
View File

@@ -18,3 +18,16 @@ limine 2/Makefile
limine 2/limine limine 2/limine
limine 2/limine.dSYM/Contents/Resources/DWARF/limine limine 2/limine.dSYM/Contents/Resources/DWARF/limine
limine 2/limine.exe limine 2/limine.exe
boredos.dump
qemu-debug.log
iso_root/
limine/
src/userland/bin/
boredos.iso
disk.img
limine
**/.DS_Store
.DS_Store
/build/
*.o
disk.img

View File

@@ -647,7 +647,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/\>.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
@@ -666,11 +666,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school, You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary. if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>. <https://www.gnu.org/licenses/\>.
The GNU General Public License does not permit incorporating your program The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>. <https://www.gnu.org/licenses/why-not-lgpl.html\>.

193
Makefile
View File

@@ -1,122 +1,231 @@
# BoredOS Makefile # BoredOS Makefile
# Target Architecture: x86_64 # Target Architecture: x86_64
# Host: macOS # Host: macOS
# Copyright (c) 2023-2026 Chris (boreddevnl)
# This software is released under the GNU General Public License v3.0. See LICENSE file for details.
# This header needs to maintain in any file it is present in, as per the GPL license terms.
CC = x86_64-elf-gcc CC = x86_64-elf-gcc
LD = x86_64-elf-ld LD = x86_64-elf-ld
NASM = nasm NASM = nasm
XORRISO = xorriso XORRISO = xorriso
SRC_DIR = src/kernel SRC_DIR = src
BUILD_DIR = build BUILD_DIR = build
ISO_DIR = iso_root ISO_DIR = iso_root
KERNEL_ELF = $(BUILD_DIR)/boredos.elf KERNEL_ELF = $(BUILD_DIR)/boredos.elf
ISO_IMAGE = boredos.iso ISO_IMAGE = boredos.iso
C_SOURCES = $(wildcard $(SRC_DIR)/*.c) C_SOURCES = $(wildcard $(SRC_DIR)/core/*.c) \
CLI_APP_SOURCES = $(wildcard $(SRC_DIR)/cli_apps/*.c) $(wildcard $(SRC_DIR)/sys/*.c) \
ASM_SOURCES = $(wildcard $(SRC_DIR)/*.asm) $(wildcard $(SRC_DIR)/mem/*.c) \
OBJ_FILES = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o, $(C_SOURCES)) \ $(wildcard $(SRC_DIR)/dev/*.c) \
$(patsubst $(SRC_DIR)/cli_apps/%.c, $(BUILD_DIR)/cli_apps/%.o, $(CLI_APP_SOURCES)) \ $(wildcard $(SRC_DIR)/net/*.c) \
$(patsubst $(SRC_DIR)/%.asm, $(BUILD_DIR)/%.o, $(ASM_SOURCES)) $(wildcard $(SRC_DIR)/net/nic/*.c) \
$(wildcard $(SRC_DIR)/fs/*.c) \
$(wildcard $(SRC_DIR)/wm/*.c) \
$(wildcard $(SRC_DIR)/net/lwip/core/*.c) \
$(wildcard $(SRC_DIR)/net/lwip/core/ipv4/*.c) \
$(SRC_DIR)/net/lwip/netif/ethernet.c \
$(SRC_DIR)/net/lwip/netif/bridgeif.c
ASM_SOURCES = $(wildcard $(SRC_DIR)/arch/*.asm)
OBJ_FILES = $(patsubst $(SRC_DIR)/core/%.c, $(BUILD_DIR)/%.o, $(wildcard $(SRC_DIR)/core/*.c)) \
$(patsubst $(SRC_DIR)/sys/%.c, $(BUILD_DIR)/%.o, $(wildcard $(SRC_DIR)/sys/*.c)) \
$(patsubst $(SRC_DIR)/mem/%.c, $(BUILD_DIR)/%.o, $(wildcard $(SRC_DIR)/mem/*.c)) \
$(patsubst $(SRC_DIR)/dev/%.c, $(BUILD_DIR)/%.o, $(wildcard $(SRC_DIR)/dev/*.c)) \
$(patsubst $(SRC_DIR)/net/%.c, $(BUILD_DIR)/%.o, $(wildcard $(SRC_DIR)/net/*.c)) \
$(patsubst $(SRC_DIR)/net/nic/%.c, $(BUILD_DIR)/%.o, $(wildcard $(SRC_DIR)/net/nic/*.c)) \
$(patsubst $(SRC_DIR)/fs/%.c, $(BUILD_DIR)/%.o, $(wildcard $(SRC_DIR)/fs/*.c)) \
$(patsubst $(SRC_DIR)/wm/%.c, $(BUILD_DIR)/%.o, $(wildcard $(SRC_DIR)/wm/*.c)) \
$(patsubst $(SRC_DIR)/net/lwip/%.c, $(BUILD_DIR)/lwip/%.o, $(filter $(SRC_DIR)/net/lwip/%.c, $(C_SOURCES))) \
$(patsubst $(SRC_DIR)/arch/%.asm, $(BUILD_DIR)/%.o, $(ASM_SOURCES))
CFLAGS = -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding \ CFLAGS = -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding \
-fno-stack-protector -fno-stack-check -fno-lto -fPIE \ -fno-stack-protector -fno-stack-check -fno-lto -fPIE \
-m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone \ -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone \
-I$(SRC_DIR) -I$(SRC_DIR)/cli_apps -I$(SRC_DIR) -I$(SRC_DIR)/net/lwip -I$(SRC_DIR)/core -I$(SRC_DIR)/sys -I$(SRC_DIR)/mem -I$(SRC_DIR)/dev -I$(SRC_DIR)/net -I$(SRC_DIR)/net/nic -I$(SRC_DIR)/fs -I$(SRC_DIR)/wm
LDFLAGS = -m elf_x86_64 -nostdlib -static -pie --no-dynamic-linker \ LDFLAGS = -m elf_x86_64 -nostdlib -static -pie --no-dynamic-linker \
-z text -z max-page-size=0x1000 -T linker.ld -z text -z max-page-size=0x1000 -T linker.ld
NASMFLAGS = -f elf64 NASMFLAGS = -f elf64
# Limine Version LIMINE_VERSION = 10.8.2
LIMINE_VERSION = 7.0.0
LIMINE_URL_BASE = https://github.com/limine-bootloader/limine/raw/v$(LIMINE_VERSION) LIMINE_URL_BASE = https://github.com/limine-bootloader/limine/raw/v$(LIMINE_VERSION)
.PHONY: all clean run limine-setup .PHONY: all clean run limine-setup
all: $(ISO_IMAGE) all: $(ISO_IMAGE)
# Ensure build directories exist
$(BUILD_DIR): $(BUILD_DIR):
mkdir -p $(BUILD_DIR) mkdir -p $(BUILD_DIR)
mkdir -p $(BUILD_DIR)/cli_apps mkdir -p $(BUILD_DIR)
# Download Limine Binaries via Git
limine-setup: limine-setup:
@if [ ! -f limine/limine-bios.sys ]; then \ @if [ ! -f limine/limine-bios.sys ]; then \
echo "Limine binaries missing or invalid. Cloning v$(LIMINE_VERSION)-binary..."; \ echo "Limine binaries missing or invalid. Cloning v$(LIMINE_VERSION)-binary..."; \
rm -rf limine; \ rm -rf limine; \
git clone https://github.com/limine-bootloader/limine.git --branch=v$(LIMINE_VERSION)-binary --depth=1 limine; \ git clone https://github.com/limine-bootloader/limine.git --branch=v$(LIMINE_VERSION)-binary --depth=1 limine; \
fi fi
@if [ ! -f $(SRC_DIR)/limine.h ]; then \ @if [ ! -f $(SRC_DIR)/core/limine.h ]; then \
echo "Copying limine.h..."; \ echo "Copying limine.h..."; \
cp limine/limine.h $(SRC_DIR)/limine.h; \ cp limine/limine.h $(SRC_DIR)/core/limine.h; \
fi fi
@echo "Building Limine host utility..."; \ @echo "Building Limine host utility..."; \
$(MAKE) -C limine $(MAKE) -C limine
# Compile C Sources
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c | $(BUILD_DIR) limine-setup $(BUILD_DIR)/%.o: $(SRC_DIR)/%.c | $(BUILD_DIR) limine-setup
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@
# Compile CLI Apps C Sources $(BUILD_DIR)/%.o: $(SRC_DIR)/core/%.c | $(BUILD_DIR) limine-setup
$(BUILD_DIR)/cli_apps/%.o: $(SRC_DIR)/cli_apps/%.c | $(BUILD_DIR) limine-setup mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@
# Assemble ASM Sources $(BUILD_DIR)/%.o: $(SRC_DIR)/sys/%.c | $(BUILD_DIR) limine-setup
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.asm | $(BUILD_DIR) mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/mem/%.c | $(BUILD_DIR) limine-setup
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/dev/%.c | $(BUILD_DIR) limine-setup
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/net/%.c | $(BUILD_DIR) limine-setup
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/net/nic/%.c | $(BUILD_DIR) limine-setup
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/fs/%.c | $(BUILD_DIR) limine-setup
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/wm/%.c | $(BUILD_DIR) limine-setup
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/lwip/%.o: $(SRC_DIR)/net/lwip/%.c | $(BUILD_DIR) limine-setup
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/arch/%.asm | $(BUILD_DIR)
$(NASM) $(NASMFLAGS) $< -o $@
$(BUILD_DIR)/test_syscall.o: $(SRC_DIR)/arch/test_syscall.asm | $(BUILD_DIR)
$(NASM) $(NASMFLAGS) $< -o $@
$(BUILD_DIR)/user_test.o: $(SRC_DIR)/arch/user_test.asm | $(BUILD_DIR)
$(NASM) $(NASMFLAGS) $< -o $@
$(BUILD_DIR)/process_asm.o: $(SRC_DIR)/arch/process_asm.asm | $(BUILD_DIR)
$(NASM) $(NASMFLAGS) $< -o $@ $(NASM) $(NASMFLAGS) $< -o $@
# Link Kernel
$(KERNEL_ELF): $(OBJ_FILES) $(KERNEL_ELF): $(OBJ_FILES)
$(LD) $(LDFLAGS) -o $@ $(OBJ_FILES) $(LD) $(LDFLAGS) -o $@ $(OBJ_FILES)
$(MAKE) -C $(SRC_DIR)/userland
# Create ISO $(BUILD_DIR)/initrd.tar: $(KERNEL_ELF)
$(ISO_IMAGE): $(KERNEL_ELF) limine.cfg limine-setup rm -rf $(BUILD_DIR)/initrd
mkdir -p $(BUILD_DIR)/initrd/bin
mkdir -p $(BUILD_DIR)/initrd/Library/images/Wallpapers
mkdir -p $(BUILD_DIR)/initrd/Library/images/gif
mkdir -p $(BUILD_DIR)/initrd/Library/Fonts/Emoji
mkdir -p $(BUILD_DIR)/initrd/Library/DOOM
mkdir -p $(BUILD_DIR)/initrd/Library/bsh
mkdir -p $(BUILD_DIR)/initrd/docs
@for f in $(SRC_DIR)/userland/bin/*.elf; do \
if [ -f "$$f" ]; then cp "$$f" $(BUILD_DIR)/initrd/bin/; fi \
done
@for f in $(SRC_DIR)/images/wallpapers/*; do \
if [ -f "$$f" ]; then cp "$$f" $(BUILD_DIR)/initrd/Library/images/Wallpapers/; fi \
done
@for f in $(SRC_DIR)/images/gif/*.gif; do \
if [ -f "$$f" ]; then cp "$$f" $(BUILD_DIR)/initrd/Library/images/gif/; fi \
done
@for f in $(SRC_DIR)/fonts/*.ttf; do \
if [ -f "$$f" ]; then cp "$$f" $(BUILD_DIR)/initrd/Library/Fonts/; fi \
done
@for f in $(SRC_DIR)/fonts/Emoji/*.ttf; do \
if [ -f "$$f" ]; then cp "$$f" $(BUILD_DIR)/initrd/Library/Fonts/Emoji/; fi \
done
@if [ -f $(SRC_DIR)/library/bsh/bshrc ]; then cp $(SRC_DIR)/library/bsh/bshrc $(BUILD_DIR)/initrd/Library/bsh/; fi
@if [ -f $(SRC_DIR)/library/bsh/startup.bsh ]; then cp $(SRC_DIR)/library/bsh/startup.bsh $(BUILD_DIR)/initrd/Library/bsh/; fi
@if [ -f $(SRC_DIR)/library/bsh/boot.bsh ]; then cp $(SRC_DIR)/library/bsh/boot.bsh $(BUILD_DIR)/initrd/Library/bsh/; fi
@if [ -f $(SRC_DIR)/userland/games/doom/doom1.wad ]; then cp $(SRC_DIR)/userland/games/doom/doom1.wad $(BUILD_DIR)/initrd/Library/DOOM/; fi
@for f in $$(find docs -name '*.md' 2>/dev/null); do \
if [ -f "$$f" ]; then \
dir=$$(dirname "$$f"); \
mkdir -p $(BUILD_DIR)/initrd/"$$dir"; \
cp "$$f" $(BUILD_DIR)/initrd/"$$dir"/; \
fi \
done
@if [ -f README.md ]; then cp README.md $(BUILD_DIR)/initrd/; fi
@if [ -f LICENSE ]; then cp LICENSE $(BUILD_DIR)/initrd/; fi
@if [ -f limine.conf ]; then cp limine.conf $(BUILD_DIR)/initrd/; fi
cd $(BUILD_DIR)/initrd && COPYFILE_DISABLE=1 tar --exclude="._*" -cf ../initrd.tar *
$(ISO_IMAGE): $(KERNEL_ELF) $(BUILD_DIR)/initrd.tar limine.conf limine-setup
rm -rf $(ISO_DIR) rm -rf $(ISO_DIR)
mkdir -p $(ISO_DIR) mkdir -p $(ISO_DIR)
mkdir -p $(ISO_DIR)/EFI/BOOT mkdir -p $(ISO_DIR)/EFI/BOOT
# Copy Kernel and Config
cp $(KERNEL_ELF) $(ISO_DIR)/ cp $(KERNEL_ELF) $(ISO_DIR)/
cp limine.cfg $(ISO_DIR)/ cp limine.conf $(ISO_DIR)/
# Copy README cp $(BUILD_DIR)/initrd.tar $(ISO_DIR)/
cp README.md $(ISO_DIR)/ echo " module_path: boot():/initrd.tar" >> $(ISO_DIR)/limine.conf
# Copy user file.c if it exists @if [ -f splash.jpg ]; then cp splash.jpg $(ISO_DIR)/; fi
@if [ -f file.c ]; then cp file.c $(ISO_DIR)/; fi
# Copy Wallpaper (if it exists)
@if [ -f src/kernel/wallpaper.ppm ]; then cp src/kernel/wallpaper.ppm $(ISO_DIR)/; fi
# Copy Limine Bootloader Files (flat structure in binary branch)
cp limine/limine-bios.sys $(ISO_DIR)/ cp limine/limine-bios.sys $(ISO_DIR)/
cp limine/limine-bios-cd.bin $(ISO_DIR)/ cp limine/limine-bios-cd.bin $(ISO_DIR)/
cp limine/limine-uefi-cd.bin $(ISO_DIR)/ cp limine/limine-uefi-cd.bin $(ISO_DIR)/
# Create EFI Boot Files
cp limine/BOOTX64.EFI $(ISO_DIR)/EFI/BOOT/ cp limine/BOOTX64.EFI $(ISO_DIR)/EFI/BOOT/
cp limine/BOOTIA32.EFI $(ISO_DIR)/EFI/BOOT/ cp limine/BOOTIA32.EFI $(ISO_DIR)/EFI/BOOT/
# Generate ISO $(XORRISO) -as mkisofs -R -J -b limine-bios-cd.bin \
$(XORRISO) -as mkisofs -b limine-bios-cd.bin \
-no-emul-boot -boot-load-size 4 -boot-info-table \ -no-emul-boot -boot-load-size 4 -boot-info-table \
--efi-boot limine-uefi-cd.bin \ --efi-boot limine-uefi-cd.bin \
-efi-boot-part --efi-boot-image --protective-msdos-label \ -efi-boot-part --efi-boot-image --protective-msdos-label \
$(ISO_DIR) -o $(ISO_IMAGE) $(ISO_DIR) -o $(ISO_IMAGE)
# Install Limine to ISO (for BIOS boot)
./limine/limine bios-install $(ISO_IMAGE) ./limine/limine bios-install $(ISO_IMAGE)
clean: clean:
rm -rf $(BUILD_DIR) $(ISO_DIR) $(ISO_IMAGE) rm -rf $(BUILD_DIR) $(ISO_DIR) $(ISO_IMAGE)
$(MAKE) -C $(SRC_DIR)/userland clean
run: $(ISO_IMAGE) run-windows: $(ISO_IMAGE)
qemu-system-x86_64 -m 2G -serial stdio -cdrom $(ISO_IMAGE) -boot d \ qemu-system-x86_64 -m 4G -serial stdio -cdrom $< -boot d \
-smp 4 \
-audiodev coreaudio,id=audio0 -machine pcspk-audiodev=audio0 \ -audiodev coreaudio,id=audio0 -machine pcspk-audiodev=audio0 \
-netdev user,id=net0,hostfwd=udp::12345-:12345 -device e1000,netdev=net0 \ -vga std -global VGA.xres=1920 -global VGA.yres=1080 \
-vga std -global VGA.xres=1920 -global VGA.yres=1080 -drive file=disk.img,format=raw,file.locking=off
run-mac: $(ISO_IMAGE)
qemu-system-x86_64 -m 4G -serial stdio -cdrom $< -boot d \
-smp 4 \
-audiodev coreaudio,id=audio0 -machine pcspk-audiodev=audio0 \
-vga std -global VGA.xres=1920 -global VGA.yres=1080 \
-display cocoa,show-cursor=off \
-drive file=disk.img,format=raw,file.locking=off \
-cpu max
run-linux: $(ISO_IMAGE)
qemu-system-x86_64 -m 4G -serial stdio -cdrom $< -boot d \
-smp 4 \
-audiodev pa,id=audio0 -machine pcspk-audiodev=audio0 \
-vga std -global VGA.xres=1920 -global VGA.yres=1080 \
-display gtk,show-cursor=off \
-drive file=disk.img,format=raw,file.locking=off \
-cpu max

22
NOTICE Normal file
View File

@@ -0,0 +1,22 @@
NOTICE
------
This product includes software developed by Chris ("boreddevnl") as part of the BoredOS (Previously Brewkernel/BrewOS) project.
Copyright (C) 20242026 Chris / boreddevnl (previously boreddevhq)
All source files in this repository contain copyright and license
headers that must be preserved in redistributions and derivative works.
If you distribute or modify this project (in whole or in part),
you MUST:
- Retain all copyright and license headers at the top of each file.
- Include this NOTICE file along with any redistributions or
derivative works.
- Provide clear attribution to the original author in documentation
or credits where appropriate.
The above attribution requirements are informational and intended to
ensure proper credit is given. They do not alter or supersede the
terms of the GNU General Public License (GPL), which governs this work.

211
README.md
View File

@@ -1,164 +1,93 @@
# BoredOS 1.50 # BoredOS
BoredOS has now exited Beta stage and is "stable enough" to be put out as a "stable" product.
<img src="bored.svg" width="200" /> </br> <div align="center">
BoredOS is a simple x86_64 hobbyist operating system. <img src="boredos.svg" alt="BoredOS Logo" width="450" />
It features a DE (and WM), a FAT32 filesystem, customizable UI and much much more! <p><em>A modern x86_64 hobbyist operating system built from the ground up.</em></p>
![Screenshot](screenshot.jpg) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
*this screenshot might be outdated* ![Platform: x86_64](https://img.shields.io/badge/Platform-x86_64-lightgrey)
![Status: Active](https://img.shields.io/badge/Status-Active-brightgreen)
[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-FFDD00?logo=buymeacoffee&logoColor=000000)](https://buymeacoffee.com/boreddevhq)
</div>
---
BoredOS is a x86_64 operating system featuring a custom Desktop Environment (DE), a dedicated Window Manager (BoredWM), and a FAT32 filesystem. It balances low-level kernel exploration with a surprisingly capable userspace.
![Screenshot](screenshot.png)
> [!NOTE]
> *The screenshot above may represent a previous build and is subject to change as the UI evolves.*
---
## Features ## Features
- Drag and drop mouse centered UI
- Customizable UI
- Basic Networking Stack
- Bored WM
- Fat 32 FS
- 64-bit long mode support
- Multiboot2 compliant
- Text editor
- Markdown Viewer
- Minesweeper
- Markdown Viewer
- GUI Text editor
- Paint application
- IDT
- Ability to run on actual x86_64 hardware
- CLI
- (Limited) C Compiler
## Prerequisites ### System Architecture
* **64-bit Long Mode:** Fully utilizing the x86_64 architecture.
* **Symmetric Multi-Processing (SMP):** Full support for multi-core CPUs via Limine SMP.
* **LAPIC & IPI Scheduling:** Advanced interrupt handling and inter-processor communication for task distribution.
* **SMP-Safe Spinlocks:** Robust kernel-wide synchronization for VFS, process management, and the GUI.
* **Multiboot2 Compliant:** Bootable on real hardware and modern emulators.
* **Kernel Core:** Interrupt Descriptor Table (IDT) management and a robust syscall interface.
* **Filesystem:** Full **FAT32** support for persistent and in-memory storage.
* **Networking:** Includes the lwIP networking stack and a basic web browser.
To build BoredOS, you'll need the following tools installed: ### Graphical User Interface
* **BoredWM:** A custom Window Manager with drag-and-drop, mouse-centered interaction.
* **Customization:** Adjustable UI to suit your aesthetic.
* **Media Support:** Built-in image decoding. (PNG, GIF, JPEG, TGA, BMP)
- **x86_64 ELF Toolchain**: `x86_64-elf-gcc`, `x86_64-elf-ld` ### Included Applications
- **NASM**: Netwide Assembler for compiling assembly code * **Productivity:** GUI Text Editor calculator, Markdown Viewer, a simple browser and BoredWord.
- **xorriso**: For creating bootable ISO images * **Creativity:** A Paint application.
- **QEMU** (optional): For testing the kernel in an emulator * **Utilities:** Terminal, Task Manager, File Explorer, Clock and a (limited) C Compiler.
* **Games:** Minesweeper and DOOM.
On macOS, you can install these using Homebrew: ---
```sh
brew install x86_64-elf-binutils x86_64-elf-gcc nasm xorriso qemu
```
## Building ## 📚 Documentation
Simply run `make` from the project root: Explore the internal workings of BoredOS via our comprehensive guides in the [`docs/`](docs/) directory.
```sh * 📖 **[Documentation Index](docs/README.md)** Start here.
make * 🏗️ **[Architecture Overview](docs/architecture/core.md)** Deep dive into the kernel.
``` * 🔨 **[Building and Running](docs/build/usage.md)** Setup your build environment.
* 🚀 **[AppDev SDK](docs/appdev/custom_apps.md)** Build your own apps for BoredOS.
This will: ---
1. Compile all kernel C sources and assembly files
2. Link the kernel ELF binary
3. Generate a bootable ISO image (`boredos.iso`)
The build output is organized as follows: ## Support the Journey
- Compiled object files: `build/`
- ISO root filesystem: `iso_root/`
- Final ISO image: `boredos.iso`
## Running If you find this project interesting or helpful, consider fueling the development with a coffee!
### QEMU Emulation <a href="https://buymeacoffee.com/boreddevhq" target="_blank">
Run the kernel in QEMU:
```sh
make run
```
Or manually:
```sh
qemu-system-x86_64 -m 2G -serial stdio -cdrom boredos.iso -boot d
```
### Running on Real Hardware
*Warning: This is at YOUR OWN RISK. This software comes with ZERO warranty and may break your system.*
1. **Create bootable USB**: Use [Balena Etcher](https://www.balena.io/etcher/) to flash `boredos.iso` to a USB drive
2. **Prepare the system**:
- Enable legacy (BIOS) boot in your system BIOS/UEFI settings
- Disable Secure Boot if needed
3. **Boot**: Insert the USB drive and select it in the boot menu during startup
**Networking requires an Intel E1000 network card or similar while using Ethernet.**
4. **Tested Hardware**:
- HP EliteDesk 705 G4 DM (AMD Ryzen 5 PRO 2400G, Radeon Vega) **Tested, no networking.**
- Lenovo ThinkPad A475 20KL002VMH (AMD Pro A12-8830B, Radeon R7) **Tested, no networking.**
- Acer Aspire E5-573-311M (Intel Core i3-5005U, Intel HD Graphics) **Tested, no networking.**
## Project Structure
- `src/kernel/` - Main kernel implementation
- `boot.asm` - Boot assembly code
- `main.c` - Kernel entry point
- `*.c / *.h` - Core kernel modules (graphics, interrupts, filesystem, etc.)
- `cli_apps/` - Command-line applications
- `build/` - Compiled object files (generated during build)
- `iso_root/` - ISO filesystem layout (generated during build)
- `limine/` - Limine bootloader files (downloaded automatically)
- `linker.ld` - Linker script for x86_64 ELF
- `limine.cfg` - Limine bootloader configuration
- `Makefile` - Build configuration and targets
###
###
<h2 align="left">Help me brew some coffee! ☕️</h2>
###
<p align="left">
If you enjoy this project, and like what i'm doing here, consider buying me a coffee!
<br><br>
<a href="https://buymeacoffee.com/boreddevnl" target="_blank">
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="50" style="border-radius: 8px;" /> <img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="50" style="border-radius: 8px;" />
</a> </a>
</p>
###
## This project was previously labeled as "BrewKernel" ---
Brewkernel was a text only very simple (and messy) project i started 3 years ago. It was my first work in OSDev and i absolutely loved it. It sadly just got too messy and i myself couldn't understand my own code anymore. About a year ago i started work on BoredOS, and pushed a *"working"* version of it a few days ago as of writing this *(Feb. 10 2026)*
Brewkernel has already been deprecated and will not be accepting any pull requests or fix any issues as it is now a public archive. ## ⚠️ Project Disclaimer & Heritage
Thanks to everyone who helped me with Brewkernel, even if it were just ideas, and intend to keep working on this for the forseeable future!
**BoredOS** is the successor to **BrewKernel**, a project initiated in 2023.
While BrewKernel served as the foundational learning ground for this OS, it has been officially **deprecated and archived**. It no longer receives updates, bug fixes, or pull request reviews. BoredOS represents a complete architectural reboot, applying years of lessons learned to create a cleaner, more modular, and more capable system.
> [!IMPORTANT]
> Please ensure all issues, discussions, and contributions are directed to this repository. Legacy BrewKernel code is preserved for historical purposes only and is not compatible with BoredOS.
---
## Contributors
- **boreddevnl** — Project creator and lead maintainer.
- **Lluciocc** — Contributor.
## License ## License
Copyright (C) 2024-2026 boreddevnl **Copyright (C) 2024-2026 boreddevnl**
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Distributed under the **GNU General Public License v3**. See the `LICENSE` file for details.
NOTICE > [!IMPORTANT]
------ > This product includes software developed by Chris ("boreddevnl"). You must retain all copyright headers and include the original attribution in any redistributions or derivative works. See the `NOTICE` file for more details.
This product includes software developed by Chris ("boreddevnl") as part of the BoredOS (Previously Brewkernel/BrewOS) project.
Copyright (C) 20242026 Chris / boreddevnl (previously boreddevhq)
All source files in this repository contain copyright and license
headers that must be preserved in redistributions and derivative works.
If you distribute or modify this project (in whole or in part),
you MUST:
- Retain all copyright and license headers at the top of each file.
- Include this NOTICE file along with any redistributions or
derivative works.
- Provide clear attribution to the original author in documentation
or credits where appropriate.
The above attribution requirements are informational and intended to
ensure proper credit is given. They do not alter or supersede the
terms of the GNU General Public License (GPL), which governs this work.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -1,6 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="364" height="323" viewBox="0 0 364 323">
<g>
<path d="M 214.21 252.46 C206.89,254.00 191.49,255.09 186.50,254.42 C174.91,252.87 168.37,251.35 160.60,248.37 C131.04,237.05 110.95,215.05 101.36,183.50 C98.88,175.35 98.62,173.03 98.62,159.00 C98.62,144.97 98.88,142.65 101.36,134.50 C102.86,129.55 105.39,122.71 106.97,119.29 L 109.85 113.09 L 107.81 110.48 C105.03,106.95 102.00,98.70 102.00,94.67 C102.00,83.87 109.64,72.78 119.64,69.03 C130.66,64.91 141.50,67.22 149.75,75.46 C155.89,81.59 156.51,84.69 152.25,87.96 C150.74,89.13 146.31,92.51 142.41,95.48 C120.32,112.27 107.85,145.44 113.38,172.69 C117.57,193.40 127.18,209.55 142.78,222.09 C182.22,253.83 239.30,243.11 264.90,199.16 C272.19,186.63 276.79,166.84 275.57,153.25 C273.24,127.38 261.78,107.28 240.25,91.30 C231.06,84.48 230.86,82.84 238.25,75.45 C244.57,69.13 252.04,66.41 260.67,67.31 C274.35,68.72 286.00,81.01 286.00,94.02 C286.00,98.35 283.36,105.84 280.53,109.55 L 277.90 113.00 L 280.83 119.25 C297.85,155.52 289.63,198.90 260.39,227.11 C247.18,239.85 230.45,249.04 214.21,252.46 ZM 248.58 185.10 C246.34,186.12 244.05,186.93 243.50,186.89 C240.22,186.68 236.44,184.60 230.84,179.94 C227.35,177.03 221.35,172.62 217.50,170.14 C209.66,165.10 207.76,163.26 206.01,159.02 C202.91,151.53 213.38,143.02 226.75,142.17 C244.76,141.02 257.91,150.18 258.82,164.52 C259.48,174.91 256.11,181.68 248.58,185.10 ZM 148.72 186.01 C148.05,186.02 146.60,186.24 145.50,186.50 C143.24,187.03 137.53,184.77 134.64,182.21 C131.66,179.56 128.02,170.93 128.02,166.50 C128.02,161.61 131.74,153.45 135.62,149.80 C141.20,144.58 147.51,142.52 158.00,142.51 C166.46,142.50 168.11,142.81 173.08,145.33 C181.97,149.83 184.53,156.84 179.47,162.85 C178.08,164.50 173.18,168.33 168.58,171.36 C163.97,174.40 157.89,178.93 155.07,181.44 C152.24,183.95 149.39,186.01 148.72,186.01 ZM 201.14 210.27 C198.36,212.87 195.15,215.00 194.00,215.00 C189.68,215.00 178.00,201.55 178.00,196.58 C178.00,193.75 182.20,192.69 193.47,192.68 C199.54,192.67 205.49,192.98 206.70,193.38 C211.98,195.11 209.59,202.37 201.14,210.27 Z" fill="rgb(255,255,255)"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

21
boredos.svg Normal file
View File

@@ -0,0 +1,21 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 415 130" width="100%">
<style>
text {
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
font-size: 16px;
white-space: pre;
font-weight: bold;
}
.magenta { fill: #B589D6; }
.blue { fill: #569CD6; }
.cyan { fill: #4EC9B0; }
.text-color { fill: #FFFFFF; }
</style>
<text x="0" y="20" xml:space="preserve"><tspan class="magenta">====================== </tspan><tspan class="text-color">__ ____ ____ </tspan></text>
<text x="0" y="40" xml:space="preserve"><tspan class="magenta">===================== </tspan><tspan class="text-color">/ /_ / __ \/ ___\</tspan></text>
<text x="0" y="60" xml:space="preserve"><tspan class="blue">==================== </tspan><tspan class="text-color">/ __ \/ / / /\___ \</tspan></text>
<text x="0" y="80" xml:space="preserve"><tspan class="blue">=================== </tspan><tspan class="text-color">/ /_/ / /_/ /____/ /</tspan></text>
<text x="0" y="100" xml:space="preserve"><tspan class="cyan">================== </tspan><tspan class="text-color">/_.___/\____//_____/ </tspan></text>
<text x="0" y="120" xml:space="preserve"><tspan class="cyan">================= </tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

43
docs/README.md Normal file
View File

@@ -0,0 +1,43 @@
<div align="center">
<h1>BoredOS Documentation</h1>
<p><em>Internal guides, architecture, and application development.</em></p>
</div>
---
Welcome to the documentation for BoredOS! This directory contains detailed guides on how the OS functions, how to build it, and how to develop applications for it.
## 📚 Table of Contents
The documentation is organized into three main categories:
### 1. 🏗️ [Architecture](architecture/)
Explains the logical layout of the kernel and internal components.
- [`Core`](architecture/core.md): Kernel source layout and the boot process (Limine, Multiboot2).
- [`Memory`](architecture/memory.md): Physical Memory Management (PMM) and Virtual Memory Management (VMM).
- [`Filesystem`](architecture/filesystem.md): Virtual File System (VFS) and the RAM-based FAT32 simulation.
- [`Window Manager`](architecture/window_manager.md): How the built-in Window Manager natively handles graphics, events, and compositing.
### 2. 🔨 [Building and Deployment](build/)
Instructions for compiling the OS from source.
- [`Toolchain`](build/toolchain.md): Prerequisites and cross-compiler setup (`x86_64-elf-gcc`, `nasm`, `xorriso`).
- [`Usage`](build/usage.md): Understanding the Makefile targets, QEMU emulation, and flashing to bare metal hardware.
### 3. 🚀 [Application Development](appdev/)
The SDK and toolchain guides for creating your own `.elf` userland binaries.
- [`SDK Reference`](appdev/sdk_reference.md): Explanation of the custom `libc` wrappers (`stdlib.h`, `string.h`) and system calls.
- [`UI API`](appdev/ui_api.md): Drawing on the screen, creating windows, and polling the event loop using `libui.h`.
- [`Widget API`](appdev/widget_api.md): High-level UI components like buttons, textboxes, and scrollbars using `libwidget.h`.
- [`Custom Apps`](appdev/custom_apps.md): A step-by-step tutorial on writing a new graphical C application, editing the Makefile, and bundling it into the ISO.
- [`Example Apps`](appdev/examples/README.md): A collection of sample C applications ranging from basic terminal output to advanced TCP networking.
- [`Grapher`](appdev/grapher.md): Full reference for the built-in mathematical graphing application — equation syntax, keyboard controls, architecture, and configuration.
### 4. [Usage](usage/)
General guides on how to interact with the OS.
- [`Booting`](usage/booting.md): How to use the Limine bootloader and toggle kernel boot flags like `-v`.
- [`Desktop`](usage/desktop.md): Window management, shortcuts, and desktop interaction.
- [`Lumos`](usage/lumos.md): Using the system-wide search (`Shift + Ctrl + Space`).
- [`Terminal`](usage/terminal.md): Command line interface, redirection, and common commands.
- [`Launching Apps`](usage/launching_apps.md): Ways to launch files and applications, plus a software overview.
---

View File

@@ -0,0 +1,90 @@
<div align="center">
<h1>Creating a Custom App</h1>
<p><em>A step-by-step tutorial on writing a new graphical C application.</em></p>
</div>
---
This guide explains how to write a new "Hello World" application locally, compile it as an `.elf` binary into the `bin/` folder, and launch it inside BoredOS.
> [!TIP]
> **Looking for working code?** Check out the [Examples Directory](examples/README.md) for full source code demonstrating basic CLI, Windows, Animations, and TCP Networking.
## Step 1: Write the C Source
Applications reside entirely in the `src/userland/` directory. Create a new file, for example, `src/userland/gui/hello.c`.
> [!TIP]
> Group CLI apps into `src/userland/cli/` and windowed apps into `src/userland/gui/` for organization.
```c
// src/userland/gui/hello.c
#include <stdlib.h>
#include <libui.h>
#include <syscall.h>
int main(void) {
// Attempt to open a 300x200 window
ui_window_t wid = ui_window_create("My Custom App", 100, 100, 300, 200);
if (wid < 0) {
printf("Error creating window!\n");
return 1;
}
// Write text in center
ui_draw_string(wid, 50, 90, "Hello, BoredOS!!", 0xFFFFFFFF);
// Commit drawing to screen
ui_mark_dirty(wid, 0, 0, 300, 200);
gui_event_t event;
while (1) {
if (ui_get_event(wid, &event)) {
if (event.type == GUI_EVENT_CLOSE) {
break; // Exit loop if 'X' is clicked
}
}
sys_yield();
}
return 0; // Returning 0 smoothly exits the process via crt0.asm
}
```
## Step 2: Edit the Makefile
Now you need to tell the build system to compile `hello.c`. Fortunately, the `src/userland/Makefile` is designed to detect new C files largely automatically!
1. Open `src/userland/Makefile`.
2. Find the line specifying `APP_SOURCES_FULL`:
```make
APP_SOURCES_FULL = $(wildcard cli/*.c gui/*.c sys/*.c games/*.c *.c)
```
Since you placed the file in `gui/hello.c`, the wildcard logic will pick it up automatically.
3. The Makefile will generate `bin/hello.elf` during the build phase.
## Step 3: Bundle it into the OS
The main overarching `Makefile` (in the project root) takes binaries from `src/userland/bin/*.elf` and places them into the `iso_root/bin/` directory, while also adding them to `limine.conf` as loadable boot modules.
1. Go back to the root of the OS:
```sh
cd ../..
```
2. Compile the entire project to build the ISO and test in QEMU:
```sh
make clean && make run
```
## Step 4: Run it inside BoredOS
1. When BoredOS boots, launch the **Terminal** application.
2. The OS automatically maps built applications to standard shell commands. Simply type your application's filename (without the `.elf` extension).
3. Type `hello` in the terminal and press Enter.
4. Your custom window will appear!
> [!NOTE]
> You can also open your app by opening the file explorer, navigating to the `bin` directory, and double-clicking the executable.
---

View File

@@ -0,0 +1,52 @@
<div align="center">
<h1>Example 01: Hello CLI</h1>
<p><em>The absolute basics. Writing a terminal program.</em></p>
</div>
---
This example demonstrates the bare minimum structure of a BoredOS application that outputs text to the standard output (usually the Terminal executing the binary).
## 📝 Concepts Introduced
* Including `stdlib.h` for basic IO.
* The `main()` entry point.
* Using `printf()` for formatted output.
---
## 💻 The Code (`src/userland/cli/hello_world.c`)
```c
#include <stdlib.h>
int main(int argc, char **argv) {
// Standard library initialization is handled automatically by crt0.asm
// Print a simple string to the terminal
printf("Hello, World from BoredOS Userland!\n");
// Print some formatted data
int favorite_number = 67;
printf("Did you know my favorite number is %d?\n", favorite_number);
// Returning from main automatically terminates the process cleanly
return 0;
}
```
## 🛠️ How it Works
1. **`#include <stdlib.h>`**: We include the SDK's standard library header which gives us access to `printf`.
2. **`int main(...)`**: Every process begins execution here (managed transparently by `crt0.asm`).
3. **`printf(...)`**: The SDK routes this call internally directly to the `SYS_WRITE` system call, making it available on the terminal.
4. **`return 0`**: A successful exit code.
## 🚀 Running It
If you build the project, you can open the Terminal and type:
```sh
/ # hello_world
Hello, World from BoredOS Userland!
Did you know my favorite number is 67?
/ #
```

View File

@@ -0,0 +1,71 @@
<div align="center">
<h1>Example 02: Basic Window</h1>
<p><em>An introduction to libui and creating graphical apps.</em></p>
</div>
---
This example demonstrates how to create an empty window that stays active on the screen until the user explicitly closes it by clicking the 'X' button.
## 📝 Concepts Introduced
* Including `libui.h` and the event structure.
* Creating a `ui_window_t` handle.
* Creating an infinite event loop using `ui_get_event()`.
* Yielding CPU time to the kernel via `sys_yield()`.
---
## 💻 The Code (`src/userland/gui/basic_window.c`)
```c
#include <stdlib.h>
#include <libui.h>
#include <syscall.h>
int main(void) {
// 1. Ask the Window Manager to create a new window
// Arguments are: Title, X Position, Y Position, Width, Height
ui_window_t wid = ui_window_create("My First GUI", 100, 100, 400, 300);
if (wid < 0) {
printf("Failed to create the window!\n");
return 1;
}
// 2. Define our event object
gui_event_t event;
// 3. Enter the main event loop
while (1) {
// ui_get_event is non-blocking. It returns true if an event was waiting.
if (ui_get_event(wid, &event)) {
// Check what type of event occurred
if (event.type == GUI_EVENT_CLOSE) {
// The user clicked the 'X' button in the titlebar!
printf("Window closed cleanly by user.\n");
break; // Break the infinite loop
}
}
// 4. CRITICAL: Yield the remainder of our timeslice
// If we don't do this, the while(1) loop will consume 100% of the CPU
// and starve the rest of the OS!
sys_yield();
}
// Returning from main will automatically destroy the window and exit the process.
return 0;
}
```
## 🛠️ How it Works
1. **Window Handle (`wid`)**: `ui_window_create` sends a request to the kernel. The kernel allocates the memory for the window and returns a numerical ID (the handle) that we use for all future interactions with that specific window.
2. **The Event Loop**: Graphical programs run forever until closed. The `while (1)` loop serves this purpose.
3. **Polling**: `ui_get_event` asks the kernel, "Hey, did the user click my window or press a key since the last time I asked?". It is non-blocking, so it immediately returns `false` if nothing happened.
4. **CPU Yielding**: Since we are constantly polling in a tight loop, we call `sys_yield()` at the end of the loop frame. This politely tells the OS scheduler, "I'm done checking for events, go ahead and let another program run for a bit."
## 🚀 Running It
Launch the Terminal and type `basic_window`. You'll see an empty window appear that you can move around the screen!

View File

@@ -0,0 +1,92 @@
<div align="center">
<h1>Example 03: Bouncing Ball</h1>
<p><em>Animating graphics and managing application state.</em></p>
</div>
---
This example builds upon the `02_basic_window` guide. It demonstrates how to constantly update the screen to simulate a bouncing square moving freely inside the window bounds.
## 📝 Concepts Introduced
* Maintaining application state across frames (Velocity/Position).
* Drawing primitives (`ui_fill_rect`, `ui_draw_string`).
* The importance of clearing the screen on a new frame.
* Explicitly forcing standard visual updates via `ui_mark_dirty()`.
---
## 💻 The Code (`src/userland/gui/bounce.c`)
```c
#include <stdlib.h>
#include <libui.h>
#include <syscall.h>
// Window Dimensions
#define W_WIDTH 400
#define W_HEIGHT 300
// Square Dimensions
#define SQ_SIZE 30
int main(void) {
ui_window_t wid = ui_window_create("Bouncing Box Animation", 50, 50, W_WIDTH, W_HEIGHT);
if (wid < 0) return 1;
// Define object state variables
int pos_x = 50;
int pos_y = 50;
int vel_x = 2; // Move 2 pixels per frame horizontally
int vel_y = 2; // Move 2 pixels per frame vertically
gui_event_t event;
while (1) {
// 1. Process Events
while (ui_get_event(wid, &event)) {
if (event.type == GUI_EVENT_CLOSE) {
return 0; // Exit cleanly
}
}
// 2. Physics & Logic Update
pos_x += vel_x;
pos_y += vel_y;
// Collision logic (Bounce off edges)
// The window has a 20px title bar, so the usable client height is W_HEIGHT - 20.
if (pos_x <= 0 || pos_x + SQ_SIZE >= W_WIDTH) {
vel_x = -vel_x; // Reverse horizontal direction
}
if (pos_y <= 0 || pos_y + SQ_SIZE >= W_HEIGHT - 20) {
vel_y = -vel_y; // Reverse vertical direction
}
// 3. Rendering Update
// Step A: Clear the entire background to Black (0xFF000000)
ui_draw_rect(wid, 0, 0, W_WIDTH, W_HEIGHT, 0xFF000000);
// Step B: Draw our shape in Red (0xFFFF0000) at the new position
ui_draw_rect(wid, pos_x, pos_y, SQ_SIZE, SQ_SIZE, 0xFFFF0000);
// Step C: Draw some UI text over the animation in White
ui_draw_string(wid, 10, 10, "BoredOS Animation Demo!", 0xFFFFFFFF);
// Step D: Instruct the compositor to flush our drawing buffer to the physical screen
ui_mark_dirty(wid, 0, 0, W_WIDTH, W_HEIGHT);
// 4. Yield and throttle
sys_yield();
}
return 0;
}
```
## 🛠️ How it Works
1. **State Management**: We store `pos_x`, `pos_y`, `vel_x`, and `vel_y`. These variables represent the "physics" of our system. Notice that they update *outside* the event-checking logic so that the animation runs even if the user isn't clicking the mouse.
2. **Screen Clearing**: We *must* fill the screen with black (`ui_draw_rect(wid, 0, 0, W_WIDTH, W_HEIGHT, ...)`). If we don't clear the screen, the red square will leave a permanent trailing smear everywhere it goes!
3. **The Double Buffer**: `ui_draw_rect` and `ui_draw_string` do not immediately appear on your monitor. They just color a hidden buffer within the kernel.
4. **`ui_mark_dirty`**: This is the crucial command that tells the kernel Window Manager, "I'm done drawing my frame. Can you quickly copy my hidden buffer over to the real screen now?"
> [!WARNING]
> Because `sys_yield()`'s pause duration depends heavily on CPU load and how many other processes are running (or QEMU emulation speed), tying physics/movement strictly to loops can make the game run faster on faster computers. Advanced developers will want to calculate delta time (time elapsed since the last frame) for smooth motion.

View File

@@ -0,0 +1,92 @@
<div align="center">
<h1>Example 04: TCP HTTP Client</h1>
<p><em>Utilizing lwIP to establish an outbound TCP connection.</em></p>
</div>
---
This advanced example demonstrates the steps required to use the raw network system calls to establish a connection with an external HTTP server and dump the response over the terminal.
## 📝 Concepts Introduced
* Verifying the network state (`sys_network_is_initialized`, `sys_network_has_ip`).
* Performing DNS lookups manually via `sys_dns_lookup`.
* Managing strict TCP flow logic (`sys_tcp_connect`, send, block for receive).
* Using the terminal `SYS_WRITE` output for debugging.
---
## 💻 The Code (`src/userland/cli/http_get.c`)
```c
#include <stdlib.h>
#include <string.h>
#include <syscall.h>
int main(void) {
if (!sys_network_is_initialized() || !sys_network_has_ip()) {
printf("Network is unreachable! Make sure you inited the network first!\n");
return 1;
}
// 1. Resolve host name to IP
const char *target_host = "boreddev.nl";
net_ipv4_address_t server_ip;
printf("Resolving %s...\n", target_host);
if (sys_dns_lookup(target_host, &server_ip) < 0) {
printf("DNS Lookup failed.\n");
return 1;
}
printf("Resolved to: %d.%d.%d.%d\n", server_ip.bytes[0], server_ip.bytes[1],
server_ip.bytes[2], server_ip.bytes[3]);
// 2. Establish a TCP connection on port 80 (HTTP)
printf("Connecting...\n");
if (sys_tcp_connect(&server_ip, 80) < 0) {
printf("Connection failed.\n");
return 1;
}
printf("Connected! Sending GET request...\n");
// 3. Format and send the raw HTTP Request
char request[256];
strcpy(request, "GET / HTTP/1.1\r\nHost: ");
strcat(request, target_host);
strcat(request, "\r\nConnection: close\r\n\r\n");
if (sys_tcp_send(request, strlen(request)) < 0) {
printf("Failed to send data.\n");
sys_tcp_close();
return 1;
}
// 4. Block and wait for response data
char recv_buf[512];
int bytes_received;
printf("\n--- RESPONSE ---\n");
while ((bytes_received = sys_tcp_recv(recv_buf, sizeof(recv_buf) - 1)) > 0) {
recv_buf[bytes_received] = '\0'; // Null-terminate the chunk
printf("%s", recv_buf); // Print the chunk to stdout
}
// 5. Cleanup
printf("\n--- END RESPONSE ---\n");
sys_tcp_close();
printf("Connection closed.\n");
return 0;
}
```
## 🛠️ How it Works
1. **Network Setup**: First, we must ensure the host machine or QEMU environment gave BoredOS a valid IP address via DHCP. The `sys_network_has_ip()` check prevents our app from hanging trying to route data to nowhere.
2. **DNS (`sys_dns_lookup`)**: Since we want to connect to a domain name, not a raw IP, we query the DNS server configured by the OS (which it received via DHCP).
3. **Connection (`sys_tcp_connect`)**: We block the application thread while the OS performs the 3-way TCP handshake over port 80.
4. **Payload (`sys_tcp_send`)**: We format a compliant HTTP/1.1 payload representing a simple GET request for the root directory `/`.
5. **Chunked Receiving (`sys_tcp_recv`)**: The server's response might be larger than our `recv_buf` (512 bytes). Therefore, we loop. `sys_tcp_recv` blocks execution until data arrives. If it returns `0`, the remote server cleanly closed the connection (which happens automatically because we specified `Connection: close` in our request payload!).
## 🚀 Running It
Make sure QEMU is running with networking enabled. Launch the terminal and type `http_get`. You will see the raw headers and HTML source of the target webpage scroll down the CLI interface!

View File

@@ -0,0 +1,28 @@
<div align="center">
<h1>Example Applications</h1>
<p><em>From basic output to complex Graphical and Network applications.</em></p>
</div>
---
Welcome to the examples directory! These guides are designed to help you understand how to write C applications for the BoredOS userland, utilizing the custom `libc` SDK.
The examples are listed in order of increasing complexity. Click on a tutorial to view the complete source code and an explanation of the concepts it introduces.
## 🟢 Beginner
* **[`01_hello_cli.md`](01_hello_cli.md)**: The absolute basics. Learn how to write a simple Terminal program that outputs text and processes standard system calls.
* **[`02_basic_window.md`](02_basic_window.md)**: An introduction to `libui.h`. Learn how to create an empty window, set up a basic event loop, and handle the "Close" button cleanly.
## 🟡 Intermediate
* **[`03_bouncing_ball.md`](03_bouncing_ball.md)**: Dive deeper into graphical rendering. This example introduces the `ui_mark_dirty` command, framerate independence via `sys_yield()`, and state management to animate a shape moving around the screen and bouncing off the window edges.
## 🔴 Advanced
* **[`04_tcp_client.md`](04_tcp_client.md)**: Using the lwIP networking stack. This example demonstrates how to perform a DNS lookup, connect to an external server over TCP (like an HTTP server), send a raw request, and print the response to the terminal.
---
> [!TIP]
> If you want to test these out, simply create a new `.c` file in `src/userland/cli/` (for terminal apps) or `src/userland/gui/` (for windowed apps), paste the example code, then run `make clean && make run` from the project root!

345
docs/appdev/grapher.md Normal file
View File

@@ -0,0 +1,345 @@
<div align="center">
<h1>Grapher</h1>
<p><em>An interactive mathematical expression plotter for BoredOS, supporting both 2D and 3D visualizations.</em></p>
</div>
---
Grapher is a built-in GUI application that lets you type any mathematical equation and see it plotted in real time. It supports 2D explicit and implicit curves as well as full 3D surface visualization — including both explicit surfaces (`z = f(x, y)`) and implicit surfaces (`f(x, y, z) = c`).
> [!NOTE]
> Grapher is located at `src/userland/gui/grapher.c`. It runs as a standard BoredOS GUI process and can be launched from the terminal or from the dock.
---
## Features at a Glance
| Feature | Details |
|---|---|
| **2D Explicit** | Plot `y = f(x)` curves |
| **2D Implicit** | Plot any `f(x, y) = g(x, y)` contour via marching squares |
| **3D Explicit** | Plot `z = f(x, y)` surfaces |
| **3D Implicit** | Plot any `f(x, y, z) = c` surface |
| **Rendering modes** | Wireframe and filled polygon modes |
| **Height coloring** | Surfaces are colored by a blue→green→yellow→red gradient based on Z height |
| **Phong-style shading** | Filled mode computes per-face normals and applies diffuse + ambient lighting |
| **Parallel rendering** | Evaluation and projection are distributed across 4 worker threads via `sys_parallel_run` |
| **Preset equations** | 7 built-in presets accessible from the toolbar |
| **Auto-fit** | 2D view auto-fits the Y axis to the plotted curve on first plot |
| **Atomic Color-Depth Buffer** | All 3D drawing uses a 64-bit atomic buffer to prevent depth/color race conditions |
---
## Launching Grapher
From the BoredOS terminal:
```sh
grapher
```
Or click the **Grapher icon** in the system dock.
---
### Toolbar Controls
| Control | Function |
|---|---|
| **Equation box** | Type your mathematical expression, then press **Enter** or **Plot** |
| **Plot button** | Parse and render the current equation |
| **Wire / Filled button** | Toggle wireframe vs. shaded polygon mode (3D only) |
| **Presets button** | Open a dropdown of example equations |
### Status Bar Controls (3D mode)
| Control | Function |
|---|---|
| **`+` button** | Increase the 3D world range (zoom out in world space) |
| **`-` button** | Decrease the 3D world range (zoom in in world space) |
---
## Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| **Enter** (in equation box) | Plot the equation |
| **Ctrl + R** | Reset the view to defaults |
| **F** | Toggle filled / wireframe rendering (3D mode) |
| **Scroll wheel** | Zoom in/out (2D mode adjusts viewport; 3D mode adjusts camera zoom) |
| **Right-click drag** | Rotate the 3D surface |
---
## Writing Equations
Grapher parses equations entered as plain text. It supports a subset of mathematical notation with automatic implicit multiplication.
### Supported Functions
| Syntax | Meaning |
|---|---|
| `sin(x)` | Sine |
| `cos(x)` | Cosine |
| `tan(x)` | Tangent |
| `sqrt(x)` | Square root |
| `abs(x)` | Absolute value |
| `log(x)` | Natural logarithm (base *e*) |
### Supported Operators
| Operator | Meaning |
|---|---|
| `+` `-` `*` `/` | Arithmetic |
| `^` | Exponentiation (right-associative) |
| `(` `)` | Grouping |
### Special Values
| Token | Value |
|---|---|
| `pi` or `PI` | π ≈ 3.14159… |
### Implicit Multiplication
Adjacent tokens that would normally require a `*` are multiplied automatically:
```
2x → 2 * x
3sin(x) → 3 * sin(x)
(x+1)(x) → (x+1) * x
```
### How Equations Are Classified
Grapher looks at which variables appear in your equation to automatically choose the rendering mode:
| Equation form | Auto-detected as |
|---|---|
| `y = f(x)` or just `f(x)` | 2D explicit |
| `f(x, y) = g(x, y)` | 2D implicit |
| `z = f(x, y)` | 3D explicit |
| `f(x, y, z) = c` | 3D implicit |
If you omit the `=` sign, Grapher treats the input as `y = <expression>` when no `y` or `z` is present, or as `<expression> = 0` otherwise.
---
## Example Equations
### 2D Examples
```
y = sin(x)
y = x^2
y = cos(x)*x
y = abs(x) - 2
x^2 + y^2 = 25 ← circle (implicit)
y = log(x)
```
### 3D Explicit Examples
```
z = sin(x)*cos(y)
z = x^2 - y^2 ← saddle surface
z = sqrt(25 - x^2 - y^2)
```
### 3D Implicit Examples
```
x^2 + y^2 + z^2 = 25 ← sphere
x^2 + y^2 = 16 ← cylinder
x^2 + y^2 - z^2 = 1 ← hyperboloid
```
---
## Navigation Controls
### 2D Mode
| Input | Action |
|---|---|
| **Scroll up** | Zoom in |
| **Scroll down** | Zoom out |
| **Ctrl+R** | Reset to default view (`x: [-10, 10]`) |
### 3D Mode
| Input | Action |
|---|---|
| **Right-click drag** | Rotate the surface (orbit camera) |
| **Scroll up** | Zoom camera in |
| **Scroll down** | Zoom camera out |
| **`+` / `-` buttons** | Increase / decrease world range |
| **Ctrl+R** | Reset rotation and zoom |
> [!TIP]
> In 3D mode, the surface auto-rotates slowly by default. This can be disabled by setting `#define ROTATE 0` in the source file.
---
## Architecture Overview
Grapher is implemented as a single self-contained C file. Below is a high-level breakdown of its major components:
### Math Library
Grapher uses the BoredOS freestanding **`libc/math.h`** library, which provides all the math functions it needs without depending on a host standard library:
| Function | Description |
|---|---|
| `sin`, `cos`, `tan` | Trigonometry via Taylor series (8 terms, range-reduced to `[-π, π]`) |
| `sqrt` | Newton-Raphson iteration (25 steps) |
| `log` | Natural logarithm via Padé-style series |
| `log2`, `log10` | Derived from `log` |
| `exp` | Range-reduced Taylor series for `e^x` |
| `pow` | Integer exponents use fast binary exponentiation; fractional exponents use `exp(e * log(b))` |
| `fabs`, `fmod` | Absolute value and floating-point remainder |
| `floor`, `ceil` | Rounding |
| `sinh`, `cosh`, `tanh` | Hyperbolic functions |
| `hypot`, `fmin`, `fmax`, `fclamp` | Utility helpers |
The constants `M_PI`, `M_E`, `M_LN2`, `M_SQRT2` are also defined in the header.
This library is automatically linked into every userland ELF — any app can `#include "math.h"` to use it.
### Expression Parser
Equations are parsed in three stages:
1. **Tokenizer** (`tokenize`) — converts the input string into a flat token array. Handles implicit multiplication by inserting `*` tokens where needed.
2. **Recursive Descent Parser** (`parse_expr`, `parse_term`, `parse_power`, `parse_unary`, `parse_atom`) — produces an Abstract Syntax Tree (AST) with up to `MAX_NODES = 128` nodes.
3. **Bytecode Compiler** (`compile_ast`) — walks the AST in post-order and emits a flat instruction sequence for a simple stack machine. This avoids recursive evaluation during rendering hot paths.
The resulting bytecode is then executed by `run_bc` for every sample point.
### Rendering Pipeline
#### 2D Rendering
- **Explicit** — evaluates `y = f(x)` at every pixel column and connects adjacent samples with Bresenham lines.
- **Implicit** — applies **marching squares** on a 200×130 grid to find sign changes in `f(x,y) - g(x,y)` and plots intersection pixels.
#### 3D Rendering
The 3D pipeline uses a multi-pass system parallelized across worker threads:
| Pass | Function | Description |
|---|---|---|
| 1 | **Evaluation** | Samples the surface at grid points. For implicit surfaces, this uses **tri-axis marching**. |
| 2 | **Projection** | Projects 3D world coordinates to 2D screen coordinates with perspective. |
| 3 | **Drawing** | Rasterizes wireframe lines or filled triangles with Z-buffering. |
##### Tri-Axis Marching (Implicit Surfaces)
Unlike explicit surfaces that only need one evaluation per grid point, implicit surfaces require finding roots of $f(x, y, z) = 0$. To ensure complete surface connectivity and eliminate "cracks," Grapher marches along all three primary axes:
1. **X-Axis Pass**: For every $(y, z)$ pair, march along $x$.
2. **Y-Axis Pass**: For every $(x, z)$ pair, march along $y$.
3. **Z-Axis Pass**: For every $(x, y)$ pair, march along $z$.
Each pass uses a multi-stage root finder (170 linear steps followed by 15 bisection iterations). By sampling along all three axes, the engine "catches" surfaces that are nearly parallel to any specific marching direction, ensuring that vertical walls and steep gradients are rendered solidly from any viewing angle.
##### Atomic Color-Depth Buffer
To prevent "z-fighting" and race conditions between parallel threads, Grapher uses a 64-bit atomic buffer (`graph_czb`). Each 64-bit word stores:
- **Upper 32 bits**: Z-depth (integer).
- **Lower 32 bits**: Pixel color (0xAARRGGBB).
A single `__atomic_compare_exchange_n` operation ensures that a pixel's color and depth are updated together only if the new depth is closer to the camera than the existing one.
Surface normals are estimated using central finite differences of the implicit function.
#### Filled Mod
When filled mode is active, each quad cell is split into two triangles. The average surface normal across the four corner vertices is computed and fed into `apply_shading`, which calculates:
```
intensity = ambient(0.3) + diffuse(0.7) * dot(normal, light_direction)
```
The light direction is fixed at `(0.577, 0.707, 0.408)` (normalized diagonal).
#### Z-Buffer
The depth buffer (`graph_zb`) stores integer depth values. `gfb_pixel_z` uses a **compare-and-swap (CAS) loop** via `__atomic_compare_exchange_n` so multiple parallel draw threads cannot produce race conditions.
### Coordinate Systems
#### 2D
World coordinates map linearly to screen pixels:
```c
screen_x = (wx - view_x_min) / (view_x_max - view_x_min) * graph_w
screen_y = (view_y_max - wy) / (view_y_max - view_y_min) * graph_h
```
#### 3D
Points are first rotated by two Euler angles (`rot_y`, `rot_x`) then projected with a simple perspective divide:
```
persp = d / (pz + d) // d = range_3d * 5
sx = px * scale * persp + screen_cx
sy = -py * scale * persp + screen_cy
```
---
## Configuration Constants
These can be changed at the top of `grapher.c` to tune behaviour:
| Constant | Default | Effect |
|---|---|---|
| `ROTATE` | `1` | Set to `0` to disable auto-rotation in 3D mode |
| `GRID_3D` | `41` | Grid resolution for 3D sampling. Higher = more detail, much slower |
> [!WARNING]
> Setting `GRID_3D` too high (e.g. 9000) will exhaust available memory. The `surf` grid and `surf_x`/`surf_y_3d` arrays are statically allocated at compile time: memory usage grows as **O(GRID_3D²)**. Values above ~512 are not recommended.
> [!TIP]
> `GRID_3D = 256` gives a good balance of detail and performance on typical BoredOS hardware emulation.
---
## Color Palette
3D surfaces are colored by height using a 4-stop rainbow ramp:
```
Low → Blue → Cyan → Green → Yellow → Red → High
```
---
## Preset Equations
The built-in presets are shown in the dropdown when you click **Presets**:
| Label | Type |
|---|---|
| `y = sin(x)` | 2D explicit |
| `y = x^2` | 2D explicit |
| `y = cos(x)*x` | 2D explicit |
| `z = sin(x)*cos(y)` | 3D explicit |
| `z = x^2 - y^2` | 3D explicit |
| `x^2+y^2+z^2=25` | 3D implicit (sphere) |
| `x^2+y^2=16` | 3D implicit (cylinder) |
---
## Known Limitations
- **No parameter slider** — equations are static; there is no way to animate a parameter.
- **No multiple equations** — only one equation can be graphed at a time.
- **Implicit surface precision** — extremely thin or high-frequency implicit surfaces may still have small artifacts if the grid resolution (`GRID_3D`) is too low.
- **3D implicit performance** — tri-axis marching evaluates the function significantly more times than explicit rendering; high resolutions will impact frame rate.
- **Integer axis labels only for large values** — very large axis values are capped at `>2G` or `<-2G` due to `itoa` limitations.

View File

@@ -0,0 +1,214 @@
<div align="center">
<h1>Userland SDK Reference</h1>
<p><em>Comprehensive manual for custom libc and system calls in BoredOS.</em></p>
</div>
---
BoredOS provides a custom `libc` implementation necessary for writing userland applications (`.elf` binaries). By avoiding a full-blown standard library like `glibc`, the OS ensures a minimal executable footprint tailored strictly to the existing kernel features.
All headers are located in `src/userland/libc/` (standard functions) and `src/wm/` (UI and widgets).
- `stdlib.h`: Memory, strings, and basic I/O.
- `math.h`: Freestanding floating-point math library.
- `libui.h`: Core window and drawing API.
- `libwidget.h`: High-level UI components.
## Standard Library (`stdlib.h` & `string.h`)
The standard library wrappers provide memory management, string manipulation, and basic IO formatting without needing direct syscalls.
### Memory Allocation
* `void* malloc(size_t size);` - Allocate a block of memory on the heap.
* `void free(void* ptr);` - Free a previously allocated memory block.
* `void* calloc(size_t nmemb, size_t size);` - Allocate and zero-out a block of memory for an array.
* `void* realloc(void* ptr, size_t size);` - Resize an existing memory block.
### Memory Manipulation (`string.h`)
* `void* memset(void *s, int c, size_t n);` - Fill a block of memory with a specific byte.
* `void* memcpy(void *dest, const void *src, size_t n);` - Copy memory from source to destination.
* `void* memmove(void *dest, const void *src, size_t n);` - Safely copy overlapping memory blocks.
* `int memcmp(const void *s1, const void *s2, size_t n);` - Compare two memory blocks.
### String Utilities
* `size_t strlen(const char *s);` - Get the length of a string.
* `int strcmp(const char *s1, const char *s2);` - Compare two strings lexicographically.
* `char* strcpy(char *dest, const char *src);` - Copy a string to a destination buffer.
* `char* strcat(char *dest, const char *src);` - Concatenate two strings.
### Conversion and Formatting
* `int atoi(const char *nptr);` - String to integer conversion.
* `void itoa(int n, char *buf);` - Integer to string conversion.
### Input / Output
* `void puts(const char *s);` - Print a string followed by a newline to the standard output.
* `void printf(const char *fmt, ...);` - Formatted print to standard output (supports `%d`, `%s`, `%x`, etc.).
### Process Control
* `void exit(int status);` - Terminate the current process.
* `void sleep(int ms);` - Pause execution for a specified number of milliseconds.
---
## Math Library (`math.h`)
BoredOS ships a freestanding floating-point math library in `libc/math.h`. It uses pure arithmetic — Taylor series, Newton-Raphson, and range-reduction — with no dependency on a host `libm` or hardware math intrinsics. It is automatically linked into every userland ELF.
```c
#include "math.h"
```
### Constants
| Constant | Value | Description |
|---|---|---|
| `M_PI` | 3.14159… | π |
| `M_E` | 2.71828… | Euler's number |
| `M_LN2` | 0.69315… | Natural log of 2 |
| `M_SQRT2` | 1.41421… | √2 |
| `HUGE_VAL` | ~+∞ | Overflow sentinel |
### Functions
#### Absolute value & remainder
* `double fabs(double x);` — Absolute value.
* `double fmod(double x, double y);` — Floating-point remainder. Returns `0` when `y == 0`.
#### Rounding
* `double floor(double x);` — Largest integer ≤ x.
* `double ceil(double x);` — Smallest integer ≥ x.
#### Trigonometry *(arguments in radians)*
* `double sin(double x);` — Sine. Range-reduced to `[-π, π]` then computed via 8-term Taylor series.
* `double cos(double x);` — Cosine. Computed via `sin(x + π/2)`.
* `double tan(double x);` — Tangent. Returns sentinel `1e15` near poles.
#### Exponential & logarithm
* `double sqrt(double x);` — Square root via Newton-Raphson (25 iterations). Returns `0` for `x ≤ 0`.
* `double log(double x);` — Natural logarithm (ln). Returns `-1e30` for `x ≤ 0`.
* `double log2(double x);` — Base-2 logarithm.
* `double log10(double x);` — Base-10 logarithm.
* `double exp(double x);` — e^x. Saturates to `1e300` for `x > 700`, `0` for `x < -700`.
* `double pow(double base, double exponent);` — General power. Integer exponents use fast binary exponentiation; fractional exponents use `exp(e * log(b))`.
#### Hyperbolic
* `double sinh(double x);` — Hyperbolic sine.
* `double cosh(double x);` — Hyperbolic cosine.
* `double tanh(double x);` — Hyperbolic tangent.
#### Utility
* `double hypot(double x, double y);``sqrt(x² + y²)` without intermediate overflow.
* `double fmin(double a, double b);` — Minimum of two values.
* `double fmax(double a, double b);` — Maximum of two values.
* `double fclamp(double x, double lo, double hi);` — Clamps `x` into `[lo, hi]`.
> [!NOTE]
> The implementation file is named `libc/libmath.c` (not `libc/math.c`) to avoid a name collision with the `math` CLI calculator app in userland. The public header is still included as `#include "math.h"`.
For advanced operations, `syscall.h` provides direct wrappers into the kernel.
### Process & System Info
* `void sys_exit(int status);` - Raw exit syscall.
* `int sys_write(int fd, const char *buf, int len);` - Write to a file descriptor (usually fd 1 for stdout).
* `void* sys_sbrk(int incr);` - Expand or shrink the process data segment (used internally by `malloc`).
* `void sys_kill(int pid);` - Send a kill signal to a process.
* `void sys_yield(void);` - Yield the remainder of the process's timeslice to the scheduler.
* `int sys_system(int cmd, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4);` - Execute a privileged system command (e.g., reboot, shutdown, beep).
* `int sys_get_os_info(os_info_t *info);` - Populate an `os_info_t` struct with version and environment details.
* `uint64_t sys_get_shell_config(const char *key);` - Retrieve internal shell configuration values.
* `void sys_set_text_color(uint32_t color);` - Set the raw CLI text output color.
### File System API (VFS)
Interacting with files and directories using the Virtual File System.
* `int sys_open(const char *path, const char *mode);` - Open a file, returning a file descriptor.
* `int sys_read(int fd, void *buf, uint32_t len);` - Read from an open file.
* `int sys_write_fs(int fd, const void *buf, uint32_t len);` - Write to an open file.
* `void sys_close(int fd);` - Close an open file descriptor.
* `int sys_seek(int fd, int offset, int whence);` - Reposition the file offset.
* `uint32_t sys_tell(int fd);` - Get the current file offset.
* `uint32_t sys_size(int fd);` - Get the total file size.
* `int sys_delete(const char *path);` - Delete a file.
* `int sys_mkdir(const char *path);` - Create a new directory.
* `int sys_exists(const char *path);` - Check if a path exists on the filesystem.
* `int sys_getcwd(char *buf, int size);` - Get the current working directory string.
* `int sys_chdir(const char *path);` - Change the current working directory.
* `int sys_list(const char *path, FAT32_FileInfo *entries, int max_entries);` - List directory contents into an array of `FAT32_FileInfo` structs.
* `int sys_get_file_info(const char *path, FAT32_FileInfo *info);` - Retrieve metadata for a specific file.
### Networking Stack API
BoredOS includes lwIP for hardware TCP/UDP networking.
#### Configuration and Status
* `int sys_network_init(void);` - Initialize the network stack.
* `int sys_network_is_initialized(void);` - Check stack status.
* `int sys_network_dhcp_acquire(void);` - Request an IP configuration from a DHCP server.
* `int sys_network_has_ip(void);` - Check if the system has a valid IP address.
* `int sys_network_get_mac(net_mac_address_t *mac);` - Get the physical MAC address of the NIC.
* `int sys_network_get_nic_name(char *name_out);` - Get the name of the active network interface card.
* `int sys_network_get_ip(net_ipv4_address_t *ip);` - Get current local IPv4 address.
* `int sys_network_set_ip(const net_ipv4_address_t *ip);` - Manually assign a static IP.
* `int sys_network_get_gateway(net_ipv4_address_t *ip);` - Get the default gateway IP.
* `int sys_network_get_dns(net_ipv4_address_t *ip);` - Get the primary DNS server IP.
* `int sys_set_dns_server(const net_ipv4_address_t *ip);` - Set the primary DNS server.
* `int sys_get_dns_server(net_ipv4_address_t *ip);` - Retrieve configured DNS server.
* `int sys_network_get_stat(int stat_type);` - Get network statistics (packets in/out, drops, etc.).
* `void sys_network_force_unlock(void);` - Force release of network stack locks (use with caution).
#### Communication
* `int sys_icmp_ping(const net_ipv4_address_t *dest_ip);` - Send an ICMP echo request.
* `int sys_udp_send(const net_ipv4_address_t *dest_ip, uint16_t dest_port, uint16_t src_port, const void *data, size_t data_len);` - Send a raw UDP datagram.
* `int sys_dns_lookup(const char *name, net_ipv4_address_t *out_ip);` - Resolve a hostname to an IPv4 address.
* `int sys_tcp_connect(const net_ipv4_address_t *ip, uint16_t port);` - Establish a TCP connection to a remote host.
* `int sys_tcp_send(const void *data, size_t len);` - Send data over an active TCP socket.
* `int sys_tcp_recv(void *buf, size_t max_len);` - Receive data from a TCP socket (blocking).
* `int sys_tcp_recv_nb(void *buf, size_t max_len);` - Receive data from a TCP socket (non-blocking).
* `int sys_tcp_close(void);` - Close the active TCP socket.
---
## Core Data Structures
### `os_info_t`
Contains detailed build and version information about the OS.
```c
typedef struct {
char os_name[64];
char os_version[64];
char os_codename[64];
char kernel_name[64];
char kernel_version[64];
char build_date[64];
char build_time[64];
char build_arch[64];
} os_info_t;
```
### `FAT32_FileInfo`
Represents a filesystem entry.
```c
typedef struct {
char name[256];
uint32_t size;
uint8_t is_directory;
uint32_t start_cluster;
uint16_t write_date;
uint16_t write_time;
} FAT32_FileInfo;
```
### `ProcessInfo`
Provides status information for an active process.
```c
typedef struct {
uint32_t pid;
char name[64];
uint64_t ticks;
size_t used_memory;
} ProcessInfo;
```
### IP / MAC Addresses
Wrappers for raw byte arrays.
```c
typedef struct { uint8_t bytes[6]; } net_mac_address_t;
typedef struct { uint8_t bytes[4]; } net_ipv4_address_t;
```

111
docs/appdev/ui_api.md Normal file
View File

@@ -0,0 +1,111 @@
<div align="center">
<h1>UI API (<code>libui.h</code>)</h1>
<p><em>Comprehensive manual for interacting with the Window Manager.</em></p>
</div>
---
The UI library (`libui.h`) is the sole mechanism for Graphical Userland Applications to draw to the screen and receive input events in BoredOS. It wraps `SYS_GUI` kernel calls.
## Window Management
A "Window" is a reserved drawing canvas managed by the compositor.
* `ui_window_t ui_window_create(const char *title, int x, int y, int w, int h);`
Creates a new window at `(x, y)` with dimensions `w`x`h`. Returns a window handle.
**Flags** are currently embedded in the syscall; standard windows include decorations (titlebar, borders).
* `void ui_window_set_title(ui_window_t win, const char *title);`
Dynamically update the text displayed in the window's titlebar.
* `void ui_window_set_resizable(ui_window_t win, bool resizable);`
Enable or disable the user's ability to resize the window by dragging its edges.
* `void ui_get_screen_size(uint64_t *out_w, uint64_t *out_h);`
Query the global screen resolution of the display.
## Drawing Primitives
All drawing functions write to an off-screen buffer associated with the window. **You must call `ui_mark_dirty()` to instruct the compositor to push your changes to the physical screen.**
* `void ui_draw_rect(ui_window_t win, int x, int y, int w, int h, uint32_t color);`
Draw a solid filled rectangle.
* `void ui_draw_rounded_rect_filled(ui_window_t win, int x, int y, int w, int h, int radius, uint32_t color);`
Fill a rectangle with rounded corners of a specified `radius`.
* `void ui_draw_image(ui_window_t win, int x, int y, int w, int h, uint32_t *image_data);`
Blit a raw ARGB pixel buffer (`image_data`) directly into the window canvas.
* `void ui_mark_dirty(ui_window_t win, int x, int y, int w, int h);`
Mark a specific rectangular region of the window as "dirty". The Window Manager will redraw this area on the next compositing pass.
> [!TIP]
> Colors are defined as 32-bit unsigned integers in **ARGB** format: `0xAARRGGBB`.
> E.g., `0xFF000000` is opaque black, `0xFFFF0000` is opaque red.
## Text Rendering
BoredOS provides multiple text rendering methodologies, including a default system font and scaled/bitmap alternatives.
* `void ui_draw_string(ui_window_t win, int x, int y, const char *str, uint32_t color);`
Draw text using the default system typeface.
* `void ui_draw_string_bitmap(ui_window_t win, int x, int y, const char *str, uint32_t color);`
Draw text using a secondary fast bitmap font renderer.
* `void ui_draw_string_scaled(ui_window_t win, int x, int y, const char *str, uint32_t color, float scale);`
Draw text scaled up or down by a floating-point multiplier.
* `void ui_draw_string_scaled_sloped(ui_window_t win, int x, int y, const char *str, uint32_t color, float scale, float slope);`
Draw scaled text with an italic-like slope/shear applied.
* `void ui_set_font(ui_window_t win, const char *path);`
Load and set a custom `.ttf` or bitmap font from the filesystem for this window.
### Font Metrics
Used for calculating layout bounds before drawing:
* `uint32_t ui_get_string_width(const char *str);`
* `uint32_t ui_get_font_height(void);`
* `uint32_t ui_get_string_width_scaled(const char *str, float scale);`
* `uint32_t ui_get_font_height_scaled(float scale);`
## Event Handling
Applications must continuously poll for events inside an infinite `$while(1)` loop.
* `bool ui_get_event(ui_window_t win, gui_event_t *ev);`
Returns `true` if an event was waiting in the queue, populating the `ev` structure. Returns `false` if the queue is empty.
> [!IMPORTANT]
> Because `ui_get_event` is non-blocking, you must call `sys_yield();` inside your event loop if no event was received. In BoredOS's **Multi-Core (SMP)** architecture, failing to yield will pin a CPU core to 100% usage, potentially starving other processes.
>
> All UI syscalls are **Thread-Safe** at the kernel level via the global GUI spinlock.
### Graphical Event Structure
```c
typedef struct {
int type; // Specifies the event class (see below)
int arg1; // Generic argument 1
int arg2; // Generic argument 2
int arg3; // Generic argument 3
} gui_event_t;
```
### Event Types & Arguments
| Event Constant | `type` ID | Trigger | `arg1` | `arg2` | `arg3` |
| :--- | :--- | :--- | :--- | :--- | :--- |
| `GUI_EVENT_NONE` | `0` | Empty event | - | - | - |
| `GUI_EVENT_PAINT` | `1` | Window needs redrawing | - | - | - |
| `GUI_EVENT_CLICK` | `2` | Mouse click down | X Coord | Y Coord | Button State |
| `GUI_EVENT_RIGHT_CLICK` | `3` | Mouse right-click down | X Coord | Y Coord | Button State |
| `GUI_EVENT_CLOSE` | `4` | User clicked 'X' button | - | - | - |
| `GUI_EVENT_KEY` | `5` | Keyboard key pressed | Keycode | Modifiers | - |
| `GUI_EVENT_KEYUP` | `10` | Keyboard key released | Keycode | Modifiers | - |
| `GUI_EVENT_MOUSE_DOWN` | `6` | Generic mouse button down | X Coord | Y Coord | Button State |
| `GUI_EVENT_MOUSE_UP` | `7` | Generic mouse button release | X Coord | Y Coord | Button State |
| `GUI_EVENT_MOUSE_MOVE` | `8` | Mouse cursor moved | X Coord | Y Coord | - |
| `GUI_EVENT_MOUSE_WHEEL` | `9` | Scroll wheel rotated | Scroll Delta | - | - |
| `GUI_EVENT_RESIZE` | `11` | Window dimensions changed| New Width | New Height | - |
*(Note: Coordinate arguments (`arg1`, `arg2`) for mouse events are typically relative to the top-left corner of the window's client area).*
---
> [!TIP]
> **Looking for Buttons, TextBoxes, or Scrollbars?**
> While `libui.h` provides the foundation for drawing, most applications should use the higher-level [**Widget API**](widget_api.md) (`libwidget.h`) for standard interactive components.
---

108
docs/appdev/widget_api.md Normal file
View File

@@ -0,0 +1,108 @@
<div align="center">
<h1>Widget API (<code>libwidget.h</code>)</h1>
<p><em>High-level UI components for BoredOS applications.</em></p>
</div>
---
The Widget library (`libwidget.h`) provides a set of reusable UI components built on top of `libui.h`. It uses an abstract `widget_context_t` to decouple component logic from specific drawing implementations, making it easier to build complex graphical interfaces.
## Widget Context
To use any widget, you must first define a `widget_context_t`. This structure contains function pointers for basic drawing operations (rects, strings) and theme preferences.
```c
typedef struct {
void *user_data;
void (*draw_rect)(void *user_data, int x, int y, int w, int h, uint32_t color);
void (*draw_rounded_rect_filled)(void *user_data, int x, int y, int w, int h, int r, uint32_t color);
void (*draw_string)(void *user_data, int x, int y, const char *str, uint32_t color);
int (*measure_string_width)(void *user_data, const char *str);
void (*mark_dirty)(void *user_data, int x, int y, int w, int h);
bool use_light_theme;
} widget_context_t;
```
> [!TIP]
> Usually, `user_data` is set to your `ui_window_t` handle, and the functions are simple wrappers around `ui_draw_rect`, `ui_draw_string`, etc.
---
## Button (`widget_button_t`)
Standard interactive button with hover and click states.
* `void widget_button_init(widget_button_t *btn, int x, int y, int w, int h, const char *text);`
* `void widget_button_draw(widget_context_t *ctx, widget_button_t *btn);`
* `bool widget_button_handle_mouse(widget_button_t *btn, int mx, int my, bool mouse_down, bool mouse_clicked, void *user_data);`
### Usage Example:
```c
widget_button_t my_btn;
widget_button_init(&my_btn, 10, 10, 80, 25, "Click Me");
my_btn.on_click = my_callback_func;
// In your event loop:
widget_button_handle_mouse(&my_btn, ev.arg1, ev.arg2, is_down, is_clicked, my_data);
```
---
## Scrollbar (`widget_scrollbar_t`)
Vertical scrollbar supporting dragging and track-paging.
* `void widget_scrollbar_init(widget_scrollbar_t *sb, int x, int y, int w, int h);`
* `void widget_scrollbar_update(widget_scrollbar_t *sb, int content_height, int scroll_y);`
* `void widget_scrollbar_draw(widget_context_t *ctx, widget_scrollbar_t *sb);`
* `bool widget_scrollbar_handle_mouse(widget_scrollbar_t *sb, int mx, int my, bool mouse_down, void *user_data);`
> [!NOTE]
> The scrollbar automatically calculates the "thumb" size based on the ratio of `h` to `content_height`.
---
## TextBox (`widget_textbox_t`)
Editable text field with focus support and keyboard handling.
* `void widget_textbox_init(widget_textbox_t *tb, int x, int y, int w, int h, char *buffer, int max_len);`
* `void widget_textbox_draw(widget_context_t *ctx, widget_textbox_t *tb);`
* `bool widget_textbox_handle_mouse(widget_textbox_t *tb, int mx, int my, bool mouse_clicked, void *user_data);`
* `bool widget_textbox_handle_key(widget_textbox_t *tb, char c, void *user_data);`
---
## Dropdown (`widget_dropdown_t`)
Selection menu for picking one item from a list.
* `void widget_dropdown_init(widget_dropdown_t *dd, int x, int y, int w, int h, const char **items, int count);`
* `void widget_dropdown_draw(widget_context_t *ctx, widget_dropdown_t *dd);`
* `bool widget_dropdown_handle_mouse(widget_dropdown_t *dd, int mx, int my, bool mouse_clicked, void *user_data);`
---
## Checkbox / Radio (`widget_checkbox_t`)
Toggleable options with support for circular "Radio" style or square "Checkbox" style.
* `void widget_checkbox_init(widget_checkbox_t *cb, int x, int y, int w, int h, const char *text, bool is_radio);`
* `void widget_checkbox_draw(widget_context_t *ctx, widget_checkbox_t *cb);`
* `bool widget_checkbox_handle_mouse(widget_checkbox_t *cb, int mx, int my, bool mouse_clicked, void *user_data);`
---
## Event Integration
Widgets are designed to be polled within your `libui` event loop. Most handle-mouse functions return `true` if the event was "consumed" by the widget, allowing you to stop further processing for that event.
```c
if (ui_get_event(win, &ev)) {
bool handled = false;
handled |= widget_button_handle_mouse(&btn, ev.arg1, ev.arg2, is_down, is_clicked, NULL);
if (!handled) {
// Handle global window events...
}
}
```

58
docs/architecture/core.md Normal file
View File

@@ -0,0 +1,58 @@
<div align="center">
<h1>Core Architecture</h1>
<p><em>Overview of BoredOS kernel layout, boot process, and userspace transition.</em></p>
</div>
---
BoredOS is a 64-bit hobbyist operating system designed for the x86_64 architecture. While it features kernel-space drivers and a built-in window manager, it supports fully-isolated userspace applications and includes a networking stack.
This document serves as an overview of the core architecture and the layout of the kernel source code.
## Source Code Layout (`src/`)
The OS heavily relies on module separation. The `src/` directory is logically split into several domains:
- **`arch/`**: Contains the assembly routines needed for bootstrapping the system (`boot.asm`) and setting up the CPU state for userland execution (`process_asm.asm`). It also handles architecture-specific mechanisms like the Global Descriptor Table (GDT) and Interrupt Descriptor Table (IDT).
- **`core/`**: The initialization sequence of the OS lives here. `main.c` is the entry point from the bootloader. This directory also contains essential kernel utilities (`kutils.c`), panic handlers (`panic.c`), and built-in command parsing logic (`cmd.c`).
- **`dev/`**: Device drivers. This includes the PCI scanner, disk management infrastructure, input drivers (keyboard and mouse), and the Real Time Clock (RTC).
- **`fs/`**: Filesystem implementations. The system uses a Virtual File System (VFS) abstraction alongside an in-memory FAT32 filesystem with support for drives over ATA that are formatted as FAT32 (plain/MBR).
- **`mem/`**: Physical and virtual memory management. It controls page frame allocation, paging, and kernel heap operations.
- **`net/`**: The networking stack. BoredOS relies on `lwIP` for processing IPv4 and TCP/UDP traffic, interacting with a range of NICs via `net/nic/`.
- **`sys/`**: System calls and process management. The ELF loader resides here, alongside the Symmetric Multi-Processing (**smp.c**) bringup and Local APIC (**lapic.c**) management logic.
- **`wm/`**: The graphical subsystem. It handles drawing primitives, window structures, font rendering, and double-buffering.
- **`userland/`**: Out-of-kernel components. This includes the custom SDK/compiler environment (`libc/`) and user applications (`cli/`, `gui/`, `games/`).
## Boot Process
BoredOS uses **Limine** as its primary bootloader.
1. **Limine Initialization**: The machine firmware (BIOS or UEFI) loads Limine. Limine parses `limine.conf`, sets up an early graphical framebuffer, and reads the kernel ELF file into memory.
2. **Multiboot2 & SMP Protocol**: The kernel expects the Limine boot protocol. It makes a specific **SMP Request** to Limine to locate and bring up all available CPU cores.
3. **Kernel Entry (`main.c`)**: The entry point `_start` is called on the Bootstrap Processor (BSP). It initializes the serial port, GDT/IDT, memory management, and paging.
4. **AP Bringup**: The BSP calls `smp_init()`, which sends the Startup Inter-Processor Interrupt (SIPI) sequence to all Application Processors (APs). Each AP initializes its own local GDT, TSS, and Page Tables before entering an idle loop.
5. **Driver Initialization**: PCI buses are scanned, finding the network card or disk controllers. The filesystem is mounted.
6. **Window Manager**: The UI is drawn on top of the Limine-provided framebuffer.
## 🧵 Multi-Core & Scheduling
BoredOS utilizes Symmetric Multi-Processing (SMP) to distribute workloads across all available CPU cores.
- **LAPIC & IPIs**: Each CPU has its own Local APIC. The kernel uses Inter-Processor Interrupts (IPIs) for inter-core communication, specifically for triggering the scheduler on other cores (`vector 0x41`).
- **Scheduler**: A round-robin scheduler runs on each core. Processes are pinned to specific CPUs (CPU Affinity) to maintain cache locality. The BSP timer interrupt (`60Hz`) broadcasts a scheduling IPI to all core to ensure balanced execution.
- **Spinlocks**: Since multiple cores can access kernel structures (VFS, Process List) simultaneously, the kernel uses **interrupt-safe spinlocks** to prevent race conditions.
## Userland Transition
The OS supports privilege separation (Ring 0 vs. Ring 3). When an application is launched, the kernel:
1. Loads the ELF file from the filesystem.
2. Assigns the process to a CPU core via a round-robin distribution strategy.
3. Allocates a new virtual address space (Page Directory) for the process.
4. Maps the executable segments according to the ELF headers.
5. Switches to User Mode (Ring 3) via the `iretq` instruction.
> [!IMPORTANT]
> Programs interact with the core kernel using system calls (`syscall.c`). Multitasking is achieved by pre-empting user processes on their respective cores.
---

View File

@@ -0,0 +1,37 @@
<div align="center">
<h1>Filesystem Architecture</h1>
<p><em>Virtual File System layer and FAT32 abstraction in BoredOS.</em></p>
</div>
---
BoredOS implements a rudimentary but functional filesystem layer designed to support reading system assets and user applications during runtime.
## Virtual File System (VFS)
The Virtual File System acts as an abstraction layer across different underlying storage mechanisms (even if, currently, only one type is fully utilized). System calls targeting files (`SYS_FS`) route through the VFS rather than interacting with the disk directly.
Key VFS functionalities include:
- **File Descriptors**: Mapping integer IDs to internal file structures for userland processes.
- **Standard Operations**: Standardizing `open()`, `read()`, `write()`, `close()`, `seek()`, and directory listings.
- **Path Parsing**: Resolving absolute and relative paths.
- **SMP Safety**: All VFS and underlying FAT32 operations are protected by a global **Spinlock**. This ensures that multiple cores can safely read from the filesystem simultaneously without corrupting internal file seek pointers or directory cache states.
## FAT32 Implementation
The primary filesystem logic in `fat32.c` handles both in-memory RAM-based filesystem simulation and physical ATA block devices.
### Storage Support
BoredOS supports two main types of storage for its FAT32 implementation:
1. **RAMFS (Boot Modules)**: During boot, Limine loads necessary files (such as userland `.elf` binaries, fonts, and wallpapers) into memory as standard boot modules. The FAT32 code parses these loaded memory modules and automatically constructs a synthetic FAT32 directory tree inside RAM (mounted as `A:`).
2. **ATA Drives**: The kernel includes a basic PIO-based ATA driver that can detect and read/write to physical IDE/PATA hard disks.
- **GPT is NOT supported**: Currently, only **MBR (Master Boot Record)** partition tables or **raw (partitionless)** disks are supported.
- **Filesystem**: The partition must be formatted as **FAT32**.
### Auto-detection
The `Disk Manager` automatically probes primary and secondary IDE channels during initialization. If a valid FAT32 partition is found (either directly at sector 0 or via an MBR partition table), the disk is assigned a drive letter (starting from `B:`) and becomes accessible to the VFS.
---

View File

@@ -0,0 +1,40 @@
<div align="center">
<h1>Memory Management</h1>
<p><em>Physical and Virtual Memory coordination in x86_64 Long Mode.</em></p>
</div>
---
Memory management in BoredOS is split into physical and virtual layers, designed to support both kernel operations and userland isolation on the x86_64 architecture.
## Physical Memory Management (PMM)
The PMM is responsible for tracking which physical RAM frames (usually 4KB each) are free and which are in use.
1. **Memory Map**: During boot, Limine provides a memory map detailing the available, reserved, and unusable physical memory regions.
2. **Bitmap Allocator**: The core PMM uses a bitmap-based allocation strategy. Each bit in the bitmap represents a single physical page (frame). If a bit is `1`, the page is in use; if `0`, it is free.
3. **Allocation**: When a new page is requested (e.g., for userland space or kernel heap), the PMM scans the bitmap for the first available zero bit, marks it as used, and returns the physical address.
4. **SMP Safety**: In a multi-core environment, the PMM and VMM are protected by **Spinlocks** to prevent two CPUs from allocating the same frame or modifying page tables simultaneously.
> [!NOTE]
> 4KB frame sizes strike a balance between allocation speed and minimal memory fragmentation, fitting directly with the page tables.
## Virtual Memory Management (VMM) and Paging
BoredOS uses 4-level paging (PML4), a requirement for x86_64 long mode, dividing the virtual address space between the kernel and userland.
- **Kernel Space**: The kernel relies on a higher-half design where its code, data, and heap are mapped to high addresses (typically above `0xFFFF800000000000`).
- **Per-CPU Structures**: Each CPU core maintains its own architectural state in memory:
* **Per-CPU GDT**: Each core is initialized with its own Global Descriptor Table.
* **Per-CPU TSS**: Each core has a dedicated Task State Segment containing the `RSP0` pointer for its own kernel stack, ensuring safe interrupt handling across cores.
- **User Space**: Userland applications are loaded into lower virtual addresses.
- **Page Faults**: The `mem/` subsystem registers an Interrupt Service Routine (ISR) for page faults (Interrupt 14). If a process accesses unmapped memory, the handler determines whether to allocate a new frame or terminate the process.
## Kernel Heap
Dynamic allocation within the kernel (`kmalloc` and `kfree`) is layered on top of the physical allocator. The kernel maintains its own heap area in virtual memory. When the heap requires more space, it requests physical frames from the PMM and maps them into the kernel's virtual address space.
> [!IMPORTANT]
> The kernel heap is a shared resource; therefore, all `kmalloc` and `kfree` operations are guarded by a global spinlock to ensure thread safety during multi-core execution.
---

View File

@@ -0,0 +1,48 @@
<div align="center">
<h1>Window Manager (WM)</h1>
<p><em>The native graphical subsystem compositing and event routing.</em></p>
</div>
---
BoredOS features a fully custom, graphical Window Manager built directly into the kernel, residing in the `src/wm/` directory. It is responsible for compositing the screen, handling window logic, rendering text, and dispatching UI events.
## Framebuffer and Rendering
1. **Limine Framebuffer**: During boot, the Limine bootloader requests a graphical framebuffer from the hardware (e.g., GOP in UEFI environments) and passes a pointer to this linear memory buffer to the kernel.
2. **Double Buffering**: To prevent screen tearing, the WM does not draw directly to the screen. It allocates a "back buffer" in kernel memory equal to the size of the screen. All drawing operations (lines, rectangles, windows) happen on this back buffer.
3. **Compositing**: Once per frame or upon request, the entire back buffer (or dirty regions) is copied to the actual Limine physical framebuffer memory, making the changes visible instantly.
> [!TIP]
> The performance of the window manager heavily depends on minimizing the "dirty regions" drawn in the compositing loop rather than sweeping the whole screen.
## 🪟 Window System (`wm.c`)
The windowing system is built around a linked list of `Window` structures.
- **Z-Ordering**: The list determines the draw order. Windows at the back of the list are drawn first, and the active window is drawn last (on top).
- **Window Structures**: Each window object tracks its dimensions (`x`, `y`, `width`, `height`), title, background color, and an internal buffer if it's acting as a canvas for userland apps.
- **Decorations**: The kernel handles drawing window borders, title bars, and close buttons automatically unless a borderless style is specified.
## Input Handling and Events
The WM acts as the central hub for input routing.
1. **Mouse Driver**: The PS/2 mouse driver (`dev/mouse.c`) detects movement and button clicks. It raises interrupts that update global cursor coordinates.
2. **Hit Testing**: The WM checks these coordinates against the bounding boxes of existing windows. It handles dragging logic (if the user clicks a title bar) or focus changes.
3. **Event Queue**: If a userland application owns the window that was clicked, the WM packages the input (coordinates, button state) into an event message and drops it into the owning process's event queue. The application can retrieve these via the custom libc UI functions.
- **Event Polling**: The UI loop inside an app continuously calls `ui_poll_event()` to respond to mouse clicks and window movement dispatched by the kernel WM.
## 🧵 Multi-Core Safety & Performance
With the introduction of Symmetric Multi-Processing (SMP), the Window Manager (WM) was redesigned to ensure stability and high performance across multiple cores.
1. **Granular Window Locks**: Each `Window` object possesses its own `spinlock_t lock;`. User applications concurrently draw directly into their own window buffers without stalling the rest of the system. The global `wm_lock` is reserved strictly for altering global structures like window z-order or syncing buffers to the screen compositing layer.
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.
> [!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.
---

52
docs/build/toolchain.md vendored Normal file
View File

@@ -0,0 +1,52 @@
# Build Toolchain
BoredOS is built cross-compiled from a host system (such as macOS or Linux) to target the generic `x86_64-elf` platform.
## Prerequisites
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.
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.
3. **xorriso**:
- A specialized tool to create ISO 9660 filesystem images.
- *Why?* `xorriso` packages the compiled kernel, Limine bootloader, and asset files (fonts, images, userland binaries) into the final bootable `boredos.iso` CD-ROM image.
4. **QEMU** (Optional but highly recommended for testing):
- `qemu-system-x86_64` is used for rapid emulation and testing.
## Installation (macOS)
You can easily install the complete toolchain using Homebrew:
```sh
brew install x86_64-elf-binutils x86_64-elf-gcc nasm xorriso qemu
```
## Installation (Linux)
Depending on your distribution, the installation commands vary. Note that some distributions may require you to build the `x86_64-elf` cross-compiler from source if it isn't available in their default repositories.
### Debian / Ubuntu
```sh
sudo apt update
sudo apt install build-essential bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo nasm xorriso qemu-system-x86
```
*(Note: You will need to build the `x86_64-elf` cross-compiler from source or find a compatible PPA, as it is not in the default Debian/Ubuntu repositories.)*
### Arch Linux
Arch Linux provides the regular tools in its standard repositories and the cross-compiler via the AUR:
```sh
sudo pacman -S nasm xorriso qemu-full
yay -S x86_64-elf-gcc x86_64-elf-binutils
```
### Fedora
```sh
sudo dnf install make gcc gcc-c++ bison flex gmp-devel mpfr-devel libmpc-devel texinfo nasm xorriso qemu
```

65
docs/build/usage.md vendored Normal file
View File

@@ -0,0 +1,65 @@
# Building, Running, and Deployment
BoredOS uses a single top-level `Makefile` to orchestrate the build process.
## The Build Process
When you run `make` in the root directory, the following stages occur automatically:
1. **Limine Setup (`limine-setup`)**:
If the Limine bootloader binaries are missing, the Makefile automatically clones the appropriate Limine binary release from GitHub and compiles its host utility.
2. **Kernel Compilation**:
All `.c` files in `src/core`, `src/mem`, `src/dev`, `src/sys`, `src/fs`, `src/wm`, and `src/net` are compiled into object files (`.o`) inside the `build/` directory using `x86_64-elf-gcc`.
3. **Kernel Assembly**:
All `.asm` files in `src/arch/` are assembled into object files using `nasm`.
4. **Kernel Linking**:
`x86_64-elf-ld` links the kernel object files together, instructed by the `linker.ld` script, outputting the `boredos.elf` kernel binary.
5. **Userland Compilation**:
The Makefile shifts into the `src/userland` directory, compiling the custom `libc` and generating `bin/*.elf` executable user applications.
6. **ISO Generation**:
The `iso_root` directory is staged. The kernel, Limine configuration, fonts, images, and userland applications are copied in. Finally, `xorriso` generates the `boredos.iso` bootable image.
## Minimum System Requirements
To run BoredOS successfully (either in emulation or on bare metal), your target machine should meet the following minimum requirements:
- **CPU**: An `x86_64` (64-bit) compatible processor.
- **Memory**: Approximately `~256 MB` of RAM.
- **Display**: A VGA-compatible display (required for the GUI Window Manager).
- **Networking (Optional)**: A compatible Network Interface Card (NIC) is required if you want to use the networking stack (e.g., an Intel E1000 or similar supported by the [`net/nic/`](../../src/net/nic/) drivers). Networking is not strictly required for the OS to boot or run offline applications.
## Running in Emulation
To test the generated ISO quickly without real hardware, use the QEMU emulator:
For MacOS:
```sh
make run-mac
```
For Linux:
```sh
make run-linux
```
For Windows:
```sh
make run-windows
```
This command invokes QEMU with specific arguments:
- `-m 4G`: Allocates 4 Gigabytes of RAM.
- `-cdrom boredos.iso`: Mounts the built OS image as a CD-ROM.
- `-smp 4`: Enables 4 CPU cores.
- `-drive file=disk.img...`: Attaches a raw disk image included in this release of BoredOS.
## Running on Bare Metal
> [!CAUTION]
> Running hobby operating systems on real hardware is at your own risk and may cause undefined behavior.
To boot BoredOS on a physical PC:
1. Build the OS to get `boredos.iso`.
2. Use a flashing tool like **Balena Etcher** or `dd` to write the ISO to a USB flash drive.
3. Reboot your target computer, enter the BIOS/UEFI setup.
4. **Boot Configuration**: BoredOS supports booting on both modern **UEFI** systems and legacy **BIOS** systems natively via Limine. Ensure **Secure Boot** is disabled in your firmware settings.
5. Select the USB drive from the boot menu.

33
docs/usage/booting.md Normal file
View File

@@ -0,0 +1,33 @@
# Booting BoredOS
BoredOS uses the Limine bootloader, which provides a flexible way to configure the boot process and pass parameters to the kernel.
## Boot Parameters
You can modify system behavior at startup by passing specific boot flags.
### Verbose Boot (`-v`)
The `-v` flag enables the kernel console (`kconsole`) during the boot process. When enabled, the kernel will display detailed initialization logs on the screen. By default, this is often disabled in the included configuration for a cleaner "splash-only" boot experience.
#### Toggling Verbose Boot at Runtime
You can enable or disable the verbose boot log directly from the Limine boot menu without modifying the source files:
1. **Select Entry**: When the Limine boot menu appears, highlight the **BoredOS** entry.
2. **Edit**: Press `E` to enter the entry editor.
3. **Modify Flag**: Find the line containing `cmdline: -v`.
- To **Enable**: Remove the `#` character if the line is commented out (change `# cmdline: -v` to `cmdline: -v`).
- To **Disable**: Add a `# ` at the start of the line.
4. **Boot**: Press `F10` to boot using the modified parameters.
#### Persistent Configuration
To change the default behavior permanently, modify the `limine.conf` file in the repository root before building the ISO:
```conf
/BoredOS
protocol: limine
path: boot():/boredos.elf
cmdline: -v
```

35
docs/usage/desktop.md Normal file
View File

@@ -0,0 +1,35 @@
# Using the Desktop
The BoredOS desktop environment is designed to be intuitive while providing powerful window management and icons for quick access to your files and applications.
## Window Management
BoredOS uses a stacking window manager (BoredWM) that allows you to overlap and organize multiple windows.
### Basic Actions
- **Focus**: Click anywhere on a window to bring it to the front and make it the active window.
- **Move**: Click and drag the **title bar** (the top bar of the window) to reposition it on the screen.
- **Close**: Click the red traffic light close button in the top-left corner of the window.
### System-wide Shortcuts
BoredOS includes several global shortcuts to help you manage your workflow:
- **`Ctrl + P`**: Take a screenshot. The image will be saved to `/root/Desktop` as `screenshot.jpg`.
- **`Shift + Ctrl + Space`**: Toggle **Lumos** search (see the [Lumos guide](lumos.md)).
## Desktop Icons
Your desktop represents the contents of the `/root/Desktop` directory.
- **Launching**: Double-click an icon to open the file or launch the application.
- **Snapping**: Icons automatically snap to a grid for a clean look. You can toggle "Snap to Grid" and "Auto Align" in the [Settings app](../launching_apps.md).
- **Context Menu**: Right-click on the desktop background to create new files, folders, or refresh the layout.
## The Bottom Dock
The dock at the bottom of the screen provides quick shortcuts to your most-used applications, with for example:
- **Files**: Browse the entire filesystem.
- **Terminal**: Access the command-line interface.
- **Calculator / Notepad / Grapher**: Essential productivity tools.
---
[Return to Documentation Index](../README.md)

View File

@@ -0,0 +1,31 @@
# Launching Applications
BoredOS provides several ways to launch applications and files, depending on your preferred workflow.
## 1. Using the File Explorer
The File Explorer is the primary way to navigate the filesystem and launch any `.elf` binary or associated document.
1. Open the **Explorer** from the dock or desktop.
2. Navigate to `/bin` for system applications or your own user folders.
3. **Double-click** any executable (`.elf`) to run it.
4. Standard files (like `.jpg` or `.txt`) will automatically open in their default viewer.
## 2. Desktop Shortcuts and Icons
Commonly used applications are placed directly on the desktop.
- Simply **Double-click** any icon on the desktop to launch it.
- You can also create desktop shortcuts by right-clicking on a file and selecting **"Create Shortcut"**.
## 3. Using Lumos (Global Search)
For the fastest access, use **Lumos** to search and launch by name:
1. Press **`Shift + Ctrl + Space`**.
2. Type the name of the app (e.g., "DOOM.elf").
3. Press **Enter** to launch.
---
[Return to Documentation Index](../README.md)

29
docs/usage/lumos.md Normal file
View File

@@ -0,0 +1,29 @@
# Lumos: System Search
**Lumos** is the powerful, system-wide search and launch assistant for BoredOS. It allows you to find applications, documents, and system files instantly without navigating through folders.
## Opening Lumos
To activate Lumos at any time, use the global keyboard shortcut:
**`Shift + Ctrl + Space`**
The Lumos search modal will appear in the center of your screen, ready for input.
## Features
- **Fuzzy Searching**: You don't need to type the exact name. Lumos uses fuzzy matching to find the most relevant results as you type.
- **Deep Indexing**: Lumos indexes files across the entire system.
- **Quick Launch**: Once you find what you're looking for, launching it is as simple as pressing `Enter`.
## Navigation
When the Lumos window is open:
- **Type**: Just start typing to filter results.
- **Arrow Keys (Up/Down)**: Move the selection highlight through the list of results.
- **Enter**: Launch the selected file or application.
- **Backspace**: Delete characters in your search query.
- **Escape**: Close Lumos and return to the desktop.
---
[Return to Documentation Index](../README.md)

60
docs/usage/terminal.md Normal file
View File

@@ -0,0 +1,60 @@
# Terminal & Command Line
The BoredOS Terminal provides a powerful command-line interface (CLI) for advanced users and developers. It supports standard Unix-like features and provides direct access to the kernel's system calls.
## The Shell
The default shell in BoredOS is **BoredShell (Bsh)**, a userspace shell with a dedicated terminal app. It features:
- **ANSI Color Support**: Rich text output with colors and styles.
- **Command History**: Use the **Up** and **Down** arrow keys to navigate through your previous commands (up to 64 history entries).
- **Output Redirection**:
- `command > file`: Write output to a new file (or overwrite existing).
- `command >> file`: Append output to an existing file.
- **Piping**:
- `command1 | command2`: Pass the output of the first command as input to the second.
### Bsh Configuration
Bsh loads its configuration from:
`/Library/bsh/bshrc`
This file is similar to `.zshrc` or `.bashrc` and can define:
- `PATH` for command lookup
- `STARTUP` for interactive shell startup scripts
- `BOOT_SCRIPT` for a once-per-boot script
- prompt templates (`PROMPT_LEFT`, `PROMPT_RIGHT`)
Prompt tokens:
- `%n` username
- `%h` hostname
- `%~` cwd ("~" for `/root`)
- `%T` time (HH:MM)
Example:
```
PATH=/bin:/root/Apps
PROMPT_LEFT=%n@%h:%~$
STARTUP=/Library/bsh/startup.bsh
BOOT_SCRIPT=/Library/bsh/boot.bsh
```
## Common Commands
Below are some of the most used commands available in `/bin`:
| Command | Description |
| :--- | :--- |
| `ls` | List files and directories in the current path. |
| `cd` | Change the current working directory. |
| `cat` | Display the contents of a file. |
| `ls` | List directory contents. |
| `rm` | Remove a file. |
| `mkdir` | Create a new directory. |
| `man` | View the manual for a specific command (e.g., `man ls`). |
| `sysfetch` | Display system and hardware information. |
---
[Return to Documentation Index](../README.md)

Binary file not shown.

Binary file not shown.

View File

@@ -1,164 +0,0 @@
# BoredOS 1.50 Beta
BoredOS is now in a Beta stage as i have brought over all apps from brewkernel and have made the DE a lot more usable and stable.
<img src="bored.svg" width="200" /> </br>
BoredOS is a simple x86_64 hobbyist operating system.
It features a DE (and WM), a FAT32 filesystem, customizable UI and much much more!
![Screenshot](screenshot.jpg)
*this screenshot might be outdated*
## Features
- Drag and drop mouse centered UI
- Customizable UI
- Basic Networking Stack
- Bored WM
- Fat 32 FS
- 64-bit long mode support
- Multiboot2 compliant
- Text editor
- Markdown Viewer
- Minesweeper
- Markdown Viewer
- GUI Text editor
- Paint application
- IDT
- Ability to run on actual x86_64 hardware
- CLI
- (Limited) C Compiler
## Prerequisites
To build BoredOS, you'll need the following tools installed:
- **x86_64 ELF Toolchain**: `x86_64-elf-gcc`, `x86_64-elf-ld`
- **NASM**: Netwide Assembler for compiling assembly code
- **xorriso**: For creating bootable ISO images
- **QEMU** (optional): For testing the kernel in an emulator
On macOS, you can install these using Homebrew:
```sh
brew install x86_64-elf-binutils x86_64-elf-gcc nasm xorriso qemu
```
## Building
Simply run `make` from the project root:
```sh
make
```
This will:
1. Compile all kernel C sources and assembly files
2. Link the kernel ELF binary
3. Generate a bootable ISO image (`boredos.iso`)
The build output is organized as follows:
- Compiled object files: `build/`
- ISO root filesystem: `iso_root/`
- Final ISO image: `boredos.iso`
## Running
### QEMU Emulation
Run the kernel in QEMU:
```sh
make run
```
Or manually:
```sh
qemu-system-x86_64 -m 2G -serial stdio -cdrom boredos.iso -boot d
```
### Running on Real Hardware
*Warning: This is at YOUR OWN RISK. This software comes with ZERO warranty and may break your system.*
1. **Create bootable USB**: Use [Balena Etcher](https://www.balena.io/etcher/) to flash `boredos.iso` to a USB drive
2. **Prepare the system**:
- Enable legacy (BIOS) boot in your system BIOS/UEFI settings
- Disable Secure Boot if needed
3. **Boot**: Insert the USB drive and select it in the boot menu during startup
**Networking requires an Intel E1000 network card or similar while using Ethernet.**
4. **Tested Hardware**:
- HP EliteDesk 705 G4 DM (AMD Ryzen 5 PRO 2400G, Radeon Vega) **Tested, no networking.**
- Lenovo ThinkPad A475 20KL002VMH (AMD Pro A12-8830B, Radeon R7) **Tested, no networking.**
- Acer Aspire E5-573-311M (Intel Core i3-5005U, Intel HD Graphics) **Tested, no networking.**
## Project Structure
- `src/kernel/` - Main kernel implementation
- `boot.asm` - Boot assembly code
- `main.c` - Kernel entry point
- `*.c / *.h` - Core kernel modules (graphics, interrupts, filesystem, etc.)
- `cli_apps/` - Command-line applications
- `build/` - Compiled object files (generated during build)
- `iso_root/` - ISO filesystem layout (generated during build)
- `limine/` - Limine bootloader files (downloaded automatically)
- `linker.ld` - Linker script for x86_64 ELF
- `limine.cfg` - Limine bootloader configuration
- `Makefile` - Build configuration and targets
###
###
<h2 align="left">Help me brew some coffee! ☕️</h2>
###
<p align="left">
If you enjoy this project, and like what i'm doing here, consider buying me a coffee!
<br><br>
<a href="https://buymeacoffee.com/boreddevnl" target="_blank">
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="50" style="border-radius: 8px;" />
</a>
</p>
###
## This project was previously labeled as "BrewKernel"
Brewkernel was a text only very simple (and messy) project i started 3 years ago. It was my first work in OSDev and i absolutely loved it. It sadly just got too messy and i myself couldn't understand my own code anymore. About a year ago i started work on BoredOS, and pushed a *"working"* version of it a few days ago as of writing this *(Feb. 10 2026)*
Brewkernel has already been deprecated and will not be accepting any pull requests or fix any issues as it is now a public archive.
Thanks to everyone who helped me with Brewkernel, even if it were just ideas, and intend to keep working on this for the forseeable future!
## License
Copyright (C) 2024-2026 boreddevnl
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
NOTICE
------
This product includes software developed by Chris ("boreddevnl") as part of the BoredOS (Previously Brewkernel/BrewOS) project.
Copyright (C) 20242026 Chris / boreddevnl (previously boreddevhq)
All source files in this repository contain copyright and license
headers that must be preserved in redistributions and derivative works.
If you distribute or modify this project (in whole or in part),
you MUST:
- Retain all copyright and license headers at the top of each file.
- Include this NOTICE file along with any redistributions or
derivative works.
- Provide clear attribution to the original author in documentation
or credits where appropriate.
The above attribution requirements are informational and intended to
ensure proper credit is given. They do not alter or supersede the
terms of the GNU General Public License (GPL), which governs this work.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,9 +0,0 @@
TIMEOUT=3
:BoredOS
PROTOCOL=limine
KERNEL_PATH=boot:///boredos.elf
#FRAMEBUFFER_WIDTH=1280
#FRAMEBUFFER_HEIGHT=720

1
limine

Submodule limine deleted from efd130dbb6

View File

@@ -1,9 +0,0 @@
TIMEOUT=3
:BoredOS
PROTOCOL=limine
KERNEL_PATH=boot:///boredos.elf
#FRAMEBUFFER_WIDTH=1280
#FRAMEBUFFER_HEIGHT=720

16
limine.conf Normal file
View File

@@ -0,0 +1,16 @@
# Copyright (c) 2023-2026 Chris (boreddevnl)
# This software is released under the GNU General Public License v3.0. See LICENSE file for details.
# This header needs to maintain in any file it is present in, as per the GPL license terms.
timeout: 3
verbose: yes
${WALLPAPER_PATH}=boot():/splash.jpg
wallpaper: ${WALLPAPER_PATH}
wallpaper_style: centered
backdrop: 000000
/BoredOS
protocol: limine
path: boot():/boredos.elf
cmdline: -v

View File

@@ -15,6 +15,12 @@ SECTIONS
*(.rodata*) *(.rodata*)
} }
.requests : {
KEEP(*(.requests_start))
KEEP(*(.requests))
KEEP(*(.requests_end))
}
.data : { .data : {
*(.data*) *(.data*)
} }
@@ -24,14 +30,6 @@ SECTIONS
*(.bss*) *(.bss*)
} }
/* Limine requests section */
.requests : {
KEEP(*(.requests_start))
KEEP(*(.requests))
KEEP(*(.requests_end))
}
/* Discard unnecessary sections */
/DISCARD/ : { /DISCARD/ : {
*(.eh_frame) *(.eh_frame)
*(.note .note.*) *(.note .note.*)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 897 KiB

Some files were not shown because too many files have changed in this diff Show More