Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 6502 Operating Systems Dr. J.. Garrido OS Concepts Using Linux Class Will Start Momentarily… (Lecture 2) CS5002 Operating Systems Dr. Jose M. Garrido.

Similar presentations


Presentation on theme: "CS 6502 Operating Systems Dr. J.. Garrido OS Concepts Using Linux Class Will Start Momentarily… (Lecture 2) CS5002 Operating Systems Dr. Jose M. Garrido."— Presentation transcript:

1 CS 6502 Operating Systems Dr. J.. Garrido OS Concepts Using Linux Class Will Start Momentarily… (Lecture 2) CS5002 Operating Systems Dr. Jose M. Garrido

2 CS 6502 Operating Systems Dr. J.. Garrido Operating Systems User Interfaces Graphics GUI (windows oriented) Command level (shell) At login time, the shell starts computing System calls Invoked from user programs

3 CS 6502 Operating Systems Dr. J.. Garrido Multiprogramming - Batch Systems Several jobs are kept in main memory at the same time, and the CPU is multiplexed among them.

4 CS 6502 Operating Systems Dr. J.. Garrido OS Features Needed for Multiprogramming I/O routine supplied by the system. Memory management – the system must allocate the memory to several jobs. CPU scheduling – the system must choose among several jobs ready to run. Allocation of devices.

5 CS 6502 Operating Systems Dr. J.. Garrido Time-Sharing Systems The CPU is multiplexed among several jobs that are kept in memory and on disk (the CPU is allocated to a job only if the job is in memory). A job is swapped in and out of memory to the disk. On-line communication between the user and the system is provided; when the operating system finishes the execution of one command, it seeks the next “control statement” not from a card reader, but rather from the user’s keyboard. On-line system must be available for users to access data and code.

6 CS 6502 Operating Systems Dr. J.. Garrido Introducing Unix/Linux A multi-user OS –Users log on by typing their user names and their passwords A Multitasking OS –Users can have more than one program executing A portable OS –Unix runs on a wider variety of different systems than any other OS

7 CS 6502 Operating Systems Dr. J.. Garrido Unix Shells A shell is a Unix program that interprets the commands that users type on their terminal keyboards Different Unix shells: –Bourne –Korn –C shell –Bash (default on Linux) –tcsh

8 CS 6502 Operating Systems Dr. J.. Garrido SSH Utility Program SSH Client for Windows is available free to KSU students and faculty. This program can be downloaded by carrying out the following steps: 1.Search the Web page: www.kennesaw.edu. 2.Select/click “Computing Resources” 3.Select “IT Service Desk” 4.On the left panel, click on n “Software Downloads” 5.Type your NETID name and password 6.Click on: SSH.exe to download this install program 7.After downloading, execute the install program

9 CS 6502 Operating Systems Dr. J.. Garrido Using the SSH Utility Two modes of operation are provided by this utility: 1.Secure File Transfer Client 2.Secure Shell Client

10 CS 6502 Operating Systems Dr. J.. Garrido Connecting The following steps are used to connect to a Linux server with the Secure Shell Client: 1.Make sure you are connected to Internet 2.Start ssh (Secure Shell Client) to connect to a remote Unix server 3.Type cs3.kennesaw.edu 4.Logon to Linux on the CS3 server 5.Start using the Linux shell

11 CS 6502 Operating Systems Dr. J.. Garrido Connecting to Linux Server

12 CS 6502 Operating Systems Dr. J.. Garrido Connecting to Linux Server After you click on the window or press the Enter key, the following dialog box appears. Type the name of the server, type your user account name, and click on the Connect button.

13 CS 6502 Operating Systems Dr. J.. Garrido Loggin In Type your password on the following dialog box

14 CS 6502 Operating Systems Dr. J.. Garrido Start Using Linux Shell

15 CS 6502 Operating Systems Dr. J.. Garrido Start Using Linux Shell

16 CS 6502 Operating Systems Dr. J.. Garrido Basic Unix Commands For a more complete set of commands Appendix A Important commands: –ls, mkdir, cd, cp, more, rm, pwd, exit Text editor: pico Start pico and read the help screens

17 CS 6502 Operating Systems Dr. J.. Garrido Printing Normally, every printer connected to a network has a symbolic name In this course, you will use FTP mode of SSH to transfer (copy) the file you want to print, from CS3 to your local computer (PC) Print the file from your computer.

18 CS 6502 Operating Systems Dr. J.. Garrido Steps to Run a Simulation Model on Linux Create a working directory for running simulations with the OS models $ mkdir os Copy to your working directory, the corresponding simulation model (s) and the psim3 script file from the “/home/jgarrido/psim3” directory $ cp /home/jgarrido/psim3/batch.cpp os $ cp /home/jgarrido/psim3/psim3 os

19 CS 6502 Operating Systems Dr. J.. Garrido Run a Simulation Model on Linux Compile and link the simulation model $./psim3 batch.cpp Run the model (output on the screen) $./a.out Run the model, redirect the output to a file $./a.out > batch.lst View the output file $ more batch.lst

