+ All Categories
Home > Documents > Operating Systems Chapter 4 Operating Systems1. 2 Why do I need to know this? Every time that you...

Operating Systems Chapter 4 Operating Systems1. 2 Why do I need to know this? Every time that you...

Date post: 22-Dec-2015
Category:
View: 215 times
Download: 0 times
Share this document with a friend
Popular Tags:
49
Operating Systems Chapter 4 Operating Systems 1
Transcript

Operating Systems

Chapter 4 Operating Systems 1

Chapter 4 Operating Systems 2

Why do I need to know this?• Every time that you use a computer (and a

cellphone), an operating system is handling your requests for i/o, computation, etc.

• An operating system is a resource manager.– Managers do no real work. They just make it

possible (hopefully) for workers to do their job.– A good manager will minimize its own

overhead and help workers do their job faster and better

Operating Systems

• Since perhaps 1981 (Xerox Star workstation), operating systems have made user friendliness a main objective– GUI support– Uniform interface to utilities– Deleted file goes to the recycle bin

– Shift delete really deletes the file

– Abstraction is provided, e.g, folders

Chapter 4 Operating Systems 3

Capabilities that OS enables• Switching between applications

• Executing process while file is being printed or data is being input/output to disk

• Hiding the actual location of a network drive or folder or file(location transparency)

• Allowing processes to be use more memory than physical memory (via virtual memory)

• Porting an application to different machines

Chapter 4 Operating Systems 4

Current Operating Systems• Desk tops, workstations typically use:

– Microsoft Windows 7,XP, 8 or Vista (over 90% of market)

– Apple’s Mac OS X (less than 9% of market)– Linux (1.25% of market)

• Cellphones typically use– Android,Apple iOS, Blackberry,Windows phone7

• Mainframes use IBM’s z/OS; UNIX• Multi-user systems (on system at the same time)

Chapter 4 Operating Systems 5

OS manages processorProcessor scheduling

– OS assigns each process to the processor, typically by priority (static, dynamic)

• In task manager, go to processes tab, click view tab, select columns, check base priority/ OK

• You’ll see static priorities of normal, high

– If there are multiple processors. OS dispatches processes to different processor per availability (unless affinity is assigned)

Chapter 4 Operating Systems 6

Types of processor assignment• One processor with Multitasking

– Two or more user processes can be in a state of execution

– OS switches between them according to user commands (mouse clicks, etc) or perhaps because process has been temporarily blocked

• Multiple processors (Multiprocessing) – Processes can be assigned different processors

• Multithreading – – Processes are divided into sub-processes (threads)

• Check task managerChapter 4 Operating Systems 7

OS manages main memory

• Allocates main memory units to each program that becomes a process(s)

• Must protect the memory of each process

• If process wants more memory than is available, OS will keep some data on disk and bring into memory as needed

• Keeps track of which memory is assigned to which process

Chapter 4 Operating Systems 8

Memory leaks and overflow

• Memory leak is a loss of system or user access to memory– Application (frequently browsers) may not keep

track of all memory that is no longer used

• Buffer overflow is when process data go outside the allocated memory into memory assigned to another process

Chapter 4 Operating Systems 9

OS manages files

• Allows user to create, name, access files– Maintains cursor of user’s current position in a

file

• Keeps table of open files

• Maintains access rights allowing/ preventing access to files

Chapter 4 Operating Systems 10

OS manages devices• Communicates (usually through device

driver and controllers) with each device– If multiple devices want attention – such as a

mail message and a printer’s signal of failure – Interrupt controller prioritizes the interrupts

• Translates user command (perhaps a click on a file name) through many levels until it reaches device

• Keeps tables of status of attached devicesChapter 4 Operating Systems 11

OS uses buffers to smooth I/O

• Different devices have different speeds– Processor is much faster than printer– Processor output is stored on disk until a printer

can print the output, for example

• Different devices compete for processor– Device data are stored in buffers until processor

can handle them

• Network printers store (spool) user data Chapter 4 Operating Systems 12

OS and peripheral devices

• I/O is the most tedious and repetitive part of handling a computer system.

• Operating Systems were first developed to control input and output from devices

• As different types of devices are being developed (cameras, external disk drives, etc.) i/o becomes more complex

Chapter 4 Operating Systems 13

What control does the user have?

• Install, execute, uninstall programs• Create, organize, rename, move, delete

directories (folders) and files (documents)• Customize interface – add, remove icons

– Enter customization in search bar • Or Control panel/personalization

– Right click on desk top (screen resolution)

• Configure equipmentChapter 4 Operating Systems 14

Compatibility

