4. System Functions and Subroutines

Size: px
Start display at page:

Download "4. System Functions and Subroutines"

Transcription

1 Chapter 4 4. System s and Subroutines This chapter describes extensions to Fortran 77 that are related to the IRIX compiler and operating system. Library s summarizes the Fortran run-time library functions. Extended Intrinsic Subroutines describes the extensions to the Fortran intrinsic subroutines. Extended Intrinsic s describes the extensions to the Fortran functions. Library s The Fortran library functions provide an interface from Fortran programs to the IRIX system functions. System functions are facilities that are provided by the IRIX system kernel directly, as opposed to functions that are supplied by library code linked with your program. System functions are documented in volume 2 of the reference pages, with an overview in the intro(2) reference page. Table 4-1 summarizes the functions in the Fortran run-time library. In general, the name of the interface routine is the same as the name of the system function that would be called from a C program. For details on a system interface routine use the command: man 2 name_of_function Note: You must declare the time function as EXTERNAL; if you do not, the compiler will assume you mean the VMS-compatible intrinsic time function rather than the IRIX system function. (In general it is a good idea to declare any library function in an EXTERNAL statement as documentation.) 51

2 Chapter 4: System s and Subroutines Table 4-1 abort(3f) access acct alarm(3f) barrier(3p) blockproc(2) brk(2) chdir chmod(3f) chown(2) chroot close creat ctime(3f) dtime(3f) dup etime(3f) exit(2) fcntl(2) fdate(3f) fgetc(3f) fork(2) fputc(3f) abnormal termination determine accessibility of a file enable/disable process accounting execute a subroutine after a specified time perform barrier operations block processes change data segment space allocation change default directory change mode of a file change owner change root directory for a command close a file descriptor create or rewrite a file return system time return elapsed execution time duplicate an open file descriptor return elapsed execution time terminate process with status file control return date and time in an ASCII string get a character from a logical unit create a copy of this process write a character to a Fortran logical unit 52

3 Library s Table 4-1 (continued) free_barrier(3p) fseek(3f) fseek64(3f) fstat(2) ftell(3f) ftell64(3f) gerror(3f) getarg(3f) getc(3f) getcwd getdents(2) getegid(2) gethostid(2) getenv(3f) geteuid(2) getgid(2) gethostname(2) getlog(3f) getpgrp getpid getppid getsockopt(2) getuid(2) gmtime(3f) free barrier reposition a file on a logical unit reposition a file on a logical unit for 64-bit architecture get file status reposition a file on a logical unit reposition a file on a logical unit for 64-bit architecture get system error messages return command line arguments get a character from a logical unit get pathname of current working directory read directory entries get effective group ID get unique identifier of current host get value of environment variables get effective user ID get user or group ID of the caller get current host ID get user s login name get process group ID get process ID get parent process ID get options on sockets get user or group ID of caller return system time 53

4 Chapter 4: System s and Subroutines Table 4-1 (continued) iargc(3f) idate(3f) ierrno(3f) ioctl(2) isatty(3f) itime(3f) kill(2) link(2) loc(3f) lseek(2) lseek64(2) lstat(2) ltime(3f) m_fork(3p) m_get_myid(3p) return command line arguments return date or time in numerical form get system error messages control device determine if unit is associated with tty return date or time in numerical form send a signal to a process make a link to an existing file return the address of an object move read/write file pointer move read/write file pointer for 64-bit architecture get file status return system time create parallel processes get task ID m_get_numprocs(3p) get number of subtasks m_kill_procs(3p) m_lock(3p) m_next(3p) m_park_procs(3p) m_rele_procs(3p) m_set_procs(3p) m_sync(3p) m_unlock(3p) kill process set global lock return value of counter suspend child processes resume child processes set number of subtasks synchronize all threads unset a global lock 54

5 Library s Table 4-1 (continued) mkdir(2) mknod(2) mount(2) new_barrier(3p) nice open(2) oserror(3f) pause(2) perror(3f) pipe(2) plock(2) prctl(2) profil(2) ptrace putc(3f) putenv(3f) qsort(3f) read readlink rename(3f) rmdir(2) sbrk(2) schedctl(2) send(2) make a directory make a directory/file mount a filesystem initialize a barrier structure lower priority of a process open a file get/set system error suspend process until signal get system error messages create an interprocess channel lock process, test, or data in memory control processes execution-time profile process trace write a character to a Fortran logical unit set environment variable quick sort read from a file descriptor read value of symbolic link change the name of a file remove a directory change data segment space allocation call to scheduler control send a message to a socket 55

6 Chapter 4: System s and Subroutines Table 4-1 (continued) setblockproccnt(2) setgid sethostid(2) setoserror(3f) setpgrp(2) setsockopt(2) setuid sginap(2) sginap64(2) shmat(2) shmdt(2) sighold(2) sigignore(2) signal(2) sigpause(2) sigrelse(2) sigset(2) sleep(3f) socket(2) sproc(2) stat(2) stime(2) symlink(2) sync set semaphore count set group ID set current host ID set system error set process group ID set options on sockets set user ID put process to sleep put process to sleep in 64-bit environment attach shared memory detach shared memory raise priority and hold signal ignore signal change the action for a signal suspend until receive signal release signal and lower priority specify system signal handling suspend execution for an interval create an endpoint for communication TCP create a new share group process get file status set time make symbolic link update superblock 56

