aos/include/spawn/spawn.h
2022-03-22 22:36:38 +01:00

68 lines
2.8 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* \file
* \brief create child process library
*/
/*
* Copyright (c) 2016, ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
* If you do not find this file, copies can be found by writing to:
* ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group.
*/
#ifndef _INIT_SPAWN_H_
#define _INIT_SPAWN_H_
#include "aos/slot_alloc.h"
#include "aos/paging.h"
struct spawninfo {
// the next in the list of spawned domains
struct spawninfo *next;
// Information about the binary
char * binary_name; // Name of the binary
// TODO(M2): Add fields you need to store state
// when spawning a new dispatcher,
// e.g. references to the child's
// capabilities or paging state
//afeer: see script page 84/85
struct cnoderef cspace_l1_cnode_info;
struct capref cspace_l1_cnode_cap;
struct cnoderef cspace_l2_cnode_taskcn; // < Contains information about the process itself.
struct cnoderef cspace_l2_cnode_slot_alloc_0; // < Empty L2 Node that contains space for the childs initial slot allocator. When the new process starts creating and retyping capa- bilities, they will be stored in here.
struct cnoderef cspace_l2_cnode_slot_alloc_1; // < A second L2 Node for the slot allocator to use.
struct cnoderef cspace_l2_cnode_slot_alloc_2; // < A third L2 Node for the slot allocator to use.
struct cnoderef cspace_l2_cnode_base_pagecn; // < Each slot holds a BASE_PAGE_SIZEd RAM capability.
struct cnoderef cspace_l2_cnode_pagecn; // < Contains capabilites to the pagetable
// these capabilites are all stored in the taskcn cnode
struct capref cspace_cap_selfep; // < Endpoint to itself. You can get this capability by retyping the dispatcher capability to ObjType_EndPointLMP.
struct capref cspace_cap_dispatcher; // < Contains the dispatcher capability.The dispatcher is the equivalent of a “Process Control Block” in other operating systems. You can create one using dispatcher_create(...);
struct capref cspace_cap_rootcn; // < Contains a capability for the root (L1) CNode.
struct capref cspace_cap_dispframe; // < A capability to the dispatcher frame, used to communicate between a process and the CPU driver.
struct capref cspace_cap_argspage; // < A page containing a list of command line arguments.
struct capref vspace_cap_l0_pagetable;
};
// Start a child process using the multiboot command line. Fills in si.
errval_t spawn_load_by_name(char *binary_name, struct spawninfo * si,
domainid_t *pid);
// Start a child with an explicit command line. Fills in si.
errval_t spawn_load_argv(int argc, char *argv[], struct spawninfo *si,
domainid_t *pid);
#endif /* _INIT_SPAWN_H_ */