*** empty log message ***

This commit is contained in:
Jorrit Herder 2005-08-23 11:31:32 +00:00
parent 10e4e98947
commit 7bf400a709
11 changed files with 83 additions and 28 deletions

View File

@ -511,18 +511,11 @@ int *front; /* return: front or back */
prev_ptr = rp; /* store ptr for next */ prev_ptr = rp; /* store ptr for next */
} }
#if 0
if (priv(rp)->s_flags & BILLABLE) { /* user process */
}
else { /* system process */
}
#endif
/* Determine the new priority of this process. The bounds are determined /* Determine the new priority of this process. The bounds are determined
* by IDLE's queue and the maximum priority of this process. Kernel task * by IDLE's queue and the maximum priority of this process. Kernel task
* and the idle process are never changed in priority. * and the idle process are never changed in priority.
*/ */
if (! iskernelp(rp) && penalty != 0) { if (penalty != 0 && ! iskernelp(rp)) {
rp->p_priority += penalty; /* update with penalty */ rp->p_priority += penalty; /* update with penalty */
if (rp->p_priority < rp->p_max_priority) /* check upper bound */ if (rp->p_priority < rp->p_max_priority) /* check upper bound */
rp->p_priority=rp->p_max_priority; rp->p_priority=rp->p_max_priority;

View File

@ -46,10 +46,10 @@
PUBLIC char *t_stack[TOT_STACK_SPACE / sizeof(char *)]; PUBLIC char *t_stack[TOT_STACK_SPACE / sizeof(char *)];
/* Define flags for the various process types. */ /* Define flags for the various process types. */
#define IDL_F (SYS_PROC | PREEMPTIBLE | BILLABLE) /* idle task */ #define IDL_F (SYS_PROC | PREEMPTIBLE | BILLABLE) /* idle task */
#define TSK_F (SYS_PROC) /* kernel tasks */ #define TSK_F (SYS_PROC) /* kernel tasks */
#define SRV_F (SYS_PROC | PREEMPTIBLE) /* system services */ #define SRV_F (SYS_PROC | PREEMPTIBLE) /* system services */
#define USR_F (BILLABLE | PREEMPTIBLE) /* user processes */ #define USR_F (BILLABLE | PREEMPTIBLE) /* user processes */
/* Define system call traps for the various process types. These call masks /* Define system call traps for the various process types. These call masks
* determine what system call traps a process is allowed to make. * determine what system call traps a process is allowed to make.

View File

@ -16,7 +16,7 @@ build: all
all install depend clean: all install depend clean:
cd ./pm && $(MAKE) $@ cd ./pm && $(MAKE) $@
cd ./fs && $(MAKE) $@ cd ./fs && $(MAKE) $@
cd ./sm && $(MAKE) $@ cd ./rs && $(MAKE) $@
cd ./is && $(MAKE) $@ cd ./is && $(MAKE) $@
cd ./init && $(MAKE) $@ cd ./init && $(MAKE) $@
cd ./inet && $(MAKE) $@ cd ./inet && $(MAKE) $@

View File

@ -40,7 +40,6 @@ PUBLIC int do_fkey_pressed(message *m)
if (pressed(F11)) timing_dmp(); if (pressed(F11)) timing_dmp();
if (pressed(F12)) sched_dmp(); if (pressed(F12)) sched_dmp();
#if DEAD_CODE
if (pressed(F9)) { if (pressed(F9)) {
printf("IS server going into infinite loop... hit 5x a function key\n"); printf("IS server going into infinite loop... hit 5x a function key\n");
printf("Five times a function key is fine as well ...\n"); printf("Five times a function key is fine as well ...\n");
@ -52,7 +51,6 @@ PUBLIC int do_fkey_pressed(message *m)
printf("IS server back to normal ... \n"); printf("IS server back to normal ... \n");
return(EDONTREPLY); return(EDONTREPLY);
} }
#endif
/* Also check Shift F1-F6 keys. */ /* Also check Shift F1-F6 keys. */
if (pressed(SF1)) mproc_dmp(); if (pressed(SF1)) mproc_dmp();

View File

@ -205,7 +205,7 @@ PRIVATE void pm_init()
/* Set process details found in the image table. */ /* Set process details found in the image table. */
rmp = &mproc[ip->proc_nr]; rmp = &mproc[ip->proc_nr];
strncpy(rmp->mp_name, ip->proc_name, PROC_NAME_LEN); strncpy(rmp->mp_name, ip->proc_name, PROC_NAME_LEN);
rmp->mp_parent = SM_PROC_NR; rmp->mp_parent = RS_PROC_NR;
rmp->mp_nice = get_nice_value(ip->priority); rmp->mp_nice = get_nice_value(ip->priority);
if (ip->proc_nr == INIT_PROC_NR) { /* user process */ if (ip->proc_nr == INIT_PROC_NR) { /* user process */
rmp->mp_pid = INIT_PID; rmp->mp_pid = INIT_PID;

45
servers/rs/Makefile Normal file
View File

@ -0,0 +1,45 @@
# Makefile for Reincarnation Server (RS)
SERVER = rs
UTIL = service
# directories
u = /usr
i = $u/include
s = $i/sys
m = $i/minix
b = $i/ibm
# programs, flags, etc.
CC = exec cc
CFLAGS = -I$i
LDFLAGS = -i
UTIL_LIBS = -lsys
LIBS = -lsys -lsysutil
UTIL_OBJ = service.o
OBJ = rs.o manager.o
# build local binary
all build: $(SERVER) $(UTIL)
$(UTIL): $(UTIL_OBJ)
$(CC) -o $@ $(LDFLAGS) $(UTIL_OBJ) $(UTIL_LIBS)
$(SERVER): $(OBJ)
$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
# install with other servers
install: /bin/$(UTIL) /usr/sbin/$(SERVER)
/bin/$(UTIL): $(UTIL)
install -c $? $@
/usr/sbin/$(SERVER): $(SERVER)
install -o root -c $? $@
# clean up local files
clean:
rm -f $(UTIL) $(SERVER) *.o *.bak
depend:
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
# Include generated dependencies.
include .depend

View File

@ -9,7 +9,7 @@
* Jul 22, 2005: Created (Jorrit N. Herder) * Jul 22, 2005: Created (Jorrit N. Herder)
*/ */
#include "sm.h" #include "rs.h"
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
@ -99,6 +99,7 @@ PUBLIC int do_start(message *m_ptr)
return(OK); return(OK);
} }
/*===========================================================================* /*===========================================================================*
* do_stop * * do_stop *
*===========================================================================*/ *===========================================================================*/
@ -139,3 +140,4 @@ PUBLIC int do_exit(message *m_ptr)
return(OK); return(OK);
} }