• Backward compatibility means that old versions can run on new systems– Example: .doc files on .docx systems

• Compatibility also means that different OS, applications, formats can run on the machine– Example: Linux on dual boot, or virtual

machine, allows Linux applications

Chapter 4 Operating Systems 15

User Interface• Command-line interface

• Graphical user interface– Mouse or other INPUT device for manipulating

graphical object• Icon

• Window

• Button on menu bar, tool bar, or ribbon

• Drop down menu

• Dialog boxes

Chapter 4 Operating Systems 16

Advantages & disadvantages of GUI

• Con: Overhead of GUI in time, space

• Pro: • user won’t mistype or forget file names, commands

• syntax of command line can be difficult

• Easy to drag (move) item, delete item

• Nice images are cheerful

• Abstraction for human understanding

Chapter 4 Operating Systems 17

Windows compared to other OSs

• Microsoft Windows (1.0, 2.0, 3.0, 3.1,NT, 95, 98, 2000, ME, XP, Vista, 7, 8)– Evolved from command line - MS/DOS

• (kernel of DOS included in early Windows versions)

– Initially divided GUI screen into rectangular windows for multiple programs on the desktop)

– NTFS (developed for Windows NT-1993) still used today

Chapter 4 Operating Systems 18

Advantages of Windows

• Large customer base (90% of PC market)– Large user community to answer questions– Same OS in many locations– Large number of applications

• This is why some smart phone OS are popular.

– Large number of compatible devices– Plug and Play (as well as generic drivers)

Chapter 4 Operating Systems 19

Disadvantages of Windows

• Reliability is comparatively low – How long does computer run without

something going wrong?– Typically, reboot your machine

• Security – Windows is targeted because it has the largest base– Attempts to address security slows system

Chapter 4 Operating Systems 20

Mac OS X• Mac’s GUI is also based on Xerox PARC

– Mouse; icons; menus

• Mac OS X (Mountain Lion v 10.8, Maverick due out)– Supports Intel processors – PowerPC applications are no longer supported

Chapter 4 Operating Systems 21

Advantages of MacOS

• Dual boot options and support for virtual machines make it easy to run Windows applications

• OS X was based on UNIX – more reliable

• Probably more secure than Windows – not attacked nearly as often

• Great graphics and user interface

Chapter 4 Operating Systems 22

Disadvantages of Mac OS

• Less than 10% of PC customer base– less on-line support

• Less applications, devices

• Manufacturers may not feel that it pays to put in the extra effort to develop products for a different system

• Apple machines are more expensive than PCs

Chapter 4 Operating Systems 23

UNIX and Linux• UNIX was developed at Bell Labs (1969) as

a reaction to MULTICS (complex OS)– Multi-user, powerful, time-sharing– POSIX was developed to provide a uniform

interface for applications using UNIX versions

• Minix, Linux are POSIX compliant

• Linux is open source software with General Public License

Chapter 4 Operating Systems 24

DOS – first IBM OS

• Command line interface

• We’ll try a few DOS commands in the network chapter– Enter command prompt in Windows search box

Chapter 4 Operating Systems 25

Windows Registry

• The Windows Registry is a Database (integrated files) of all system devices and software. Information on configuration management, all new installations, etc.

Chapter 4 Operating Systems 26

OS support for directories & files

• The File system is the user interface to a computer– OS must enable user to create, delete, and

change files– OS must control access to files– OS creates metadata for file (user name,

creation date, modified date)– OS maps files to disk and flash storage

Chapter 4 Operating Systems 27

File Basics

• A file is a named (by user or for user’s consumption) collection of data that exists on a storage medium

• Can be of many types– Extension may help you, the OS, and the

application identify its type– .exe – executable process– .doc (.docx) word processing

Chapter 4 Operating Systems 28

Naming conventions

• Case sensitive?

• Maximum length (8 characters for name in DOS, 3 for extensions)

• Permissible characters (letters, numbers)– Non permissible characters

• Linux, UNIX do not allow blanks

• \ , *, :, / are not permissible characters in Windows

Chapter 4 Operating Systems 29

Reserved words

• Some files names are reserved for the system - cannot be assigned by users– Microsoft

• In Word, you cannot use “nul” for a file name

• Also reserved: com1, com2, com3, com4, lpt1, lpt2, lpt3, lpt4, prn, aux

Chapter 4 Operating Systems 30

File locations

• First find storage device– Drive letter, such as c: (local) – x: (network); a: floppy disk; d: CD drive

– These are not standardized

• Hard disk may be partitioned, with each partition mapped to a drive letter

• Within each partition is a tree of subdirectories (folders)

Chapter 4 Operating Systems 31

