xref: /minix/minix/kernel/table.c (revision 2a404668)
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 
34 /* The system image table lists all programs that are part of the boot image.
35  * The order of the entries here MUST agree with the order of the programs
36  * in the boot image and all kernel tasks must come first.
37  * The order of the entries here matches the priority NOTIFY messages are
38  * delivered to a given process. NOTIFY messages are always delivered with
39  * the highest priority. DS must be the first system process in the list to
40  * allow reliable asynchronous publishing of system events. RS comes right after
41  * to prioritize ping messages periodically delivered to system processes.
42  */
43 
44 struct boot_image image[NR_BOOT_PROCS] = {
45 /* process nr, name */
46 {ASYNCM,        "asyncm"},
47 {IDLE,          "idle"  },
48 {CLOCK,         "clock" },
49 {SYSTEM,        "system"},
50 {HARDWARE,      "kernel"},
51 
52 {DS_PROC_NR,    "ds"    },
53 {RS_PROC_NR,    "rs"    },
54 
55 {PM_PROC_NR,    "pm"    },
56 {SCHED_PROC_NR, "sched" },
57 {VFS_PROC_NR,   "vfs"   },
58 {MEM_PROC_NR,   "memory"},
59 {TTY_PROC_NR,   "tty"   },
60 {MIB_PROC_NR,   "mib"   },
61 {VM_PROC_NR,    "vm"    },
62 {PFS_PROC_NR,   "pfs"   },
63 {MFS_PROC_NR,   "mfs"   },
64 {INIT_PROC_NR,  "init"  },
65 };
66 
67