tac0S
Template Affectional Command Operating System
Macros | Functions
main.cc File Reference

Bootstrap code to initialize the operating system kernel. More...

#include "copyright.h"
#include "utility.h"
#include "system.h"
#include "../machine/machine.h"

Functions

void ThreadTest (void)
 
void Copy (const char *unixFile, const char *nachosFile)
 Copy Copy the contents of the UNIX file "from" to the Nachos file "to".
 
void Print (char *file)
 
void PerformanceTest (void)
 
void StartProcess (char *file)
 
void ConsoleTest (char *in, char *out)
 
void MailTest (int networkID)
 Test out message delivery, by doing the following: More...
 
void SynchConsoleTest (char *readFile, char *writeFile)
 
int testList ()
 testList More...
 
int testUTMmono ()
 testUTMmono test the UserThreamManager in monothreading More...
 
int main (int argc, char **argv)
 main Bootstrap the operating system kernel. More...
 

Detailed Description

Bootstrap code to initialize the operating system kernel.

Author
Olivier Hureau, Hugo Feydel , Julien ALaimo
 Allows direct calls into internal operating system functions,
 to simplify debugging and testing.  In practice, the
 bootstrap code would just initialize data structures,
 and start a user program to print the login prompt.

 Most of this file is not needed until later assignments.

Usage: nachos -d <debugflags> -rs <random seed #> -s -x <nachos file>=""> -c <consoleIn> <consoleOut> -f -cp <unix file>=""> <nachos file>=""> -p <nachos file>=""> -r <nachos file>=""> -l -D -t -n <network reliability>=""> -m <machine id>=""> -o <other machine="" id>=""> -z

-d causes certain debugging messages to be printed (cf. utility.h) -rs causes Yield to occur at random (but repeatable) spots -z prints the copyright message

USER_PROGRAM -s causes user programs to be executed in single-step mode -x runs a user program -c tests the console

FILESYS -f causes the physical disk to be formatted -cp copies a file from UNIX to Nachos -p prints a Nachos file to stdout -r removes a Nachos file from the file system -l lists the contents of the Nachos directory -D prints the contents of the entire file system -t tests the performance of the Nachos file system

NETWORK -n sets the network reliability -m sets this machine's host id (needed for the network) -o runs a simple test of the Nachos network software

NOTE – flags are ignored until the relevant assignment. Some of the flags are interpreted here; some in system.cc.

Copyright (c) 1992-1993 The Regents of the University of California. All rights reserved. See copyright.h for copyright notice and limitation of liability and disclaimer of warranty provisions.

Function Documentation

void MailTest ( int  farAddr)

Test out message delivery, by doing the following:

  1. send a message to the machine with ID "farAddr", at mail box #0
  2. wait for the other machine's message to arrive (in our mailbox #0)
  3. send an acknowledgment for the other machine's message
  4. wait for an acknowledgement from the other machine to our original message
int main ( int  argc,
char **  argv 
)

main Bootstrap the operating system kernel.

Check command line arguments Initialize data structures (optionally) Call test procedure

Parameters
argcis the number of command line arguments (including the name of the command) – ex: "nachos -d +" -> argc = 3
argvis an array of strings, one for each command line argument ex: "nachos -d +" -> argv = {"nachos", "-d", "+"}
int testList ( void  )

testList

Returns
"int" : 0 : no error 1 : list is said empty but is not; 2 : list is not empty but is said it is; 3 : Append do not add in the right order 4 : Get do not return the right objet 6 : Get with a no good index don't return NULL
int testUTMmono ( )

testUTMmono test the UserThreamManager in monothreading

Returns
"int" : 0 : no error 1 : Don't give the ID in the good order. 2: Don't reUse ID. 3 Reuse id that allready have been associated 4 Don't reuse in the good order