reg_ax = get_reg(curpid,reg_addr("AX"));
switch (reg_ax) {
- case 0: Printf(" MM ");
+ case 0: Printf(" PM ");
break;
- case 1: Printf(" FS ");
+ case 1: Printf(" VFS ");
break;
case 2: Printf(" INET ");
break;
printf("Memory map: 0x%04.4x\n", pt->p_map[NR_LOCAL_SEGS]); /* struct mem_map */
#endif
#if DEAD_CODE
- printf("Process id passed in from MM: 0x%04.4x\n", pt->p_pid); /* int */
+ printf("Process id passed in from PM: 0x%04.4x\n", pt->p_pid); /* int */
#endif
#if 0
printf("User time in ticks: %ld\n", pt->user_time); /* time_t */
int nr_tasks, nr_procs;
extern int errno;
-/* Process tables of the kernel, MM, and FS. */
+/* Process tables of the kernel, PM, and VFS. */
struct proc *ps_proc;
struct mproc *ps_mproc;
struct fproc *ps_fproc;
time_t ps_utime; /* accumulated user time */
time_t ps_stime; /* accumulated system time */
char *ps_args; /* concatenated argument string */
- vir_bytes ps_procargs; /* initial stack frame from MM */
+ vir_bytes ps_procargs; /* initial stack frame from PM */
};
/* Ps_state field values in pstat struct above */
sysgetenv.val= val;
sysgetenv.vallen= sizeof(val);
- if (svrctl(MMGETPARAM, &sysgetenv) == -1) {
+ if (svrctl(PMGETPARAM, &sysgetenv) == -1) {
if (errno == ESRCH) {
ex |= 2;
} else {
int mayflush;
{
/* Process a SIGINT, SIGQUIT or SIGKILL char from the keyboard or SIGHUP from
- * a tty close, "stty 0", or a real RS-232 hangup. MM will send the signal to
+ * a tty close, "stty 0", or a real RS-232 hangup. PM will send the signal to
* the process group (INT, QUIT), all processes (KILL), or the session leader
* (HUP).
*/
#define REBOOT 76
#define SVRCTL 77
#define SYSUNAME 78
-#define GETSYSINFO 79 /* to PM or FS */
+#define GETSYSINFO 79 /* to PM, VFS, RS, or DS */
#define GETDENTS 80 /* to FS */
-#define LLSEEK 81 /* to FS */
-#define FSTATFS 82 /* to FS */
-#define SELECT 85 /* to FS */
-#define FCHDIR 86 /* to FS */
-#define FSYNC 87 /* to FS */
+#define LLSEEK 81 /* to VFS */
+#define FSTATFS 82 /* to VFS */
+#define SELECT 85 /* to VFS */
+#define FCHDIR 86 /* to VFS */
+#define FSYNC 87 /* to VFS */
#define GETPRIORITY 88 /* to PM */
#define SETPRIORITY 89 /* to PM */
#define GETTIMEOFDAY 90 /* to PM */
#define SETEUID 91 /* to PM */
#define SETEGID 92 /* to PM */
-#define TRUNCATE 93 /* to FS */
-#define FTRUNCATE 94 /* to FS */
-#define FCHMOD 95 /* to FS */
-#define FCHOWN 96 /* to FS */
-#define GETSYSINFO_UP 97 /* to PM or FS */
+#define TRUNCATE 93 /* to VFS */
+#define FTRUNCATE 94 /* to VFS */
+#define FCHMOD 95 /* to VFS */
+#define FCHOWN 96 /* to VFS */
+#define GETSYSINFO_UP 97 /* to PM or VFS */
#define SPROF 98 /* to PM */
#define CPROF 99 /* to PM */
/* Calls provided by PM and FS that are not part of the API */
-#define EXEC_NEWMEM 100 /* from FS or RS to PM: new memory map for
+#define EXEC_NEWMEM 100 /* from VFS or RS to PM: new memory map for
* exec
*/
#define SRV_FORK 101 /* to PM: special fork call for RS */
*/
#define SRV_KILL 111 /* to PM: special kill call for RS */
-#define TASK_REPLY 121 /* to FS: reply code from drivers, not
+#define TASK_REPLY 121 /* to VFS: reply code from drivers, not
* really a standalone call.
*/
-#define MAPDRIVER 122 /* to FS, map a device */
+#define MAPDRIVER 122 /* to VFS, map a device */
#include <minix/ioctl.h>
/* PM controls. */
-#define MMGETPARAM _IOW('M', 5, struct sysgetenv)
-#define MMSETPARAM _IOR('M', 7, struct sysgetenv)
+#define PMGETPARAM _IOW('M', 5, struct sysgetenv)
+#define PMSETPARAM _IOR('M', 7, struct sysgetenv)
struct sysgetenv {
char *key; /* Name requested. */
switch ((request >> 8) & 0xFF) {
case 'M':
case 'S':
- /* MM handles calls for itself and the kernel. */
+ /* PM handles calls for itself and the kernel. */
return _syscall(PM_PROC_NR, SVRCTL, &m);
case 'F':
case 'I':
- /* FS handles calls for itself and inet. */
+ /* VFS handles calls for itself and inet. */
return _syscall(VFS_PROC_NR, SVRCTL, &m);
default:
errno = EINVAL;
endpoint_t proc_ep; /* which proc_ep has exited */
int signr; /* signal number: 1 - 16 */
{
-/* A proc_ep has to be signaled via MM. Tell the kernel. */
+/* A proc_ep has to be signaled via PM. Tell the kernel. */
message m;
m.SIG_ENDPT = proc_ep;
/* _taskcall() is the same as _syscall() except it returns negative error
- * codes directly and not in errno. This is a better interface for MM and
- * FS.
+ * codes directly and not in errno. This is a better interface for PM and
+ * VFS.
*/
#include <lib.h>
State:
R: runnable
W: waiting (on a message)
- S: sleeping (i.e.,suspended on MM or FS)
+ S: sleeping (i.e.,suspended on PM or VFS)
Z: zombie
T: stopped
.PP
.B lp
device sends any bytes written to it to the printer.
.SS "TCP/IP (major 7)"
-The TCP/IP task is not a kernel task, but a server like MM and FS. It sits
-between FS and the DP8390 task that manages the ethernet boards. Together
+The TCP/IP task is not a kernel task, but a server like PM and VFS. It sits
+between VFS and the DP8390 task that manages the ethernet boards. Together
they implement the TCP/IP protocol. See also
.BR ip (4).
.SS "Controller 1 (major 8)"
.BR chmem (1).
.TP
0x0008
-Load MM, FS, etc. into extended memory.
+Load PM, VFS, etc. into extended memory.
.TP
0x0010
No need to patch process sizes into the kernel.
sysgetenv.keylen = 8+1;
sysgetenv.val = bootopts;
sysgetenv.vallen = sizeof(bootopts);
- if (svrctl(MMGETPARAM, &sysgetenv) == 0) *rcp++ = bootopts;
+ if (svrctl(PMGETPARAM, &sysgetenv) == 0) *rcp++ = bootopts;
*rcp = "start";
execute(rc_command);
str[5] = (flags & STOPPED) ? 'S' : '-';
str[6] = (flags & SIGSUSPENDED) ? 'U' : '-';
str[7] = (flags & REPLY) ? 'R' : '-';
- str[8] = (flags & FS_CALL) ? 'F' : '-';
+ str[8] = (flags & VFS_CALL) ? 'F' : '-';
str[9] = (flags & PM_SIG_PENDING) ? 's' : '-';
str[10] = (flags & PRIV_PROC) ? 'p' : '-';
str[11] = (flags & PARTIAL_EXEC) ? 'x' : '-';
#define offsetof(type, field) ((size_t)(&((type *)0)->field))
/* Miscellaneous constants */
-#define SYS_UID ((uid_t) 0) /* uid_t for processes MM and INIT */
-#define SYS_GID ((gid_t) 0) /* gid_t for processes MM and INIT */
+#define SYS_UID ((uid_t) 0) /* uid_t for processes PM and INIT */
+#define SYS_GID ((gid_t) 0) /* gid_t for processes PM and INIT */
{
message m;
- /* Forward call to FS */
+ /* Forward call to VFS */
m.m_type = PM_EXEC;
m.PM_PROC = mp->mp_endpoint;
m.PM_PATH = m_in.exec_name;
* do_fork: perform the FORK system call
* do_srv_fork: special FORK, used by RS to create sys services
* do_exit: perform the EXIT system call (by calling exit_proc())
- * exit_proc: actually do the exiting, and tell FS about it
- * exit_restart: continue exiting a process after FS has replied
+ * exit_proc: actually do the exiting, and tell VFS about it
+ * exit_restart: continue exiting a process after VFS has replied
* do_waitpid: perform the WAITPID or WAIT system call
* wait_test: check whether a parent is waiting for a child
*/
if (rmc->mp_tracer != NO_TRACER)
sig_proc(rmc, SIGSTOP, TRUE /*trace*/, FALSE /* ksig */);
- /* Do not reply until FS is ready to process the fork
+ /* Do not reply until VFS is ready to process the fork
* request
*/
return SUSPEND;
if (dump_core && rmp->mp_realuid != rmp->mp_effuid)
dump_core = FALSE;
- /* System processes are destroyed before informing FS, meaning that FS can
+ /* System processes are destroyed before informing VFS, meaning that VFS can
* not get their CPU state, so we can't generate a coredump for them either.
*/
if (dump_core && (rmp->mp_flags & PRIV_PROC))
p_mp->mp_child_stime += sys_time + rmp->mp_child_stime; /* add system time */
/* Tell the kernel the process is no longer runnable to prevent it from
- * being scheduled in between the following steps. Then tell FS that it
+ * being scheduled in between the following steps. Then tell VFS that it
* the process has exited and finally, clean up the process at the kernel.
- * This order is important so that FS can tell drivers to cancel requests
+ * This order is important so that VFS can tell drivers to cancel requests
* such as copying to/ from the exiting process, before it is gone.
*/
if ((r = sys_stop(proc_nr_e)) != OK) /* stop the process */
}
if (proc_nr_e == VFS_PROC_NR)
{
- panic("exit_proc: FS died: %d", r);
+ panic("exit_proc: VFS died: %d", r);
}
- /* Tell FS about the exiting process. */
+ /* Tell VFS about the exiting process. */
m.m_type = dump_core ? PM_DUMPCORE : PM_EXIT;
m.PM_PROC = rmp->mp_endpoint;
if (rmp->mp_flags & PRIV_PROC)
{
- /* Destroy system processes without waiting for FS. This is
+ /* Destroy system processes without waiting for VFS. This is
* needed because the system process might be a block device
- * driver that FS is blocked waiting on.
+ * driver that VFS is blocked waiting on.
*/
if((r= sys_clear(rmp->mp_endpoint)) != OK)
panic("exit_proc: sys_clear failed: %d", r);
/* Clean up most of the flags describing the process's state before the exit,
* and mark it as exiting.
*/
- rmp->mp_flags &= (IN_USE|FS_CALL|PRIV_PROC|TRACE_EXIT);
+ rmp->mp_flags &= (IN_USE|VFS_CALL|PRIV_PROC|TRACE_EXIT);
rmp->mp_flags |= EXITING;
- /* Keep the process around until FS is finished with it. */
+ /* Keep the process around until VFS is finished with it. */
rmp->mp_exitstatus = (char) exit_status;
struct mproc *rmp; /* pointer to the process being terminated */
int dump_core; /* flag indicating whether to dump core */
{
-/* FS replied to our exit or coredump request. Perform the second half of the
+/* VFS replied to our exit or coredump request. Perform the second half of the
* exit code.
*/
int r;
if (rp->mp_flags & ZOMBIE) {
/* This child meets the pid test and has exited. */
tell_parent(rp); /* this child has already exited */
- if (!(rp->mp_flags & FS_CALL))
+ if (!(rp->mp_flags & VFS_CALL))
cleanup(rp);
return(SUSPEND);
}
/* The 'try_cleanup' flag merely saves us from having to be really
* careful with statement ordering in exit_proc() and exit_restart().
*/
- if (try_cleanup && !(child->mp_flags & FS_CALL))
+ if (try_cleanup && !(child->mp_flags & VFS_CALL))
cleanup(child);
}
else {
/* This file contains the main program of the process manager and some related
* procedures. When MINIX starts up, the kernel runs for a little while,
- * initializing itself and its tasks, and then it runs PM and FS. Both PM
- * and FS initialize themselves as far as they can. PM asks the kernel for
+ * initializing itself and its tasks, and then it runs PM and VFS. Both PM
+ * and VFS initialize themselves as far as they can. PM asks the kernel for
* all free memory and starts serving requests.
*
* The entry points into this file are:
FORWARD _PROTOTYPE( void sendreply, (void) );
FORWARD _PROTOTYPE( int get_nice_value, (int queue) );
-FORWARD _PROTOTYPE( void handle_fs_reply, (void) );
+FORWARD _PROTOTYPE( void handle_vfs_reply, (void) );
#define click_to_round_k(n) \
((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
case PM_SETGROUPS_REPLY:
if (who_e == VFS_PROC_NR)
{
- handle_fs_reply();
+ handle_vfs_reply();
result= SUSPEND; /* don't reply */
}
else
/* Set scheduling info */
rmp->mp_scheduler = KERNEL;
- /* Tell FS about this system process. */
+ /* Tell VFS about this system process. */
mess.m_type = PM_INIT;
mess.PM_SLOT = ip->proc_nr;
mess.PM_PID = rmp->mp_pid;
mess.PM_PROC = rmp->mp_endpoint;
if (OK != (s=send(VFS_PROC_NR, &mess)))
- panic("can't sync up with FS: %d", s);
+ panic("can't sync up with VFS: %d", s);
}
}
- /* Tell FS that no more system processes follow and synchronize. */
+ /* Tell VFS that no more system processes follow and synchronize. */
mess.PR_ENDPT = NONE;
if (sendrec(VFS_PROC_NR, &mess) != OK || mess.m_type != OK)
- panic("can't sync up with FS");
+ panic("can't sync up with VFS");
#if (CHIP == INTEL)
uts_val.machine[0] = 'i';
}
/*===========================================================================*
- * handle_fs_reply *
+ * handle_vfs_reply *
*===========================================================================*/
-PRIVATE void handle_fs_reply()
+PRIVATE void handle_vfs_reply()
{
struct mproc *rmp;
endpoint_t proc_e;
proc_e = m_in.PM_PROC;
if (pm_isokendpt(proc_e, &proc_n) != OK) {
- panic("handle_fs_reply: got bad endpoint from FS: %d", proc_e);
+ panic("handle_vfs_reply: got bad endpoint from VFS: %d", proc_e);
}
rmp = &mproc[proc_n];
- /* Now that FS replied, mark the process as FS-idle again */
- if (!(rmp->mp_flags & FS_CALL))
- panic("handle_fs_reply: reply without request: %d", call_nr);
+ /* Now that VFS replied, mark the process as VFS-idle again */
+ if (!(rmp->mp_flags & VFS_CALL))
+ panic("handle_vfs_reply: reply without request: %d", call_nr);
- rmp->mp_flags &= ~FS_CALL;
+ rmp->mp_flags &= ~VFS_CALL;
if (rmp->mp_flags & UNPAUSED)
- panic("handle_fs_reply: UNPAUSED set on entry: %d", call_nr);
+ panic("handle_vfs_reply: UNPAUSED set on entry: %d", call_nr);
/* Call-specific handler code */
switch (call_nr) {
break;
default:
- panic("handle_fs_reply: unknown reply code: %d", call_nr);
+ panic("handle_vfs_reply: unknown reply code: %d", call_nr);
}
/* Now that the process is idle again, look at pending signals */
/* For the moment, this is only used to return pending signals to
* system processes that request the PM for their own status.
*
- * Future use might include the FS requesting for process status of
+ * Future use might include the VFS requesting for process status of
* any user process.
*/
else
monitor_code[0] = '\0';
- /* Order matters here. When FS is told to reboot, it exits all its
+ /* Order matters here. When VFS is told to reboot, it exits all its
* processes, and then would be confused if they're exited again by
* SIGKILL. So first kill, then reboot.
*/
req = m_in.svrctl_req;
ptr = (vir_bytes) m_in.svrctl_argp;
- /* Is the request indeed for the MM? */
+ /* Is the request indeed for the PM? */
if (((req >> 8) & 0xFF) != 'M') return(EINVAL);
/* Control operations local to the PM. */
switch(req) {
- case MMSETPARAM:
- case MMGETPARAM: {
+ case PMSETPARAM:
+ case PMGETPARAM: {
struct sysgetenv sysgetenv;
char search_key[64];
char *val_start;
sizeof(sysgetenv)) != OK) return(EFAULT);
/* Set a param override? */
- if (req == MMSETPARAM) {
+ if (req == PMSETPARAM) {
if (local_params >= MAX_LOCAL_PARAMS) return ENOSPC;
if (sysgetenv.keylen <= 0
|| sysgetenv.keylen >=
#define STOPPED 0x00080 /* set if process stopped for tracing */
#define SIGSUSPENDED 0x00100 /* set by SIGSUSPEND system call */
#define REPLY 0x00200 /* set if a reply message is pending */
-#define FS_CALL 0x00400 /* set if waiting for FS (normal calls) */
-#define PM_SIG_PENDING 0x00800 /* process got a signal while waiting for FS */
+#define VFS_CALL 0x00400 /* set if waiting for VFS (normal calls) */
+#define PM_SIG_PENDING 0x00800 /* process got a signal while waiting for VFS */
#define UNPAUSED 0x01000 /* process is not in a blocking call */
#define PRIV_PROC 0x02000 /* system process, special privileges */
#define PARTIAL_EXEC 0x04000 /* process got a new map but no content */
* sig_proc: interrupt or terminate a signaled process
* check_sig: check which processes to signal with sig_proc()
* check_pending: check if a pending signal can now be delivered
- * restart_sigs: restart signal work after finishing a FS call
+ * restart_sigs: restart signal work after finishing a VFS call
*/
#include "pm.h"
rmp->mp_flags &= ~DELAY_CALL;
/*
- * If the FS_CALL flag is still set we have a process which is stopped
+ * If the VFS_CALL flag is still set we have a process which is stopped
* and we only need to wait for a reply from VFS. We are going to check
* the pending signal then
*/
- if (rmp->mp_flags & FS_CALL)
+ if (rmp->mp_flags & VFS_CALL)
return OK;
if (rmp->mp_flags & PM_SIG_PENDING)
panic("process_ksig: bad process state");
return;
}
- if (rmp->mp_flags & FS_CALL) {
+ if (rmp->mp_flags & VFS_CALL) {
sigaddset(&rmp->mp_sigpending, signo);
if (!(rmp->mp_flags & PM_SIG_PENDING)) {
- /* No delay calls: FS_CALL implies the process called us. */
+ /* No delay calls: VFS_CALL implies the process called us. */
if ((r = sys_stop(rmp->mp_endpoint)) != OK)
panic("sys_stop failed: %d", r);
}
if (!badignore && sigismember(&rmp->mp_catch, signo)) {
/* Signal is caught. First interrupt the process's current call, if
- * applicable. This may involve a roundtrip to FS, in which case we'll
+ * applicable. This may involve a roundtrip to VFS, in which case we'll
* have to check back later.
*/
if (!(rmp->mp_flags & UNPAUSED)) {
sigdelset(&rmp->mp_sigpending, i);
sig_proc(rmp, i, FALSE /*trace*/, FALSE /* ksig */);
- if (rmp->mp_flags & FS_CALL)
+ if (rmp->mp_flags & VFS_CALL)
break;
}
}
PUBLIC void restart_sigs(rmp)
struct mproc *rmp;
{
-/* FS has replied to a request from us; do signal-related work.
+/* VFS has replied to a request from us; do signal-related work.
*/
int r;
- if (rmp->mp_flags & (FS_CALL | EXITING)) return;
+ if (rmp->mp_flags & (VFS_CALL | EXITING)) return;
if (rmp->mp_flags & TRACE_EXIT) {
/* Tracer requested exit with specific exit value */
exit_proc(rmp, rmp->mp_exitstatus, FALSE /*dump_core*/);
}
else if (rmp->mp_flags & PM_SIG_PENDING) {
- /* We saved signal(s) for after finishing a FS call. Deal with this.
+ /* We saved signal(s) for after finishing a VFS call. Deal with this.
* PM_SIG_PENDING remains set to indicate the process is still stopped.
*/
check_pending(rmp);
- /* The process may now be FS-blocked again, because a signal exited the
+ /* The process may now be VFS-blocked again, because a signal exited the
* process or was caught. Restart the process only when this is NOT the
* case.
*/
- if (!(rmp->mp_flags & FS_CALL)) {
+ if (!(rmp->mp_flags & VFS_CALL)) {
rmp->mp_flags &= ~(PM_SIG_PENDING | UNPAUSED);
if ((r = sys_resume(rmp->mp_endpoint)) != OK)
/* A signal is to be sent to a process. If that process is hanging on a
* system call, the system call must be terminated with EINTR. Possible
* calls are PAUSE, WAIT, READ and WRITE, the latter two for pipes and ttys.
- * First check if the process is hanging on an PM call. If not, tell FS,
+ * First check if the process is hanging on an PM call. If not, tell VFS,
* so it can check for READs and WRITEs from pipes, ttys and the like.
*/
message m;
return;
}
- /* Not paused in PM. Let FS try to unpause the process. */
+ /* Not paused in PM. Let VFS try to unpause the process. */
if (!(rmp->mp_flags & PM_SIG_PENDING)) {
/* Stop process from running. */
r = sys_delay_stop(rmp->mp_endpoint);
case T_EXIT: /* exit */
child->mp_flags |= TRACE_EXIT;
- /* Defer the exit if the traced process has an FS call pending. */
- if (child->mp_flags & FS_CALL)
+ /* Defer the exit if the traced process has an VFS call pending. */
+ if (child->mp_flags & VFS_CALL)
child->mp_exitstatus = (int) m_in.data; /* save for later */
else
exit_proc(child, (int) m_in.data, FALSE /*dump_core*/);
- /* Do not reply to the caller until FS has processed the exit
+ /* Do not reply to the caller until VFS has processed the exit
* request.
*/
return(SUSPEND);
*/
int r;
- if (rmp->mp_flags & FS_CALL)
+ if (rmp->mp_flags & VFS_CALL)
panic("tell_vfs: not idle: %d", m_ptr->m_type);
r = asynsend3(VFS_PROC_NR, m_ptr, AMF_NOREPLY);
if (r != OK)
- panic("unable to send to FS: %d", r);
+ panic("unable to send to VFS: %d", r);
- rmp->mp_flags |= FS_CALL;
+ rmp->mp_flags |= VFS_CALL;
}
int unmap_ok = 0;
{
/* Perform the execve(name, argv, envp) call. The user library builds a
* complete stack image, including pointers, args, environ, etc. The stack
- * is copied to a buffer inside FS, and then to the new core image.
+ * is copied to a buffer inside VFS, and then to the new core image.
*/
int r, r1, sep_id, round, proc_s, hdrlen, load_text, allow_setuid;
vir_bytes text_bytes, data_bytes, bss_bytes, pc;
return(r);
}
- /* Patch up stack and copy it from FS to new core image. */
+ /* Patch up stack and copy it from VFS to new core image. */
vsp = stack_top;
vsp -= frame_len;
patch_ptr(mbuf, vsp);
*===========================================================================*/
PRIVATE int patch_stack(vp, stack, stk_bytes)
struct vnode *vp; /* pointer for open script file */
-char stack[ARG_MAX]; /* pointer to stack image within FS */
+char stack[ARG_MAX]; /* pointer to stack image within VFS */
vir_bytes *stk_bytes; /* size of initial stack */
{
/* Patch the argument vector to include the path name of the script to be