Tip 6 Chunking 1 Computer Systems A primary



















































- Slides: 51
Tip #6: Chunking 1 Computer Systems ■ A primary method that the brain uses to help it absorb more information is called 'chunking'. ■ One chunk is a recognizable piece of information that be fitted into one of the 'slots' in short-term memory. The actual amount of information in a chunk is quite variable - it need only be recognizable as a single packet. A chunk may contain other chunks, which allows us to assimilate large amounts of information at once (e. g. we can remember and recognize a person as single. List: chunk. ) Un-chunked Chunked List: ■ Examples: newspaper articles, phone numbers, lists, etc. Bread Frozen Foods IP addresses, Bakery ■ ■ Ice cream Bread Milk Chunking makes block structured Frozen languages like C/C++ vegetables Bagels natural to use. Tomatoes ■ The program is a single chunk, which is. Diary divided and subdivided smaller and Fruitsinto / Vegetables Eggs smaller Milk distinguishable. Tomatoes Butter chunks, each visibly and logically Eggs Apples ■ A knowledgeable reader can read in big chunks, while a less experience reader Butter Lettuce English muffins must work in smaller chunks. Thus the author of a function can read a complex Cream Bananas Frozen vegetables expression as single chunk, while a new reader must break it down into variables Lettuce and operators and understand these individual chunks before he can piece it back Cream together into a single understood chunk. Bananas
http: //syque. com/cstyle/contents. htm Tip #6: Chunking (continued) 2 ■ ■ Lay out code in chunks ■ The smallest effective chunk is a single token (e. g. identifier, operator, keyword). ■ Larger chunks such as parenthesized items, single comparisons, etc. build into larger expressions and statements. Groups of statements which together perform an identifiable act are also chunks, as are individual functions and complete subsystems. ■ Items which are close together form a visual chunk and have an implied association. If they are separated, then they appear less associated. When an item is between two other items, it will appear more closely associated with the item to which it is positioned closest. ■ Vertical white space (form feeds and blank lines) can be used not only to separate chunks but also to show relationships between chunks. ■ By recognizing chunks and making them stand out, code can be made more readable which means more maintainable.
ENIAC 2020 3 2010 2000 1990 1980 1970 Transistor EDSAC and EDVAC 1950 BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN 1960 Burroughs B 5000 IBM 7090 DEC PDP-1 IBM System/360 1940 OS Complexity The OS Evolution Operating Systems
Brief Look at the Evolution of OS 4 Operating Systems ■ 1960 s: Disks become mainstream ■ The first disk drive, the IBM 350 disk storage unit, was introduced in 1956. It had a capacity of 3. 75 megabytes stored as five million six-bit characters on fifty (!) 24 -inch diameter disks. ■ IBM leased it for $3, 200 per month. ■ By the 1960’s disk storage finally comes into widespread use. It offers high capacity, almost-random-access-storage. ■ IBM created a family of Disk Operating Systems (DOS, DOS– 2314, DOS MP, DOS VS, DOS/VSE) to take advantage of this technology.
ENIAC 2020 5 2010 2000 1990 1980 1970 Transistor EDSAC and EDVAC 1950 BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN 1960 Burroughs B 5000 IBM 7090 DEC PDP-1 IBM System/360 GE-645 Mainframe 1940 OS Complexity The OS Evolution Operating Systems
ENIAC 2020 6 2010 2000 1990 1980 Transistor EDSAC and EDVAC 1950 BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN 1960 Burroughs B 5000 IBM 7090 DEC PDP-1 IBM System/360 GE-645 Mainframe DEC PD-8 1970 1940 OS Complexity The OS Evolution Operating Systems
ENIAC 2020 7 2010 2000 1990 1980 Transistor EDSAC and EDVAC 1950 BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN 1960 Burroughs B 5000 IBM 7090 DEC PDP-1 IBM System/360 GE-645 Mainframe DEC PD-8 1970 Intel 4004 1940 OS Complexity The OS Evolution Operating Systems
ENIAC 2020 8 2010 2000 1990 1980 Transistor EDSAC and EDVAC 1950 BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN 1960 Burroughs B 5000 IBM 7090 DEC PDP-1 IBM System/360 GE-645 Mainframe DEC PD-8 1970 Intel 4004 CRAY-1 1940 OS Complexity The OS Evolution Operating Systems
ENIAC 2020 9 2010 2000 1990 1980 Transistor EDSAC and EDVAC 1950 BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN 1960 Burroughs B 5000 IBM 7090 DEC PDP-1 IBM System/360 GE-645 Mainframe DEC PD-8 1970 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse 1940 OS Complexity The OS Evolution Operating Systems
ENIAC 2020 10 2000 1990 1980 Transistor EDSAC and EDVAC 1950 BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN 1960 Burroughs B 5000 IBM 7090 DEC PDP-1 IBM System/360 GE-645 Mainframe DEC PD-8 1970 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 1940 OS Complexity The OS Evolution Operating Systems
ENIAC 2020 11 2010 2000 1990 1980 Transistor EDSAC and EDVAC 1950 BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN 1960 Burroughs B 5000 IBM 7090 DEC PDP-1 IBM System/360 GE-645 Mainframe DEC PD-8 1970 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M 1940 OS Complexity The OS Evolution Operating Systems
ENIAC 2020 12 2010 2000 1990 Transistor EDSAC and EDVAC 1950 BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN 1960 Burroughs B 5000 IBM 7090 DEC PDP-1 IBM System/360 GE-645 Mainframe DEC PD-8 1970 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M Apple II, PET, Atari 1980 1940 OS Complexity The OS Evolution Operating Systems
2020 Transistor EDSAC and EDVAC BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN Burroughs B 5000 IBM 7090 DEC PDP-1 IBM System/360 GE-645 Mainframe DEC PD-8 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M Apple II, PET, Atari DEC VAX 11/780 ENIAC 13 2010 2000 1990 1980 1970 1960 1950 1940 OS Complexity The OS Evolution Operating Systems
2020 Transistor EDSAC and EDVAC BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN Burroughs B 5000 IBM 7090 DEC PD-1 IBM System/360 GE-645 Mainframe DEC PDP-8 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M Apple II, PET, Atari DEC VAX 11/780 Visicalc, Word. Star ENIAC 14 2010 2000 1990 1980 1970 1960 1950 1940 OS Complexity The OS Evolution Operating Systems
2020 Transistor EDSAC and EDVAC BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN Burroughs B 5000 IBM 7090 DEC PD-1 IBM System/360 GE-645 Mainframe DEC PDP-8 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M Apple II, PET, Atari DEC VAX 11/780 Visicalc, Word. Star IBM PC ENIAC 15 2010 2000 1990 1980 1970 1960 1950 1940 OS Complexity The OS Evolution Operating Systems
2020 Transistor EDSAC and EDVAC BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN Burroughs B 5000 IBM 7090 DEC PD-1 IBM System/360 GE-645 Mainframe DEC PDP-8 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M Apple II, PET, Atari DEC VAX 11/780 Visicalc, Word. Star IBM PC Apple Macintosh ENIAC 16 2010 2000 1990 1980 1970 1960 1950 1940 OS Complexity The OS Evolution Operating Systems
2020 Transistor EDSAC and EDVAC BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN Burroughs B 5000 IBM 7090 DEC PD-1 IBM System/360 GE-645 Mainframe DEC PDP-8 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M Apple II, PET, Atari DEC VAX 11/780 Visicalc, Word. Star IBM PC Apple Macintosh SUN NFS ENIAC 17 2010 2000 1990 1980 1970 1960 1950 1940 OS Complexity The OS Evolution Operating Systems
2020 Transistor EDSAC and EDVAC BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN Burroughs B 5000 IBM 7090 DEC PD-1 IBM System/360 GE-645 Mainframe DEC PDP-8 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M Apple II, PET, Atari DEC VAX 11/780 Visicalc, Word. Star IBM PC Apple Macintosh SUN NFS MACH vs Amoeba ENIAC 18 2010 2000 1990 1980 1970 1960 1950 1940 OS Complexity The OS Evolution Operating Systems
Transistor EDSAC and EDVAC BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN Burroughs B 5000 IBM 7090 DEC PD-1 IBM System/360 GE-645 Mainframe DEC PDP-8 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M Apple II, PET, Atari DEC VAX 11/780 Visicalc, Word. Star IBM PC Apple Macintosh SUN NFS MACH vs Amoeba ENIAC 2020 19 2010 2000 1990 Windows 3. 0 1980 1970 1960 1950 1940 OS Complexity The OS Evolution Operating Systems
Transistor EDSAC and EDVAC BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN Burroughs B 5000 IBM 7090 DEC PD-1 IBM System/360 GE-645 Mainframe DEC PDP-8 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M Apple II, PET, Atari DEC VAX 11/780 Visicalc, Word. Star IBM PC Apple Macintosh SUN NFS MACH vs Amoeba ENIAC 2020 20 2010 2000 1990 Windows 3. 0 GNU / Linux 1980 1970 1960 1950 1940 OS Complexity The OS Evolution Operating Systems
Transistor EDSAC and EDVAC BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN Burroughs B 5000 IBM 7090 DEC PD-1 IBM System/360 GE-645 Mainframe DEC PDP-8 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M Apple II, PET, Atari DEC VAX 11/780 Visicalc, Word. Star IBM PC Apple Macintosh SUN NFS MACH vs Amoeba ENIAC 2020 21 2010 2000 1990 Windows 3. 0 GNU / Linux Windows NT 1980 1970 1960 1950 1940 OS Complexity The OS Evolution Operating Systems
Transistor EDSAC and EDVAC BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN Burroughs B 5000 IBM 7090 DEC PD-1 IBM System/360 GE-645 Mainframe DEC PDP-8 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M Apple II, PET, Atari DEC VAX 11/780 Visicalc, Word. Star IBM PC Apple Macintosh SUN NFS MACH vs Amoeba ENIAC 2020 22 2010 2000 1990 Windows 3. 0 GNU / Linux Windows NT Mosaic, Netscape, IE 1980 1970 1960 1950 1940 OS Complexity The OS Evolution Operating Systems
Transistor EDSAC and EDVAC BINAC UNIVAC IBM 701 UNIVAC 1103 A FORTRAN Burroughs B 5000 IBM 7090 DEC PD-1 IBM System/360 GE-645 Mainframe DEC PDP-8 Intel 4004 CRAY-1 Ethernet, WYSIWYG, Mouse Altair 8800 BASIC, CP/M Apple II, PET, Atari DEC VAX 11/780 Visicalc, Word. Star IBM PC Apple Macintosh SUN NFS MACH vs Amoeba ENIAC 2020 23 ios Android OS 2010 Google Chrome Internet of Things 2000 Internet Appliance 1990 Windows 3. 0 GNU / Linux Windows NT Mosaic, Netscape, IE 1980 1970 1960 1950 1940 OS Complexity The OS Evolution Operating Systems
Evolution of Operating Systems 24 Operating Systems ■ Early Systems (1950) ■ Simple Batch Systems (1960) ■ Multiprogrammed Batch Systems (1970) ■ Time-Sharing and Real-Time Systems (1970) ■ Personal/Desktop Computers (1980) ■ Multiprocessor Systems (1980) ■ Networked/Distributed Systems (1980) ■ Web-based Systems (1990) ■ Virtualization … https: //www. cs. rutgers. edu/~pxk/416/notes/01 -intro. html 1 st generation 1945 – 1955 - vacuum tubes, plug boards 2 nd generation 1955 – 1965 - transistors, batch systems 3 rd generation 1965 – 1980 - ICs and multiprogramming 4 th generation 1980 – - personal computers 5 th generation - ? ? ? - ubiquitousness, mobile, present
25
Chapter 2 Reading Quiz 26 Computer Systems 1. What are the objectives of an OS? 2. What services does an OS provide? 3. What computer resources need management? 4. What hardware advancements facilitated OS development? 5. What is JCL? 6. What does SPOOLing stand for? 7. What is a Virtual Machine? Why Virtualize? 8. What differentiates Windows 7, UNIX, and Linux?
1. What are the Objectives of an OS? 27 Computer Systems ■ Convenience ■ ■ Make the computer more convenient to use Efficiency ■ Efficient use of computer system resources Accessibility ■ Uniformity ■ Ability to evolve ■ ■ Permit effective development, testing, and introduction of new system functions without interfering with service
2. What Services does an OS provide? 28 Computer Systems ■ Program development ■ ■ Program execution ■ ■ Authorization, sharing, caching System access ■ ■ Uniform interface, hides details Controlled access to files ■ ■ Initialization, scheduling Operating systems are among the most complex pieces of software ever developed. . . Access to I/O devices ■ ■ Editors, debuggers, frameworks Protection, authorization, resolve conflicts Error detection and response Hardware errors: memory error or device failure ■ Software errors: arithmetic errors, access forbidden memory locations errors ■ ■ Accounting ■ Collect statistics (billing), monitor performance (future enhancements)
3. What Resources need management? 29 Computer Systems ■ Memory Cache ■ Virtual ■ Secondary ■ Peripherals ■ Computer programs ■ User programs ■ Shared libraries ■ Concurrency / Synchronization ■ ■ CPU cores
4. What H/W Advancements? 30 Computer Systems ■ Memory protection (1960’s) ■ ■ Do not allow the memory area containing the monitor to be altered by a user program. Privileged instructions Can be executed only by the resident monitor. ■ A trap occurs if a program tries these instructions. ■ ■ Interrupts (1956) Provide flexibility for relinquishing control to and regaining control from user programs. ■ Timer interrupts prevent a job from monopolizing the system. ■
Characteristics of Early Systems 31 Computer Systems ■ ■ ■ Early software: Assemblers, Libraries of common subroutines (I/O, Floating-point), Device Drivers, Compilers, Linkers. Need significant amount of setup time. Extremely slow I/O devices. Very low CPU utilization. But computer was very secure.
Early Systems 32 Computer Systems ■ Structure Single user system. ■ Programmer/User as operator (Open Shop). ■ Large machines run from console. ■ Paper Tape or Punched cards. ■
Early Computer System 33 Computer Systems
Offline Operation 34 Computer Systems ■ Problem: Card Reader slow, Printer slow (compared to Tape). ■ I/O and CPU could not overlap. ■ ■ Solution: Offline Operation (Satellite Computers) ■ Speed up computation by loading jobs into memory from tapes while card reading and line printing is done off-line using smaller machines.
Simple Batch Systems 35 Computer Systems Use of high-level languages, magnetic tapes. ■ Jobs are batched together by type of languages. ■ An operator was hired to perform the repetitive tasks of loading jobs, starting the computer, and collecting the output (Operator-driven Shop). ■ It was not feasible for users to inspect memory or patch programs directly. ■
Simple Batch Systems 36 Computer Systems The user submits a job (written on cards or tape) to a computer operator. ■ The computer operator place a batch of several jobs on an input device. ■ A special program called the monitor, manages the execution of each program in the batch. ■ ■ ■ “Resident monitor” is always in main memory and available for execution. ■ Monitor utilities are loaded when needed. ■ Reduce setup time by batching similar jobs. ■ Alternate execution between user program and the monitor program. ■ Use Automatic Job Sequencing – automatically transfer control from one job when it finishes to another one. Rely on available hardware to effectively alternate execution from various parts of memory.
5. What is JCL? 37 Computer Systems ■ Job Control language is the language that provides instructions to the monitor: what compiler to use ■ what data to use ■ ■ Example of job format: ------->> $FTN load/run the compiler. ■ $LOAD load object code (in place of compiler). ■ $RUN transfers control to user program. ■ $JOB $FTN. . . FORTRAN program. . . $LOAD $RUN. . . Data. . . $END
Operator-driven Shop 38 Computer Systems
Uniprogramming 39 Computer Systems I/O operations are exceedingly slow (compared to instruction execution). ■ A program containing even a very small number of I/O operations, will spend most of its time waiting for them. ■ Hence: poor CPU usage when only one program is present in memory. ■
Batch Multiprogramming 40 Computer Systems ■ Several jobs are kept in main memory at the same time, and the CPU is multiplexed among them.
Concurrent Multiprogramming 41 Computer Systems ■ Allows the processor to execute another program while one program must wait for an I/O device.
Why Multiprogramming? 42 Computer Systems ■ ■ ■ Single user cannot keep CPU and I/O devices busy at all times. Multiprogramming organizes jobs (code and data) so CPU always has one to execute. A subset of total jobs in system is kept in memory. One job selected and run via job scheduling. When it has to wait, OS switches to another job.
Multiprogramming Requirements 43 Computer Systems ■ Hardware support: I/O interrupts and DMA controllers in order to execute instructions while I/O device is busy. ■ Timer interrupts for CPU to gain control. ■ ■ Memory management ■ several ready-to-run jobs must be kept in memory. Memory protection (data and programs). ■ Software support from the OS: ■ For scheduling (which program is to be run next). ■ To manage resource contention. ■
Multi (processor/core) 44 Computer Systems ■ n Traditionally, the computer has been viewed as a sequential machine. ■ Multiple control signals ■ Pipelining Parallelism n Symmetric Multiprocessors (SMP) n n Multicore Computers n n n 2 or more identical processors that share resources Integrated OS to control jobs, tasks, files, data elements… High degree of interaction/cooperation between processes Single piece of silicon (die) Independent processors + levels of cache Intel Core i 7 Prefetching Cluster computing n n Loosely coupled - network Client / server environment Middleware DME, RPC
6. What does Spool stand for? 45 Computer Systems ■ Problem: Card reader, Line printer and Tape drives slow ■ I/O and CPU could not overlap. ■ ■ Solution: Spooling Overlap I/O of one job with the computation of another job (using double buffering, DMA, etc). ■ Technique is called SPOOLing: Simultaneous Peripheral Operation On Line. ■
7. What is a Virtual Machine? 46 Computer Systems Virtualization technology enables a single PC or server to simultaneously run multiple operating systems on a single platform. ■ The host OS can support many virtual machines, each with characteristics of a particular OS. ■
8. Windows, Unix, Linux? 47 Computer Systems
Modern OS Architecture 48 Computer Systems
Desktop Market Share 49 Computer Systems
Desktop Market Share 50 Computer Systems
51