CS2028 -UNIX INTERNALS

Size: px
Start display at page:

Download "CS2028 -UNIX INTERNALS"

Transcription

1 DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY,SIRUVACHUR CS2028 -UNIX INTERNALS PART B UNIT 1 1. Explain briefly details about History of UNIX operating system? In 1965, Bell Telephone Laboratories joined an effort with the General Electric Company and Project MAC of the Massachusetts Institute of Technology to develop a new operating system called Multics [Organick 72]. Ritchie implemented their system design on the PDP-7, including an early version of the UNIX file system, the process subsystem, and a small set of utility programs.eventually, the new system no longer needed the GECOS system as a development environment but could support itself. The new system was given the name UNIX,a pun on the name Multics coined by another member of the Computing Science Research Center, Brian Kernighan. Although this early version of the UNIX system held much promise, it could not realize its potential 2. Explain the System Structure of UNIX operating system? The operating system interacts directly3 with the hardware, providing common services to programs and insulating them from hardware idiosyncrasies. Viewing the system as a set of layers, the operating system is commonly called the system kernel, or just the kernel, emphasizing its isolation from user programs. The system calls instruct the kernel to do various operations for the calling program and exchange data between the kernel and the program.several programs shown in the figure are in standard system configurations and are known as commands.

2 3. Explain the details Operating System services. The kernel performs various primitive operations on behalf of user processes to support the user interface described above. Among the services provided by the kernel are Controlling the execution of processes by allowing their creation, termination or suspension, and communication Scheduling processes fairly for execution on the CPU. Processes share the CPU in a time-shared manner: the CPU5 executes a process, the kernel suspends it when its time quantum elapses, and the kernel schedules another process to execute. The kernel later reschedules the suspended process. Allocating main memory for an executing process. The kernel allows processes to share portions of their address space under certain conditions, but protects the private address space of a process from outside tampering. 4. What is User Perspective? Discuss briefly high level features of Unix system about File System? USER PERSPECTIVE It reviews high-level features of the UNIX system such as the file system, the processing environment, and building block primitives (for example, pipes). The File System The UNIX file system is characterized by a hierarchical structure, consistent treatment of file data, the ability to create and delete files, dynamic growth of files, the protection of file data. 5. Explain about the Processing Environment in UNIX OS? A program is an executable file, and a process is an instance of the program in execution.

3 Many processes can execute simultaneously on UNIX systems (this feature is sometimes called multiprogramming or multitasking) with no logical limit to their number, and many instances of a program (such as copy) can exist simultaneously in the system. Various system calls allow processes to create new processes, terminate processes, synchronize stages of process execution, and control reaction to various events. Subject to their use of system calls, processes execute independently of each other. For example, a process executing the program in Figure 1.4 executes the fork system call to create a new process. The new process, called the child process, gets a 0 return value from fork and invokes execl to execute the program copy. 6. Explain about the Building Block Primitives in UNIX Kernel? The philosophy of the UNIX system is to provide operating system primitives that enable users to write small, modular programs that can be used as building blocks to build more complex programs. One such primitive visible to shell users is the capability to redirect I/O. Processes conventionally have access to three files: they read from their standard input file, write to their standard output file, and write error messages to their standard error file. Processes executing at a terminal typically use the terminal for these three files, but each may be "redirected" independently. For instance, the command line Is lists all files in the current directory on the standard output, but the command line. 7. Explain Assumptions about Hardware? The execution of user processes on UNIX systems is divided into two levels: user and kernel. When a process executes a system call, the execution mode of the process changes from user mode to kernel mode: the operating system executes and attempts to service the user request, returning an error code if it fails. Even if the user makes no explicit requests for operating system services, the operating system still does bookkeeping operations that relate to the user

