tac0S
Template Affectional Command Operating System
system.h
Go to the documentation of this file.
1 
11 #ifndef SYSTEM_H
12 #define SYSTEM_H
13 
14 #define MAX_STRING_SIZE 512
15 #define FLAG_ERROR_FOR_VOID ((void*) -1)
16 
17 #include "copyright.h"
18 #include "utility.h"
19 #include "thread.h"
20 #include "scheduler.h"
21 #include "interrupt.h"
22 #include "stats.h"
23 #include "timer.h"
24 
25 
26 
27 extern void Initialize (int argc, char **argv); // Initialization,
28  // called before anything else
29 extern void Cleanup (); // Cleanup, called when
30  // Nachos is done.
31 
32 extern Thread *currentThread; // the thread holding the CPU
33 extern Thread *threadToBeDestroyed; // the thread that just finished
34 extern Scheduler *scheduler; // the ready list
35 extern Interrupt *interrupt; // interrupt status
36 extern Statistics *stats; // performance metrics
37 extern Timer *timer; // the hardware alarm clock
38 
39 #ifdef USER_PROGRAM
40 #include "machine.h"
41 extern Machine *machine; // user program memory and registers
42 #include "synchconsole.h"
43 extern SynchConsole *synchConsole;
44 #endif
45 
46 #ifdef FILESYS_NEEDED // FILESYS or FILESYS_STUB
47 #include "filesys.h"
48 extern FileSystem *fileSystem;
49 #endif
50 
51 #ifdef FILESYS
52 #include "synchdisk.h"
53 extern SynchDisk *synchDisk;
54 #endif
55 
56 #ifdef NETWORK
57 #include "post.h"
58 extern PostOffice *postOffice;
59 #endif
60 
61 #include "userthread.h"
62 #include "ManagerUserThreadID.h"
63 #include "UserThreadMetadata.h"
64 extern ManagerUserThreadID * managerUserThreadID;
65 extern ManagerUserThreadID * managerSemaphoreID;
66 extern ManagerUserThreadID * managerLockID;
67 extern char* path;
68 
69 #endif // SYSTEM_H
Definition: synchconsole.h:15
The following class defines a hardware timer.
Definition: timer.h:30
The following class defines the scheduler/dispatcher abstraction – the data structures and operation...
Definition: scheduler.h:22
Synchrone Data structures to simulate the behavior of a terminal I/O device.
Definition: post.h:104
Definition: interrupt.h:78
The following class defines the simulated host workstation hardware, as seen by user programs – the ...
Definition: machine.h:108
Data structures.
Data structures to export a synchronous interface to the raw disk device.
Definition: filesys.h:93
Definition: ManagerUserThreadID.h:15
Data structures for the thread dispatcher and scheduler.
Implementation of system-dependent interface.
User thread implementation.
The following class defines a "thread control block" – which represents a single thread of execution...
Definition: thread.h:79
Data structures for managing threads.
User thread implementation.
The following class defines a "synchronous" disk abstraction. As with other I/O devices, the raw physical disk is an asynchronous device – requests to read or write portions of the disk return immediately, and an interrupt occurs later to signal that the operation completed. (Also, the physical characteristics of the disk device assume that only one operation can be requested at a time).
Definition: synchdisk.h:28
Data structures to emulate low-level interrupt hardware.
Miscellaneous useful definitions, including debugging routines.
Data structures to represent the Nachos file system.
Data structures for simulating the execution of user programs running on top of Nachos.
User thread implementation.
The following class defines the statistics that are to be kept about Nachos behavior – how much time...
Definition: stats.h:25