20 CS 6502 Operating Systems Dr. J.. Garrido Using CS3 To compile and link the C++ program: $./psim3 batch.cpp To execute the program $./a.out

21 CS 6502 Operating Systems Dr. J.. Garrido ‘ls’ Command List files and subdirectories in current directory or specified directory $ ls The long listing is produced with the -l option: $ ls -l $ ls -lt | more

22 CS 6502 Operating Systems Dr. J.. Garrido ‘man’ Command To get a short online manual or documentation on the specified command $ man ls (help with ‘ls’) $ man cd (help with ‘cd’) The space key shows the next page

23 CS 6502 Operating Systems Dr. J.. Garrido Make and Change Directory To make a new directory under your current directory: $ mkdir mydir To change to a directory: $ cd mydir (change to mydir) $ cd os (change to os)

24 CS 6502 Operating Systems Dr. J.. Garrido Directories The system root directory is denoted as a slash (/) An absolute path denotes the position of a file in the file structure /export/home/jjg/psim/batch.cpp The current working directory is denoted as dot (.), The parent of the current directory as dotdot (..)

25 CS 6502 Operating Systems Dr. J.. Garrido Show Current Working To display the current working directory: $ pwd To return to your home directory: $ cd

26 CS 6502 Operating Systems Dr. J.. Garrido File Protection - Access Permissions Types of users for file access: –Owner of the file or directory (user) –Group, users in the same group as the owner –Others, all other users –Types of access permissions Read (r) Write (w) Execute (x)

27 CS 6502 Operating Systems Dr. J.. Garrido Change File Access Mode To change the read access permission to all users for batch.cpp $ chmod a+r batch.cpp $ chmod o-w batch.cpp (remove write permission to others) When writing a shell script, change execute permission

28 CS 6502 Operating Systems Dr. J.. Garrido Unix File Concept A file is a sequence of bytes All input/output devices are treated as files Types of files –simple/ordinary –directory –symbolic link –special (device) –named pipe

29 CS 6502 Operating Systems Dr. J.. Garrido Copying Files The copy (cp) command copies one or more files from a source directory to a destination directory $ cp /home/jjg/psim/batch.lng. The previous command copied file ‘batch.lng’ located in /home/jjg/psim to your current directory (dot)

30 CS 6502 Operating Systems Dr. J.. Garrido Moving Files The move (mv) command is used to move files from a source directory to a destination directory. The command is also used to change the name of a file, in the same directory: $ mv batch.cpp batch.txt

31 CS 6502 Operating Systems Dr. J.. Garrido Systems and Models A system is the part of the real world under study. Composed of a set of entities interacting among themselves and with the environment. A model is an abstract representation of a system. The system behavior is dependent on the input data and actions from the environment.

32 CS 6502 Operating Systems Dr. J.. Garrido Abstraction The most important concept in analysis and design A high-level description of a collection of objects Only the relevant properties and features of the objects are included.

33 CS 6502 Operating Systems Dr. J.. Garrido System A system has: Structure Behavior The model of a system is simpler than the real system in its structure and behavior. But it should be equivalent to the system.

34 CS 6502 Operating Systems Dr. J.. Garrido A High-Level Model

35 CS 6502 Operating Systems Dr. J.. Garrido Using a Model A user must be allowed to: Manipulate the model by supplying it with a set of inputs Observe its behavior or output Predict the behavior of the real system by analyzing the behavior of the model.

36 CS 6502 Operating Systems Dr. J.. Garrido Behavior of a Model Depends on: The passage of time Input data Events generated by the environment

37 CS 6502 Operating Systems Dr. J.. Garrido Types of Model The most general categories of models are: Physical models (scale models) Graphical models Mathematical models. Mathematical models are the most flexible ones and are the ones studied here.

38 CS 6502 Operating Systems Dr. J.. Garrido Solutions to Mathematical Models Analytic, the solution is a set of expressions that define the behavior of the model. Numeric, mathematical techniques are used to derive values for the model behavior within given intervals. Deterministic and stochastic models are solved with numerical techniques.

39 CS 6502 Operating Systems Dr. J.. Garrido Models with Uncertain Behavior Models are further categorized as: Deterministic - models that display a completely predictable behavior (with 100% certainty) Stochastic - models that display some level of uncertainty in their behavior. This random behavior is implemented with random variables.

40 CS 6502 Operating Systems Dr. J.. Garrido Simple Batch System

41 CS 6502 Operating Systems Dr. J.. Garrido Stochastic Models A stochastic model is one which includes some uncertainty in its behavior. One or more attributes change value according to some probability distribution. Random number generation is used. For example, in the simple batch OS model: –arrival of jobs –service time for a job

42 CS 6502 Operating Systems Dr. J.. Garrido Simulation A simulation model is a mathematical model implemented with a general-purpose programming language, or a simulation language. A simulation run is an experiment carried out for some observation period and with the simulation model to study the behavior of the model.

43 CS 6502 Operating Systems Dr. J.. Garrido Continuous and Discrete Models Continuous models change their state continuously with time. Mathematical notation is used to completely define the behavior. For example, the free-falling object. Discrete models only change their state at discrete instants. For example, arrival of a job in the Simple batch OS model.