4 process, handling interrupts, scheduling processes, managing memory, and so on. Many machine architectures (and their operating systems) support more levels than the two outlined here, but the two modes, user and kernel, are sufficient for UNIX systems. Interrupts and Exceptions. Processor Execution Levels. Memory Management 8. Explain about the Architecture of UNIX operating system? The UNIX system supports the illusions that the file system has "places" and that processes have "life." The two entities, files and processes, are the two central concepts in the UNIX system model. Figure gives a block diagram of the kernel, showing various modules and their relationships to each other. In particular, it shows the file subsystem on the left and the process control subsystem on the right, the two major components of the kernel. The diagram serves as a useful logical view of the kernel, although in practice the kernel deviates from the model because some modules interact with the internal operations of others. Figure shows three levels: user, kernel, and hardware. The system call and library interface represent the border between user programs and the kernel depicted in Figure. System calls look like ordinary function calls in C programs, and libraries map these function calls to the primitives needed to enter the operating system, as covered in more detail. Assembly language programs may invoke system calls directly without a system call library, however. Programs frequently use other libraries such as the standard I/O library to provide a more sophisticated use of the system calls.

5 UNIT II 1.Explain in detail about the structure of regular file. Most files are just files, called regular files; they contain normal data, for example text files, executable files or programs, input for or output from a program and so on. While it is reasonably safe to suppose that everything you encounter on a Linux system is a file, there are some exceptions. Directories: files that are lists of other files. Special files: the mechanism used for input and output. Most special files are in /dev, we will discuss them later. Links: a system to make a file or directory visible in multiple parts of the system's file tree. We will talk about links in detail. (Domain) sockets: a special file type, similar to TCP/IP sockets, providing inter-process networking protected by the file system's access control. Named pipes: act more or less like sockets and form a way for processes to communicate with each other, without using network socket semantics. 2. Explain the algorithm for converting the path name to inode 3.Explain the system call used for creating the special files. Process Control. Device Management. File Management.

6 Information Maintanance. Communications. 4.Write notes on a) Directories Unix uses a hierarchical file system for storing files. This system consists of a "root" directory which is made up of sub-directories which in turn are made up of sub-directories. If you are not already familiar with the concept of a hierarchical file system, see one of the general books listed in the references for a detailed discussion of this structure. Listing Files: ls Command Listing Hidden Files Long Listing of File Properties 5. Super blocks Unix file system metadata is kept in the superblock at the beginning of the file system image. The superblock stores information like file system state (clean or dirty), last mounted time and location, and pointers to the root of the file system, free block and inode lists, and the file system journal (if any). For redundancy, the primary superblock is replicated throughout the file system. That way if you lose the primary superblock for some reason, you can often recover the file system using one of the alternates, depending on the nature of the corruption. 6. Explain the details about buffer headers. The performance advantages of in-core buffering or disc caching are fairly obvious and most operating systems provide this sort of facility. The number of such buffers is usually a "tunable" parameter. The size of buffers is not likely to be alterable and will impose constraints on the attachment of discs of very different characteristics. A multi-tasking operating system, such as Unix, imposes further constraints on the design of the kernel buffering system.

7 UNIT III 1. Discuss the concepts of pipes and DUP system call Creating ``pipelines'' with the C programming language can be a bit more involved than our simple shell example. To create a simple pipe with C, we make use of the pipe() system call. It takes a single argument, which is an array of two integers, and if successful, the array will contain two new file descriptors to be used for the pipeline. After creating a pipe, the process typically spawns a new process (remember the child inherits open file descriptors). SYSTEM CALL: pipe(); PROTOTYPE: int pipe( int fd[2] ); RETURNS: 0 on success -1 on error: errno = EMFILE (no free descriptors) EMFILE (system file table is full) EFAULT (fd array is not valid) NOTES: fd[0] is set up for reading, fd[1] is set up for writing. 2. Explain how a file is mounted and unmounted from the file structure The file system is best visualized as a tree, rooted, as it were, at /. /dev, /usr, and the other directories in the root directory are branches, which may have their own branches, such as /usr/local, and so on. There are various reasons to house some of these directories on separate file systems. /var contains the directorieslog/, spool/, and various types of temporary files, and as such, may get filled up. Filling up the root file system is not a good idea, so splitting /var from / is often favorable. 3.Discuss the open system call and algorithm open is rather like the fopen, except that instead of returning a file pointer, it returns a file descriptor, which is just an int. open returns -1 if any error occurs. #include <fcntl.h> int fd; int open(char *name, int flags, int perms); fd = open(name, flags, perms);

