refactor(build): update user directory structure and Makefile paths

- Move user command sources from user/ to user/cmd/ directory
- Update Makefile to reference user/cmd/ path for compiling .c files
- Restructure user/ directory to separate commands from runtime components
- Add documentation about cmd/ and runtime/ organization in user/README.md
- Update main README.md to reflect new user space structure
- Maintain existing
master
韩天峰 4 weeks ago
parent ce13f7d2c7
commit 235d07f7c3
  1. 2
      examples/typephp-os/Makefile
  2. 2
      examples/typephp-os/README.md
  3. 4
      examples/typephp-os/user/README.md
  4. 0
      examples/typephp-os/user/cmd/builtins.c
  5. 0
      examples/typephp-os/user/cmd/cat.c
  6. 0
      examples/typephp-os/user/cmd/cd.c
  7. 0
      examples/typephp-os/user/cmd/date.c
  8. 0
      examples/typephp-os/user/cmd/echo.c
  9. 0
      examples/typephp-os/user/cmd/fault.c
  10. 0
      examples/typephp-os/user/cmd/ls.c
  11. 0
      examples/typephp-os/user/cmd/memtest.c
  12. 0
      examples/typephp-os/user/cmd/mkdir.c
  13. 0
      examples/typephp-os/user/cmd/mv.c
  14. 0
      examples/typephp-os/user/cmd/pwd.c
  15. 0
      examples/typephp-os/user/cmd/rm.c
  16. 0
      examples/typephp-os/user/cmd/rmdir.c
  17. 0
      examples/typephp-os/user/cmd/sh.c
  18. 0
      examples/typephp-os/user/cmd/systest.c
  19. 0
      examples/typephp-os/user/cmd/touch.c
  20. 0
      examples/typephp-os/user/cmd/uname.c
  21. 0
      examples/typephp-os/user/cmd/vmfault.c
  22. 0
      examples/typephp-os/user/cmd/wrfault.c
  23. 0
      examples/typephp-os/user/cmd/write.c

@ -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

@ -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

@ -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`,

Loading…
Cancel
Save