7 Library s Table 4-1 (continued) sysmp(2) sysmp64(2) system(3f) taskblock(3p) taskcreate(3p) taskctl(3p) taskdestroy(3p) tasksetblockcnt(3p) taskunblock(3p) time(3f) ttynam(3f) uadmin ulimit(2) ulimit64(2) umask umount(2) unblockproc(2) unlink(2) uscalloc(3p) uscalloc64(3p) uscas(3p) usclosepollsema(3p) usconfig(3p) uscpsema(3p) control multiprocessing control multiprocessing in 64-bit environment issue a shell command block tasks create a new task control task kill task set task semaphore count unblock task return system time (must be declared EXTERNAL) find name of terminal port administrative control get and set user limits get and set user limits in 64-bit architecture get and set file creation mask dismount a file system unblock processes remove a directory entry shared memory allocator shared memory allocator in 64-bit environment compare and swap operator detach file descriptor from a pollable semaphore semaphore and lock configuration operations acquire a semaphore 57

8 Chapter 4: System s and Subroutines Table 4-1 (continued) uscsetlock(3p) usctlsema(3p) usdumplock(3p) usdumpsema(3p) usfree(3p) usfreelock(3p) usfreepollsema(3p) usfreesema(3p) usgetinfo(3p) usinit(3p) usinitlock(3p) usinitsema(3p) usmalloc(3p) usmalloc64(3p) usmallopt(3p) usnewlock(3p) usnewpollsema(3p) usnewsema(3p) usopenpollsema(3p) uspsema(3p) usputinfo(3p) usrealloc(3p) usrealloc64(3p) ussetlock(3p) unconditionally set lock semaphore control operations dump lock information dump semaphore information user shared memory allocation free a lock free a pollable semaphore free a semaphore exchange information through an arena semaphore and lock initialize routine initialize a lock initialize a semaphore allocate shared memory allocate shared memory in 64-bit environment control allocation algorithm allocate and initialize a lock allocate and initialize a pollable semaphore allocate and initialize a semaphore attach a file descriptor to a pollable semaphore acquire a semaphore exchange information through an arena user share memory allocation user share memory allocation in 64-bit environment set lock 58

9 Extended Intrinsic Subroutines Table 4-1 (continued) ustestlock(3p) ustestsema(3p) usunsetlock(3p) usvsema(3p) uswsetlock(3p) wait(2) write test lock return value of semaphore unset lock free a resource to a semaphore set lock wait for a process to terminate write to a file Extended Intrinsic Subroutines This section describes the intrinsic subroutines that are extensions to Fortran 77 (the intrinsic functions that are standard to Fortran 77 are documented in Appendix A of the MIPSpro Fortran 77 Language Reference Manual). The rules for using the names of intrinsic subroutines are also discussed in that appendix. Table 4-2 gives an overview of the intrinsic subroutines and their function; they are described in detail in the sections following the topics. Table 4-2 Subroutine DATE IDATE ERRSNS EXIT TIME MVBITS Overview of System Subroutines Information Returned Current date as nine-byte string in ASCII representation Current month, day, and year, each represented by a separate integer Description of the most recent error Terminates program execution Current time in hours, minutes, and seconds as an eight-byte string in ASCII representation Moves a bit field to a diferent storage location 59

10 Chapter 4: System s and Subroutines DATE The DATE routine returns the current date as set by the system; the format is as follows: CALL DATE (buf) where buf is a variable, array, array element, or character substring nine bytes long. After the call, buf contains an ASCII variable in the format dd-mmm-yy, where dd is the date in digits, mmm is the month in alphabetic characters, and yy is the year in digits. IDATE The IDATE routine returns the current date as three integer values representing the month, date, and year; the format is as follows: CALL IDATE (m, d, y) where m, d, and y are either INTEGER*4 or INTEGER*2 values representing the current month, day and year. For example, the values of m, d, and y on August 10, 1989, are m = 8 d = 10 y = 89 ERRSNS The ERRSNS routine returns information about the most recent program error; the format is as follows: CALL ERRSNS (arg1, arg2, arg3, arg4, arg5) 60

11 Extended Intrinsic Subroutines The arguments (arg1, arg2, and so on) can be either INTEGER*4 or INTEGER*2 variables. On return from ERRSNS, the arguments contain the information shown in Table 4-3. Table 4-3 Argument arg1 arg2 arg3 arg4 arg5 Information Returned by ERRSNS Contents IRIX global variable errno, which is then reset to zero after the call Zero Zero Logical unit number of the file that was being processed when the error occurred Zero Although only arg1 and arg4 return relevant information, arg2, arg3, and arg5 are always required. EXIT The EXIT routine causes normal program termination and optionally returns an exit-status code; the format is as follows: CALL EXIT (status) where status is an INTEGER*4 or INTEGER*2 argument containing a status code. TIME The TIME routine returns the current time in hours, minutes, and seconds; the format is as follows: CALL TIME (clock) where clock is a variable, array, array element, or character substring; it must be eight bytes long. After execution, clock contains the time in the format hh:mm:ss, where hh, mm, and ss are numerical values representing the hour, the minute, and the second. 61

