1 / 63

OS Concepts Using Linux

(Lecture 2). OS Concepts Using Linux. CS5002 Operating Systems Dr. Jose M. Garrido. Class Will Start Momentarily…. Operating Systems User Interfaces. Graphics GUI (windows oriented) Command level (shell) At login time, the shell starts computing

atalo
Télécharger la présentation

OS Concepts Using Linux

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. (Lecture 2) OS ConceptsUsing Linux CS5002 Operating SystemsDr. Jose M. Garrido • Class • Will • Start • Momentarily…

  2. 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. Multiprogramming - Batch Systems Several jobs are kept in main memory at the same time, and the CPU is multiplexed among them.

  4. 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. 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. 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. 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. 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: • Search the Web page: www.kennesaw.edu • Select/click “Computing Resources” • Select “IT Service Desk” • On the left panel, click on n “Software Downloads” • Type your NETID name and password • Click on: SSH.exe to download this install program • After downloading, execute the install program

  9. Using the SSH Utility Two modes of operation are provided by this utility: • Secure File Transfer Client • Secure Shell Client

  10. Connecting The following steps are used to connect to a Linux server with the Secure Shell Client: • Make sure you are connected to Internet • Start ssh (Secure Shell Client) to connect to a remote Unix server • Type cs3.kennesaw.edu • Logon to Linux on the CS3 server • Start using the Linux shell

  11. Connecting to Linux Server

  12. 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. Loggin In • Type your password on the following dialog box

  14. Start Using Linux Shell

  15. Start Using Linux Shell

  16. 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. 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. 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. 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. Using CS3 • To compile and link the C++ program: $ ./psim3 batch.cpp • To execute the program $ ./a.out

  21. ‘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. ‘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. 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. 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. Show Current Working • To display the current working directory: $ pwd • To return to your home directory: $ cd

  26. 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. 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. 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. 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. 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. 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. 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. 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. A High-Level Model

  35. 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. Behavior of a Model Depends on: • The passage of time • Input data • Events generated by the environment

  37. 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. 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. 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. Simple Batch System

  41. 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. 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. 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. 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. 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. Simple Batch System

  47. Performance Measures • Throughput • Capacity • Response time • Utilization • Reliability • Speedup • Backlog

  48. 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. Workload Parameters • Interarrival time • Task size • I/O request rate • I/O service rate • Memory size • Task mix • Parallelism

  50. Migration of Operating-System

More Related