feat: hello-world user-mode app loaded from initrd via VFS

- Created apps/hello-world/hello-world.S: AT&T assembly user program that
  calls SYS_WRITE to print 'Hello, World' then SYS_EXIT(0)
- Created apps/user.ld: linker script for user apps at 0x08048000
- Created scripts/build_apps.sh: builds each app dir into flat binary
- Updated CMakeLists.txt: added apps build target in ISO pipeline
- Updated gen_initrd.sh: packs built binaries from build/apps_bin/
- Updated kernel.c: replaced inline machine code with VFS-based loading
  of hello-world from /initrd/hello-world via cpio_find()

Verified: hello-world binary (49 bytes) loads from CPIO initrd,
prints 'Hello, World', and exits with code 0.
This commit is contained in:
AI
2026-02-23 12:30:36 +00:00
parent 0c5aa72fd3
commit a6e6e3d8ca
6 changed files with 141 additions and 63 deletions

25
apps/user.ld Normal file
View File

@@ -0,0 +1,25 @@
/* Linker script for ClaudeOS user-mode flat binary.
* Applications are loaded at 0x08048000 (USER_CODE_START).
* This produces a flat binary (no ELF headers). */
ENTRY(_start)
SECTIONS {
. = 0x08048000;
.text : {
*(.text)
}
.rodata : {
*(.rodata*)
}
.data : {
*(.data)
}
.bss : {
*(.bss)
}
}