12 Chapter 4: System s and Subroutines MVBITS The MVBITS routine transfers a bit field from one storage location to another; the format is as follows: CALL MVBITS (source,sbit,length,destination,dbit) Table 4-4 defines the arguments. Arguments can be declared as INTEGER*2, INTEGER*4, or INTEGER*8. Table 4-4 Arguments to MVBITS Argument Type Contents source Integer variable or array element Source location of bit field to be transferred. sbit Integer expression First bit position in the field to be transferred from source. length Integer expression Length of the field to be transferred from source. destination Integer variable or array element Destination location of the bit field dbit Integer expression First bit in destination to which the field is transferred. Extended Intrinsic s Table 4-5 gives an overview of the intrinsic functions added as extensions of Fortran 77. Table 4-5 SECNDS RAN Extensions Information Returned Elapsed time as a floating point value in seconds. This is an intrinsic routine. The next number from a sequence of pseudo-random numbers. This is not an intrinsic routine. These functions are described in detail in the following sections. 62

13 Extended Intrinsic s SECNDS SECNDS is an intrinsic routine that returns the number of seconds since midnight, minus the value of the passed argument; the format is as follows: s = SECNDS(n) After execution, s contains the number of seconds past midnight less the value specified by n. Both s and n are single-precision, floating point values. RAN RAN generates a pseudo-random number. The format is as follows: v = RAN(s) The argument s is an INTEGER*4 variable or array element. This variable serves as a seed in determining the next random number. It should initially be set to a large, odd integer value. You can compute multiple random number series by supplying different variables or array elements as the seed argument to different calls of RAN. Note: Because RAN modifies the argument s, calling the function with a constant can cause a core dump. The algorithm used in RAN is the linear congruential method. The code is similar to the following fragment: S = S * L RAN = FLOAT(IAND(RSHIFT(S,16),32767))/ RAN is supplied for compatibility with VMS. For demanding applications, consider using the functions described in the random(3b) reference page. These can all be called using techniques described under Using %VAL on page

14

Overview. Over the next four weeks, we will look at these topics: Building Blocks. Advanced Authentication Issues.

Overview. Over the next four weeks, we will look at these topics: Building Blocks. Advanced Authentication Issues. Overview Over the next four weeks, we will look at these topics: Building Blocks Advanced Authentication Issues Security Overview Storage and its abstraction Virtualization and appliances Data Replication

More information

Building blocks for Unix power tools

Building blocks for Unix power tools for Unix power tools Now that we have given a good overview of a lot of the better Unix tools, I want to take some time to talk about our toolset for building Unix programs. The most important of these

More information

Linux is obsolete 2.0

Linux is obsolete 2.0 CCCamp 2007 Tanenbaum versus Brown Thus, of course, Linus didn t sit down in a vacuum and suddenly type in the Linux source code. He had my book, was running MINIX, and undoubtedly knew the history (since

More information

UNIT I Linux Utilities

UNIT I Linux Utilities UNIT I Linux Utilities 1. a) How does Linux differ from Unix? Discuss the features of Linux. 5M b) Explain various text processing utilities, with a suitable example for each. 5M 2. a) Explain briefly

More information

Advanced Programming in the UNIX Environment W. Richard Stevens

Advanced Programming in the UNIX Environment W. Richard Stevens Advanced Programming in the UNIX Environment W. Richard Stevens ADDISON-WESLEY PUBLISHING COMPANY Reading, Massachusetts Menlo Park, California New York Don Mills, Ontario Wokingham, England Amsterdam

More information

CSCI 4500/8506 Operating Systems Some UNIX System Calls, Library, and PThreads Functions

CSCI 4500/8506 Operating Systems Some UNIX System Calls, Library, and PThreads Functions CSCI 4500/8506 Operating Systems Some UNIX System Calls, Library, and PThreads Functions Described below is a subset of UNIX system calls, library functions, and Pthreads (that is, POSIX Threads) functions.

More information

Department of Computer Science and Technology, UTU 2014

Department of Computer Science and Technology, UTU 2014 Short Questions 060010601 Unix Internals Unit 1 : Introduction and Overview of UNIX 1. What were the goals of Multics System? 2. List out the levels in which UNIX system architecture is divided. 3. Which

More information

Noorul Islam College Of Engineering, Kumaracoil MCA Degree Model Examination (October 2007) 5 th Semester MC1642 UNIX Internals 2 mark Questions

Noorul Islam College Of Engineering, Kumaracoil MCA Degree Model Examination (October 2007) 5 th Semester MC1642 UNIX Internals 2 mark Questions Noorul Islam College Of Engineering, Kumaracoil MCA Degree Model Examination (October 2007) 5 th Semester MC1642 UNIX Internals 2 mark Questions 1. What are the different parts of UNIX system? i. Programs

More information

University of Massachusetts Lowell. One University Avenue. Department of Computer Science Tel: (508)

University of Massachusetts Lowell. One University Avenue. Department of Computer Science Tel: (508) University of Massachusetts Lowell One University Avenue Lowell, MA 01854 College of Arts and Science Prof. William F Moloney, Executive Ocer Department of Computer Science Tel: (508) 934-3640 bill@cs.uml.edu

More information

codius-sandbox Documentation

codius-sandbox Documentation codius-sandbox Documentation Release 0.1.0 The Codius Team November 05, 2014 Contents 1 Dependencies 3 1.1 C++ API................................................. 3 1.2 Node.js API...............................................