8 As with fopen, the name argument is a character string containing the filename. The second argument,flags, is an int that specifies how the file is to be opened; the main values are O_RDONLY O_WRONLY O_RDWR open for reading only open for writing only open for both reading and writing 4. Discuss the lseek system call and algorithm lseek is a system call that is used to change the location of the read/write pointer of a file descriptor. The location can be set either in absolute or relative terms. Required Include Files #include <unistd.h> #include <sys/types.h> 5. Write Short notes on File locking & Record Locking. Record Locking is the term normally used to describe the ability of a process to prevent other processes from modifying a region of a file,. while the first process is reading or modifying that portion of the file. POSIX.1 bases it's record locking mechanism on the fcntl function: #include <sys/types.h> #include <unistd.h> #include <fcntl.h> /* * Returns: * -1 on error */ int fcntl(int filedes, int cmd,... /* struct flock *flockptr */ );

9 UNIT IV 1. What is region? state any 3 region system calls that are invoked by a process, one when getting hold a region, one during execution and one while relinquishing it back. A development system having a compiler that allows programmers and software developers to more efficiently develop compiled applications with runtime exception handling support is described. The compiler implements methods for handling of exceptions, which may occur during runtime execution of the program. In an exemplary embodiment, the system of the present invention registers exception handling information (e.g., an Exception Registration Record) with the underlying operating system, during execution of prolog code for each function (or other discrete section of code). 2.Describe the state transition that a process undergoes during its lifetime 1 Primary process states o 1.1 Created o 1.2 Ready and waiting o 1.3 Running Kernel mode User mode o 1.4 Blocked (Waiting) o 1.5 Terminated 2 Additional process states o 2.1 Swapped out and waiting o 2.2 Swapped out and blocked 3.Discuss the context of a process in detail The lifetime of a process is between a fork and an exit (process state-transition diagram, states created 8 to zombie 9), and is largely spent sleeping, running or waiting to be scheduled. The kernel's process table holds a list of all processes ps. shows most of the information about a P. Context of a Unix process 1. user-level 2. register 3. system-level.

10 4. Write the algorithm involved in creating a new process and explain it. fork : create a new process exit : terminate process execution wait : allow parent process to synchronize its execution with the exit of a child process exec : invoke a new program brk : allocate more memory dynamically signal : inform asynchronous event major loop of the shell and of init. 5.Write and explain the algorithm for booting the system A boot block may contains several physical blocks. Note that a physical block contains 512 bytes (or 1K or 2KB). A boot block contains a short loader program for booting. Files: Type: file, directory, pipe, symbolic link Access: read/write/execute (owner, group,) owner: who own this I-node (file, directory,...) timestamp: creation, modification, access time size: the number of bytes block count: the number of data blocks direct blocks: pointers to the data

11 UNIT V 1. Explain process scheduling Controls the execution of processes by allowing their creation, termination, suspension, and communication Schedules processes fairly for execution on CPU CPU executes a process Kernel suspends process when its time quantum elapses Kernel schedules another process to execute Kernel later reschedules the suspended process Allocates main memory for an executing process Allocates secondary memory for efficient storage and retrieval of user data Allows controlled peripheral device access to processes 2.What is the function of a clock interrupt handler? Details any 3 function along with the system calls and their data structures Used by the OS to keep track of each process and resource Cross-referenced or linked in main memory for proper coordination Memory tables Used to keep track of allocated and requested main and secondary memory Protection attributes of blocks of main and secondary memory Information to map main memory to secondary memory I/O tables Used to manage I/O devices and channels State of I/O operation and location in main memory as source/destination of operation File tables Information on file existence, location in secondary memory, current status, and other attributes Part of file management system Process control block Most important data structure in an OS Set of all process control blocks describes the state of the OS Read and modified by almost every subsystem in the OS, including scheduler, resource allocator, and performance monitor Constructed at process creation time Physical manifestation of the process 3.Process or CPU Scheduling Major task of any operating system allocate ready processes to available processors Scheduler decides the process to run first by using a scheduling algorithm Effectively a matter of managing queues to minimize queueing delay and to optimize performance in a queueing environment

12 Two components of a scheduler 1. Process scheduling Decision making policies to determine the order in which active processes compete for the use of CPU 2. Process dispatch Actual binding of selected process to the CPU Involves removing the process from ready queue, change its status, and load the processor state 4.Allocation of swap space The swap device is a block device in a configurable section of a disk Kernel allocates contiguous space on the swap device without fragmentation It maintains free space of the swap device in an in-core table, called map The kernel treats each unit of the swap map as group of disk blocks As kernel allocates and frees resources, it updates the map accordingly 5.Data Structure for Demand Paging Page table entry Disk block descriptors Page frame data table Swap use table

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

