Professional Documents
Culture Documents
Systems Programming 1 2015F t1
Systems Programming 1 2015F t1
Systems Programming 1 2015F t1
Operating Systems
Users and applications access the computers
hardware via the operating system.
Process
In computing, a process is an instance of a computer
program that is being executed. It contains the program
code and its current activity.
Depending on the operating system (OS), a process may
be made up of multiple threads of execution that execute
instructions concurrently.
A process is a dynamic entity.
PuTTY: (UNIX connection)
click putty; use following information to set up and connect
host name: alpha.fdu.edu
connection type: SSH
change keyboard under Terminal at left panel
The backspace key: control-H
The function key and keypad: VT100+
4
Process
http://www.putty.org
Process
Process
Fundamental to all operating systems is the
concept of a process.
A process consists of
1.
2.
3.
4.
Executing program
Its current values
State information
The resources used by the O.S. to manage
the execution of the process
7
Multiprogramming or Multitasking
allows multiple programs to run simultaneously by sharing
the same CPU. Allowing you to use a word processor to edit a
file at the same time as your Web browser is downloading a
file.
Multithreading
allows a single program to execute multiple tasks at the same
time. At the word processing editing and saving are two
tasks within the same application, run concurrently.
Program
A program is an inactive, static entity consisting of a set of
instructions and associated data.
We can consider a program to be in one of two basic formats:
1. Source program non-executable
A source program is a series of valid statements for a
specific programming language (such as C, C++, Java, ).
The source program is stored in a plain ASCII text file.
ASCII
The American Standard Code for Information
Interchange(ASCII ) is a character-encoding scheme
originally based on the English alphabet that encodes 128
specified characters.
11
*cptr="Hello World\n";
buffer1[25];
void main(void)
{
void showit(char *);
int i = 0;
strcpy(buffer1, "A demonstration\n");
write(1, buffer1, strlen(buffer1)+1);
for(; i<3; ++i)
showit(cptr);
}
// static by placement
// function prototype
// automatic variable
// library function
// system call
// function call
12
13
Library Functions
Function:
A function is a collection of declarations and statements that
carries out a specific action and/or returns a value.
1. Defined by the user
2. Previously defined: stored in object code format in
library files
Object code format is a special file format that is generated
as an intermediate step when an executable program is
produced.
Like executable files, object code files are also not displayed
to the screen or printed.
Library functions: functions stored in library files
14
Library Functions
/usr/lib: The standard location for library files in most UNIX
systems.
15