More information

Design Overview of the FreeBSD Kernel CIS 657

Design Overview of the FreeBSD Kernel CIS 657 Design Overview of the FreeBSD Kernel CIS 657 Organization of the Kernel Machine-independent 86% of the kernel (80% in 4.4BSD) C code Machine-dependent 14% of kernel Only 0.6% of kernel in assembler (2%

More information

(In columns, of course.)

(In columns, of course.) CPS 310 first midterm exam, 10/9/2013 Your name please: Part 1. Fun with forks (a) What is the output generated by this program? In fact the output is not uniquely defined, i.e., it is not always the same.

More information

11/3/71 SYS BREAK (II)

11/3/71 SYS BREAK (II) 11/3/71 SYS BREAK (II) break -- set program break SYNOPSIS sys break; addr / break = 17. break sets the system s idea of the highest location used by the program to addr. Locations greater than addr and

More information

UNIT I Linux Utilities and Working with Bash

UNIT I Linux Utilities and Working with Bash Subject with Code :(16MC814)Course& Branch: MCA Year & Sem: II-MCA& I-Sem UNIT I Linux Utilities and Working with Bash 1. a) How does Linux differ from Unix? Discuss the features of Linux.6M b) Explain

More information

St. MARTIN S ENGINEERING COLLEGE Dhulapally,Secunderabad DEPARTMENT OF INFORMATION TECHNOLOGY Academic year

St. MARTIN S ENGINEERING COLLEGE Dhulapally,Secunderabad DEPARTMENT OF INFORMATION TECHNOLOGY Academic year St. MARTIN S ENGINEERING COLLEGE Dhulapally,Secunderabad-000 DEPARTMENT OF INFORMATION TECHNOLOGY Academic year 0-0 QUESTION BANK Course Name : LINUX PROGRAMMING Course Code : A0 Class : III B. Tech I

More information

Babu Madhav Institute of Information Technology, UTU

Babu Madhav Institute of Information Technology, UTU 5 Years Integrated M.Sc.(IT) Semester 6 Question Bank 060010601 UNIX Internals Unit 1: Introduction and Overview of UNIX Answer following in short 1. What is system call? 2. Who are principal designer

More information

Design Overview of the FreeBSD Kernel. Organization of the Kernel. What Code is Machine Independent?

Design Overview of the FreeBSD Kernel. Organization of the Kernel. What Code is Machine Independent? Design Overview of the FreeBSD Kernel CIS 657 Organization of the Kernel Machine-independent 86% of the kernel (80% in 4.4BSD) C C code Machine-dependent 14% of kernel Only 0.6% of kernel in assembler

More information

Files and Directories

Files and Directories Files and Directories Stat functions Given pathname, stat function returns structure of information about file fstat function obtains information about the file that is already open lstat same as stat

More information

Reconstructive Software Archaeology Warren Toomey School of IT, Bond Uni

Reconstructive Software Archaeology Warren Toomey School of IT, Bond Uni Reconstructive Software Archaeology Warren Toomey School of IT, Bond Uni This is a case study in resurrecting an old piece of software. The reconstruction is interesting in itself, but it also raises many

More information

Reconstructive Software

Reconstructive Software Reconstructive Software Archaeology Warren Toomey School of IT, Bond University This is a case study in restoring the 1st Edition of UNIX from 1971. The restoration is interesting in itself, but it also

More information

11/3/71 SYS MOUNT (II) sys mount; special; name / mount = 21.; not in assembler

11/3/71 SYS MOUNT (II) sys mount; special; name / mount = 21.; not in assembler 11/3/71 SYS MOUNT (II) SYNOPSIS mount -- mount file system sys mount; special; name / mount = 21.; not in assembler mount announces to the system that a removable file system has been mounted on special

More information

CS 33. Signals Part 2. CS33 Intro to Computer Systems XXIV 1 Copyright 2016 Thomas W. Doeppner. All rights reserved.

CS 33. Signals Part 2. CS33 Intro to Computer Systems XXIV 1 Copyright 2016 Thomas W. Doeppner. All rights reserved. CS 33 Signals Part 2 CS33 Intro to Computer Systems XXIV 1 Copyright 2016 Thomas W. Doeppner. All rights reserved. Job Control $ who foreground job $ multiprocessprogram ^Z foreground job stopped $ bg

More information

f90 unix env: Unix Environment Functions Module March 9, 2009

f90 unix env: Unix Environment Functions Module March 9, 2009 f90 unix env: Unix Environment Functions Module March 9, 2009 1 Name f90 unix env Module of Unix environment functions 2 Usage USE F90 UNIX ENV This module contains part of a Fortran API to functions detailed

More information

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad -500 043 COMPUTER SCIENCE AND ENGINEERING TUTORIAL QUESTION BANK Course Name : LINUX PROGRAMMING Course Code : ACS010 Class : III

More information

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad -500 043 COMPUTER SCIENCE AND ENGINEERING TUTORIAL QUESTION BANK Course Name : LINUX PROGRAMMING Course Code : A70511 (R15) Class

More information

Midterm Exam CPS 210: Operating Systems Spring 2013

Midterm Exam CPS 210: Operating Systems Spring 2013 Your name: Sign for your honor: Midterm Exam CPS 210: Operating Systems Spring 2013 The last page of this exam is a list of terms used in this class, and whose meanings you should know. You may detach

