part ii: software in part ii, we focus on topics associated with software. in particular, we will...

35
Part II: Software • In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication of algorithms. • Operating systems and networks. • Algorithms. • Programming languages. • Software engineering.

Upload: miles-richard

Post on 11-Jan-2016

218 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Part II: Software

• In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication of algorithms.

• Operating systems and networks.• Algorithms.• Programming languages.• Software engineering.

Page 2: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Ch. 3 Operating Systems and Networks

• The evolution of operating systems.• Operating system architecture.

• Coordinating the machine’s activities.

• Handling Competition among processes.

• Networks.

• Network protocols.

Page 3: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Operating Systems

• Why needs an operating system? • Computer applications often require a single machine

to perform activities that may compete with one another for the machine’s resources. It requires a high degree of coordination to ensure that unrelated activities do not interfere with one another and that communication between related activities is efficient and reliable.

• What is an operating system? A software system which handles such a coordination task.

Page 4: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

The evolution of Operating Systems

• Single-processor systems.• Batch processing - the execution of jobs

(programs) by collecting them in a single batch, then executing them without further interaction with the user.

• A job queue (FIFO) and a job control language (JCL).

• The main drawback to batch processing is no interaction between user and job.

Page 5: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

The Evolution of Operating Systems

• Interactive processing.• Real-time processing.• Time-sharing.• Multitasking - time-sharing for a single-us

er system.• From multiprocessor systems to networks.

Page 6: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Operating System Architecture

Software

Application System

Utility Operating system

Shell Kernel

Page 7: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Operating System Architecture

• A machine’s software can be divided into two categories: application software and system software.

• Application software - the programs for performing tasks particular to the machine’s utilization.

• System software - performs tasks which are common to computer systems in general.

Page 8: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Operating System Architecture

• System software can be divided into two categories: operating-system software and utility software.

• Utility software consists of software units that extend the capabilities of the operating system. For example, the ability to format a disk or software for communicating through a modem over telephone lines.

Page 9: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Operating System Architecture

• Shell - the portion of an operating system that defines the interface between the operating system and its users.

• Graphical user interface (GUI).• Importance of uniformity in the human-

machine interface across a variety of machines.

• UNIX Vs. MS-DOS and Windows.

Page 10: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Operating System Architecture

• Kernel - the internal part of an operating system, which contains those software components that perform the very basic functions required by the computer installation.

• File manager - file descriptor and directory (folder).

• Device drivers - communicate with controllers.

Page 11: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Operating System Architecture

• Memory manager - virtual memory.• Scheduler and dispatcher.• Booting (boot strapping).• Bootstrap - a short program placed in ROM and t

his program is executed automatically when the machine is turned on.– transfer the operating system to memory

– direct the CPU to execute the operating system

Page 12: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Coordinating the Machine Activities

• Process - is a dynamic activity whose properties change as time progresses.

• Process state - current status of the activity, including the current position in the program being executed and the values in the other CPU registers and the associated memory cells.

• A program Vs. a process.• Interprocess communication.

Page 13: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Coordinating the Machine’s Activities

• Process administration - the tasks associated with process coordination are handled by the scheduler and dispatcher within the operating system’s kernel.

• Process table - keeps information of a process; when a process is created, it is assigned a memory area, a priority, and a status - ready or waiting.

Page 14: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Coordinating the Machine’s Activities

• The dispatcher is the component of the kernel that ensures that the scheduled processes are actually executed.

• In a time-sharing system, the time is divided into time slices or quanta.

• The dispatcher initiates a timer circuit each time a process begins its time slice.

• At the end of the time slice, the timer circuit generates an interrupt.

Page 15: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Coordinating the Machine’s Activities

• When the CPU receives an interrupt, it saves the current state of the process in the process table, and begins executing the interrupt handler, which is a part of the dispatcher.

• At this moment, the dispatcher allows the scheduler to update the process table.

Page 16: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Coordinating the Machine’s Activities

• The dispatcher then selects the highest priority process among the ready processes, restarts the timer circuit, and allows the selected process to begin its time slice.

• At times a process’s time slice is terminated before the timer has expired (for example, an I/O request), the scheduler will update the process table to reflect the process’s waiting status.

Page 17: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Coordinating the Machine’s Activities

• Later, when the controller indicates that the I/O request has been completed, the scheduler will reclassify the process as ready.

Page 18: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Coordinating the Machine’s Activities

