
The new MIB service implements the sysctl(2) system call which, as we adopt more NetBSD code, is an increasingly important part of the operating system API. The system call is implemented in the new service rather than as part of an existing service, because it will eventually call into many other services in order to gather data, similar to ProcFS. Since the sysctl(2) functionality is used even by init(8), the MIB service is added to the boot image. MIB stands for Management Information Base, and the MIB service should be seen as a knowledge base of management information. The MIB service implementation of the sysctl(2) interface is fairly complete; it incorporates support for both static and dynamic nodes and imitates many NetBSD-specific quirks expected by userland. The patch also adds trace(1) support for the new system call, and adds a new test, test87, which tests the fundamental operation of the MIB service rather thoroughly. Change-Id: I4766b410b25e94e9cd4affb72244112c2910ff67
68 lines
2.6 KiB
C
68 lines
2.6 KiB
C
/* The object file of "table.c" contains most kernel data. Variables that
|
|
* are declared in the *.h files appear with EXTERN in front of them, as in
|
|
*
|
|
* EXTERN int x;
|
|
*
|
|
* Normally EXTERN is defined as extern, so when they are included in another
|
|
* file, no storage is allocated. If EXTERN were not present, but just say,
|
|
*
|
|
* int x;
|
|
*
|
|
* then including this file in several source files would cause 'x' to be
|
|
* declared several times. While some linkers accept this, others do not,
|
|
* so they are declared extern when included normally. However, it must be
|
|
* declared for real somewhere. That is done here, by redefining EXTERN as
|
|
* the null string, so that inclusion of all *.h files in table.c actually
|
|
* generates storage for them.
|
|
*
|
|
* Various variables could not be declared EXTERN, but are declared PUBLIC
|
|
* or PRIVATE. The reason for this is that extern variables cannot have a
|
|
* default initialization. If such variables are shared, they must also be
|
|
* declared in one of the *.h files without the initialization. Examples
|
|
* include 'boot_image' (this file) and 'idt' and 'gdt' (protect.c).
|
|
*
|
|
* Changes:
|
|
* Nov 22, 2009 rewrite of privilege management (Cristiano Giuffrida)
|
|
* Aug 02, 2005 set privileges and minimal boot image (Jorrit N. Herder)
|
|
* Oct 17, 2004 updated above and tasktab comments (Jorrit N. Herder)
|
|
* May 01, 2004 changed struct for system image (Jorrit N. Herder)
|
|
*/
|
|
#define _TABLE
|
|
|
|
#include "kernel/kernel.h"
|
|
#include <minix/com.h>
|
|
|
|
/* The system image table lists all programs that are part of the boot image.
|
|
* The order of the entries here MUST agree with the order of the programs
|
|
* in the boot image and all kernel tasks must come first.
|
|
* The order of the entries here matches the priority NOTIFY messages are
|
|
* delivered to a given process. NOTIFY messages are always delivered with
|
|
* the highest priority. DS must be the first system process in the list to
|
|
* allow reliable asynchronous publishing of system events. RS comes right after
|
|
* to prioritize ping messages periodically delivered to system processes.
|
|
*/
|
|
|
|
struct boot_image image[NR_BOOT_PROCS] = {
|
|
/* process nr, name */
|
|
{ASYNCM, "asyncm"},
|
|
{IDLE, "idle" },
|
|
{CLOCK, "clock" },
|
|
{SYSTEM, "system"},
|
|
{HARDWARE, "kernel"},
|
|
|
|
{DS_PROC_NR, "ds" },
|
|
{RS_PROC_NR, "rs" },
|
|
|
|
{PM_PROC_NR, "pm" },
|
|
{SCHED_PROC_NR, "sched" },
|
|
{VFS_PROC_NR, "vfs" },
|
|
{MEM_PROC_NR, "memory"},
|
|
{TTY_PROC_NR, "tty" },
|
|
{MIB_PROC_NR, "mib" },
|
|
{VM_PROC_NR, "vm" },
|
|
{PFS_PROC_NR, "pfs" },
|
|
{MFS_PROC_NR, "mfs" },
|
|
{INIT_PROC_NR, "init" },
|
|
};
|
|
|