More information

PROCESSES. Jo, Heeseung

PROCESSES. Jo, Heeseung PROCESSES Jo, Heeseung TODAY'S TOPICS What is the process? How to implement processes? Inter-Process Communication (IPC) 2 WHAT IS THE PROCESS? Program? vs. Process? vs. Processor? 3 PROCESS CONCEPT (1)

More information

Processes. Jo, Heeseung

Processes. Jo, Heeseung Processes Jo, Heeseung Today's Topics What is the process? How to implement processes? Inter-Process Communication (IPC) 2 What Is The Process? Program? vs. Process? vs. Processor? 3 Process Concept (1)

More information

ESE 333 Real-Time Operating Systems 2 What is an operating system? Two views: 1. Top-down view: Extended machine ffl Covers the details of the hardwar

ESE 333 Real-Time Operating Systems 2 What is an operating system? Two views: 1. Top-down view: Extended machine ffl Covers the details of the hardwar 1 A computer system consists of: ffl Hardware Physical devices Λ Processors Λ Memory Λ I/O devices Microprogramming Machine language (instruction set) ffl Software System programs Λ Operating system Λ

More information

CSI 402 Lecture 11 (Unix Discussion on Files continued) 11 1 / 19

CSI 402 Lecture 11 (Unix Discussion on Files continued) 11 1 / 19 CSI 402 Lecture 11 (Unix Discussion on Files continued) 11 1 / 19 User and Group IDs Ref: Chapter 3 of [HGS]. Each user is given an ID (integer) called uid. (Most system programs use uid instead of the

More information

Kernel Internals. Course Duration: 5 days. Pre-Requisites : Course Objective: Course Outline

Kernel Internals. Course Duration: 5 days. Pre-Requisites : Course Objective: Course Outline Course Duration: 5 days Pre-Requisites : Good C programming skills. Required knowledge Linux as a User Course Objective: To get Kernel and User Space of Linux and related programming Linux Advance Programming

More information

A. Run-Time Error Messages

A. Run-Time Error Messages Appendix A A. Table A-1 lists possible Fortran run-time I/O errors. Other errors given by the operating system may also occur (refer to the intro(2) and perror(3f) reference pages for details). Each error

More information

CS2028 -UNIX INTERNALS

CS2028 -UNIX INTERNALS DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY,SIRUVACHUR-621113. CS2028 -UNIX INTERNALS PART B UNIT 1 1. Explain briefly details about History of UNIX operating system? In 1965, Bell Telephone

More information

COMP 3100 Operating Systems

COMP 3100 Operating Systems Programming Interface» A process is an instance of a running program. COMP 3100 Operating Systems» Functionality that an OS provides to applications» Process Management» Input/Output Week 3 Processes and

More information

RTEMS Filesystem Design Guide

RTEMS Filesystem Design Guide RTEMS Filesystem Design Guide Edition 1, for RTEMS 4.5.0-beta3 May 2000 On-Line Applications Research Corporation On-Line Applications Research Corporation TEXinfo 1999-09-25.10 COPYRIGHT c 1988-2000.

More information

CptS 360 (System Programming) Unit 6: Files and Directories

CptS 360 (System Programming) Unit 6: Files and Directories CptS 360 (System Programming) Bob Lewis School of Engineering and Applied Sciences Washington State University Spring, 2019 Motivation Need to know your way around a filesystem. A properly organized filesystem

More information

PROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D)

PROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D) MANAGEMENT OF APPLICATION EXECUTION PROCESS CONTROL BLOCK Resources (processor, I/O devices, etc.) are made available to multiple applications The processor in particular is switched among multiple applications

More information

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS SOLUTIONS ENGR 3950U / CSCI 3020U (Operating Systems) Midterm Exam October 23, 2012, Duration: 80 Minutes (10 pages, 12 questions, 100 Marks) Instructor: Dr. Kamran Sartipi Question 1 (Computer Systgem)

More information

Appendix A: FreeBSD. Operating System Concepts 9 th Edition

Appendix A: FreeBSD. Operating System Concepts 9 th Edition Appendix A: FreeBSD Operating System Concepts 9 th Edition Silberschatz, Galvin and Gagne 2013 Module A: The FreeBSD System UNIX History Design Principles Programmer Interface User Interface Process Management

More information

File I/O and File Systems

File I/O and File Systems File I/O and File Systems System calls for Þles UNIX File Manipulation and protection creat Create a new ordinary (data) Þle mknod Create a new directory link Add an existing Þle to another directory unlink

More information

Process Concepts. CSC400 - Operating Systems. 3. Process Concepts. J. Sumey

Process Concepts. CSC400 - Operating Systems. 3. Process Concepts. J. Sumey CSC400 - Operating Systems 3. Process Concepts J. Sumey Overview Concurrency Processes & Process States Process Accounting Interrupts & Interrupt Processing Interprocess Communication CSC400 - Process

More information

Lecture 8: Unix Pipes and Signals (Feb 10, 2005) Yap

Lecture 8: Unix Pipes and Signals (Feb 10, 2005) Yap Lecture 8: Unix Pipes and Signals (Feb 10, 2005) Yap February 17, 2005 1 ADMIN Our Grader will be Mr. Chien-I Liao (cil217@nyu.edu). Today s Lecture, we will go into some details of Unix pipes and Signals.