SHRI ANGALAMMAN COLLEGE OF ENGINEERING AND TECHNOLOGY (An ISO 9001:2008 Certified Institution) SIRUGANOOR, TIRUCHIRAPPALLI

SHRI ANGALAMMAN COLLEGE OF ENGINEERING AND TECHNOLOGY (An ISO 9001:2008 Certified Institution) SIRUGANOOR, TIRUCHIRAPPALLI SHRI ANGALAMMAN COLLEGE OF ENGINEERING AND TECHNOLOGY (An ISO 9001:2008 Certified Institution) SIRUGANOOR, TIRUCHIRAPPALLI 621 105 DEPARTMENT OF COMPUTER SCIENCE AND ENGG. Cs 1005- UNIX INTERNALS UNIT

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

ADVANCED OPERATING SYSTEMS

ADVANCED OPERATING SYSTEMS ADVANCED OPERATING SYSTEMS UNIT I INTRODUCTION TO UNIX/LINUX KERNEL BY MR.PRASAD SAWANT Prof.Prasad Sawant,Assitiant Professor,Dept. Of CS PCCCS PREREQUISITES: 1. Working knowledge of C programming. 2.

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 Slides based on the book Operating System Concepts, 9th Edition, Abraham Silberschatz, Peter B. Galvin and Greg Gagne,

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

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

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

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

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

1.Define signal? NOV DEC 2011 MAY JUNE 2011

1.Define signal? NOV DEC 2011 MAY JUNE 2011 SEM/ YEAR : VI / III CS2028 UNIX INTERNALS UNIT IV THE STRUCTURE OF PROCESSES PART A 1.Define signal? NOV DEC 2011 MAY JUNE 2011 A signal is an asynchronous event which is delivered to a process. 2. Define

More information

Logical disks. Bach 2.2.1

Logical disks. Bach 2.2.1 Logical disks Bach 2.2.1 Physical disk is divided into partitions or logical disks Logical disk linear sequence of fixed size, randomly accessible, blocks disk device driver maps underlying physical storage

More information

Linux Operating System

Linux Operating System Linux Operating System Dept. of Computer Science & Engineering 1 History Linux is a modern, free operating system based on UNIX standards. First developed as a small but self-contained kernel in 1991 by

More information

Chapter 3: Operating-System Structures

Chapter 3: Operating-System Structures Chapter 3: Operating-System Structures System Components Operating System Services System Calls POSIX System Programs System Structure Virtual Machines System Design and Implementation System Generation

More information

The UNIX Time- Sharing System

The UNIX Time- Sharing System The UNIX Time- Sharing System Dennis M. Ritchie and Ken Thompson Bell Laboratories Communications of the ACM July 1974, Volume 17, Number 7 UNIX overview Unix is a general-purpose, multi-user, interactive

More information

mywbut.com UNIX Operating System

mywbut.com UNIX Operating System UNIX Operating System 1 Lecture Notes Overview Unlike many operating systems, UNIX is not limited to specific computers using a particular microprocessor as a CPU. Instead, UNIX systems run on all sizes

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

Chapter 3: Process Concept

Chapter 3: Process Concept Chapter 3: Process Concept Chapter 3: Process Concept Process Concept Process Scheduling Operations on Processes Inter-Process Communication (IPC) Communication in Client-Server Systems Objectives 3.2

More information

Chapter 3: Process Concept

Chapter 3: Process Concept Chapter 3: Process Concept Chapter 3: Process Concept Process Concept Process Scheduling Operations on Processes Inter-Process Communication (IPC) Communication in Client-Server Systems Objectives 3.2

More information

UNIX rewritten using C (Dennis Ritchie) UNIX (v7) released (ancestor of most UNIXs).

UNIX rewritten using C (Dennis Ritchie) UNIX (v7) released (ancestor of most UNIXs). UNIX: HISTORY: 1. 1969 UNIX developed (Ken Thompson). 2. 1972 UNIX rewritten using C (Dennis Ritchie). 3. 1976 UNIX (v6) released for commercial use. 4. 1978 UNIX (v7) released (ancestor of most UNIXs).

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

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

