Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

syscall.h File Reference

#include "copyright.h"

Go to the source code of this file.

Defines

#define SYSCALLS_H
#define SC_Halt   0
#define SC_Exit   1
#define SC_Exec   2
#define SC_Join   3
#define SC_Create   4
#define SC_Open   5
#define SC_Read   6
#define SC_Write   7
#define SC_Close   8
#define SC_ThreadFork   9
#define SC_ThreadYield   10
#define ConsoleInput   0
#define ConsoleOutput   1

Typedefs

typedef int SpaceId
typedef int OpenFileId

Functions

void Halt ()
void Exit (int status)
SpaceId Exec (char *name)
int Join (SpaceId id)
void Create (char *name)
OpenFileId Open (char *name)
void Write (char *buffer, int size, OpenFileId id)
int Read (char *buffer, int size, OpenFileId id)
void Close (OpenFileId id)
void ThreadFork (void(*func)())
void ThreadYield ()


Define Documentation

#define ConsoleInput   0
 

when an address space starts up, it has two open files, representing keyboard input and display output (in UNIX terms, stdin and stdout). Read and Write can be used directly on these, without first opening the console device.

Definition at line 86 of file syscall.h.

Referenced by SynchConsoleInput::SynchConsoleInput().

#define ConsoleOutput   1
 

Definition at line 87 of file syscall.h.

Referenced by SynchConsoleOutput::SynchConsoleOutput().

#define SC_Close   8
 

Definition at line 29 of file syscall.h.

#define SC_Create   4
 

Definition at line 25 of file syscall.h.

#define SC_Exec   2
 

Definition at line 23 of file syscall.h.

#define SC_Exit   1
 

Definition at line 22 of file syscall.h.

#define SC_Halt   0
 

system call codes -- used by the stubs to tell the kernel which system call is being asked for

Definition at line 21 of file syscall.h.

#define SC_Join   3
 

Definition at line 24 of file syscall.h.

#define SC_Open   5
 

Definition at line 26 of file syscall.h.

#define SC_Read   6
 

Definition at line 27 of file syscall.h.

#define SC_ThreadFork   9
 

Definition at line 30 of file syscall.h.

#define SC_ThreadYield   10
 

Definition at line 31 of file syscall.h.

#define SC_Write   7
 

Definition at line 28 of file syscall.h.

#define SYSCALLS_H
 

Definition at line 14 of file syscall.h.


Typedef Documentation

typedef int OpenFileId
 

A unique identifier for an open Nachos file.

Definition at line 78 of file syscall.h.

typedef int SpaceId
 

A unique identifier for an executing user program (address space)

Definition at line 55 of file syscall.h.


Function Documentation

void Close ( OpenFileId id )
 

Close the file, we're done reading and writing to it.

Referenced by ConsoleInput::~ConsoleInput(), ConsoleOutput::~ConsoleOutput(), and Disk::~Disk().

void Create ( char * name )
 

Create a Nachos file, with "name"

SpaceId Exec ( char * name )
 

Run the executable, stored in the Nachos file "name", and return the address space identifier

void Exit ( int status )
 

Exit Quit without dropping core.

Definition at line 131 of file sysdep.cc.

Referenced by ThreadedKernel::~ThreadedKernel().

void Halt ( )
 

Stop Nachos, and print out performance stats

Referenced by ExceptionHandler(), and NetKernel::Run().

int Join ( SpaceId id )
 

Only return once the the user program "id" has finished. Return the exit status.

OpenFileId Open ( char * name )
 

Open the Nachos file "name", and return an "OpenFileId" that can be used to read and write to the file.

Referenced by AddrSpace::Load().

int Read ( char * buffer,
int size,
OpenFileId id )
 

Read "size" bytes from the open file into "buffer". Return the number of bytes actually read -- if the open file isn't long enough, or if it is an I/O device, and there aren't enough characters to read, return whatever is available (for I/O devices, you should always wait until you can return at least one character).

Referenced by ConsoleInput::CallBack(), Disk::Disk(), and Disk::ReadRequest().

void ThreadFork ( void(* func)() )
 

void ThreadYield ( )
 

void Write ( char * buffer,
int size,
OpenFileId id )
 

Write "size" bytes from "buffer" to the open file.


Generated at Wed Jul 4 11:32:22 2001 for Nachos by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001