View File

@ -8,3 +8,4 @@ _PROTOTYPE( int do_exit, (message *m));
_PROTOTYPE( int do_start, (message *m)); _PROTOTYPE( int do_start, (message *m));
_PROTOTYPE( int do_stop, (message *m)); _PROTOTYPE( int do_stop, (message *m));

View File

@ -1,10 +1,11 @@
/* System Process Manager. /* Reincarnation Server. This servers starts new system services and detects
* they are exiting. In case of errors, system services can be restarted.
* *
* Created: * Created:
* Jul 22, 2005 by Jorrit N. Herder * Jul 22, 2005 by Jorrit N. Herder
*/ */
#include "sm.h" #include "rs.h"
/* Set debugging level to 0, 1, or 2 to see no, some, all debug output. */ /* Set debugging level to 0, 1, or 2 to see no, some, all debug output. */
#define DEBUG_LEVEL 1 #define DEBUG_LEVEL 1
@ -70,7 +71,7 @@ PUBLIC void main(void)
result = do_stop(&m_in); result = do_stop(&m_in);
break; break;
default: default:
printf("Warning, SM got unexpected request %d from %d\n", printf("Warning, RS got unexpected request %d from %d\n",
m_in.m_type, m_in.m_source); m_in.m_type, m_in.m_source);
result = EINVAL; result = EINVAL;
} }
@ -82,12 +83,13 @@ PUBLIC void main(void)
} }
} }
/*===========================================================================* /*===========================================================================*
* init_server * * init_server *
*===========================================================================*/ *===========================================================================*/
PRIVATE void init_server(void) PRIVATE void init_server(void)
{ {
/* Initialize the information service. */ /* Initialize the reincarnation server. */
int i, s; int i, s;
struct sigaction sa; struct sigaction sa;
@ -95,12 +97,13 @@ PRIVATE void init_server(void)
sa.sa_handler = SIG_MESS; sa.sa_handler = SIG_MESS;
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sa.sa_flags = 0; sa.sa_flags = 0;
if (sigaction(SIGCHLD, &sa, NULL)<0) panic("SM","sigaction failed", errno); if (sigaction(SIGCHLD, &sa, NULL)<0) panic("RS","sigaction failed", errno);
if (sigaction(SIGTERM, &sa, NULL)<0) panic("SM","sigaction failed", errno); if (sigaction(SIGTERM, &sa, NULL)<0) panic("RS","sigaction failed", errno);
if (sigaction(SIGABRT, &sa, NULL)<0) panic("SM","sigaction failed", errno); if (sigaction(SIGABRT, &sa, NULL)<0) panic("RS","sigaction failed", errno);
if (sigaction(SIGHUP, &sa, NULL)<0) panic("SM","sigaction failed", errno); if (sigaction(SIGHUP, &sa, NULL)<0) panic("RS","sigaction failed", errno);
} }
/*===========================================================================* /*===========================================================================*
* get_work * * get_work *
*===========================================================================*/ *===========================================================================*/
@ -109,11 +112,12 @@ PRIVATE void get_work()
int status = 0; int status = 0;
status = receive(ANY, &m_in); /* this blocks until message arrives */ status = receive(ANY, &m_in); /* this blocks until message arrives */
if (OK != status) if (OK != status)
panic("SM","failed to receive message!", status); panic("RS","failed to receive message!", status);
who = m_in.m_source; /* message arrived! set sender */ who = m_in.m_source; /* message arrived! set sender */
callnr = m_in.m_type; /* set function call number */ callnr = m_in.m_type; /* set function call number */
} }
/*===========================================================================* /*===========================================================================*
* reply * * reply *
*===========================================================================*/ *===========================================================================*/
@ -125,6 +129,8 @@ int result; /* report result to replyee */
m_out.m_type = result; /* build reply message */ m_out.m_type = result; /* build reply message */
send_status = send(who, &m_out); /* send the message */ send_status = send(who, &m_out); /* send the message */
if (OK != send_status) if (OK != send_status)
panic("SM", "unable to send reply!", send_status); panic("RS", "unable to send reply!", send_status);
} }

