summaryrefslogtreecommitdiff
path: root/sys/kern/kern_spawn.c
AgeCommit message (Collapse)Author
15 hourskernel: Increment g_nthreads in proc_init() onlyIan Moffett
It seems somewhat dangerous to have to manually increment the number of threads every time we make a process. This change makes every call to proc_init() increment the number of threads. The value is decremented once the process exits. Signed-off-by: Ian Moffett <ian@osmora.org>
16 hourskernel: proc: Add proc_init() routineIan Moffett
This commit moves a lot of initialization logic within spawn() into the proc_init() function. The logic of spawning a process from an executable should not have mixed with the logic of initializing a process. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-07-17kernel: spawn: Deprecate SPAWN_WAITIan Moffett
Deprecate SPAWN_WAIT in favor of waitpid() Signed-off-by: Ian Moffett <ian@osmora.org>
2025-07-17kernel: spawn: Add waitpid()Ian Moffett
Add waitpid() in preparation of deprecating SPAWN_WAIT. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-07-17kernel: spawn: Continue if procp NULLIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-07-16kernel: Move 'g_nthreads' to kern_accnt.cIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-07-16kernel: proc: Decrement proc count on exitIan Moffett
Previously, our process counter was monotonic (wuh oh!). We want to be sure that it decrements when a process exits. - Rename nthreads to g_nthreads as a global - Atomically increment on enter and decrement on exit Signed-off-by: Ian Moffett <ian@osmora.org>
2025-07-09kernel: proc: Add cred per processaIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-13kernel: spawn: Add argv + stub envp argumentsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-13kernel: Only free thread data on exitIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-09kernel: spawn: Wait on both PROC_SLEEP + PROC_ZOMBIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-09kernel: spawn: Set PROC_WAITED before td enqueueIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-09kernel: spawn: Ensure pathbuf is zeroedIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-09kernel: spawn: Improve wait sleep handlingIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-06-08kernel: spawn: Return process exit status on failIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-31kernel: spawn: Fix fmt argIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-31kernel: spawn: Add support for SPAWN_WAIT flagIan Moffett
Add SPAWN_WAIT flag that causes spawn() to wait until the child process completes. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-31kernel: proc: `spawn_data' -> `data'Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-31kernel: spawn: Add missing includeIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-28kernel: exit: Handle killings of kernel threadsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-16kernel: spawn: Exit on execve() failureIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-16kernel: spawn: Add proper spawn impl + SYS_spawnIan Moffett
This commit introduces a more complete spawn implementation as well as the SYS_spawn syscall and a libc interface. Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-15kernel: proc: Do not introduce fork()Ian Moffett
Simplicity is divine, fork() may be powerful but is no longer simple. It became a thing in the late 70s during the early days of UNIX when computing was simple, when CPUs were only 16-bits, MMUs were not prevalent and RAM was only 512 KB. However it isn't 1971 anymore, process management, CPUs and memory architecture has advanced significantly since. This commit ceases work on the fork() syscall as implementing it would only introduce unnecessary complexity, security issues, hefty processing overhead and would perpetuate what should now be considered legacy. The current best alternative would be providing a form of process spawning as well as a mechanism to wait for the child process to complete. Signed-off-by: Ian Moffett <ian@osmora.org>