mywbut.com UNIX Operating System

Similar documents
Operating Systems Comprehensive Exam. Spring Student ID # 3/16/2006

B. V. Patel Institute of Business Management, Computer &Information Technology, UTU

UNIX Kernel. UNIX History

SNS COLLEGE OF ENGINEERING

Operating Systems Comprehensive Exam. Spring Student ID # 3/20/2013

CS2028 -UNIX INTERNALS

Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science

COMP SCI 3SH3: Operating System Concepts (Term 2 Winter 2006) Test 2 February 27, 2006; Time: 50 Minutes ;. Questions Instructor: Dr.

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses.

Creating a Shell or Command Interperter Program CSCI411 Lab

(MCQZ-CS604 Operating Systems)

Exam Guide COMPSCI 386

Secondary Storage (Chp. 5.4 disk hardware, Chp. 6 File Systems, Tanenbaum)

Introduction. Secondary Storage. File concept. File attributes

CS2506 Quick Revision

File. File System Implementation. Operations. Permissions and Data Layout. Storing and Accessing File Data. Opening a File

a process may be swapped in and out of main memory such that it occupies different regions

CS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University

The UNIX Time- Sharing System

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure.

Outline. V Computer Systems Organization II (Honors) (Introductory Operating Systems) Advantages of Multi-level Page Tables

The Operating System. Chapter 6

Operating Systems, Unix Files and Commands SEEM

Unix/Linux: History and Philosophy

31268_WEB SYSTEMS LECTURE 1. Operating Systems Part 1

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. Compiler vs.

Chapter 3 Memory Management: Virtual Memory

Chapter 8: Virtual Memory. Operating System Concepts

CS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University

Last Class: Deadlocks. Where we are in the course

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

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

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

Techno India Batanagar Department of Computer Science & Engineering. Model Questions. Multiple Choice Questions:

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1

5/8/2012. Creating and Changing Directories Chapter 7

Today s class. Operating System Machine Level. Informationsteknologi. Friday, November 16, 2007 Computer Architecture I - Class 12 1

CS 3733 Operating Systems

Notes on the Exam. Question 1. Today. Comp 104:Operating Systems Concepts 11/05/2015. Revision Lectures (separate questions and answers)

Disks and I/O Hakan Uraz - File Organization 1

Chapter 9: Virtual Memory

Example Sheet for Operating Systems I (Part IA)

REVIEW OF COMMONLY USED DATA STRUCTURES IN OS

Question 1. Notes on the Exam. Today. Comp 104: Operating Systems Concepts 11/05/2015. Revision Lectures

Comp 204: Computer Systems and Their Implementation. Lecture 25a: Revision Lectures (separate questions and answers)

Course Outline. Processes CPU Scheduling Synchronization & Deadlock Memory Management File Systems & I/O Distributed Systems

Operating Systems Comprehensive Exam. Fall Student ID # 10/31/2013

Course: Operating Systems Instructor: M Umair. M Umair

Welcome to Linux. Lecture 1.1

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

8.1 Background. Part Four - Memory Management. Chapter 8: Memory-Management Management Strategies. Chapter 8: Memory Management

Mon Sep 17, 2007 Lecture 3: Process Management

CSC209 Review. Yeah! We made it!

File System Internals. Jo, Heeseung

Memory: Overview. CS439: Principles of Computer Systems February 26, 2018

SYED AMMAL ENGINEERING COLLEGE CS6401- OPERATING SYSTEM

UNIX Memory Management Interview Questions and Answers

Virtual Memory Outline

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

Chapters 9 & 10: Memory Management and Virtual Memory

CLASS: II YEAR / IV SEMESTER CSE SUBJECT CODE AND NAME: CS6401 OPERATING SYSTEMS UNIT I OPERATING SYSTEMS OVERVIEW

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

Unix Introduction to UNIX

Lecture 4: Memory Management & The Programming Interface

Introduction to Operating Systems

Unix Internal Assessment-2 solution. Ans:There are two ways of starting a job in the background with the shell s & operator and the nohup command.

Example Sheet for Operating Systems I (Part IA)

Chapter 9: Virtual-Memory

Virtual Memory. Overview: Virtual Memory. Virtual address space of a process. Virtual Memory

Scripting Languages Course 1. Diana Trandabăț

Operating Systems. No. 9 ศร ณย อ นทโกส ม Sarun Intakosum

Directory Structure and File Allocation Methods

The UNIX Operating System. HORT Lecture 2 Instructor: Kranthi Varala