View File

@ -1,3 +1,10 @@
/* Utility to start or stop system services. Requests are sent to the
* reincarnation server that does the actual work.
*
* Changes:
* Jul 22, 2005: Created (Jorrit N. Herder)
*/
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -11,6 +18,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
/* This array defines all known requests. */ /* This array defines all known requests. */
PRIVATE char *known_requests[] = { PRIVATE char *known_requests[] = {
"up", "up",
@ -68,6 +76,7 @@ PRIVATE void panic(char *app_name, char *mess, int num)
exit(EGENERIC); exit(EGENERIC);
} }
/* Parse and verify correctness of arguments. Report problem and exit if an /* Parse and verify correctness of arguments. Report problem and exit if an
* error is found. Store needed parameters in global variables. * error is found. Store needed parameters in global variables.
*/ */
@ -139,6 +148,7 @@ PRIVATE int parse_arguments(int argc, char **argv)
return(i); return(i);
} }
/* Main program. /* Main program.
*/ */
PUBLIC int main(int argc, char **argv) PUBLIC int main(int argc, char **argv)
@ -164,7 +174,7 @@ PUBLIC int main(int argc, char **argv)
m.SRV_ARGS_ADDR = req_args; m.SRV_ARGS_ADDR = req_args;
m.SRV_ARGS_LEN = strlen(req_args); m.SRV_ARGS_LEN = strlen(req_args);
m.SRV_DEV_MAJOR = req_major; m.SRV_DEV_MAJOR = req_major;
if (OK != (s=_taskcall(SM_PROC_NR, SRV_UP, &m))) if (OK != (s=_taskcall(RS_PROC_NR, SRV_UP, &m)))
panic(argv[ARG_NAME], "sendrec to manager server failed", s); panic(argv[ARG_NAME], "sendrec to manager server failed", s);
result = m.m_type; result = m.m_type;
break; break;