PATH

• File’s location is its path relative to its root directory

• Try, in Windows search bar, the command• Powershell

• Then pwd (print working directory)

• You’ll find your path relative to the c: drive

• Command Prompt will show it

• You can follow the path through Windows explorer

• URL provides a path within a domainChapter 4 Operating Systems 32

File data• Date and file type are shown next to file

name in explorer– Right click on file and choose properties

• Size

• If a folder, tells how many files it contains

• Security properties, permissions

• File format– Each application uses a different format

– You can rename file, but changing the format is harder

Chapter 4 Operating Systems 33

Some Windows file types and extensions

• Batch files: .bat

• Configuration files: .cfg, sys, .ini, .bin

• Help .hlp

• Temporary .tmp

• Executable .exe (.com)

• Support program: .dll

Chapter 4 Operating Systems 34

Some Application file types

• Text .txt

• Sound .wav; .m4p

• Graphics .bmp; .gif; .jpg – See “save as” in Paint (or open/ all picture files)

• Sometimes the file metadata is corrupted or the file is not in the correct format– Windows will ask you to find its program

Chapter 4 Operating Systems 35

File Management

• Save as / specify location– Save utilizes default location; default name

• Use tags to add information– Or right click on file and click on properties– Insert information

• Rename by right clicking on file name– Chose rename

Chapter 4 Operating Systems 36

Libraries to organize user folders

• On tool bar, click on icon for libraries– Organized by documents, music, pictures,

video– Click on organize for search and other options

• Windows search will not search in system directories

Chapter 4 Operating Systems 37

Deleting a file

• Press the delete key when cursor is over the file name – File will go to recycle bin; can be retrieved

• Press shift/delete – file is deleted

Chapter 4 Operating Systems 38

File Storage

• Disks are first formatted by disk manufacturers (low level formatting)

• A disk is divided into tracks and then into sectors (perhaps 512 bytes)– A sector is the smallest unit of the disk that

your program can be allocated • Typically OS requires a multiple of sectors to be

allocated to each file

Chapter 4 Operating Systems 39

OS formatting

• OS formatting can partition a disk for multiple OS or multiple file systems

• OS formatting will – set up a file system – set up a free memory list – group sectors into larger units (Windows calls

these clusters or blocks)

• Windows file system is NTFS Chapter 4 Operating Systems 40

OS copies files to disk

• If possible, OS stores a file contiguously.

• If not possible, or user adds onto file after another file has been stored in following clusters, the rest of the file will be placed in another cluster(s) – noncontiguous

• Defragmentation utility will move files to contiguous locations.

Chapter 4 Operating Systems 41

Shredding files• Suppose you are going to throw out your

computer or give it to charity– Files may contain personal data

• Even if you delete files in recycle bin, the files are still there – only the pointers to them have been changed

• Shredding software is available

• The DoD writes over an entire disk 7 times

Chapter 4 Operating Systems 42

Backup Security

• Data disasters– Malware destroying your file or metadata– Disk crash

• Save your important files

• Backup is important!

• Backup of files or of entire image

Chapter 4 Operating Systems 43

Backup device

• External hard disk ($100 or less; 1TB capacity)

• Network server / cloud (capacity varies, but may not save large files)

• Writeable CD, DVD ($50 for 7 GB)– Slower to use

• USB flash drive($5 for 8 GB)–up to 128GB

Chapter 4 Operating Systems 44

Back up issues

• How often - every week?

• Be careful that you do not back up contaminated data

• Where should you store backup?– Location redundancy

Chapter 4 Operating Systems 45

Computer forensics

• “Computer forensics is the scientific examination and analysis of data located on computer storage media, conducted to offer evidence of computer crimes in court”

• Text p. 235

Chapter 4 Operating Systems 46

Steps in forensics1) Exact replica of the disk information (disk

image)– Copied to write-once medium (so that no

evidence can be planted; medium is STERILE)

2) Data may be searched for key words

3) Data recovery software looks for deletions

4) Search emails and visited URLs

5) Login attempts; log files (view event logs)Chapter 4 Operating Systems 47

Monitor your system

• Monitor login attempts

• changes to log files

• file access requests

• There are intrusion detection systems (look up SNORT) that maintain this information in databases and use A.I. for outlier analysis

• Sandboxes to execute new processes

Chapter 4 Operating Systems 48

Create a honeypot

• Make a system appear vulnerable (appear to have a lot of open ports; appear to have unpatched vulnerabilities, etc.)

• Monitor the intruder until it can be identified– Note that innocent zombies may be controlled

to do bad things

Chapter 4 Operating Systems 49


Recommended