🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

CIT 113 OS Lsn 2 Final.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

ශ්‍රී ලංකා තාක්ෂණ විශ්වවිද්‍යාලය - පර්යේෂණ SLTC Research University Bachelor of Applied Information Technology – (BAIT) DK 1 DK 2 Module: CIT113 BAIT Operating Systems...

ශ්‍රී ලංකා තාක්ෂණ විශ්වවිද්‍යාලය - පර්යේෂණ SLTC Research University Bachelor of Applied Information Technology – (BAIT) DK 1 DK 2 Module: CIT113 BAIT Operating Systems DK 3 BAIT Operating Systems - Architecture "Good Architecture tells us WHY has something been done. Not HOW and not WHEN and not WHO …" Lesson 2 - DK Lesson 2 – Operating System - Architecture Content ▪ Basic Design Goals of an OS ▪ Two Layer Model ▪ Operating Systems Architecture? ▪ Monolithic Architecture ▪ Layered Architecture ▪ Microkernel Architecture ▪ Hybrid Architecture ▪ Single User Single Task Operating Systems ▪ PC DOS Scenario DK 5 Learning Outcomes Students should be able to: ▪ Explain the design goals of operating systems. ▪ Describe main types of operating system architectures. ▪ Compare different operating system architectures. ▪ Explain the structure and the organization of a single user single task operating system DK 6 Basic Design Goals of an OS 1. User Goal - Convenience ❖ Providing an easy- to-use environment hiding all complexities from the user 2. System Goals ❖ Efficiency - High Throughput, Low Turnaround time and Low response time Throughput - The number of jobs that can be executed in a unit time. Turnaround Time - The interval from the time of submission of a job to the time of completion. Response time - The amount of time taken to start responding E.g. Multiprogramming provides a better use of CPU and I/O resources. Multiprogramming – is the ability to run more than one program at a time. Thus, the utilization of fast devices and slow devices can be compromised. ❖ Improved Performance - Effective use of computer’s resources ❖ Scalability - The ability to cater for the advancement of the technology by allowing new hardware and methodologies. ❖ Availability - The ability to accept and successfully process an individual job or a large number of jobs concurrently. ❖ Serviceability - Includes on-line diagnosis and repair of malfunctions concurrent with normal job execution. ❖ Reliability - The ability to work with a minimum of failures. - The consistence with which a result can be produced. - Early discovery of troubles - Searching for faulty areas and isolating them - Diagnosing troubles - Monitoring overloads - Providing security ❖ Security - Includes on-line diagnosis and repair of malfunctions concurrent with normal job execution. ❖ Portability - Will the operating system be portable to widely varying types of hardware platforms? ❖ Backward Compatibility and Emulation - Is it important that software that ran under previous operating system versions or under different operating systems be supported? Two Layer Model Resident part of the operating system. Shell Memory management Kernel Task management Disk management Process management The interface that accepts, interprets and executes user commands or programs. User Interaction SHELL KERNEL User Provides Communicates Communicates Services by with the Shell with the kernel processing all system calls Kernel is protected from user access Operating Systems Architecture ▪ Today’s OSs are complex because they provide many services and support a variety of H/W ▪ OS architecture can help the designers to keep it simple as possible by organizing the OS components. ▪ One of the earliest architecture is Monolithic Architecture. E.g. OS/360, VMS, Linux, UNIX ▪ Every OS component is contained in the kernel and can communicate with each other directly. This feature makes the OS efficient. Monolithic Architecture APPLICATIONS USER SPACE SYSTEMS CALL INTERFACE KERNEL SPACE Memory KERNEL I/O Manager Manager File System Network Scheduler Manager Monolithic Architecture: ❖ The entire operating system kernel runs in a single address space. ❖ Components such as device drivers, file systems, and system utilities are all part of the kernel. Examples: UNIX (Old Versions), Linux before version 2.6. DK 15 Layered Architecture ▪ When the Operating Systems become complex monolithic designs become unmanageable. ▪ OS functions are grouped into layers and each layer is assigned some specific functions. ▪ Layered architectures promote modular designs. ▪ A module is highly cohesive and the coupling between two adjacent modules is loose. ▪ A modular design helps improving the structure and consistency of an Operating System. Debugging, updating, validation etc. becomes much easy. ▪ A layer in between can communicate with the layer above and below. ▪ Each module hides its functional complexity to others and provides a standard interface to communicate with other components. ▪ Performance degrades as intercommunication among components is not direct. USER APPLICATION LAYER LAYER 5 SPACE IO MANAGEMENT LAYER 4 HARDWARE KERNEL INTER PROCESS COMMUNICATION LAYER 3 SPACE MEMORY MANAGEMENT LAYER 2 PROCESSOR ALLOCATION & PROCESS SCHEDULING LAYER 1 Microkernel Architecture ▪ Kernel is small and provides a APPLICATIONS small number of services. ▪ Provides a high degree of modularity. SYSTEMS CALL INTERFACE USER SPACE ▪ Components such as Process management, File FILE PROCESS DEVICE SYSTEM SCHEDULER MANAGER system, Networking and IO are kept outside the kernel. KERNEL SPACE KERNEL INTERPROCESS COMMUNICATION ▪ E.g. Some versions of Linux, MEMORY SYNCHRONIZATION Windows XP MANAGEMENMT Hybrid Architecture ❖ A hybrid architecture is basically a combination of monolithic and microkernel designs. ❖ Some services are included in the kernel space for efficiency, while others are implemented ❖ as user-space processes. Examples: Linux (after version 2.6), Windows NT family (Windows 2000 and later). DK 19 Microkernel Architecture MONOLITHIC KERNEL MICRO KERNEL Lack of structure – SW Eng. Structured, Open, Modular – SW Techniques cannot be adapted Eng. Techniques can be adapted. Large kernel, difficult to debug. Small kernel, Easy debug Re-implementing means Daunting, poor performance rebuilding. during inter communication High performance Needs lot of memory to load Single Cycle User Operating Single System (COS) Task DK 21 Single User Single Task Operating Systems Only one user can use it IBM PC Specifications and perform only one Developer Type International Business Machines (IBM) Personal computer application at a time Generation First generation Release date August 12, 1981; 42 years ago Lifespan 1981–1987 Examples: Introductory price US$1,565 (equivalent to $5,240 in 2023) Discontinued April 2, 1987; 37 years ago MS-DOS – IBM PC Operating system IBM BASIC / PC DOS 1.0 CP/M-86 UCSD p-System Symbian OS – Mobile-phone CPU Intel 8088 @ 4.77 MHz Memory 16 KB – 256 KB (motherboard) (DRAM) Palm OS - PDA Removable storage 5.25" Floppy drives (160 KB or 320 KB), Cassette Display IBM 5151 Monochrome Display, IBM 5153 Color Display Graphics MDA, CGA Sound PC speaker 1-channel square-wave/1-bit digital (PWM-capable) Input XT-Keyboard Connectivity Serial port, parallel port Power 20/240 V AC ~ Dimensions Approximately 20.25" (width) x 16.5" (depth) x 5.5" (height) or 51.4 cm x 41.9 cm x 14 cm Mass 24-30 lbs (10.9-13.6kg) PC DOS Scenario ▪ DOS -Disk Operating System ▪ First widely-installed operating system for the IBM PC - 1981 ▪ 4000 – 40000 Assembler lines ▪ Single user – Single Task ▪ Provided a base for : ❖MS Windows ❖Windows 95,98 and Me ❖Windows NT, 2000 and XP ❖Windows XP emulates DOS to support existing DOS applications Structure ▪ Modular Design ▪ The modules are organized in a hierarchical way where each level is assigned specific tasks. Interprets DOS commands COMMAND.COM Performs a house keeping tasks DOS UTILITIES Provides core DOS services and is IBMDOS.COM the logical part of the OS’s I/O Provides a changeable extension to IBMBIO.COM ROM BIOS BOOT RECORD Track 0, Sector 0 of a disk which provides the boot program. ROM BIOS Provides most basic services needed Command Processor ❖ Consists of three parts: 1. Startup portion 2. Resident portion Resident part 3. Transient portion Transient part Startup portion Startup part ❖ Executes the autoexec.bat if it exists. Available Memory ❖ After execution it terminates and memory PC Memory space it consumed is released. Resident portion ▪ Always exists in the memory ▪ Handles the functions which need Resident part immediate response Available READ Memory PC Memory command.com Resident part Transient part ▪ Finishing execution of programs/user Available termination by ctrl-break Memory PC Memory Transient Portion ❖ Many applications overwrite this area. ❖ When it happens resident part of the command processor reloads it. ❖ If the resident portion cannot find the command processor it will display the message "Insert disk with command.com in drive A and strike any key when ready." CLS Resident part COPY Transient part VER Available Error Memory message FORMAT PC Memory DOS Kernel ▪ File Management ▪ Directory Management ▪ Application to the DOS Services BIOS ▪ Carries I/O operations at low level ▪ Resides in the ROM ▪ In config.sys ▪ device = mouse ▪ Files = 20 DOS Low level format H/W Device DOS Drivers IBMBIO.COM Packet Format CONFIG.SYS Bootstrapping ❖ Bootstrapping is the process of initializing the loading of the operating system from disk into RAM. ❖ A small routine available in ROM, called the Bootstrap Loader, reads a special load routine residing in the boot sector (Track 0, Sector 0) of the diskette into the RAM. ❖ This program loads the rest of the operating system into memory Free Memory OS gets loaded into the memory OS 3 5.25" Floppy Disk Drive OS Loader 4 2 Bootstrap 1 Loader Memory System Generation ❖ As DOS boots it reads device drivers and system parameters specified in the config.sys and uses the information to generate OS in the memory. ❖ Config.sys is located at the root directory ❖ Once config.sys is examined it closes the file and loads command processor from the disk. ❖ The startup portion of the command processor searches the root directory for autoexec.bat and executes the batch commands. ❖ Executes date and time commands DOS Interrupts contd.. ▪ Interrupt is a signal to the processor from a program or hardware device. ▪ Interrupts temporarily suspends the CPU’s current function so that it can handle another task. ▪ Each interrupt has a code resident in the memory to be used by the process called an Interrupt handler or an interrupt service routine. ▪ Each When an interrupt occurs the processor locates the associated interrupt handler and executes that section of the code. ❖ Each interrupt has an address in contd.. memory ❖ E.g. Int Address ❖ 1 007001ED ❖ 2 3D2809D2 ❖ Processor finds ISR s by using interrupt vectors (IVT) IV Meaning 20 Terminate.COM program 21 DOS services Services 1 KB Input 2 Display character 9 Display string Using Interrupts MOV AH,02 MOV DL,2A INT 21 INT 20 MOV DX,109 MOV AH,09 INT 21 INT 20 :0109 DB ‘Hello! Students’ Interrupts Device 0 IRQ 0 0 INT IRQ 1 1 Device 1 NMI 8259 CPU PIC Device 7 7 NMI => Non Maskable Interrupt (for critical signals) PIC => Programmable Interrupt Controller DK 34 Memory Management contd.. ❖ To run a computer smoothly its memory How much Which data can be programs and disk space must be stored from you can properly managed. one session to run? the next? How much data that a How fast ❖ To run programs they program can programs have be loaded into the work with at run? memory a time? ▪ More memory means more data you can store. ▪ In most PCs the physical memory can be increased. RAM Organization of a PC Under DOS A program should be Can only be used specifically EXPANDED MEMORY by installing a designed to use memory manager extended / EXTENDED MEMORY i) HIMEM.SYS expanded UMA (384 KB) ii) EMM386.EXE memory 64 KB Page – 16 KB Programs CONVENTIONAL require less MEMORY (640 KB) memory run here BODY MIND BUILDING EXERCISES for the Success Study the lesson concisely many times before you try the following questions. (Do not waste bullets) DK 37 QUIZ Q1. Which command is used to list the contents of a directory in Linux? A. ls B. cp C. mv D. rm Q2. Which of the following is NOT a Linux distribution? A. Ubuntu B. CentOS C. Red Hat D. UNIX DK 38 QUIZ Q3. Which of the following statements about interrupts is true? A. Interrupts improve the performance of the CPU B. An interrupt is caused by a hardware device C. The CPU ignores interrupts during its normal operation D. Interrupts are handled only by the operating system Q4. Which security feature in Windows 11 provides hardware-based isolation for sensitive data and credentials? A. Windows Hello B. Device Encryption C. Virtualization-based Security (VBS) D. Windows Defender DK 39 QUIZ Q5. What is the primary function of the Kernel in an operating system? A. User interface B. Memory management C. File management D. Application execution Q6. What is the minimum system requirement for installing Windows 11? A. TPM 2.0 and Secure Boot B. 4 GB RAM and 64 GB storage C. DirectX 12 compatible graphics D. All of the above DK 40 QUIZ Q7. What is the role of an interrupt vector? A. It indicates the location in memory where the interrupt handler routine is located B. It stores the priority of each interrupt C. It converts physical addresses to virtual addresses D. It manages the CPU scheduling Q8. Which statement about interrupt handling is correct? A. Interrupt handling increases the response time of the CPU B. Interrupts cannot be disabled once the system is running C. Interrupts are managed by the BIOS D. Interrupt service routines (ISRs) are executed asynchronously with respect to the currently executing code DK 41 QUIZ Q9. In a computer system, which hardware component is responsible for initiating an interrupt? A. ALU B. CPU C. I/O devices D. RAM Q10. Which command is used to display the contents of a file in MS-DOS? A. type B. cat C. read D. display DK 42 End of Lesson 2 DK 43

Use Quizgecko on...
Browser
Browser