When we start? 10/24/2013 Operating Systems, Beykent University 1

CS307: Operating Systems

Virtual Memory. Overview: Virtual Memory. Virtual address space of a process. Virtual Memory. Demand Paging

Basic Memory Management

Unix API Books. Linux Kernel Books. Assignments and Exams. Grading for CSC 256. Operating Systems 8/31/2018. CSC 256/456 Fall

Memory Management. Contents: Memory Management. How to generate code? Background

Workloads. CS 537 Lecture 16 File Systems Internals. Goals. Allocation Strategies. Michael Swift

Logical disks. Bach 2.2.1

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

File Management By : Kaushik Vaghani

18-Sep CSCI 2132 Software Development Lecture 6: Links and Inodes. Faculty of Computer Science, Dalhousie University. Lecture 6 p.

What is an Operating System? A Whirlwind Tour of Operating Systems. How did OS evolve? How did OS evolve?

stack Two-dimensional logical addresses Fixed Allocation Binary Page Table

TDDI04, K. Arvidsson, IDA, Linköpings universitet Operating System Structures. Operating System Structures Overview. Operating System Services

MC7204 OPERATING SYSTEMS

Process Time. Steven M. Bellovin January 25,

OPERATING SYSTEMS & UTILITY PROGRAMS

Introduction to Operating Systems

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

Operating System Concepts

Introduction to Operating Systems. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Introduction. CS3026 Operating Systems Lecture 01

6 - Main Memory EECE 315 (101) ECE UBC 2013 W2

Final Exam Preparation Questions

QUESTION BANK UNIT I

Unix Processes. What is a Process?

Transcription:

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 of computers using a wide range of microprocessors. In addition, current versions of many other operating systems have been revised to include the capability to run UNIX applications and connect smoothly with UNIX networks. This chapter begins by presenting the evolution of UNIX operating systems. It then discusses design goals. The roles of the Memory, Device, Processor, and File Managers in UNIX systems are discussed. The chapter concludes with a discussion on the user interface in the UNIX operating system. Learning Objectives After completing this chapter, the student should be able to describe: The goals of UNIX designers The significance of using files to manipulate devices The strengths and weaknesses of having competing versions of UNIX The advantages of command-driven user interfaces The roles of the Memory, Processor, Device, and File Managers in UNIX Teaching Tips Overview 1. Provide students with an overview of the UNIX operating system. Discuss the three major advantages: portability, powerful utilities, and device independence. 2. Point out the disadvantages of the UNIX operating system. Be sure to mention that there is no single, standardized version of this operating system and that the commands may seem cryptic to novice users. 2

Teaching Tip Note: UNIX is case sensitive and strongly oriented toward lowercase characters, which are faster and easier to type. Remind students that throughout this chapter, all filenames and commands are shown in lowercase. History 1. Provide students with a brief overview of the history of the UNIX operating system. Use Table 13.1 on page 403 as a guide. The Evolution of UNIX 1. Explain the evolution of the various UNIX operating systems. Include in your discussion the historical roots of UNIX, its features, and modifications. 2. Discuss the features of newer, more current releases of UNIX. Examples include full support for local area networks, compliance with international operating system standards, improved system security, and the Common Desktop Environment (CDE). 3. Discuss the challenges involved in the development of UNIX, including standardization efforts to improve portability of programs from one system to another. Point out that the release of ISO/IEC 9945:2003 is a major step in this direction. Design Goals 1. Discuss the design goals of UNIX and list some original goals of the designers of UNIX. These include the immediate goals of developing an operating system that supports software development and uses as simple algorithms as possible, and the longterm goal of making it portable. 2. Point out that popular versions of UNIX meet the additional design element of conforming to the specifications for POSIX. 3

Memory Management 1. Point out that UNIX was originally designed for single users, but that it eventually developed into powerful operating systems for multiuser environments as well. 2. Explain memory management techniques used in UNIX operating systems, namely swapping and demand paging. Discuss their key features, situations in which they are used, and their pros and cons. 3. Explain the typical internal memory layout for a single user-memory part UNIX image. Discuss the key features, including the purpose and location of each part (program code, data segment, and stack). Use Figure 13.2 on page 407 as a guide and pictorial example. 4. Explain the key features of the UNIX kernel. Point out that UNIX uses the same memory management concepts for network PCs, single-user, and multi-user systems. Process Management 1. Provide students with an overview of process management in UNIX operating systems. Outline the tasks performed by the Process Manager of the UNIX system kernel. 2. Explain the process scheduling algorithm in UNIX operating systems. Make sure students understand the concept of compute-to-total-time ratio. Process Table Versus User Table 1. Provide students with an overview of the process control structure in UNIX, using Figure 13.3 on page 410 as a guide. 2. Explain the three tables that UNIX uses to keep the system running smoothly: the process table, user table, and text table. 3. Explain how the process table and text table interact for processes with sharable code, as well as for those without sharable code. Synchronization 1. Provide students with a brief overview of process synchronization in UNIX operating systems. Discuss how this is achieved using an example such as that provided on page 411 in the text. Explain the situation where a race can occur. 4

