Operating Systems, 142

Size: px
Start display at page:

Download "Operating Systems, 142"

Transcription

1 Operating Systems, 142 Tas: Vadim Levit, Dan Brownstein, Ehud Barnea, Matan Drory and Yerry Sofer Practical Session 1, System Calls

2 A few administrative notes Course homepage: Contact staff through the dedicated (format the subject of your according to the instructions listed in the course homepage) Assignments: Extending xv6 (a pedagogical OS) Submission in pairs. Frontal checking: 1. Assume the grader may ask anything. 2. Must register to exactly one checking session.

3 System Calls A System Call is an interface between a user application and a service provided by the operating system (or kernel). These can be roughly grouped into five major categories: 1. Process control (e.g. create/terminate process) 2. File Management (e.g. read, write) 3. Device Management (e.g. logically attach a device) 4. Information Maintenance (e.g. set time or date) 5. Communications (e.g. send messages)

4 System Calls - motivation A process is not supposed to access the kernel. It can t access the kernel memory or functions. This is strictly enforced ( protected mode ) for good reasons: Can jeopardize other processes running. Cause physical damage to devices. Alter system behavior. The system call mechanism provides a safe mechanism to request specific kernel operations.

5 System Calls - interface Calls are usually made with C/C++ library functions: User Application C - Library Kernel System Call getpid() Load arguments, eax _NR_getpid, kernel mode (int 80) syscall_exit Call Sys_Call_table[eax] return sys_getpid() resume_userspace return User-Space Kernel-Space Remark: Invoking int 0x80 is common although newer techniques for faster control transfer are provided by both AMD s and Intel s architecture.

6 System Calls tips Kernel behavior can be enhanced by altering the system calls themselves: imagine we wish to write a message (or add a log entry) whenever a specific user is opening a file. We can re-write the system call open with our new open function and load it to the kernel (need administrative rights). Now all open requests are passed through our function. We can examine which system calls are made by a program by invoking strace<arguments>.

7 Process control Fork pid_t fork(void); Fork is used to create a new process. It creates a duplicate of the original process (including all file descriptors, registers, instruction pointer, etc ). Once the call is finished, the process and its copy go their separate ways. Subsequent changes to one should not effect the other. The fork call returns a different value to the original process (parent) and its copy (child): in the child process this value is zero, and in the parent process it is the PID of the child process. When fork is invoked the parent s information should be copied to its child however, this can be wasteful if the child will not need this information (see exec() ). To avoid such situations, Copy On Write (COW) is used for the data section.

8 Copy On Write (COW) How does Linux manage COW? fork() Parent Process DATA STRUCTURE (task_struct) RW Child Process DATA STRUCTURE (task_struct) RW RO write information protection fault! Copying is expensive. The child process will point to the parent s pages Well, no other choice but to allocate a new RW copy of each required page

