Write an app
For Joshua Tree 7.6 and later. You need a Raspberry Pi 4, a microSD card and a Mac. You never touch the kernel.
1. Put Joshua Tree on a card
Clone two repositories side by side in one folder: joshuatree, and plank, the language its apps are written in. Plank needs uv. Put a FAT32 card in the Mac, then from the joshuatree folder:
tools/flash-pi.sh "/Volumes/NO NAME"
It builds the kernel, fetches the Pi's boot files, puts the Plank compiler on the card, and ejects it. Put the card in the Pi and power it on. It boots straight to the desktop. Your card has no Wi-Fi password in it; join a network later from Settings.
2. Write it on the Pi
Open the Terminal (press F1, type terminal). Build the editor once:
userrun plankc build CODE.PK
Then open a new file in it:
userrun code SKY.PK
Type this, then press Esc to save and close:
fn main() {
let name = "sky"
print(name + ": made on the pi")
}
Build it and run it:
userrun plankc build SKY.PK
userrun sky
If the program has a mistake, the build prints the line and the reason. Fix it in Code and build again. Names are up to eight letters or digits, and a name a built-in app already has (like hello or notes) runs the built-in, so pick your own.
3. Or write it in C on the Mac
One C file is a whole app. It includes jtsys.h for the system calls and starts at _start:
#include "jtsys.h"
#include "libjt/string.h"
__attribute__((section(".text.start"), used))
void _start(void) {
static const char m[] = "sun: made with the sdk\n";
jt_write(1, m, (unsigned)strlen(m));
jt_exit(7);
}
tools/mkapp.sh sun.c
That makes SUN.APP. Copy it to the card's JT/APPS/ folder, put the card back in the Pi, and userrun sun runs it. A Plank program builds on the Mac the same way with tools/plankapp.sh sky.pk.
4. Give it a window
In Plank, declare the window calls with extern fn and draw with them: jtw_open, jtw_fill, jtw_text, jtw_present, and jtw_wait for keys and clicks. store/slide.pk, the 15 puzzle, is a whole app in about a hundred lines. In C, open a window with jt_window_open and loop on jt_window_poll, as user/calendar.c does.
The headers are user/jtsys.h (every system call) and user/libjt/ (strings, drawing, fonts, pictures). Every call is listed in the architecture notes.
5. When it goes wrong
debug sky runs your app one instruction at a time for its first twelve instructions, or debug sky 40 for forty. Each line shows where it is, the instruction it runs next and the registers that changed, and the last one adds the stack. Then it runs on as usual.
6. Who can run it
Your app is unsigned. On a Pi with no accounts that does not matter: everything runs. Once the Pi has accounts, only an admin runs an unsigned app, with sudo userrun sky; the first account made is an admin. The compiler on your card is unsigned too, so build with sudo userrun plankc build SKY.PK there.
7. Put it in the store
The store is what install NAME fetches, and every app in it is signed by Joshua's key, so it runs for anyone. To add yours, open a pull request that adds store/NAME.pk or store/NAME.c. Once it is merged, every Pi gets it with install NAME.
Stuck?
Open an issue on GitHub with what you typed and what the Pi said.