2. Explain the usefulness of fork, wait, and exec commands in process management, using Figures 13.4, 13.5, and 13.6 on pages 412-413 in the text as a guide. Teaching Tip System calls such as the ls command illustrate the flexibility of UNIX that programmers find extremely useful. Quick Quiz 1 1. Which of the following truly describe the stack segment in the internal memory layout for a single user-memory part UNIX image? (Choose all that apply.) a. Starts at the highest memory address and grows downward b. Starts after the program code and grows toward higher memory locations c. Section where process information is saved when a process is interrupted d. Sharable section of memory Answer: a and c 2. UNIX uses the page replacement algorithm. a. MRU b. LRU c. FCFS d. FIFO Answer: b 3. Which of the following commands in UNIX gives the user the capability of executing one program from another program? a. nohup b. nice c. fork d. exexv Answer: c Device Management 1. Discuss the important features of device management in UNIX operating systems. 2. Discuss the incorporation of device drivers into the kernel. 3. Explain the roles of the config.c file. Device Classifications 1. List the two categories into which UNIX divides the I/O system, namely the block I/O system (sometimes called the structured I/O system) and the character I/O system (sometimes called the unstructured I/O system). 5

2. Explain the hierarchy of I/O devices in UNIX using Figure 13.7 on page 415 as a guide. Discuss the roles of the major device number, minor device number, and block I/O system. 3. Explain the mechanisms of character devices. Device Drivers 1. Provide students with a brief overview of device drivers in UNIX. Point out that although device files may be kept anywhere on the file system, by default and convention they are kept in the /dev directory. Teaching Tip An innovative feature of UNIX is its treatment of devices; the operating system is truly device independent. It achieves this independence by treating each I/O device as a special type of file. File Management 1. Explain briefly the three types of files in UNIX: directories, ordinary files, and special files. 2. Explain how files are stored in UNIX operating systems. 3. Explain the organization of disks in the UNIX file management system. Discuss briefly the four basic regions into which the disk is divided. Mention that whenever possible, files are stored in contiguous empty blocks. 4. Explain i-node and the information it contains on a specific file. File Naming Conventions 1. Discuss the general rules for filenames in UNIX. Be sure to mention that filenames in UNIX are case sensitive. 2. Describe the hierarchical tree file structure supported in UNIX, using an example as shown in Figure 13.8 on page 418 as a guide. 3. Explain the rules that apply to all path names using the bullet points on page 419 as a guide. Directory Listings 1. Describe the eight pieces of information for each file that a long listing of files in a directory shows, using Table 13.2 on page 419 as a guide. Explain the meaning of each of the ten characters used in the first column in the directory listing. 6

2. Explain the meaning of each of the characters used in the second column in the directory listing 3. Clarify the concept of aliases. 4. Explain the meaning of each of the characters used in the remaining columns in the directory listing. Columns three through five show the name of the group, the name of the owner, and the file size in bytes. Columns six and seven show the date and time of the last modification. The last column lists the filename. Data Structures 1. Describe the data structure in UNIX, using Figure 13.9 on page 421 as a guide. Point out that the information presented in the directory is not all kept in the same location. UNIX divides the file descriptors into parts, with the hierarchical directories containing only the name of the file and the i-number, which is a pointer to another location, the i-node, where the rest of the information is kept. 2. Discuss what happens when a file is opened, created, linked, or deleted. User Interface 1. Remind students that UNIX is a command-driven system. Explain the key features of user commands: they are very short, either one character or a group of characters (an acronym of the words, which make up the command); they cannot be abbreviated or spelled out; and they must be in the correct case. Note that the system prompt is very economical only one character, ($) or (%) and that brief error messages are displayed. 2. Explain various user commands, using Table 13.3 on page 422 as a guide. Explain the general syntax of commands. Note that information in the figure displayed in the accompanying PowerPoint slide is incomplete, and refer the students to pages 422-423 for the complete list of sample commands. 3. Describe the general command syntax and the three components (command, arguments, and filename). Use Figure 13.10 on page 423 in the text to demonstrate the command interface for an MAC OS x system. Script Files 1. Provide students with an overview of script files. Provide an example as included in the text on page 424 to illustrate their use. 7

