Add PIDs and Milestone 3 preparation
This commit is contained in:
parent
f46cf6d66a
commit
22401e4cb0
@ -6,5 +6,6 @@ bootdriver /armv8/sbin/boot_armv8_generic
|
||||
cpudriver /armv8/sbin/cpu_a57_qemu loglevel=3 serial=0x9000000 logmask=128
|
||||
module /armv8/sbin/init
|
||||
module /armv8/sbin/hello catch Aurel Jan Sandro
|
||||
module /armv8/sbin/memeater
|
||||
|
||||
# End of file, this needs to have a certain length...
|
||||
|
||||
@ -6,3 +6,4 @@ bootdriver /armv8/sbin/boot_armv8_generic
|
||||
cpudriver /armv8/sbin/cpu_imx8x
|
||||
module /armv8/sbin/init
|
||||
module /armv8/sbin/hello catch Aurel Jan Sandro
|
||||
module /armv8/sbin/memeater
|
||||
@ -25,6 +25,8 @@ struct spawninfo {
|
||||
struct spawninfo *next;
|
||||
struct capref dispatcher; // < dispatcher used to start/stop the child process
|
||||
|
||||
domainid_t pid; // < unique id for this domain
|
||||
|
||||
// Information about the binary
|
||||
char * binary_name; // Name of the binary
|
||||
|
||||
|
||||
@ -17,6 +17,8 @@ extern struct bootinfo *bi;
|
||||
extern coreid_t my_core_id;
|
||||
|
||||
struct spawninfo *spawn_process_list = NULL;
|
||||
// TODO: handle "freeing" of PIDs in case we learn how to detect stopped child processes
|
||||
domainid_t spawn_last_pid = 1;
|
||||
|
||||
|
||||
|
||||
@ -302,6 +304,11 @@ static errval_t spawn_serialize_vspace(struct spawninfo *si, struct paging_state
|
||||
errval_t spawn_load_argv(int argc, char *argv[], struct spawninfo *si,
|
||||
domainid_t *pid) {
|
||||
errval_t err;
|
||||
|
||||
if(spawn_last_pid == MAX_DOMAINID) {
|
||||
return SPAWN_ERR_OUT_OF_PIDS;
|
||||
}
|
||||
|
||||
// - Initialize the spawn_info struct
|
||||
// TODO
|
||||
|
||||
@ -565,6 +572,10 @@ errval_t spawn_load_argv(int argc, char *argv[], struct spawninfo *si,
|
||||
);
|
||||
if (err_is_fail(err)) return err_push(err, SPAWN_ERR_RUN);
|
||||
|
||||
// Get a unique PID
|
||||
si->pid = ++spawn_last_pid;
|
||||
*pid = si->pid;
|
||||
|
||||
return SYS_ERR_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
let
|
||||
-- Default list of modules to build/install
|
||||
modules_common = [ "/sbin/" ++ f | f <- [ "init", "hello"
|
||||
modules_common = [ "/sbin/" ++ f | f <- [ "init", "hello", "memeater"
|
||||
] ]
|
||||
in
|
||||
[
|
||||
|
||||
Loading…
Reference in New Issue
Block a user