feat: implement per-process environment variables (AI)
- Created env.c/h: key=value store with ENV_MAX_VARS=32 entries per process. Supports get, set, unset, and copy operations. - Added env_block_t and cwd[128] fields to process_t struct. - process_create() initializes CWD=/ by default. - Fork inherits environment via memcpy of the entire process_t. - Added SYS_GETENV (8) and SYS_SETENV (9) system calls. - Created env-test user app that verifies: CWD default, set/get, and inheritance across fork. - Updated kernel.c to launch 'sh' as init process (for next task). - Updated README.md to check off environment variables task. Tested: env-test reads CWD=/, sets TEST=hello, reads it back, forks child which inherits TEST=hello. All verified via QEMU.
This commit is contained in:
@@ -19,6 +19,7 @@ add_executable(kernel
|
||||
cpio.c
|
||||
vfs.c
|
||||
initrd_fs.c
|
||||
env.c
|
||||
interrupts.S
|
||||
kernel.c
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user