Redirection Pipes Filters 1. Explain the redirection command, which is used to redirect output from one standard input or output device to another. Use examples to illustrate. Point out that redirection works in the opposite manner as well. Emphasize the concepts of reverse direction and direction. Discuss the append command as well. 2. Point out that redirection can be combined with system commands to achieve results not possible otherwise. Provide examples of the use of the redirection command in combination with who and sort commands as provided on page 425. 3. Be sure to emphasize that the interpretation of < and > is done by the shell and not by the individual program. 1. Explain the use of the pipe command with examples. Point out that it is possible to combine pipes and other filters. 2. Discuss pipeline using an example such as that provided on page 426. 1. Explain various filter commands, such as wc and sort. Provide different examples to illustrate the use of the sort command to arrange files in ascending order (numerically or alphabetically), in reverse order, or to sort the files by column. 8

Quick Quiz 2 1. The is used as an index to the array to access the appropriate code for a specific device driver. a. i-number b. Minor device number c. Major device number d. Stack number Answer: c 2. If you want to put a very long job on the background, work on some other jobs, and log out before the long job is finished, which of the following commands will you use? a. nohup b. nice c. fork d. exexv Answer: a 3. Recent versions of UNIX have a program called config that will automatically create a(n) file for any given hardware configuration. Answer: conf.c Class Discussion Topics 1. Have students discuss device management in the UNIX operating systems. How is it different from device management in the Windows operating systems? Ask students to list all the advanced key features of device management in UNIX operating systems. 2. Ask students if any of them have worked with UNIX in the past, and if so, how they felt about the experience. What were some of the challenges that they faced in attempting to install and configure UNIX? Do they think that UNIX will be a long-term and viable alternative to Windows? Why or why not? Additional Projects 1. Have students research online and compile a chart illustrating the major advantages and disadvantages of the Windows and UNIX operating systems. The chart should be a guide for users who may consider making a change from Windows to UNIX or from UNIX to Windows. 2. Have students research online and create a list of what they consider to be the best online UNIX resources available, along with the types of information each site provides. Once completed, compile the students lists into a master list to be distributed to the class. 9

Additional Resources 1. IBM.com: www.ibm.com 2. IBM's UNIX servers and AIX documentation: www-1.ibm.com/servers/eserver/pseries/ 3. Sun.com: www.sun.com/ 4. IEEE: www.ieee.org 5. The Open Source: www.theopengroup.org/ Key Terms Argument: in a command-driven operating system, a value or option placed in the command that modifies how the command is to be carried out. Child process: in UNIX-like operating systems, the subordinate processes that are created and controlled by a parent process. Command line interface: an interface that accepts typed commands, one line at a time, from the user. It contrasts with a graphical user interface. Compaction: the process of collecting fragments of available memory space into contiguous blocks by moving programs and data in a computer s memory or secondary storage. CPU-bound: a job that will perform a great deal of nonstop processing before issuing an interrupt. A CPU-bound job can tie up the CPU for long periods of time. Device driver: a device-specific program module that handles the interrupts and controls a particular type of device. Device independent: programs that can work on a variety of computers and with a variety of devices. Directory: a logical storage unit that contains files. I/O-bound: a job that requires a large number of input/output operations, resulting in much free time for the CPU. Kernel: the part of the operating system that resides in main memory at all times and performs the most essential tasks, such as managing memory and handling disk input and output. Multitasking: a synonym for multiprogramming, a technique that allows a single processor to process several programs residing simultaneously in main memory and interleaving their execution by overlapping I/O requests with CPU requests. Parent process: in UNIX-like operating systems, a job that controls one or more child processes, which it created. 10

Portable Operating System Interface for Computer Environments (POSIX): a set of IEEE standards that defines the standard user and programming interfaces for operating systems so developers can port programs from one operating system to another. Race: a synchronization problem between two processes vying for the same resource. In some cases, it may result in data corruption because the order in which the processes will finish executing cannot be controlled. Reentrant code: code that can be used by two or more processes at the same time; each shares the same copy of the executable code but has separate data areas. Script: a series of executable commands written in plain text that can be executed by the operating system in sequence as a single procedure. Sharable code: executable code in the operating system that can be shared by several processes. 11