• The various units within an operating system compete for time slices under control of the dispatcher.

• To coordinate their activities, these processes must communicate with one another.– For example, to schedule a new process, the sc

heduler must obtain memory space from the memory manager for that process

Page 19: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Coordinating the Machine’s Activities

• The client/server model for inter-process communication.

• A client makes requests to servers and waits for replies.

• A server satisfies the requests and sends replies back to the clients.

• The client/server model in the design of software leads to uniformity among the types of communication taking place in the system.

Page 20: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Handling Competition Among Processes

• Competing resources among processes.• The file manager allocates both access to current

files and disk space for the construction of new files.

• The memory manager allocates memory space.• The scheduler allocates space in the process

table.• The dispatcher allocates time slices.

Page 21: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Handling Competition Among Processes

• To control access to the printer, the operating system must keep track of whether the printer has been allocated.– By a flag: check the flag then set the flag

– Problem: check the flag and find it clear; the process is then interrupted; the new process also requests the use of the printer; the operating system allows it to use the printer; later, the first process resumes and the operating system allows it to use the printer too

Page 22: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Handling Competition Among Processes

• Interrupt disable and interrupt enable.• Test-and-set instruction.• A properly implemented flag is called a se

maphore.• Critical region - a sequence of instructions

which can be executed by only one process.– Mutual exclusion– Guard the critical region with a semaphore

Page 23: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Handling Competition Among Processes

• Deadlock - when two or more processes are blocked from processing because each is waiting for access to resources allocated to another.

• Three necessary conditions for deadlock:– 1. There is competition for non-shareable

resources

Page 24: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Handling Competition Among Processes

– 2. The resources are requested on a partial basis; that is, having received some resources, a process will return later to request more

– 3. Once a resource has been allocated, it cannot be forcibly retrieved

• Deadlock detection and correction to attack the third condition.

• Deadlock avoidance to attack the first two conditions.

Page 25: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Handling Competition Among Processes

– Require each process to request all its resources at one time

– Make nonshareable resources appear shareable• holding data for output at a later but more convenie

nt time• spooling

Page 26: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Networks

• Local area networks (LAN) Vs wide area networks (WAN).

• Open networks Vs proprietary networks.

• Network configurations - ring, bus, star, and irregular.

Page 27: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Networks

• Internet - initiated in 1973 by the Defense Advanced Research Projects Agency (DARPA) to develop the ability to connect a variety of computer networks so that they can function as a single network.– A collection of network clusters (domains)

• Internet addressing - network identifier, host address; ex., 192.207.177.133.– ssenterprise.awl.com– alpchen.cs.nthu.edu.tw

Page 28: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Networks

• Email and name server.– [email protected][email protected]

• The world wide web - hypertext and hypermedia documents.

• A browser - a client.

Page 29: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Networks

• Uniform resource locator (URL) - a browser can contact the proper server and request the desired document.– Figure 3.12, homepage: http://www.awl.com, portal

• Hypertext Markup Language (HTML).– Special markers that describe how the document shoul

d appear on the computer screen and which items within the document are to be linked to other documents for a browser to perform its task

Page 30: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Network Protocols

• Protocols - the rules that govern the communication between different components within a computer system.

• Token ring protocol for networks with the ring topology (Figure 3.13).

• CSMA/CD (carrier sense, multiple access with collision detection) in an Ethernet (Figure 3.14).

Page 31: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Network Protocols

You

Shipper

Airline

Customer

Shipper

Airline

Package Package

Container Container

Aircraft

Page 32: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Application layer

Network Protocols: The Internet Software Layer

Transport layer

Network layer

Link layer

Application layer

Transport layer

Network layer

Link layer

Message source Message destination

Page 33: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Network Protocols: The Internet Software Layer

• Application layer consists of software units that must communicate with each other across the Internet.– FTP, telnet, requires name server services

• Transport layer divides long messages into packets.

• Network layer wraps the packets it receives with the intermediate address.

• Link layer deals with the communication details (whether token ring or bus is used).

• Figure 3.17.

Page 34: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Network Protocols

• Open system interconnection (OSI) reference model produced by International standards organization (ISO).– Seven-level hierarchy

• TCP/IP protocol suite defines the four-level hierarchy.

Page 35: Part II: Software In part II, we focus on topics associated with software. In particular, we will investigate the discovery, representation, and communication

Networks

• Unauthorized access to information and vandalism.

• Passwords and data encryption.• Virus and worm.