9 Running the above code on some systems will almost always return this value. Why? Process control An example: int i = 3472; printf("my process pid is %d\n",getpid()); fork_id=fork(); if (fork_id==0){ i= 6794; printf( child pid %d, i=%d\n",getpid(),i); else printf( parent pid %d, i=%d\n",getpid(),i); return 0; Output: my process pid is 8864 child pid 8865, i=6794 parent pid 8864, i=3472 Program flow: fork_id = 8865 i=3472 PID = 8864 i = 3472 fork () Is this the only possible output? PID = 8865 fork_id=0 i = 6794

10 Process control - zombies When a process ends, the memory and resources associated with it are deallocated. However, the entry for that process is not removed from the process table. This allows the parent to collect the child s exit status. When this data is not collected by the parent the child is called a zombie. Such a leak is usually not worrisome in itself, however, it is a good indicator for problems to come.

11 Process control - zombies In some (rare) occasions, a zombie is actually desired it may, for example, prevent the creation of another child process with the same pid. Zombies are not the same as orphan processes (a process whose parent ended and is then adopted by init (process id 1)). Zombies can be detected with ps el (marked with Z ). Zombies can be collected with the wait system call.

12 Process control Wait pid_t wait(int *status); pid_t waitpid(pid_t pid, int *status, int options); The wait command is used for waiting on child processes whose state changed (the process terminated, for example). The process calling wait will suspend execution until one of its children (or a specific one) terminates. Waiting can be done for a specific process, a group of processes or on any arbitrary child with waitpid. Once the status of a process is collected that process is removed from the process table by the collecting process. Kernel and later also introduced waitid( ) which gives finer control.

13 Process control exec* int execv(const char *path, char *const argv[]); int execvp(const char *file, char *const argv[]); exec. The exec() family of function replaces current process image with a new process image (text, data, bss, stack, etc). Since no new process is created, PID remains the same. Exec functions do not return to the calling process unless an error occurred (in which case -1 is returned and errno is set with a special value). The system call is execve( )

14 errno The <errno.h> header file includes the integer errno variable. This variable is set by many functions (including sys calls) in the event of an error to indicate what went wrong. errnos value is only relevant when the call returned an error (usually -1). A successful call to a function may also change the errno value. errno may be a macro. errno is thread local meaning that setting it in one thread does not affect its value in any other thread. Be wary of mistakes such as: If (call()==-1){ printf( failed ); if (errno==..) Code defensively! Use errno often!

15 Process control simple shell #define int main(int argc, char **argv){ while(true){ type_prompt(); read_command(command, params); pid=fork(); if (pid<0){ if (errno==eagain) printf( ERROR cannot allocate sufficient memory\n ); continue; if (pid>0) wait(&status); else execvp(command,params);

16 File management In POSIX operating systems files are accessed via a file descriptor (Microsoft Windows uses a slightly different object: file handle). A file descriptor is an integer specifying the index of an entry in the file descriptor table held by each process. A file descriptor table is held by each process, and contains details of all open files. The following is an example of such a table: FD Name Other information 0 Standard Input (stdin) 1 Standard Output (stdout) 2 Standard Error (stderr) File descriptors can refer to files, directories, sockets and a few more data objects.

17 File management Open int open(const char *pathname, int flags); int open(const char *pathname, int flags, mode_t mode); Open returns a file descriptor for a given pathname. This file descriptor will be used in subsequent system calls (according to the flags and mode) Flags define the access mode: O_RDONLY (read only), O_WRONLY (write only), O_RDRW (read write). These can be bit-wised or ed with more creation and status flags such as O_APPEND, O_TRUNC, O_CREAT. Close Int close(int fd); Closes a file descriptor so it no longer refers to a file. Returns 0 on success or -1 in case of failure (errno is set).

18 File management Read ssize_t read(int fd, void *buf, size_t count); Attempts to read up to count bytes from the file descriptor fd, into the buffer buf. Returns the number of bytes actually read (can be less than requested if read was interrupted by a signal, close to EOF, reading from pipe or terminal). On error -1 is returned (and errno is set). Note: The file position advances according to the number of bytes read. Write ssize_t write(int fd, const void *buf, size_t count); Writes up to count bytes to the file referenced to by fd, from the buffer positioned at buf. Returns the number of bytes actually wrote, or -1 (and errno) on error.

19 File management lseek off_t lseek(int fd, off_t offset, int whence); This function repositions the offset of the file position of the file associated with fd to the argument offset according to the directive whence. Whence can be set to SEEK_SET (directly to offset), SEEK_CUR (current+offset), SEEK_END (end+offset). Positioning the offset beyond file end is allowed. This does not change the size of the file. Writing to a file beyond its end results in a hole filled with \0 characters (null bytes). Returns the location as measured in bytes from the beginning of the file, or -1 in case of error (and set errno).

20 File management Dup int dup(int oldfd); int dup2(int oldfd, int newfd); The dup commands create a copy of the file descriptor oldfd. After a successful dup command is executed the old and new file descriptors may be used interchangeably. They refer to the same open file descriptions and thus share information such as offset and status. That means that using lseek on one will also affect the other! They do not share descriptor flags (FD_CLOEXEC). Dup uses the lowest numbered unused file descriptor, and dup2 uses newfd (closing current newfd if necessary). Returns the new file descriptor, or -1 in case of an error (and set errno).

21 File management Consider the following example: filefd= open( file.txt ); close(1); /* closes file handle 1, which is stdout.*/ As a result (abstract): 0 stdin 1 stdout 2 stderr 3 file.txt fd =dup(filefd); /* will create another file handle. File handle 1 is free, so it will be allocated. */ close(filefd); /* don t need this descriptor anymore.*/ 0 stdin 1 file.txt 2 stderr printf( this did not go to stdout );

22 File management - example #define #define RW_BLOCK 10 int main(int argc, char **argv){ int fdsrc, fddst; ssize_t readbytes, wrotebytes; char *buf[rw_block]; char *source = argv[1]; char *dest = argv[2]; fdsrc=open(source,o_rdonly); if (fdsrc<0){ perror("error while trying to open source file:"); exit(-1); fddst=open(dest,o_rdwr O_CREAT O_TRUNC, 0666); if (fddst<0){ perror("error while trying to open destination file:"); exit(-2); perror() produces a message on the standard error output describing the last error encountered during a call to a system call. Use with care: the message is not cleared when non erroneous calls are made. exit() system call. Bitwise OR: open for both reading and writing, if the file does not exist create it and always start at 0.

23 File management - example lseek(fddst,20,seek_set); do{ readbytes=read(fdsrc, buf, RW_BLOCK); if (readbytes<0){ if (errno == EIO){ printf("i/o errors detected, aborting.\n"); exit(-10); exit (-11); wrotebytes=write(fddst, buf, readbytes); if (wrotebytes<rw_block) if (errno == EDQUOT) printf("error: out of quota.\n"); else if (errno == ENOSPC) printf("error: not enough disk space.\n"); while (readbytes>0); lseek(fddst,0,seek_set); write(fddst,"\\*write START*\\\n",16); close(fddst); close(fdsrc); return 0; Change the offset to 20. Using errno directly. Start writing at offset 20. If the file is opened with hexedit, the first 20 bytes will be 00. Adding an extra comment at the beginning of the file.

24 Fork example (1) How many lines of Hello will be printed in the following example: int main(int argc, char **argv){ int i; for (i=0; i<10; i++){ fork(); printf( Hello \n ); return 0;

25 Fork example (1) How many lines of Hello will be printed in the following example: Program flow: int main(int argc, char **argv){ int i; for (i=0; i<10; i++){ fork(); printf( Hello \n ); return 0; i=0 i=1 i=2 Total number of printf calls:

26 Fork example (2) How many lines of Hello will be printed in the following example: int main(int argc, char **argv){ int i; for (i=0; i<10; i++){ printf( Hello \n ); fork(); return 0;

27 Fork example (2) How many lines of Hello will be printed in the following example: int main(int argc, char **argv){ int i; for (i=0; i<10; i++){ return 0; printf( Hello \n ); fork(); Program flow: i=0 i=1 i=2 Total number of printf calls:

28 Fork example (3) How many lines of Hello will be printed in the following example: int main(int argc, char **argv){ int i; for (i=0; i<10; i++) fork(); printf( Hello \n ); return 0;

29 Fork example (3) How many lines of Hello will be printed in the following example: Program flow: int main(int argc, char **argv){ int i; for (i=0; i<10; i++) fork(); printf( Hello \n ); return 0; i=0 i=1 i=2 Total number of printf calls:

30 Tips Information sources are abundant: The internet. Man pages (apropos). In Linux it is often useful (and easy) to examine the included header files. You can easily find their location by using the whereis command (you may also find which useful). MSDN this is less relevant to our course, but it also includes code examples. A list of system calls on CS dept. computers: /usr/include/asm/unistd_32.h

31 Overview ASSIGNMENT 1

32 Assignment 1 Divided into four parts: 1. Get to know xv6, and brush up your c skills 2. Create and modify system calls 3. Implement different scheduling algorithms 4. Write user space programs to test previous sections You can start working on sections 1, 2 and 4 immediately. General scheduling algorithms will be discussed in practical session 3

33 Assignment 1 Hello xv6 xv6 is a simplistic educational OS, it is used in universities such as MIT and Yale. xv6 is a re-implementation of Unix Version 6, but offers only a partial implementation. We will use QEMU, which is a generic and open source machine emulator and virtualizer to run xv6. Everything you need is installed on lab computers.

34 Assignment 1 Details We will use svn to retrieve the initial xv6 version, and modify that version. There are two main files that are built by the makefile: xv6.img and fs.img, one is the OS and the other is the file system. In the first task you will add to xv6 the PATH environment variable, and the option for the right and left arrows (,,, ). In the second task you will add scheduling algorithms and helpful system calls. In the last task you will add user space programs. Notice that they are different from regular c programs because they use xv6 libraries.

35 XV6 CODE 35

36 THE SHELL int main(void) { static char buf[100]; int fd; // Assumes three file descriptors open. while((fd = open("console", O_RDWR)) >= 0){ if(fd >= 3){ close(fd); break; // Read and run input commands. while(getcmd(buf, sizeof(buf)) >= 0){ if(buf[0] == 'c' && buf[1] == 'd' && buf[2] == ' '){ // Clumsy but will have to do for now. // Chdir has no effect on the parent if run in the child. buf[strlen(buf)-1] = 0; // chop \n if(chdir(buf+3) < 0) printf(2, "cannot cd %s\n", buf+3); continue; if(fork1() == 0) runcmd(parsecmd(buf)); wait(); exit(); 36

37 // Per-CPU process scheduler. // Each CPU calls scheduler() after setting itself up. // Scheduler never returns. It loops, doing: // - choose a process to run // - swtch to start running that process // - eventually that process transfers control // via swtch back to the scheduler. void scheduler(void) { struct proc *p; THE SCHEDULER for(;;){ // Enable interrupts on this processor. sti(); // Loop over process table looking for process to run. acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[nproc]; p++){ if(p->state!= RUNNABLE) continue; // Switch to chosen process. It is the process's job // to release ptable.lock and then reacquire it // before jumping back to us. proc = p; switchuvm(p); p->state = RUNNING; swtch(&cpu->scheduler, proc->context); switchkvm(); // Process is done running for now. // It should have changed its p->state before coming back. proc = 0; release(&ptable.lock); 37

38 /*** sysproc.c ***/ THE KILL SYSTEM CALL int sys_kill(void) { int pid; /*** proc.c ***/ // Kill the process with the given pid. // Process won't exit until it returns // to user space (see trap in trap.c). int kill(int pid) { struct proc *p; if(argint(0, &pid) < 0) return -1; return kill(pid); acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[nproc]; p++){ if(p->pid == pid){ p->killed = 1; // Wake process from sleep if necessary. if(p->state == SLEEPING) p->state = RUNNABLE; release(&ptable.lock); return 0; release(&ptable.lock); return -1; /*** syscall.c ***/ static int (*syscalls[])(void) = { [SYS_chdir] sys_chdir, [SYS_close] sys_close, [SYS_dup] sys_dup, [SYS_exec] sys_exec, [SYS_exit] sys_exit, [SYS_fork] sys_fork, [SYS_fstat] sys_fstat, [SYS_getpid] sys_getpid, [SYS_kill] sys_kill, [SYS_link] sys_link, [SYS_mkdir] sys_mkdir, [SYS_mknod] sys_mknod, [SYS_open] sys_open, [SYS_pipe] sys_pipe, [SYS_read] sys_read, [SYS_sbrk] sys_sbrk, [SYS_sleep] sys_sleep, [SYS_unlink] sys_unlink, [SYS_wait] sys_wait, [SYS_write] sys_write, [SYS_uptime] sys_uptime, ; 38

Recitation 8: Tshlab + VM

Recitation 8: Tshlab + VM Recitation 8: Tshlab + VM Instructor: TAs 1 Outline Labs Signals IO Virtual Memory 2 TshLab and MallocLab TshLab due Tuesday MallocLab is released immediately after Start early Do the checkpoint first,

More information

UNIX System Calls. Sys Calls versus Library Func

UNIX System Calls. Sys Calls versus Library Func UNIX System Calls Entry points to the kernel Provide services to the processes One feature that cannot be changed Definitions are in C For most system calls a function with the same name exists in the

More information

CMPS 105 Systems Programming. Prof. Darrell Long E2.371

CMPS 105 Systems Programming. Prof. Darrell Long E2.371 + CMPS 105 Systems Programming Prof. Darrell Long E2.371 darrell@ucsc.edu + Chapter 3: File I/O 2 + File I/O 3 n What attributes do files need? n Data storage n Byte stream n Named n Non-volatile n Shared

More information

ICS143A: Principles of Operating Systems. Lecture 14: System calls (part 2) Anton Burtsev November, 2017

ICS143A: Principles of Operating Systems. Lecture 14: System calls (part 2) Anton Burtsev November, 2017 ICS143A: Principles of Operating Systems Lecture 14: System calls (part 2) Anton Burtsev November, 2017 System call path 3316 void 3317 tvinit(void) 3318 { 3319 Initialize IDT int i; tvinit() is called

More information

Process Creation in UNIX

Process Creation in UNIX Process Creation in UNIX int fork() create a child process identical to parent Child process has a copy of the address space of the parent process On success: Both parent and child continue execution at

More information

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto Ricardo Rocha Department of Computer Science Faculty of Sciences University of Porto For more information please consult Advanced Programming in the UNIX Environment, 3rd Edition, W. Richard Stevens and

More information

CSC209H Lecture 6. Dan Zingaro. February 11, 2015

CSC209H Lecture 6. Dan Zingaro. February 11, 2015 CSC209H Lecture 6 Dan Zingaro February 11, 2015 Zombie Children (Kerrisk 26.2) As with every other process, a child process terminates with an exit status This exit status is often of interest to the parent

More information

CS 25200: Systems Programming. Lecture 14: Files, Fork, and Pipes

CS 25200: Systems Programming. Lecture 14: Files, Fork, and Pipes CS 25200: Systems Programming Lecture 14: Files, Fork, and Pipes Dr. Jef Turkstra 2018 Dr. Jeffrey A. Turkstra 1 Lecture 14 File table and descriptors Fork and exec Fd manipulation Pipes 2018 Dr. Jeffrey

More information

Process Management! Goals of this Lecture!

Process Management! Goals of this Lecture! Process Management! 1 Goals of this Lecture! Help you learn about:" Creating new processes" Programmatically redirecting stdin, stdout, and stderr" Unix system-level functions for I/O" The Unix stream

More information

Lecture files in /home/hwang/cs375/lecture05 on csserver.

Lecture files in /home/hwang/cs375/lecture05 on csserver. Lecture 5 Lecture files in /home/hwang/cs375/lecture05 on csserver. cp -r /home/hwang/cs375/lecture05. scp -r user@csserver.evansville.edu:/home/hwang/cs375/lecture05. Project 1 posted, due next Thursday

More information

Outline. OS Interface to Devices. System Input/Output. CSCI 4061 Introduction to Operating Systems. System I/O and Files. Instructor: Abhishek Chandra

Outline. OS Interface to Devices. System Input/Output. CSCI 4061 Introduction to Operating Systems. System I/O and Files. Instructor: Abhishek Chandra Outline CSCI 6 Introduction to Operating Systems System I/O and Files File I/O operations File Descriptors and redirection Pipes and FIFOs Instructor: Abhishek Chandra 2 System Input/Output Hardware devices:

More information

Operating systems. Lecture 7

Operating systems. Lecture 7 Operating systems. Lecture 7 Michał Goliński 2018-11-13 Introduction Recall Plan for today History of C/C++ Compiler on the command line Automating builds with make CPU protection rings system calls pointers

More information

CSE 333 SECTION 3. POSIX I/O Functions

CSE 333 SECTION 3. POSIX I/O Functions CSE 333 SECTION 3 POSIX I/O Functions Administrivia Questions (?) HW1 Due Tonight Exercise 7 due Monday (out later today) POSIX Portable Operating System Interface Family of standards specified by the

More information

Processes. q Process concept q Process model and implementation q Multiprocessing once again q Next Time: Scheduling

Processes. q Process concept q Process model and implementation q Multiprocessing once again q Next Time: Scheduling Processes q Process concept q Process model and implementation q Multiprocessing once again q Next Time: Scheduling The process model Computers can do more than one thing at a time Hard to keep track of

More information

Systems Programming. COSC Software Tools. Systems Programming. High-Level vs. Low-Level. High-Level vs. Low-Level.

Systems Programming. COSC Software Tools. Systems Programming. High-Level vs. Low-Level. High-Level vs. Low-Level. Systems Programming COSC 2031 - Software Tools Systems Programming (K+R Ch. 7, G+A Ch. 12) The interfaces we use to work with the operating system In this case: Unix Programming at a lower-level Systems

More information

Process Management 1

Process Management 1 Process Management 1 Goals of this Lecture Help you learn about: Creating new processes Programmatically redirecting stdin, stdout, and stderr (Appendix) communication between processes via pipes Why?

More information

Operating System Labs. Yuanbin Wu

Operating System Labs. Yuanbin Wu Operating System Labs Yuanbin Wu cs@ecnu Annoucement Next Monday (28 Sept): We will have a lecture @ 4-302, 15:00-16:30 DON'T GO TO THE LABORATORY BUILDING! TA email update: ecnucchuang@163.com ecnucchuang@126.com

More information

Lecture 3. Introduction to Unix Systems Programming: Unix File I/O System Calls

Lecture 3. Introduction to Unix Systems Programming: Unix File I/O System Calls Lecture 3 Introduction to Unix Systems Programming: Unix File I/O System Calls 1 Unix File I/O 2 Unix System Calls System calls are low level functions the operating system makes available to applications

More information

File I/0. Advanced Programming in the UNIX Environment

File I/0. Advanced Programming in the UNIX Environment File I/0 Advanced Programming in the UNIX Environment File Descriptors Created and managed by the UNIX kernel. Created using open or creat system call. Used to refer to an open file UNIX System shells

More information

Processes COMPSCI 386

Processes COMPSCI 386 Processes COMPSCI 386 Elements of a Process A process is a program in execution. Distinct processes may be created from the same program, but they are separate execution sequences. call stack heap STACK

More information

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University

Hyo-bong Son Computer Systems Laboratory Sungkyunkwan University File I/O Hyo-bong Son (proshb@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Unix Files A Unix file is a sequence of m bytes: B 0, B 1,..., B k,..., B m-1 All I/O

More information

Process Management! Goals of this Lecture!

Process Management! Goals of this Lecture! Process Management! 1 Goals of this Lecture! Help you learn about:" Creating new processes" Programmatically redirecting stdin, stdout, and stderr" (Appendix) communication between processes via pipes"

More information

Processes often need to communicate. CSCB09: Software Tools and Systems Programming. Solution: Pipes. Recall: I/O mechanisms in C

Processes often need to communicate. CSCB09: Software Tools and Systems Programming. Solution: Pipes. Recall: I/O mechanisms in C 2017-03-06 Processes often need to communicate CSCB09: Software Tools and Systems Programming E.g. consider a shell pipeline: ps wc l ps needs to send its output to wc E.g. the different worker processes

More information

File Descriptors and Piping

File Descriptors and Piping File Descriptors and Piping CSC209: Software Tools and Systems Programming Furkan Alaca & Paul Vrbik University of Toronto Mississauga https://mcs.utm.utoronto.ca/~209/ Week 8 Today s topics File Descriptors

More information

OS COMPONENTS OVERVIEW OF UNIX FILE I/O. CS124 Operating Systems Fall , Lecture 2

OS COMPONENTS OVERVIEW OF UNIX FILE I/O. CS124 Operating Systems Fall , Lecture 2 OS COMPONENTS OVERVIEW OF UNIX FILE I/O CS124 Operating Systems Fall 2017-2018, Lecture 2 2 Operating System Components (1) Common components of operating systems: Users: Want to solve problems by using

More information

CSE 333 SECTION 3. POSIX I/O Functions

CSE 333 SECTION 3. POSIX I/O Functions CSE 333 SECTION 3 POSIX I/O Functions Administrivia Questions (?) HW1 Due Tonight HW2 Due Thursday, July 19 th Midterm on Monday, July 23 th 10:50-11:50 in TBD (And regular exercises in between) POSIX

More information

Unix-Linux 2. Unix is supposed to leave room in the process table for a superuser process that could be used to kill errant processes.

Unix-Linux 2. Unix is supposed to leave room in the process table for a superuser process that could be used to kill errant processes. Unix-Linux 2 fork( ) system call is successful parent suspended child created fork( ) returns child pid to parent fork( ) returns zero value to child; zero is the pid of the swapper/scheduler process both

More information

IC221: Systems Programming 12-Week Written Exam [SOLUTIONS]

IC221: Systems Programming 12-Week Written Exam [SOLUTIONS] IC221: Systems Programming 12-Week Written Exam [SOLUTIONS] April 2, 2014 Answer the questions in the spaces provided on the question sheets. If you run out of room for an answer, continue on the back

More information

Processes. Today. Next Time. Process concept Process model Implementing processes Multiprocessing once again. Scheduling processes

Processes. Today. Next Time. Process concept Process model Implementing processes Multiprocessing once again. Scheduling processes Processes Today Process concept Process model Implementing processes Multiprocessing once again Next Time Scheduling processes The process model Most computers can do more than one thing at a time Hard

More information

CSC 271 Software I: Utilities and Internals

CSC 271 Software I: Utilities and Internals CSC 271 Software I: Utilities and Internals Lecture 13 : An Introduction to File I/O in Linux File Descriptors All system calls for I/O operations refer to open files using a file descriptor (a nonnegative

More information

CS471 ASST2. System Calls

CS471 ASST2. System Calls CS471 ASST2 System Calls Save all of us some time and do NOT attempt to find a solution online. Deliverables Code walk-through (20 points) Same as previous assignments. Implementations (60 points) System

More information

everything is a file main.c a.out /dev/sda1 /dev/tty2 /proc/cpuinfo file descriptor int

everything is a file main.c a.out /dev/sda1 /dev/tty2 /proc/cpuinfo file descriptor int everything is a file main.c a.out /dev/sda1 /dev/tty2 /proc/cpuinfo file descriptor int #include #include #include int open(const char *path, int flags); flagso_rdonly

More information

Lesson 2. process id = 1000 text data i = 5 pid = 1200

Lesson 2. process id = 1000 text data i = 5 pid = 1200 Lesson 2 fork: create a new process. The new process (child process) is almost an exact copy of the calling process (parent process). In this method we create an hierarchy structure for the processes,

More information

Processes & Threads. Today. Next Time. ! Process concept! Process model! Implementing processes! Multiprocessing once again. ! More of the same J

Processes & Threads. Today. Next Time. ! Process concept! Process model! Implementing processes! Multiprocessing once again. ! More of the same J Processes & Threads Today! Process concept! Process model! Implementing processes! Multiprocessing once again Next Time! More of the same J The process model! Most computers can do more than one thing

More information

Windows architecture. user. mode. Env. subsystems. Executive. Device drivers Kernel. kernel. mode HAL. Hardware. Process B. Process C.

Windows architecture. user. mode. Env. subsystems. Executive. Device drivers Kernel. kernel. mode HAL. Hardware. Process B. Process C. Structure Unix architecture users Functions of the System tools (shell, editors, compilers, ) standard library System call Standard library (printf, fork, ) OS kernel: processes, memory management, file

More information

UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT

UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING SOFTWARE ENGINEERING DEPARTMENT OPERATING SYSTEM LAB #06 & 07 System Calls In UNIX System Call: A system call is just what its name implies a request for the operating system to do something on behalf of the user s program. Process related

More information

Naked C Lecture 6. File Operations and System Calls

Naked C Lecture 6. File Operations and System Calls Naked C Lecture 6 File Operations and System Calls 20 August 2012 Libc and Linking Libc is the standard C library Provides most of the basic functionality that we've been using String functions, fork,

More information

Operating System Structure

Operating System Structure Operating System Structure CSCI 4061 Introduction to Operating Systems Applications Instructor: Abhishek Chandra Operating System Hardware 2 Questions Operating System Structure How does the OS manage

More information

CS 201. Files and I/O. Gerson Robboy Portland State University

CS 201. Files and I/O. Gerson Robboy Portland State University CS 201 Files and I/O Gerson Robboy Portland State University A Typical Hardware System CPU chip register file ALU system bus memory bus bus interface I/O bridge main memory USB controller graphics adapter

More information

Week 2 Intro to the Shell with Fork, Exec, Wait. Sarah Diesburg Operating Systems CS 3430

Week 2 Intro to the Shell with Fork, Exec, Wait. Sarah Diesburg Operating Systems CS 3430 Week 2 Intro to the Shell with Fork, Exec, Wait Sarah Diesburg Operating Systems CS 3430 1 Why is the Shell Important? Shells provide us with a way to interact with the core system Executes programs on

More information

CSC209 Review. Yeah! We made it!

CSC209 Review. Yeah! We made it! CSC209 Review Yeah! We made it! 1 CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files 2 ... and C programming... C basic syntax functions

More information

W4118: OS Overview. Junfeng Yang

W4118: OS Overview. Junfeng Yang W4118: OS Overview Junfeng Yang References: Modern Operating Systems (3 rd edition), Operating Systems Concepts (8 th edition), previous W4118, and OS at MIT, Stanford, and UWisc Outline OS definitions

More information

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files ... and systems programming C basic syntax functions arrays structs

More information

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs.

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs. CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files... and systems programming C basic syntax functions arrays structs

More information

628 Lecture Notes Week 4

628 Lecture Notes Week 4 628 Lecture Notes Week 4 (February 3, 2016) 1/8 628 Lecture Notes Week 4 1 Topics I/O Redirection Notes on Lab 4 Introduction to Threads Review Memory spaces #include #include int

More information

Goals of this Lecture

Goals of this Lecture I/O Management 1 Goals of this Lecture Help you to learn about: The Unix stream concept Standard C I/O functions Unix system-level functions for I/O How the standard C I/O functions use the Unix system-level

More information

I/O Management! Goals of this Lecture!

I/O Management! Goals of this Lecture! I/O Management! 1 Goals of this Lecture! Help you to learn about:" The Unix stream concept" Standard C I/O functions" Unix system-level functions for I/O" How the standard C I/O functions use the Unix

More information

I/O Management! Goals of this Lecture!

I/O Management! Goals of this Lecture! I/O Management! 1 Goals of this Lecture! Help you to learn about:" The Unix stream concept" Standard C I/O functions" Unix system-level functions for I/O" How the standard C I/O functions use the Unix

More information

The Process Abstraction. CMPU 334 Operating Systems Jason Waterman

The Process Abstraction. CMPU 334 Operating Systems Jason Waterman The Process Abstraction CMPU 334 Operating Systems Jason Waterman How to Provide the Illusion of Many CPUs? Goal: run N processes at once even though there are M CPUs N >> M CPU virtualizing The OS can

More information

CS 33. Architecture and the OS. CS33 Intro to Computer Systems XIX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

CS 33. Architecture and the OS. CS33 Intro to Computer Systems XIX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved. CS 33 Architecture and the OS CS33 Intro to Computer Systems XIX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved. The Operating System My Program Mary s Program Bob s Program OS CS33 Intro to

More information

Section 3: File I/O, JSON, Generics. Meghan Cowan

Section 3: File I/O, JSON, Generics. Meghan Cowan Section 3: File I/O, JSON, Generics Meghan Cowan POSIX Family of standards specified by the IEEE Maintains compatibility across variants of Unix-like OS Defines API and standards for basic I/O: file, terminal

More information

Contents. IPC (Inter-Process Communication) Representation of open files in kernel I/O redirection Anonymous Pipe Named Pipe (FIFO)

Contents. IPC (Inter-Process Communication) Representation of open files in kernel I/O redirection Anonymous Pipe Named Pipe (FIFO) Pipes and FIFOs Prof. Jin-Soo Kim( jinsookim@skku.edu) TA JinHong Kim( jinhong.kim@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Contents IPC (Inter-Process Communication)

More information

Changes made in this version not seen in first lecture:

Changes made in this version not seen in first lecture: Scheduling 1 1 Changelog 1 Changes made in this version not seen in first lecture: 10 September: RR varying quantum examples: fix calculation of response/wait time on Q=2 10 September: add priority scheduling

More information

Getting to know you. Anatomy of a Process. Processes. Of Programs and Processes

Getting to know you. Anatomy of a Process. Processes. Of Programs and Processes Getting to know you Processes A process is an abstraction that supports running programs A sequential stream of execution in its own address space A process is NOT the same as a program! So, two parts

More information

CS 33. Architecture and the OS. CS33 Intro to Computer Systems XIX 1 Copyright 2018 Thomas W. Doeppner. All rights reserved.

CS 33. Architecture and the OS. CS33 Intro to Computer Systems XIX 1 Copyright 2018 Thomas W. Doeppner. All rights reserved. CS 33 Architecture and the OS CS33 Intro to Computer Systems XIX 1 Copyright 2018 Thomas W. Doeppner. All rights reserved. The Operating System My Program Mary s Program Bob s Program OS CS33 Intro to

More information

Reading Assignment 4. n Chapter 4 Threads, due 2/7. 1/31/13 CSE325 - Processes 1

Reading Assignment 4. n Chapter 4 Threads, due 2/7. 1/31/13 CSE325 - Processes 1 Reading Assignment 4 Chapter 4 Threads, due 2/7 1/31/13 CSE325 - Processes 1 What s Next? 1. Process Concept 2. Process Manager Responsibilities 3. Operations on Processes 4. Process Scheduling 5. Cooperating

More information

Building Concurrency Primitives

Building Concurrency Primitives Building Concurrency Primitives Science Computer Science CS 450: Operating Systems Sean Wallace Previously 1. Decided concurrency was a useful (sometimes necessary) thing to have. 2.

More information

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras Week 03 Lecture 12 Create, Execute, and Exit from a Process

More information

Preview. System Call. System Call. System Call. System Call. Library Functions 9/20/2018. System Call

Preview. System Call. System Call. System Call. System Call. Library Functions 9/20/2018. System Call Preview File Descriptors for a Process for Managing Files write read open close lseek A system call is a request for the operating system to do something on behalf of the user's program. The system calls

More information

CMSC 216 Introduction to Computer Systems Lecture 17 Process Control and System-Level I/O

CMSC 216 Introduction to Computer Systems Lecture 17 Process Control and System-Level I/O CMSC 216 Introduction to Computer Systems Lecture 17 Process Control and System-Level I/O Sections 8.2-8.5, Bryant and O'Hallaron PROCESS CONTROL (CONT.) CMSC 216 - Wood, Sussman, Herman, Plane 2 Signals

More information

The course that gives CMU its Zip! I/O Nov 15, 2001

The course that gives CMU its Zip! I/O Nov 15, 2001 15-213 The course that gives CMU its Zip! I/O Nov 15, 2001 Topics Files Unix I/O Standard I/O A typical hardware system CPU chip register file ALU system bus memory bus bus interface I/O bridge main memory

More information

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017 CS 471 Operating Systems Yue Cheng George Mason University Fall 2017 Review: RAID 2 RAID o Idea: Build an awesome disk from small, cheap disks o Metrics: Capacity, performance, reliability 3 RAID o Idea:

More information

Section 2: Processes

Section 2: Processes September 7, 2016 Contents 1 Warmup 2 1.1 Hello World............................................ 2 2 Vocabulary 2 3 Problems 3 3.1 Forks................................................ 3 3.2 Stack Allocation.........................................

More information

CS 33. Shells and Files. CS33 Intro to Computer Systems XX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

CS 33. Shells and Files. CS33 Intro to Computer Systems XX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved. CS 33 Shells and Files CS33 Intro to Computer Systems XX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved. Shells Command and scripting languages for Unix First shell: Thompson shell sh, developed

More information

What Is Operating System? Operating Systems, System Calls, and Buffered I/O. Academic Computers in 1983 and Operating System

What Is Operating System? Operating Systems, System Calls, and Buffered I/O. Academic Computers in 1983 and Operating System What Is Operating System? Operating Systems, System Calls, and Buffered I/O emacs gcc Browser DVD Player Operating System CS 217 1 Abstraction of hardware Virtualization Protection and security 2 Academic

More information

I/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo

I/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo I/O OPERATIONS UNIX Programming 2014 Fall by Euiseong Seo Files Files that contain a stream of bytes are called regular files Regular files can be any of followings ASCII text Data Executable code Shell

More information

Introduction to OS Processes in Unix, Linux, and Windows MOS 2.1 Mahmoud El-Gayyar

Introduction to OS Processes in Unix, Linux, and Windows MOS 2.1 Mahmoud El-Gayyar Introduction to OS Processes in Unix, Linux, and Windows MOS 2.1 Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Mahmoud El-Gayyar / Introduction to OS 1 Processes in Unix, Linux, and Windows Unix pre-empted

More information

UNIX System Programming

UNIX System Programming File I/O 경희대학교컴퓨터공학과 조진성 UNIX System Programming File in UNIX n Unified interface for all I/Os in UNIX ü Regular(normal) files in file system ü Special files for devices terminal, keyboard, mouse, tape,

More information

Assignment 1. Teaching Assistant: Michalis Pachilakis (

Assignment 1. Teaching Assistant: Michalis Pachilakis ( Assignment 1 Teaching Assistant: Michalis Pachilakis ( mipach@csd.uoc.gr) System Calls If a process is running a user program in user mode and needs a system service, such as reading data from a file,

More information

Lecture 3: System Calls & API Standards

Lecture 3: System Calls & API Standards Lecture 3: System Calls & API Standards Contents OS structure System call implementation and types API Standards Process Control Calls Memory Management Calls File Access Calls File & Directory Management

More information

Computer Architecture and System Programming Laboratory. TA Session 5

Computer Architecture and System Programming Laboratory. TA Session 5 Computer Architecture and System Programming Laboratory TA Session 5 Addressing Mode specifies how to calculate effective memory address of an operand x86 64-bit addressing mode rule: up to two of the

More information

OPERATING SYSTEMS: Lesson 2: Operating System Services

OPERATING SYSTEMS: Lesson 2: Operating System Services OPERATING SYSTEMS: Lesson 2: Operating System Services Jesús Carretero Pérez David Expósito Singh José Daniel García Sánchez Francisco Javier García Blas Florin Isaila 1 Goals To understand what an operating

More information

Processes. Operating System CS 217. Supports virtual machines. Provides services: User Process. User Process. OS Kernel. Hardware

Processes. Operating System CS 217. Supports virtual machines. Provides services: User Process. User Process. OS Kernel. Hardware es CS 217 Operating System Supports virtual machines Promises each process the illusion of having whole machine to itself Provides services: Protection Scheduling Memory management File systems Synchronization

More information

Chapter 3 Processes we will completely ignore threads today

Chapter 3 Processes we will completely ignore threads today Chapter 3 Processes we will completely ignore threads today Images from Silberschatz Pacific University 1 Process Define: Memory Regions: Loaded from executable file: ELF: Executable and Linkable Format

More information

Pipelines, Forks, and Shell

Pipelines, Forks, and Shell Scribe Notes for CS61: 11/14/13 By David Becerra and Arvind Narayanan Pipelines, Forks, and Shell Anecdote on Pipelines: Anecdote 1: In 1964, Bell Labs manager Doug Mcllroy sent a memo stating that programs

More information

I/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo

I/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo I/O OPERATIONS UNIX Programming 2014 Fall by Euiseong Seo Files Files that contain a stream of bytes are called regular files Regular files can be any of followings ASCII text Data Executable code Shell

More information

CSE 410: Systems Programming

CSE 410: Systems Programming CSE 410: Systems Programming Input and Output Ethan Blanton Department of Computer Science and Engineering University at Buffalo I/O Kernel Services We have seen some text I/O using the C Standard Library.

More information

CS240: Programming in C

CS240: Programming in C CS240: Programming in C Lecture 16: Process and Signals Cristina Nita-Rotaru Lecture 16/ Fall 2013 1 Processes in UNIX UNIX identifies processes via a unique Process ID Each process also knows its parent

More information

Pipes and FIFOs. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Pipes and FIFOs. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University Pipes and FIFOs Woo-Yeong Jeong (wooyeong@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Open Files in Kernel How the Unix kernel represents open files? Two descriptors

More information

CSC209 Fall Karen Reid 1

CSC209 Fall Karen Reid 1 ' & ) ) #$ "! How user programs interact with the Operating System. Somehow we need to convert a program into machine code (object code). A compiler passes over a whole program before translating it into

More information

CS240: Programming in C

CS240: Programming in C CS240: Programming in C Lecture 15: Unix interface: low-level interface Cristina Nita-Rotaru Lecture 15/Fall 2013 1 Streams Recap Higher-level interface, layered on top of the primitive file descriptor

More information

Operating Systems. Lecture 06. System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line

Operating Systems. Lecture 06. System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line Operating Systems Lecture 06 System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line March 04, 2013 exec() Typically the exec system call is

More information

Processes. Today. Next Time. ! Process concept! Process model! Implementing processes! Multiprocessing once again. ! Scheduling processes

Processes. Today. Next Time. ! Process concept! Process model! Implementing processes! Multiprocessing once again. ! Scheduling processes Processes Today! Process concept! Process model! Implementing processes! Multiprocessing once again Next Time! Scheduling processes The process model! Most computers can do more than one thing at a time

More information

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2018 Lecture 20

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2018 Lecture 20 CS24: INTRODUCTION TO COMPUTING SYSTEMS Spring 2018 Lecture 20 LAST TIME: UNIX PROCESS MODEL Began covering the UNIX process model and API Information associated with each process: A PID (process ID) to

More information

CS 355 Operating Systems. Keeping Track of Processes. When are processes created? Process States 1/26/18. Processes, Unix Processes and System Calls

CS 355 Operating Systems. Keeping Track of Processes. When are processes created? Process States 1/26/18. Processes, Unix Processes and System Calls CS 355 Operating Systems Processes, Unix Processes and System Calls Process User types command like run foo at keyboard I/O device driver for keyboard and screen Command is parsed by command shell Executable

More information

Project 2: Shell with History1

Project 2: Shell with History1 Project 2: Shell with History1 See course webpage for due date. Submit deliverables to CourSys: https://courses.cs.sfu.ca/ Late penalty is 10% per calendar day (each 0 to 24 hour period past due). Maximum

More information

Computer Architecture and Assembly Language. Practical Session 5

Computer Architecture and Assembly Language. Practical Session 5 Computer Architecture and Assembly Language Practical Session 5 Addressing Mode - "memory address calculation mode" An addressing mode specifies how to calculate the effective memory address of an operand.

More information

Contents. PA1 review and introduction to PA2. IPC (Inter-Process Communication) Exercise. I/O redirection Pipes FIFOs

Contents. PA1 review and introduction to PA2. IPC (Inter-Process Communication) Exercise. I/O redirection Pipes FIFOs Pipes and FIFOs Prof. Jin-Soo Kim( jinsookim@skku.edu) TA Dong-Yun Lee(dylee@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Contents PA1 review and introduction to

More information

CS 350 : COMPUTER SYSTEM CONCEPTS SAMPLE TEST 2 (OPERATING SYSTEMS PART) Student s Name: MAXIMUM MARK: 100 Time allowed: 70 minutes

CS 350 : COMPUTER SYSTEM CONCEPTS SAMPLE TEST 2 (OPERATING SYSTEMS PART) Student s Name: MAXIMUM MARK: 100 Time allowed: 70 minutes CS 350 : COMPUTER SYSTEM CONCEPTS SAMPLE TEST 2 (OPERATING SYSTEMS PART) Student s Name: MAXIMUM MARK: 100 Time allowed: 70 minutes Q1 (30 marks) NOTE: Unless otherwise stated, the questions are with reference

More information

Process management 1

Process management 1 Process management 1 The kernel The core set of service that the OS provides 2 User Mode & kernel mode User mode apps delegate to system APIs in order to access hardware User space Kernel space User Utilities

More information

Creating a Shell or Command Interperter Program CSCI411 Lab

Creating a Shell or Command Interperter Program CSCI411 Lab Creating a Shell or Command Interperter Program CSCI411 Lab Adapted from Linux Kernel Projects by Gary Nutt and Operating Systems by Tannenbaum Exercise Goal: You will learn how to write a LINUX shell

More information

CS240: Programming in C

CS240: Programming in C CS240: Programming in C Lecture 17: Processes, Pipes, and Signals Cristina Nita-Rotaru Lecture 17/ Fall 2013 1 Processes in UNIX UNIX identifies processes via a unique Process ID Each process also knows

More information

Operating System Labs. Yuanbin Wu

Operating System Labs. Yuanbin Wu Operating System Labs Yuanbin Wu cs@ecnu Announcement Project 1 due 21:00, Oct. 8 Operating System Labs Introduction of I/O operations Project 1 Sorting Operating System Labs Manipulate I/O System call

More information

15-213/ Final Exam Notes Sheet Spring 2013!

15-213/ Final Exam Notes Sheet Spring 2013! Jumps 15-213/18-213 Final Exam Notes Sheet Spring 2013 Arithmetic Operations Jump Condi+on jmp 1 je ZF jne ~ZF js SF jns ~SF jg ~(SF^OF)&~ZF jge ~(SF^OF) jl (SF^OF) jle (SF^OF) ZF ja ~CF&~ZF jb CF Format

More information

Files. Eric McCreath

Files. Eric McCreath Files Eric McCreath 2 What is a file? Information used by a computer system may be stored on a variety of storage mediums (magnetic disks, magnetic tapes, optical disks, flash disks etc). However, as a

More information

Maria Hybinette, UGA. ! One easy way to communicate is to use files. ! File descriptors. 3 Maria Hybinette, UGA. ! Simple example: who sort

Maria Hybinette, UGA. ! One easy way to communicate is to use files. ! File descriptors. 3 Maria Hybinette, UGA. ! Simple example: who sort Two Communicating Processes Hello Gunnar CSCI 6730/ 4730 Operating Systems Process Chat Maria A Hi Nice to Hear from you Process Chat Gunnar B Dup & Concept that we want to implement 2 On the path to communication

More information

fork System-Level Function

fork System-Level Function Princeton University Computer Science 217: Introduction to Programming Systems Process Management Goals of this Lecture Help you learn about: Creating new processes Waiting for processes to terminate Executing

More information

UNIX System Programming. Overview. 1. A UNIX System. 2. Processes (review) 2.1. Context. Pipes/FIFOs

UNIX System Programming. Overview. 1. A UNIX System. 2. Processes (review) 2.1. Context. Pipes/FIFOs UNIX System Programming Pipes/FIFOs Overview 1. A UNIX System (review) 2. Processes (review) Objectives Look at UNIX support for interprocess communication (IPC) on a single machine Review processes pipes,

More information

Chap 4, 5: Process. Dongkun Shin, SKKU

Chap 4, 5: Process. Dongkun Shin, SKKU Chap 4, 5: Process 1 Process Concept Job A bundle of program and data to be executed An entity before submission for execution Process (= running program) An entity that is registered to kernel for execution

More information

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo PROCESS MANAGEMENT Operating Systems 2015 Spring by Euiseong Seo Today s Topics Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication

More information