xref: /minix/minix/kernel/table.c (revision 7f5f010b)
1 /* The object file of "table.c" contains most kernel data. Variables that
2  * are declared in the *.h files appear with EXTERN in front of them, as in
3  *
4  *    EXTERN int x;
5  *
6  * Normally EXTERN is defined as extern, so when they are included in another
7  * file, no storage is allocated.  If EXTERN were not present, but just say,
8  *
9  *    int x;
10  *
11  * then including this file in several source files would cause 'x' to be
12  * declared several times.  While some linkers accept this, others do not,
13  * so they are declared extern when included normally.  However, it must be
14  * declared for real somewhere.  That is done here, by redefining EXTERN as
15  * the null string, so that inclusion of all *.h files in table.c actually
16  * generates storage for them.
17  *
18  * Various variables could not be declared EXTERN, but are declared PUBLIC
19  * or PRIVATE. The reason for this is that extern variables cannot have a
20  * default initialization. If such variables are shared, they must also be
21  * declared in one of the *.h files without the initialization.  Examples
22  * include 'boot_image' (this file) and 'idt' and 'gdt' (protect.c).
23  *
24  * Changes:
25  *    Nov 22, 2009   rewrite of privilege management (Cristiano Giuffrida)
26  *    Aug 02, 2005   set privileges and minimal boot image (Jorrit N. Herder)
27  *    Oct 17, 2004   updated above and tasktab comments  (Jorrit N. Herder)
28  *    May 01, 2004   changed struct for system image  (Jorrit N. Herder)
29  */
30 #define _TABLE
31 
32 #include "kernel/kernel.h"
33 #include <minix/com.h>
34 
35 /* The system image table lists all programs that are part of the boot image.
36  * The order of the entries here MUST agree with the order of the programs
37  * in the boot image and all kernel tasks must come first.
38  * The order of the entries here matches the priority NOTIFY messages are
39  * delivered to a given process. NOTIFY messages are always delivered with
40  * the highest priority. DS must be the first system process in the list to
41  * allow reliable asynchronous publishing of system events. RS comes right after
42  * to prioritize ping messages periodically delivered to system processes.
43  */
44 
45 struct boot_image image[NR_BOOT_PROCS] = {
46 /* process nr, flags, stack size, name */
47 {ASYNCM,        "asyncm"},
48 {IDLE,          "idle"  },
49 {CLOCK,         "clock" },
50 {SYSTEM,        "system"},
51 {HARDWARE,      "kernel"},
52 
53 {DS_PROC_NR,    "ds"    },
54 {RS_PROC_NR,    "rs"    },
55 
56 {PM_PROC_NR,    "pm"    },
57 {SCHED_PROC_NR, "sched" },
58 {VFS_PROC_NR,   "vfs"   },
59 {MEM_PROC_NR,   "memory"},
60 {TTY_PROC_NR,   "tty"   },
61 {MFS_PROC_NR,   "mfs"   },
62 {VM_PROC_NR,    "vm"    },
63 {PFS_PROC_NR,   "pfs"   },
64 {INIT_PROC_NR,  "init"  },
65 };
66 
67