Chapter 3: Process Concept

Chapter 3: Process Concept Chapter 3: Process Concept Silberschatz, Galvin and Gagne 2013! Chapter 3: Process Concept Process Concept" Process Scheduling" Operations on Processes" Inter-Process Communication (IPC)" Communication

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

ADVANCED OPERATING SYSTEMS

ADVANCED OPERATING SYSTEMS ADVANCED OPERATING SYSTEMS UNIT 2 FILE AND DIRECTORY I/O BY MR.PRASAD SAWANT Prof.Prasad Sawant,Assitiant Professor,Dept. Of CS PCCCS Chichwad Prof.Prasad Sawant,Assitiant Professor,Dept. Of CS PCCCS Chichwad

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

PROCESS STATES AND TRANSITIONS:

PROCESS STATES AND TRANSITIONS: The kernel contains a process table with an entry that describes the state of every active process in the system. The u area contains additional information that controls the operation of a process. The

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

Process Time. Steven M. Bellovin January 25,

Process Time. Steven M. Bellovin January 25, Multiprogramming Computers don t really run multiple programs simultaneously; it just appears that way Each process runs to completion, but intermixed with other processes Process 1 6 ticks Process 2 Process

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

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 24 File Systems Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Questions from last time How

More information

Chapter 3: Operating-System Structures

Chapter 3: Operating-System Structures Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System Design and Implementation System Generation 3.1

More information

Process Description and Control. Chapter 3

Process Description and Control. Chapter 3 Process Description and Control Chapter 3 Major Requirements of an Operating System Interleave the execution of many processes to maximize processor utilization while providing reasonable response time

More information

Outline. Relationship between file descriptors and open files

Outline. Relationship between file descriptors and open files Outline 3 File I/O 3-1 3.1 File I/O overview 3-3 3.2 open(), read(), write(), and close() 3-7 3.3 The file offset and lseek() 3-21 3.4 Atomicity 3-30 3.5 Relationship between file descriptors and open

More information

Process Description and Control. Chapter 3

Process Description and Control. Chapter 3 Process Description and Control Chapter 3 Contents Process states Process description Process control Unix process management Process From processor s point of view execute instruction dictated by program

More information

Processes. Dr. Yingwu Zhu

Processes. Dr. Yingwu Zhu Processes Dr. Yingwu Zhu Process Growing Memory Stack expands automatically Data area (heap) can grow via a system call that requests more memory - malloc() in c/c++ Entering the kernel (mode) Hardware

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

OS and Computer Architecture. Chapter 3: Operating-System Structures. Common System Components. Process Management

OS and Computer Architecture. Chapter 3: Operating-System Structures. Common System Components. Process Management Last class: OS and Architecture OS and Computer Architecture OS Service Protection Interrupts System Calls IO Scheduling Synchronization Virtual Memory Hardware Support Kernel/User Mode Protected Instructions

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

UNIT I INTRODUCTION TO UNIX & FILE SYSTEM

UNIT I INTRODUCTION TO UNIX & FILE SYSTEM INTRODUCTION TO UNIX & FILE SYSTEM Part A 1. What is UNIX? UNIX(Uniplexed Information Computing System) it is an operating system was developed in Early 1970 at Bell Labs. It was initially a character

More information

Announcement. Exercise #2 will be out today. Due date is next Monday

Announcement. Exercise #2 will be out today. Due date is next Monday Announcement Exercise #2 will be out today Due date is next Monday Major OS Developments 2 Evolution of Operating Systems Generations include: Serial Processing Simple Batch Systems Multiprogrammed Batch

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

Fall 2017 :: CSE 306. File Systems Basics. Nima Honarmand

Fall 2017 :: CSE 306. File Systems Basics. Nima Honarmand File Systems Basics Nima Honarmand File and inode File: user-level abstraction of storage (and other) devices Sequence of bytes inode: internal OS data structure representing a file inode stands for index

More information

Course: Operating Systems Instructor: M Umair. M Umair

