mirror of
https://github.com/JannisHeydemann/BoredOS.git
synced 2026-05-30 02:16:58 +00:00
Tweak: Improved Documentation and README.MD
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
# Creating a Custom App (Step-by-Step)
|
||||
<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.
|
||||
|
||||
## Step 1: Write the C Source
|
||||
## 📝 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`.
|
||||
|
||||
@@ -44,7 +49,7 @@ int main(void) {
|
||||
}
|
||||
```
|
||||
|
||||
## Step 2: Edit the Makefile
|
||||
## ⚙️ 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!
|
||||
|
||||
@@ -56,7 +61,7 @@ Now you need to tell the build system to compile `hello.c`. Fortunately, the `sr
|
||||
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
|
||||
## 📦 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.
|
||||
|
||||
@@ -69,11 +74,14 @@ The main overarching `Makefile` (in the project root) takes binaries from `src/u
|
||||
make clean && make run
|
||||
```
|
||||
|
||||
## Step 4: Run it inside BoredOS
|
||||
## 🚀 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!
|
||||
4. Your custom window will appear!
|
||||
|
||||
*you can also open your app by opening the file explorer and navigating to the bin directory and double clicking the executable.*
|
||||
> [!NOTE]
|
||||
> You can also open your app by opening the file explorer, navigating to the `bin` directory, and double-clicking the executable.
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user