More information

Mid Term from Feb-2005 to Nov 2012 CS604- Operating System

Mid Term from Feb-2005 to Nov 2012 CS604- Operating System Mid Term from Feb-2005 to Nov 2012 CS604- Operating System Latest Solved from Mid term Papers Resource Person Hina 1-The problem with priority scheduling algorithm is. Deadlock Starvation (Page# 84) Aging

More information

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017 ECE 550D Fundamentals of Computer Systems and Engineering Fall 2017 The Operating System (OS) Prof. John Board Duke University Slides are derived from work by Profs. Tyler Bletsch and Andrew Hilton (Duke)

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

Use of interaction networks in teaching Minix

Use of interaction networks in teaching Minix Use of interaction networks in teaching Minix Paul Ashton, Carl Cerecke, Craig McGeachie, Stuart Yeates Department of Computer Science University of Canterbury TR-COSC 08/95, Sep 1995 The contents of this

More information

Lecture 17. Log into Linux. Copy two subdirectories in /home/hwang/cs375/lecture17/ $ cp r /home/hwang/cs375/lecture17/*.

Lecture 17. Log into Linux. Copy two subdirectories in /home/hwang/cs375/lecture17/ $ cp r /home/hwang/cs375/lecture17/*. Lecture 17 Log into Linux. Copy two subdirectories in /home/hwang/cs375/lecture17/ $ cp r /home/hwang/cs375/lecture17/*. Both subdirectories have makefiles that will make all the programs. The "unnamed"

More information

Signals: Management and Implementation. Sanjiv K. Bhatia Univ. of Missouri St. Louis

Signals: Management and Implementation. Sanjiv K. Bhatia Univ. of Missouri St. Louis Signals: Management and Implementation Sanjiv K. Bhatia Univ. of Missouri St. Louis sanjiv@aryabhat.umsl.edu http://www.cs.umsl.edu/~sanjiv Signals Mechanism to notify processes of asynchronous events

More information

Virtual File System. Don Porter CSE 306

Virtual File System. Don Porter CSE 306 Virtual File System Don Porter CSE 306 History Early OSes provided a single file system In general, system was pretty tailored to target hardware In the early 80s, people became interested in supporting

More information

Module A: The FreeBSD System

Module A: The FreeBSD System Module A: The FreeBSD System History Design Principles Programmer Interface User Interface Process Management Memory Management File System I/O System Interprocess Communication A.1 History First developed

More information

Module A: The FreeBSD System

Module A: The FreeBSD System Module A: The FreeBSD System History Design Principles Programmer Interface User Interface Process Management Memory Management File System I/O System Interprocess Communication A.1 History First developed

More information

Linux System Administration

Linux System Administration System Processes Objective At the conclusion of this module, the student will be able to: Describe and define a process Identify a process ID, the parent process and the child process Learn the PID for

More information

(MCQZ-CS604 Operating Systems)

(MCQZ-CS604 Operating Systems) command to resume the execution of a suspended job in the foreground fg (Page 68) bg jobs kill commands in Linux is used to copy file is cp (Page 30) mv mkdir The process id returned to the child process

More information

The Design and Implementation of the 4.4BSD Operating System. Marshall Kirk McKusick Keith Bostic Michael J. Karels John S.

The Design and Implementation of the 4.4BSD Operating System. Marshall Kirk McKusick Keith Bostic Michael J. Karels John S. The Design and Implementation of the 4.4BSD Operating System Marshall Kirk McKusick Keith Bostic Michael J. Karels John S. Quarterman The Design and Implementation of the 4.4BSD Operating System by Marshall

More information

Interprocess Communication

Interprocess Communication Interprocess Communication Reading: Silberschatz chapter 4 Additional Reading: Stallings chapter 6 EEL 358 1 Outline Introduction Shared memory systems POSIX shared memory Message passing systems Direct

More information

3.1 Introduction. Computers perform operations concurrently

3.1 Introduction. Computers perform operations concurrently PROCESS CONCEPTS 1 3.1 Introduction Computers perform operations concurrently For example, compiling a program, sending a file to a printer, rendering a Web page, playing music and receiving e-mail Processes

More information

Shell Execution of Programs. Process Groups, Session and Signals 1

Shell Execution of Programs. Process Groups, Session and Signals 1 Shell Execution of Programs Process Groups, Session and Signals 1 Signal Concepts Signals are a way for a process to be notified of asynchronous events (software interrupts). Some examples: a timer you

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

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

PROCESS CONCEPTS. Process Concept Relationship to a Program What is a Process? Process Lifecycle Process Management Inter-Process Communication 2.

PROCESS CONCEPTS. Process Concept Relationship to a Program What is a Process? Process Lifecycle Process Management Inter-Process Communication 2. [03] PROCESSES 1. 1 OUTLINE Process Concept Relationship to a Program What is a Process? Process Lifecycle Creation Termination Blocking Process Management Process Control Blocks Context Switching Threads

More information

Secure Software Programming and Vulnerability Analysis

Secure Software Programming and Vulnerability Analysis Secure Software Programming and Vulnerability Analysis Christopher Kruegel chris@auto.tuwien.ac.at http://www.auto.tuwien.ac.at/~chris Race Conditions Secure Software Programming 2 Overview Parallel execution

More information

PROCESS CONTROL: PROCESS CREATION: UNIT-VI PROCESS CONTROL III-II R

PROCESS CONTROL: PROCESS CREATION: UNIT-VI PROCESS CONTROL III-II R PROCESS CONTROL: This will describe the use and implementation of the system calls that control the process context. The fork system call creates a new process, the exit call terminates process execution,

More information

ECE 650 Systems Programming & Engineering. Spring 2018

ECE 650 Systems Programming & Engineering. Spring 2018 ECE 650 Systems Programming & Engineering Spring 2018 User Space / Kernel Interaction Tyler Bletsch Duke University Slides are adapted from Brian Rogers (Duke) Operating System Services User and other

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

IT 540 Operating Systems ECE519 Advanced Operating Systems

IT 540 Operating Systems ECE519 Advanced Operating Systems IT 540 Operating Systems ECE519 Advanced Operating Systems Prof. Dr. Hasan Hüseyin BALIK (3 rd Week) (Advanced) Operating Systems 3. Process Description and Control 3. Outline What Is a Process? Process

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

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA QUESTION BANK UNIT 1

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA QUESTION BANK UNIT 1 CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF MCA QUESTION BANK SUBJECT: NETWORK PROGRAMMING/MC9241 YEAR/ SEM: II /I V 1 CCET UNIT 1 1. What are the steps involved in obtaining a shared

More information

* What are the different states for a task in an OS?

* What are the different states for a task in an OS? * Kernel, Services, Libraries, Application: define the 4 terms, and their roles. The kernel is a computer program that manages input/output requests from software, and translates them into data processing

More information

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission Process Heechul Yun Disclaimer: some slides are adopted from the book authors slides with permission 1 Recap OS services Resource (CPU, memory) allocation, filesystem, communication, protection, security,

More information

PERL - FUNCTIONS REFERENCES

PERL - FUNCTIONS REFERENCES PERL - FUNCTIONS REFERENCES http://www.tutorialspoint.com/perl/perl_function_references.htm Copyright tutorialspoint.com Here is the list of all the important functions supported by standard Perl. abs

More information

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad -500 043 COMPUTER SCIENCE AND ENGINEERING TUTORIAL QUESTION BANK Course Name : LINUX PROGRAMMING Course Code : A70511 Class : IV B.

More information

Chp1 Introduction. Introduction. Objective. Logging In. Shell. Briefly describe services provided by various versions of the UNIX operating system.

Chp1 Introduction. Introduction. Objective. Logging In. Shell. Briefly describe services provided by various versions of the UNIX operating system. Chp1 Objective Briefly describe services provided by various versions of the UNIX operating system. Logging In /etc/passwd local machine or NIS DB root:x:0:1:super-user:/root:/bin/tcsh Login-name, encrypted

More information

AC72/AT72/AC117/AT117 LINUX INTERNALS DEC 2015

AC72/AT72/AC117/AT117 LINUX INTERNALS DEC 2015 Q.2 a. Provide a list of 14 main characteristics of LINUX (no description required) (7) 1. Multitasking 2. Multi-user access 3. Multi-processing 4. Architecture independence 5. Demand load executables

More information

Variant-based Competitive Parallel Execution of Sequential Programs

Variant-based Competitive Parallel Execution of Sequential Programs Variant-based Competitive Parallel Execution of Sequential Programs Oliver Trachsel and Thomas R. Gross Laboratory for Software Technology Department of Computer Science ETH Zurich, Switzerland Technical

More information

Unix Processes. What is a Process?

Unix Processes. What is a Process? Unix Processes Process -- program in execution shell spawns a process for each command and terminates it when the command completes Many processes all multiplexed to a single processor (or a small number

More information

CS140 Operating Systems Final December 12, 2007 OPEN BOOK, OPEN NOTES

CS140 Operating Systems Final December 12, 2007 OPEN BOOK, OPEN NOTES CS140 Operating Systems Final December 12, 2007 OPEN BOOK, OPEN NOTES Your name: SUNet ID: In accordance with both the letter and the spirit of the Stanford Honor Code, I did not cheat on this exam. Furthermore,

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

Virtual File System. Don Porter CSE 506

Virtual File System. Don Porter CSE 506 Virtual File System Don Porter CSE 506 History ò Early OSes provided a single file system ò In general, system was pretty tailored to target hardware ò In the early 80s, people became interested in supporting

More information

CS OPERATING SYSTEMS Fall Notes on Virtual Machines

CS OPERATING SYSTEMS Fall Notes on Virtual Machines CS 471 -- OPERATING SYSTEMS Fall 1999 Notes on Virtual Machines P. J. Denning 10/23/98 11/27/98 (revised) 11/1/99 (newly revised) 1/12/01 (more newly revised) Virtual Machine Models for OS Levels A virtual

More information

Unix Systems Programming In a Nutshell

Unix Systems Programming In a Nutshell Unix Systems Programming In a Nutshell Unix presents a huge set of interfaces to the systems programmer. However, much of this complexity can be tamed by understanding several fundamental abstractions

More information

PROCESS MANAGEMENT Operating Systems Design Euiseong Seo

PROCESS MANAGEMENT Operating Systems Design Euiseong Seo PROCESS MANAGEMENT 2016 Operating Systems Design Euiseong Seo (euiseong@skku.edu) Definition A process is a program in execution Context Resources Specifically, Register file state Address space File and

More information

Most of the work is done in the context of the process rather than handled separately by the kernel

Most of the work is done in the context of the process rather than handled separately by the kernel Process Control Process Abstraction for a running program Manages program s use of memory, cpu time, and i/o resources Most of the work is done in the context of the process rather than handled separately

More information

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR / ODD SEMESTER

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR / ODD SEMESTER KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR 2011-2012 / ODD SEMESTER Question Bank Subject Code/Name: CS1005-Unix Internals Year / Sem: IV / VII UNIT I- GENERAL

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

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2017 Lecture 19

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2017 Lecture 19 CS24: INTRODUCTION TO COMPUTING SYSTEMS Spring 2017 Lecture 19 LAST TIME Introduced UNIX signals A kernel facility that provides user-mode exceptional control flow Allows many hardware-level exceptions

More information

read(2) There can be several cases where read returns less than the number of bytes requested:

read(2) There can be several cases where read returns less than the number of bytes requested: read(2) There can be several cases where read returns less than the number of bytes requested: EOF reached before requested number of bytes have been read Reading from a terminal device, one line read

More information

Operating Systems. Lecture 05

Operating Systems. Lecture 05 Operating Systems Lecture 05 http://web.uettaxila.edu.pk/cms/sp2013/seosbs/ February 25, 2013 Process Scheduling, System Calls Execution (Fork,Wait,Exit,Exec), Inter- Process Communication Schedulers Long

More information

Appendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc.

Appendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc. Appendix A GLOSSARY SYS-ED/ Computer Education Techniques, Inc. $# Number of arguments passed to a script. $@ Holds the arguments; unlike $* it has the capability for separating the arguments. $* Holds

More information

REVIEW OF COMMONLY USED DATA STRUCTURES IN OS

REVIEW OF COMMONLY USED DATA STRUCTURES IN OS REVIEW OF COMMONLY USED DATA STRUCTURES IN OS NEEDS FOR EFFICIENT DATA STRUCTURE Storage complexity & Computation complexity matter Consider the problem of scheduling tasks according to their priority

More information

CS 3013 Operating Systems WPI, A Term Assigned: Friday, August 31, 2007 Due: Monday, September 17, 2007

CS 3013 Operating Systems WPI, A Term Assigned: Friday, August 31, 2007 Due: Monday, September 17, 2007 CS 3013 Operating Systems WPI, A Term 2007 Craig E. Wills Project 2 (30 pts) Assigned: Friday, August 31, 2007 Due: Monday, September 17, 2007 Introduction This assignment is intended to help you learn

More information

CS510 Operating System Foundations. Jonathan Walpole

CS510 Operating System Foundations. Jonathan Walpole CS510 Operating System Foundations Jonathan Walpole The Process Concept 2 The Process Concept Process a program in execution Program - description of how to perform an activity instructions and static

More information

Introduction. Yolanda Becerra Fontal Juan José Costa Prats

Introduction. Yolanda Becerra Fontal Juan José Costa Prats Introduction Yolanda Becerra Fontal Juan José Costa Prats Facultat d'informàtica de Barcelona (FIB) Universitat Politècnica de Catalunya (UPC) BarcelonaTech 2015-2016 QT Content Previous concepts Architecture

More information

Signals and Session Management. Signals. Mechanism to notify processes of system events

Signals and Session Management. Signals. Mechanism to notify processes of system events Signals and Session Management Signals Mechanism to notify processes of system events Primitives for communication and synchronization between user processes Signal generation and handling Allow an action

More information

CS 3733 Operating Systems

CS 3733 Operating Systems Topics: Signals (USP Chapter 8.1-8.6) CS 3733 Operating Systems Instructor: Dr. Turgay Korkmaz Department Computer Science The University of Texas at San Antonio Office: NPB 3.330 Phone: (210) 458-7346

More information

CL020 - Advanced Linux and UNIX Programming

CL020 - Advanced Linux and UNIX Programming Corder Enterprises International Building World Class MIS Teams, for you! CL020 - Advanced Linux and UNIX Programming Course Description: In-depth training for software developers on Linux and UNIX system

More information

Embedded System Curriculum

Embedded System Curriculum Embedded System Curriculum ADVANCED C PROGRAMMING AND DATA STRUCTURE (Duration: 25 hrs) Introduction to 'C' Objectives of C, Applications of C, Relational and logical operators, Bit wise operators, The

More information

MC1751 UNIX and Network programming. Short questions and answers

MC1751 UNIX and Network programming. Short questions and answers MC1751 UNIX and Network programming Short questions and answers 1. Define directory and filename A directory is a file that contains directory entries. The directory entry containing a file name along

More information

CSCI 4500 Operating Systems. In This Module

CSCI 4500 Operating Systems. In This Module CSCI 4500 Operating Systems Module 2 OS Concepts: Processes and File Systems 2008 Stanley A. Wileman, Jr. Operating Systems Slide 1 In This Module Operating System Concepts Introduction to Processes Files

More information

Inter-process communication (IPC)

Inter-process communication (IPC) Inter-process communication (IPC) Operating Systems Kartik Gopalan References Chapter 5 of OSTEP book. Unix man pages Advanced Programming in Unix Environment by Richard Stevens http://www.kohala.com/start/apue.html

More information