|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmoss.kernel.MKernel
public class MKernel
| Field Summary | |
|---|---|
static MProcess[] |
current
array of active processes by CPU. |
static MProcess |
init_task
the special "init task" |
static MProcessor[] |
processors
virtual processor objects |
static MProcess |
task_list
task list |
| Constructor Summary | |
|---|---|
MKernel()
|
|
| Method Summary | |
|---|---|
static void |
add_to_run_queue(MProcess p)
adds a process to the run-queue. |
static void |
add_to_task_list(MProcess p)
adds a process to the global task list. |
static void |
deliver_process_signals(MProcess p)
this delivers any pending signals to process p. |
static void |
ending_process(MProcess p,
int exitcode)
this is invoked by a process as it finishes. |
static void |
finalinit()
this is called by the init-task as the first thing it does; final kernel setup happens here, and we're in the context of the init-process. |
static MProcess |
find_process(int pid)
finds a process from its PID |
static void |
first_process(MProcess p)
this is called once to set the first process up. |
static int |
get_free_pid()
returns a free PID (and stops it being allocated again until released) |
static MProcess[] |
get_process_list()
extracts a process list. |
static void |
init_kernel(MProcessor[] cpus,
java.io.PrintStream msgs)
initialises the kernel |
static void |
log_msg(java.lang.String msg)
generates a kernel `log' message |
static void |
module_fault(MProcess p,
java.lang.RuntimeException e)
called when a kernel module generates a run-time error |
static void |
panic(java.lang.String message)
causes a kernel panic; that aborts the simulator |
static void |
process_fault(MProcess p,
java.lang.RuntimeException e)
called when a process generates a run-time error (typically caught RuntimeExceptions for main-code or signal-handling). |
static void |
queue_signal(MProcess p,
MSignal signal)
queues a signal to be delivered to the given process |
static void |
quiet_add_to_run_queue(MProcess p)
adds a process to the run-queue. |
static void |
release_free_pid(int pid)
returns a used PID to the system |
static void |
remove_from_task_list(MProcess p)
removes a process from the global task queue. |
static void |
schedule()
this deschedules the current process, picks a new process from the run-queue and runs it. |
static void |
start_process(MProcess p)
this is called to start a new process. |
static void |
starting_process(MProcess p)
this is invoked by a process as it starts up -- not "running" as far as MOSS is concerned. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static MProcess[] current
public static MProcess init_task
public static MProcess task_list
public static MProcessor[] processors
| Constructor Detail |
|---|
public MKernel()
| Method Detail |
|---|
public static void init_kernel(MProcessor[] cpus,
java.io.PrintStream msgs)
cpus - array of virtual processors to usemsgs - somewhere we can write boot-messagespublic static void panic(java.lang.String message)
message - informational messagepublic static void log_msg(java.lang.String msg)
msg - log string (without terminating newline)public static void schedule()
public static void first_process(MProcess p)
p - an INVALID MProcess (not started as a Thread, yet)public static void finalinit()
public static void starting_process(MProcess p)
p - process that is starting
public static void ending_process(MProcess p,
int exitcode)
public static void start_process(MProcess p)
p - process to be startedpublic static int get_free_pid()
public static void release_free_pid(int pid)
pid - process-ID no longer in usepublic static void quiet_add_to_run_queue(MProcess p)
public static void add_to_run_queue(MProcess p)
p - process to add. Must not be on any other queue!public static void add_to_task_list(MProcess p)
p - process to addpublic static void remove_from_task_list(MProcess p)
p - process to removepublic static MProcess find_process(int pid)
pid - PID of process to search for
public static void deliver_process_signals(MProcess p)
p - a current process
public static void queue_signal(MProcess p,
MSignal signal)
p - process to be signalledsignal - signal to be deliveredpublic static MProcess[] get_process_list()
public static void process_fault(MProcess p,
java.lang.RuntimeException e)
p - process that faultede - Java RuntimeException generated
public static void module_fault(MProcess p,
java.lang.RuntimeException e)
p - process that faultede - Java RuntimeException generated
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||