44 CS 6502 Operating Systems Dr. J.. Garrido Discrete-Event Simulation Event approach Activity approach Process interaction approach – Psim and PsimL uses the full power of process interaction simulation. – GPSS has limited support – Simscript has limited support – Modsim III has good support

45 CS 6502 Operating Systems Dr. J.. Garrido Simulation Results For every simulation run there are two types of output: Trace - sequence of events that occur during the simulation period Performance measures - summary statistics about the simulation.

46 CS 6502 Operating Systems Dr. J.. Garrido Simple Batch System

47 CS 6502 Operating Systems Dr. J.. Garrido Performance Measures Throughput Capacity Response time Utilization Reliability Speedup Backlog

48 CS 6502 Operating Systems Dr. J.. Garrido Workload on a System The performance measures depend on the current workload of the system The workload for a system can be characterized by another series of measures, which are made on the input to the system Errors in characterizing the workload may have serious consequences

49 CS 6502 Operating Systems Dr. J.. Garrido Workload Parameters Interarrival time Task size I/O request rate I/O service rate Memory size Task mix Parallelism

50 CS 6502 Operating Systems Dr. J.. Garrido Migration of Operating-System

51 CS 6502 Operating Systems Dr. J.. Garrido Parallel Systems Multiprocessor systems with more than one CPU in close communication. Tightly coupled system – processors share memory and a clock; communication usually takes place through the shared memory. Advantages of parallel system: –Increased throughput –Economical –Increased reliability graceful degradation fail-soft systems

52 CS 6502 Operating Systems Dr. J.. Garrido Parallel Systems (Cont.) Symmetric multiprocessing (SMP) –Each processor runs an identical copy of the operating system. –Many processes can run at once without performance deterioration. –Most modern operating systems support SMP Asymmetric multiprocessing –Each processor is assigned a specific task; master processor schedules and allocates work to slave processors. –More common in extremely large systems

53 CS 6502 Operating Systems Dr. J.. Garrido Symmetric Multiprocessing Architecture

54 CS 6502 Operating Systems Dr. J.. Garrido Real-Time Systems Often used as a control device in a dedicated application such as controlling scientific experiments, medical imaging systems, industrial control systems, and some display systems. Well-defined fixed time constraints. Hard real-time system. –Secondary storage limited or absent, data stored in short-term memory, or read-only memory (ROM) –Conflicts with time-sharing systems, not supported by general-purpose operating systems. Soft real-time system –Limited utility in industrial control or robotics –Useful in applications (multimedia, virtual reality) requiring advanced operating-system features.

55 CS 6502 Operating Systems Dr. J.. Garrido Distributed Systems Distribute the computation among several physical processors. Loosely coupled system – each processor has its own local memory; processors communicate with one another through various communications lines, such as high-speed buses or telephone lines. Advantages of distributed systems. –Resources Sharing –Computation speed up – load sharing –Reliability –Communications

56 CS 6502 Operating Systems Dr. J.. Garrido Distributed Systems (Cont.) Network Operating System –provides file sharing –provides communication scheme –runs independently from other computers on the network Distributed Operating System –less autonomy between computers –gives the impression there is a single operating system controlling the network.

57 CS 6502 Operating Systems Dr. J.. Garrido Dual-Mode of Operation Two modes of operation: –User mode – no special priviledges –Supervisor mode – when executing OS routines Protection is maintained by controlling the transition between modes (rather than checking each time an OS routine is executed) A process when requesting service from the OS, changes mode to supervisor, and provides its own service!

58 CS 6502 Operating Systems Dr. J.. Garrido System Components Process Management Main-Memory Management File Management I/O System Management Secondary-Storage Management Networking Protection (address space/errant process) User Interface (command line&GUI)

59 CS 6502 Operating Systems Dr. J.. Garrido System Calls Process Management –Load, execute, end, abort –Create/terminate process –Get or set process attributes –Wait, wait for event, signal event –Allocate and free memory

60 CS 6502 Operating Systems Dr. J.. Garrido System Calls (cont.) File Management –Create/delete file –Open/close file –Read,write, reposition pointer –Get/set file attributes Device Management –Request/release device –Read,write,reposition –Get/set attributes –Mount and unmount device

61 CS 6502 Operating Systems Dr. J.. Garrido System Calls cont. Manipulate information and attributes –Get/set file/device/process attributes –Create/delete “environment variables” Communications –Create/delete channels/links/ports –Send/receive messages –Distributed computing/access Attach/detach remote devices

62 CS 6502 Operating Systems Dr. J.. Garrido System Structure – Layered Approach The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface. With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers.

63 CS 6502 Operating Systems Dr. J.. Garrido Layered Structure of the THE OS A layered design was first used in THE operating system. Its six layers are as follows:


Download ppt "CS 6502 Operating Systems Dr. J.. Garrido OS Concepts Using Linux Class Will Start Momentarily… (Lecture 2) CS5002 Operating Systems Dr. Jose M. Garrido."

Similar presentations


Ads by Google