diff --git a/examples/typephp-os/Makefile b/examples/typephp-os/Makefile index 257a8a12..69735365 100644 --- a/examples/typephp-os/Makefile +++ b/examples/typephp-os/Makefile @@ -116,7 +116,7 @@ $(BOOTSTRAP_OBJECT): boot/boot.S | $(OBJECT_DIR) $(KERNEL64_ENTRY_OBJECT): boot/kernel64-entry.S | $(OBJECT_DIR) gcc $(KERNEL64_BOOTFLAGS) -c $< -o $@ -$(OBJECT_DIR)/%.o: user/%.c $(USER_HEADERS) kernel/core/abi/typephp_os_syscall.h | $(OBJECT_DIR) +$(OBJECT_DIR)/%.o: user/cmd/%.c $(USER_HEADERS) kernel/core/abi/typephp_os_syscall.h | $(OBJECT_DIR) gcc $(USER_CFLAGS) -c $< -o $@ $(OPENLIBM_SOURCES): | thirdparty diff --git a/examples/typephp-os/README.md b/examples/typephp-os/README.md index ce20c5b2..c46ee1b7 100644 --- a/examples/typephp-os/README.md +++ b/examples/typephp-os/README.md @@ -22,7 +22,7 @@ boot/ Make-built startup assembly and linker scripts kernel/*.php TypePHP kernel implementation kernel/core/ Native kernel implementation compiled by tpc kernel/core/abi/ Freestanding C/POSIX and C++ compatibility boundary -user/ Independently built Ring-3 programs and bootstrap libc +user/ Ring-3 commands, TypePHP projects, headers, and runtime ``` Additional TypePHP kernel files stay directly under `kernel/` until a concrete diff --git a/examples/typephp-os/user/README.md b/examples/typephp-os/user/README.md index 31327aa2..0979e9e7 100644 --- a/examples/typephp-os/user/README.md +++ b/examples/typephp-os/user/README.md @@ -33,6 +33,10 @@ The following rules are normative for this directory: programs must link the same `libtypephp-os.a` platform runtime instead of maintaining private startup or libc copies. +The resident shell and its standalone C command sources live under `cmd/`. +Reusable startup, syscall, POSIX/libc, C++ ABI, and math support lives under +`runtime/` and is emitted only as `build/libtypephp-os.a`. + The current shared userspace runtime provides `syscall`, `read`, `write`, `openat`, `open`, `close`, `lseek`, `getcwd`, `chdir`, `mkdir`, `rmdir`, `unlink`, `rename`, `stat`, `lstat`, `fstat`, `access`, `fsync`, `fdatasync`, `truncate`, diff --git a/examples/typephp-os/user/builtins.c b/examples/typephp-os/user/cmd/builtins.c similarity index 100% rename from examples/typephp-os/user/builtins.c rename to examples/typephp-os/user/cmd/builtins.c diff --git a/examples/typephp-os/user/cat.c b/examples/typephp-os/user/cmd/cat.c similarity index 100% rename from examples/typephp-os/user/cat.c rename to examples/typephp-os/user/cmd/cat.c diff --git a/examples/typephp-os/user/cd.c b/examples/typephp-os/user/cmd/cd.c similarity index 100% rename from examples/typephp-os/user/cd.c rename to examples/typephp-os/user/cmd/cd.c diff --git a/examples/typephp-os/user/date.c b/examples/typephp-os/user/cmd/date.c similarity index 100% rename from examples/typephp-os/user/date.c rename to examples/typephp-os/user/cmd/date.c diff --git a/examples/typephp-os/user/echo.c b/examples/typephp-os/user/cmd/echo.c similarity index 100% rename from examples/typephp-os/user/echo.c rename to examples/typephp-os/user/cmd/echo.c diff --git a/examples/typephp-os/user/fault.c b/examples/typephp-os/user/cmd/fault.c similarity index 100% rename from examples/typephp-os/user/fault.c rename to examples/typephp-os/user/cmd/fault.c diff --git a/examples/typephp-os/user/ls.c b/examples/typephp-os/user/cmd/ls.c similarity index 100% rename from examples/typephp-os/user/ls.c rename to examples/typephp-os/user/cmd/ls.c diff --git a/examples/typephp-os/user/memtest.c b/examples/typephp-os/user/cmd/memtest.c similarity index 100% rename from examples/typephp-os/user/memtest.c rename to examples/typephp-os/user/cmd/memtest.c diff --git a/examples/typephp-os/user/mkdir.c b/examples/typephp-os/user/cmd/mkdir.c similarity index 100% rename from examples/typephp-os/user/mkdir.c rename to examples/typephp-os/user/cmd/mkdir.c diff --git a/examples/typephp-os/user/mv.c b/examples/typephp-os/user/cmd/mv.c similarity index 100% rename from examples/typephp-os/user/mv.c rename to examples/typephp-os/user/cmd/mv.c diff --git a/examples/typephp-os/user/pwd.c b/examples/typephp-os/user/cmd/pwd.c similarity index 100% rename from examples/typephp-os/user/pwd.c rename to examples/typephp-os/user/cmd/pwd.c diff --git a/examples/typephp-os/user/rm.c b/examples/typephp-os/user/cmd/rm.c similarity index 100% rename from examples/typephp-os/user/rm.c rename to examples/typephp-os/user/cmd/rm.c diff --git a/examples/typephp-os/user/rmdir.c b/examples/typephp-os/user/cmd/rmdir.c similarity index 100% rename from examples/typephp-os/user/rmdir.c rename to examples/typephp-os/user/cmd/rmdir.c diff --git a/examples/typephp-os/user/sh.c b/examples/typephp-os/user/cmd/sh.c similarity index 100% rename from examples/typephp-os/user/sh.c rename to examples/typephp-os/user/cmd/sh.c diff --git a/examples/typephp-os/user/systest.c b/examples/typephp-os/user/cmd/systest.c similarity index 100% rename from examples/typephp-os/user/systest.c rename to examples/typephp-os/user/cmd/systest.c diff --git a/examples/typephp-os/user/touch.c b/examples/typephp-os/user/cmd/touch.c similarity index 100% rename from examples/typephp-os/user/touch.c rename to examples/typephp-os/user/cmd/touch.c diff --git a/examples/typephp-os/user/uname.c b/examples/typephp-os/user/cmd/uname.c similarity index 100% rename from examples/typephp-os/user/uname.c rename to examples/typephp-os/user/cmd/uname.c diff --git a/examples/typephp-os/user/vmfault.c b/examples/typephp-os/user/cmd/vmfault.c similarity index 100% rename from examples/typephp-os/user/vmfault.c rename to examples/typephp-os/user/cmd/vmfault.c diff --git a/examples/typephp-os/user/wrfault.c b/examples/typephp-os/user/cmd/wrfault.c similarity index 100% rename from examples/typephp-os/user/wrfault.c rename to examples/typephp-os/user/cmd/wrfault.c diff --git a/examples/typephp-os/user/write.c b/examples/typephp-os/user/cmd/write.c similarity index 100% rename from examples/typephp-os/user/write.c rename to examples/typephp-os/user/cmd/write.c