Course: Operating Systems Instructor: M Umair. M Umair Course: Operating Systems Instructor: M Umair Process The Process A process is a program in execution. A program is a passive entity, such as a file containing a list of instructions stored on disk (often

More information

ELEC 377 Operating Systems. Week 1 Class 2

ELEC 377 Operating Systems. Week 1 Class 2 Operating Systems Week 1 Class 2 Labs vs. Assignments The only work to turn in are the labs. In some of the handouts I refer to the labs as assignments. There are no assignments separate from the labs.

More information

CS2506 Quick Revision

CS2506 Quick Revision CS2506 Quick Revision OS Structure / Layer Kernel Structure Enter Kernel / Trap Instruction Classification of OS Process Definition Process Context Operations Process Management Child Process Thread Process

More information

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter Lecture Topics Today: Operating System Overview (Stallings, chapter 2.1-2.4, 2.8-2.10) Next: Processes (Stallings, chapter 3.1-3.6) 1 Announcements Consulting hours posted Self-Study Exercise #3 posted

More information

CS 3733 Operating Systems

CS 3733 Operating Systems What will be covered in MidtermI? CS 3733 Operating Systems Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio Basics of C programming language Processes, program

More information

UNIX Kernel. UNIX History

UNIX Kernel. UNIX History UNIX History UNIX Kernel 1965-1969 Bell Labs participates in the Multics project. 1969 Ken Thomson develops the first UNIX version in assembly for an DEC PDP-7 1973 Dennis Ritchie helps to rewrite UNIX

More information

Module 1. Introduction:

Module 1. Introduction: Module 1 Introduction: Operating system is the most fundamental of all the system programs. It is a layer of software on top of the hardware which constitutes the system and manages all parts of the system.

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

File Management 1/34

File Management 1/34 1/34 Learning Objectives system organization and recursive traversal buffering and memory mapping for performance Low-level data structures for implementing filesystems Disk space management for sample

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

Chapter 3: Operating-System Structures

Chapter 3: Operating-System Structures 1 Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System Design and Implementation System Generation 3.1

More information

Exam Guide COMPSCI 386

Exam Guide COMPSCI 386 FOUNDATIONS We discussed in broad terms the three primary responsibilities of an operating system. Describe each. What is a process? What is a thread? What parts of a process are shared by threads? What

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

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

Chapter 3 Processes. Process Concept. Process Concept. Process Concept (Cont.) Process Concept (Cont.) Process Concept (Cont.)

Chapter 3 Processes. Process Concept. Process Concept. Process Concept (Cont.) Process Concept (Cont.) Process Concept (Cont.) Process Concept Chapter 3 Processes Computers can do several activities at a time Executing user programs, reading from disks writing to a printer, etc. In multiprogramming: CPU switches from program to

More information

Last class: OS and Architecture. OS and Computer Architecture

Last class: OS and Architecture. OS and Computer Architecture Last class: OS and Architecture OS and Computer Architecture OS Service Protection Interrupts System Calls IO Scheduling Synchronization Virtual Memory Hardware Support Kernel/User Mode Protected Instructions

More information

Last class: OS and Architecture. Chapter 3: Operating-System Structures. OS and Computer Architecture. Common System Components

Last class: OS and Architecture. Chapter 3: Operating-System Structures. OS and Computer Architecture. Common System Components Last class: OS and Architecture Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System Design and Implementation

More information

CPS 310 first midterm exam, 2/26/2014

CPS 310 first midterm exam, 2/26/2014 CPS 310 first midterm exam, 2/26/2014 Your name please: Part 1. More 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 necessarily

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

Layers in a UNIX System. Create a new process. Processes in UNIX. fildescriptors streams pipe(2) labinstructions

Layers in a UNIX System. Create a new process. Processes in UNIX. fildescriptors streams pipe(2) labinstructions Process Management Operating Systems Spring 2005 Layers in a UNIX System interface Library interface System call interface Lab Assistant Magnus Johansson magnusj@it.uu.se room 1442 postbox 54 (4th floor,

More information

Unix System Architecture, File System, and Shell Commands

Unix System Architecture, File System, and Shell Commands Unix System Architecture, File System, and Shell Commands Prof. (Dr.) K.R. Chowdhary, Director COE Email: kr.chowdhary@iitj.ac.in webpage: http://www.krchowdhary.com JIET College of Engineering August

More information

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems, 3rd edition. Uses content with permission from Assoc. Prof. Florin Fortis, PhD

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems, 3rd edition. Uses content with permission from Assoc. Prof. Florin Fortis, PhD OPERATING SYSTEMS #2 After A.S.Tanenbaum, Modern Operating Systems, 3rd edition Uses content with permission from Assoc. Prof. Florin Fortis, PhD INTRODUCTION Operating systems structure OPERATING SYSTEM

More information

Operating-System Structures

Operating-System Structures Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System Design and Implementation System Generation 3.1 Sana a University,

More information

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Processes and Non-Preemptive Scheduling. Otto J. Anshus Processes and Non-Preemptive Scheduling Otto J. Anshus Threads Processes Processes Kernel An aside on concurrency Timing and sequence of events are key concurrency issues We will study classical OS concurrency

More information

VIRTUAL FILE SYSTEM AND FILE SYSTEM CONCEPTS Operating Systems Design Euiseong Seo

VIRTUAL FILE SYSTEM AND FILE SYSTEM CONCEPTS Operating Systems Design Euiseong Seo VIRTUAL FILE SYSTEM AND FILE SYSTEM CONCEPTS 2016 Operating Systems Design Euiseong Seo (euiseong@skku.edu) File Layout An entity that separates and isolates data Files have meanings only to applications

More information

we are here Page 1 Recall: How do we Hide I/O Latency? I/O & Storage Layers Recall: C Low level I/O

we are here Page 1 Recall: How do we Hide I/O Latency? I/O & Storage Layers Recall: C Low level I/O CS162 Operating Systems and Systems Programming Lecture 18 Systems October 30 th, 2017 Prof. Anthony D. Joseph http://cs162.eecs.berkeley.edu Recall: How do we Hide I/O Latency? Blocking Interface: Wait

More information

Filesystem. Disclaimer: some slides are adopted from book authors slides with permission

Filesystem. Disclaimer: some slides are adopted from book authors slides with permission Filesystem Disclaimer: some slides are adopted from book authors slides with permission 1 Recap Directory A special file contains (inode, filename) mappings Caching Directory cache Accelerate to find inode

More information

Module 3: Operating-System Structures

Module 3: Operating-System Structures Module 3: Operating-System Structures System Components Operating-System Services System Calls System Programs System Structure Virtual Machines System Design and Implementation System Generation Operating

More information

Motivation. Operating Systems. File Systems. Outline. Files: The User s Point of View. File System Concepts. Solution? Files!

Motivation. Operating Systems. File Systems. Outline. Files: The User s Point of View. File System Concepts. Solution? Files! Motivation Operating Systems Process store, retrieve information Process capacity restricted to vmem size When process terminates, memory lost Multiple processes share information Systems (Ch 0.-0.4, Ch.-.5)

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

Windows 7 Overview. Windows 7. Objectives. The History of Windows. CS140M Fall Lake 1

Windows 7 Overview. Windows 7. Objectives. The History of Windows. CS140M Fall Lake 1 Windows 7 Overview Windows 7 Overview By Al Lake History Design Principles System Components Environmental Subsystems File system Networking Programmer Interface Lake 2 Objectives To explore the principles

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

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals EECS 3221 Operating System Fundamentals Instructor: Prof. Hui Jiang Email: hj@cse.yorku.ca Web: http://www.eecs.yorku.ca/course/3221 General Info 3 lecture hours each week 2 assignments (2*5%=10%) 1 project

More information

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals General Info EECS 3221 Operating System Fundamentals Instructor: Prof. Hui Jiang Email: hj@cse.yorku.ca Web: http://www.eecs.yorku.ca/course/3221 3 lecture hours each week 2 assignments (2*5%=10%) 1 project

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

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

CS 326: Operating Systems. Process Execution. Lecture 5

CS 326: Operating Systems. Process Execution. Lecture 5 CS 326: Operating Systems Process Execution Lecture 5 Today s Schedule Process Creation Threads Limited Direct Execution Basic Scheduling 2/5/18 CS 326: Operating Systems 2 Today s Schedule Process Creation

More information

Introduction to OS. File Management. MOS Ch. 4. Mahmoud El-Gayyar. Mahmoud El-Gayyar / Introduction to OS 1

Introduction to OS. File Management. MOS Ch. 4. Mahmoud El-Gayyar. Mahmoud El-Gayyar / Introduction to OS 1 Introduction to OS File Management MOS Ch. 4 Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Mahmoud El-Gayyar / Introduction to OS 1 File Management Objectives Provide I/O support for a variety of storage device

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

Chapter 10: Case Studies. So what happens in a real operating system?

Chapter 10: Case Studies. So what happens in a real operating system? Chapter 10: Case Studies So what happens in a real operating system? Operating systems in the real world Studied mechanisms used by operating systems Processes & scheduling Memory management File systems

More information

we are here I/O & Storage Layers Recall: C Low level I/O Recall: C Low Level Operations CS162 Operating Systems and Systems Programming Lecture 18

we are here I/O & Storage Layers Recall: C Low level I/O Recall: C Low Level Operations CS162 Operating Systems and Systems Programming Lecture 18 I/O & Storage Layers CS162 Operating Systems and Systems Programming Lecture 18 Systems April 2 nd, 2018 Profs. Anthony D. Joseph & Jonathan Ragan-Kelley http://cs162.eecs.berkeley.edu Application / Service

More information

Operating System Design

Operating System Design Operating System Design Processes Operations Inter Process Communication (IPC) Neda Nasiriani Fall 2018 1 Process 2 Process Lifecycle 3 What information is needed? If you want to design a scheduler to

More information

Universidad Carlos III de Madrid Computer Science and Engineering Department Operating Systems Course

Universidad Carlos III de Madrid Computer Science and Engineering Department Operating Systems Course Exercise 1 (20 points). Autotest. Answer the quiz questions in the following table. Write the correct answer with its corresponding letter. For each 3 wrong answer, one correct answer will be subtracted

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

THE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7

THE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7 THE PROCESS ABSTRACTION CS124 Operating Systems Winter 2015-2016, Lecture 7 2 The Process Abstraction Most modern OSes include the notion of a process Term is short for a sequential process Frequently

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

Fall 2015 COMP Operating Systems. Lab #3

Fall 2015 COMP Operating Systems. Lab #3 Fall 2015 COMP 3511 Operating Systems Lab #3 Outline n Operating System Debugging, Generation and System Boot n Review Questions n Process Control n UNIX fork() and Examples on fork() n exec family: execute

More information

ELEC 377 Operating Systems. Week 8 Class 1

ELEC 377 Operating Systems. Week 8 Class 1 ELEC 377 Operating Systems Week 8 Class 1 Last Class Shell Scripting Admin No class next Monday or Tuesday There IS A lab, still: Lab 4 Part 1 Quiz #3 moved to Thursday November 8th Today File Systems

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 Lecture 22 File Systems Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Disk Structure Disk can

More information

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University Che-Wei Chang chewei@mail.cgu.edu.tw Department of Computer Science and Information Engineering, Chang Gung University l Chapter 10: File System l Chapter 11: Implementing File-Systems l Chapter 12: Mass-Storage

More information

Lecture 19: File System Implementation. Mythili Vutukuru IIT Bombay

Lecture 19: File System Implementation. Mythili Vutukuru IIT Bombay Lecture 19: File System Implementation Mythili Vutukuru IIT Bombay File System An organization of files and directories on disk OS has one or more file systems Two main aspects of file systems Data structures

More information

Files and File System

Files and File System Operating System IIIT Kalyani 1 Files and File System Operating System IIIT Kalyani 2 File Primarily a file is a named collection of data stored in a non-volatile storage media such as a hard disk. In

More information

3. Process Management in xv6

3. Process Management in xv6 Lecture Notes for CS347: Operating Systems Mythili Vutukuru, Department of Computer Science and Engineering, IIT Bombay 3. Process Management in xv6 We begin understanding xv6 process management by looking

More information

Files and the Filesystems. Linux Files

Files and the Filesystems. Linux Files Files and the Filesystems Linux Files The file is the most basic and fundamental abstraction in Linux. Linux follows the everything-is-a-file philosophy. Consequently, much interaction occurs via reading

More information

File Management. Ezio Bartocci.

File Management. Ezio Bartocci. File Management Ezio Bartocci ezio.bartocci@tuwien.ac.at Cyber-Physical Systems Group Institute for Computer Engineering Faculty of Informatics, TU Wien Motivation A process can only contain a limited

More information