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

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

Document Details

KidFriendlyAllegory2168

Uploaded by KidFriendlyAllegory2168

Tags

operating systems computer software ict

Full Transcript

Operating systems – PART 01 OPERATING SYSTEMS Computer software Software refers to a set of instructions, data, or programs that enable computers to perform specific tasks or functions. It enc...

Operating systems – PART 01 OPERATING SYSTEMS Computer software Software refers to a set of instructions, data, or programs that enable computers to perform specific tasks or functions. It encompasses a wide range of digital programs, applications, and systems that run on various computing devices, from personal computers and smartphones to servers and embedded systems. ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 1 Operating systems – PART 01 Types of software Software Operating system An OS, or Operating System, is a fundamental software component that serves as an intermediary between computer hardware and user applications. It manages various hardware resources, provides essential services, and facilitates interaction between the user and the computer system. Few services of an OS 1. …………………………………………………………………………….. 2. …………………………………………………………………………….. 3. …………………………………………………………………………….. 4. …………………………………………………………………………….. 5. …………………………………………………………………………….. ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 2 Operating systems – PART 01 Different examples for OSes are, …………………………………………… …………………………………………… …………………………………………… …………………………………………… …………………………………………… Main parts of an OS Kernel The kernel is the core component of the operating system responsible for managing hardware resources and providing essential services to enable software applications to run on the computer system. In the other words, kernel is the collection of the most essential parts of an OS. It contains, Process management Memory management File system management System calls, mainly. ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 3 Operating systems – PART 01 The kernel should be loaded into the main memory. If the kernel is small in size, the time and other resources to load the kernel to the main memory will be reduced. This is known as the microkernel architecture. Shell The shell is a command-line interface (CLI) or a user interface (UI) that allows users to interact with the operating system and execute commands or programs. It acts as a user-level interpreter or interface for accessing the kernel's functionalities and system resources. It contains, Job controlling Command interpretation User interface management Scripting, mainly. Evolution of operating systems. The evolution of operating systems (OSes) spans several decades, marked by significant advancements in technology, architecture, and user interaction. Below is a brief overview of the key stages in the evolution of operating systems: 1. ………………………………………………………………………………………………………. 2. ………………………………………………………………………………………………………. 3. ………………………………………………………………………………………………………. 4. ………………………………………………………………………………………………………. Linear processing (No OS) The first generation of operating system is NO OS. This means the user had to communicate directly with hardware components as there was no intermediate bridge between the user and the hardware components. Therefore, people who used computers had to use the machine language which was consisting of 1 and 0. Characteristics were, People had to use machine language There was no translator Execution process was very fast Single task at a time Tasks were inserted one after another in a linear manner. ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 4 Operating systems – PART 01 Simple batch processing Simple batch operating systems worked by allowing users to submit batches of jobs, typically in the form of punched cards or magnetic tapes, to a computer operator. The operator would then organize these jobs into a queue, and the computer would process them one after another without direct user intervention. A batch is a collection of jobs or tasks that are grouped together for processing by the computer system. These jobs are typically submitted together by users or applications and are executed sequentially without direct user intervention. Each batch may consist of one or more programs or processes along with their associated data. Job Submission: o Users would prepare their programs and data on punched cards or magnetic tapes. Each job consisted of a set of instructions (program) and the data it needed to process. Job Queue: o The operator would collect these batches of jobs and organize them into a queue based on priorities, resource availability, or other criteria. Loading and Execution: o The operating system would take each job from the queue, load it into the computer's memory (typically using a card reader or tape drive), and execute it. Resource Management: o The operating system managed resources such as CPU time, memory, and I/O devices among the concurrently executing jobs. o It ensured that each job received its fair share of resources and that one job's actions didn't disrupt others. However, still there was only one program running at a time, therefore there was no multiprogramming. The other drawback was, in the switching time between 2 batches, CPU was in its idle i.e. CPU was running but with no task. ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 5 Operating systems – PART 01 Multiprogramming batch processing Here, the basic concept was making the CPU busy (increasing CPU utilization) when switching 2 batches by allowing multiple programs to be loaded into memory simultaneously and executed concurrently. Job Submission: o Users submit batches of jobs to the operating system. Each job consists of one or more programs along with the necessary data and instructions. Job Scheduling: o The operating system organizes the submitted jobs into a queue based on criteria such as priority, resource requirements, and scheduling policies. Memory Management: o The operating system allocates memory space to each job. This could involve partitioning the available memory into fixed-size or variable-size partitions to accommodate different jobs. Loading and Execution: o The operating system loads multiple programs into memory concurrently. o It then switches the CPU's attention between these programs, allowing them to execute in a time-shared manner. o This switching is achieved through techniques like context switching, where the state of one program is saved, and the state of another program is loaded into the CPU. Process Scheduling: o The operating system employs process scheduling algorithms to determine which program should execute next. o This could be based on priorities, time slices, or other factors. The goal is to optimize CPU utilization, throughput, and response time. ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 6 Operating systems – PART 01 Time sharing system Time-sharing systems, also known as multitasking operating systems, allow multiple users to interact with a computer system simultaneously. Unlike batch processing systems where jobs are processed one after another, time-sharing systems enable users to share the CPU's time and switch between tasks rapidly, giving the illusion (not actual concurrent running, just an illusion) of simultaneous execution. Each job gets equal time quantum of CPU time. After time quantum expires, CPU is allocated to the next job in the queue. Multiprogramming: o Time-sharing systems employ multiprogramming, which means that multiple programs are loaded into memory concurrently. o Each program is allocated a small time slice or quantum of CPU time during which it can execute. Interactive User Interface: o Time-sharing systems provide an interactive user interface that allows users to interact with the computer system in real-time. o This interface can take the form of a command-line interface (CLI) or a graphical user interface (GUI), depending on the system's design. OS classification We can classify operating systems by using their characteristics such as the number of users can be handled at a time and the number of tasks can be handled at a time, by the operating system. ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 7 Operating systems – PART 01 1. ………………………………………………………………… E.g.: MS-DOS 2. ………………………………………………………………… E.g.: Windows 10, Android 3. ………………………………………………………………… E.g.: Windows server 4. ………………………………………………………………… E.g.: ATM machine OS, calculator OS File management What is a file? …………………………………………………………………………………………………………………………………………………………………………… …………………………………………………………………………………………………………………………………………………………………………… …………………………………………………………………………………………………………………………………………………………………… There are different types of files in a computer. E.g.: image file, audio file, video file, PDF file, etc. To determine the type of a file, the OS uses an extension for each file. The extension is trailed by the file name. E.g.: myimage.jpeg File name extension Several extensions for file types are, File type Extensions Image file.jpg,.png,.svg,.jpeg, etc Audio file.mp3,.wav,.aac,.flac, etc Video file.mp4,.avi,.flv,.mpeg, etc Word processing file.doc,.docx,.rtf,.odt, etc ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 8 Operating systems – PART 01 Why an OS uses extensions? For 2 main purposes. They are, 1. Identification File extensions provide a quick way for the operating system to identify the type of file and determine how to handle it. For example, ".docx" indicates a Microsoft Word document, while ".jpg" indicates a JPEG image file. 2. Default application File extensions allow the operating system to associate files with default applications for opening and editing. When a user double-clicks on a file with a specific extension, the operating system launches the associated application automatically. Attributes of a file ………………………………………………………………… ………………………………………………………………… ………………………………………………………………… …………………………………………………….………….. ………………………………………………………………… ……………………………………………………………….. ………………………………………………………………… Directory A directory, in computing, is a container or a hierarchical structure used to organize files into a logical order. It's also commonly referred to as a folder. Directories serve several purposes in computing, ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 9 Operating systems – PART 01 Directories (folders) with several files Hierarchy: o Directories can be organized hierarchically, with subdirectories (folders) contained within parent directories. o This hierarchical structure allows for a more systematic organization of files and helps to maintain order, especially in systems with a large number of files. Navigation: o Users can navigate through directories to locate specific files or folders using file managers or command-line interfaces. o This navigation typically involves moving up and down the directory hierarchy, opening folders to view their contents, and accessing files stored within them. File systems A file system is a method used by an operating system to store, organize, and manage files and directories (folders) on storage devices such as hard drives, solid-state drives (SSDs), USB drives, and network storage. It provides a structured approach to manage data and defines how data is stored, accessed, and manipulated. Key concepts in a file system are, 1. Organization of data 2. File naming and metadata 3. File accessing 4. File allocation 5. Error handling and recovery ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 10 Operating systems – PART 01 FAT, NTFS file systems FAT and NTFS are two different file systems used by Microsoft operating systems, such as MS-DOS, Windows 95, 98, and Windows NT. FAT stands for File Allocation Table, and NTFS stands for New Technology File System. Characteristic FAT NTFS Complexity Maximum file size Maximum partition size Efficiency Reliability Supported by different types Compatibility Only supported by Windows of operating systems. Disk formatting A hard disk is consisting of sectors (the fixed size smallest unit in an HDD). Each sector can hold data from 512B to 16KB according to the HDD manufacturing. But the thing is an OS cannot handle the HDD with these sectors. Therefore, when an OS is installed in the computer, it prepares the HDD to use it in an efficient way. This preparing process is called disk formatting. Here, a logical unit called block is created by the OS by grouping several sectors. ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 11 Operating systems – PART 01 Memory allocation When a file is saved in the HDD, the memory required for it should be allocated by the OS. There are 3 main memory allocation techniques used by an OS. 1. Contiguous memory allocation 2. Linked memory allocation 3. Indexed memory allocation Contiguous memory allocation Contiguous memory allocation is a technique used by file systems and operating systems to allocate disk space for a file as a single, contiguous block of storage. In other words, all the sectors or clusters required to store a file are located together in a sequential manner on the disk. Advantages ………………………………………………………………………. ………………………………………………………………………. ………………………………………………………………………. Disadvantages ………………………………………………………………………. ………………………………………………………………………. This method can be used easily in ROM (Read Only memory) type storage media because once data is written, no need to extend or edit those data. ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 12 Operating systems – PART 01 Linked memory allocation Linked memory allocation is a method used in operating systems and file systems to allocate disk space for files in a non-contiguous manner. It involves creating a data structure called a linked list to keep track of the different blocks of disk space allocated to a file. Each block of disk space is linked to the next block in the list, forming a chain of blocks that together make up the file. Each block contains a link (pointer) to the next block file is saved. In the last block, the pointer is -1 meaning, the end of the file. When extending the file size, the only thing should be done is updating the last block in the sequence. Here, the directory entry is the starting block’s address. ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 13 Operating systems – PART 01 Indexed memory allocation Indexed allocation is a method used in operating systems and file systems to allocate disk space for files in a non-contiguous manner. It involves creating an index, also known as an "allocation table" or "allocation map," to keep track of the different blocks of disk space allocated to a file. In an indexed allocation scheme, each file is assigned a unique index block, which serves as a pointer to the blocks of disk space allocated to the file. The index block contains a list of pointers to the blocks of disk space allocated to the file, along with metadata such as the file's size and attributes. Fragmentation Disk fragmentation is a phenomenon that occurs when files are stored in non-contiguous blocks (also known as fragments) on a storage device, such as a hard disk drive (HDD) or a solid-state drive (SSD). Fragmentation can occur naturally over time as files are created, modified, and deleted on the disk, and it can have several negative effects on disk performance and efficiency. Defragmentation …………………………………………………………………………………………………………………………………………………………………………… …………………………………………………………………………………………………………………………………………………………………………… ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 14 Operating systems – PART 01 Process management What is a program and what is a process? A program is a ……………………………………………………………………………………………………………………………………………………………………….…… ……………………………………………………………………………………………………………………………………………………………………………. A process is a ……………………………………………………………………………………………………………………………………………………………………….…… ……………………………………………………………………………………………………………………………………………………………………………. Until a user opens a program, it is in the secondary storage medium as a passive entity. When the user opens the program, it becomes a set of processes and those processes are loaded into the main memory in order to be executed by the CPU. When a program becomes a set of processes and then loaded into the memory, it becomes an active entity. Process states A process can become various states. When a process is created – new When a new process is queued – ready When a ready process is executed – running When a running process needs a hardware – blocked When a blocked process has low priority – swapped out and blocked When a ready process has low priority – swapped out and ready ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 15 Operating systems – PART 01 We can illustrate these process states and their transitions in a diagram as following. Levels User level – the actions can be taken by a user to affect a process. They are, 1. Creating a process by opening a software 2. Terminating a process by closing a running software Kernel level – the actions taken by the OS kernel to affect a process. They are, 1. Queueing in the ready queue (New to Ready) - ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… 2. Switching the currently running process (Running to Ready) - ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 16 Operating systems – PART 01 3. Dispatching (Ready to Running) - ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… 4. Device involvement (Running to Waiting)- ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… General queues maintained by the OS 1. Job queue 2. Ready queue 3. Device queue Questions 1. When a running process is transferred into blocked state? ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… 2. Why a blocked process is transferred into ready state? ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 17 Operating systems – PART 01 3. Like which occasions a running process is transferred into ready state? ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………… Virtual memory All the queues maintained by the OS exist on the main memory. As we know, the main memory is a limited resource which should be used very effectively. When a higher priority processes than existing processes arrive to queues, low priority processes are transferred into a reserved memory area in the secondary storage. This specific area is called the Virtual memory and transferring between the Virtual memory and the main memory is known as swapping. Schedulers …………………………………………………………………………………………………………………………………………………………………………… …………………………………………………………………………………………………………………………………………………………………………… …………………………………………………………………………………………………………………………………………………………………………… Types of schedulers 1. Long-term schedulers 2. Mid-term schedulers 3. Short-term schedulers Long-term schedulers Mid-term schedulers Short-term schedulers ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 18 Operating systems – PART 01 Context switching As the name suggests, context switching means switching (or changing) the context (the including) in the CPU. In other words, deallocating the CPU (the running state) from the currently CPU allocated process and, allocating the CPU to another process is known as context switching. Context switching happens due to various reasons such as, o The allocated time slot for the current process is over (timeout/ an interruption is issued) o Arrival of a process with a higher priority than currently running process (an interruption is issued) o Arrival of a process with a shorter processing time (burst time) than the currently running process (an interruption is issued) o Etc. A context switching process between 2 processes (process P1 and P2) can be illustrated as following. ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 19 Operating systems – PART 01 Process control block (PCB) …………………………………………………………………………………………………………………………………………………………………………… …………………………………………………………………………………………………………………………………………………………………………… …………………………………………………………………………………………………………………………………………………………………………… In the main memory, its every memory location is indexed by a memory address typically in hexa-decimal form. A process may be allocated several memory locations (may be contiguous or linked) according to the process size, and we know process is consisting of instructions and data. Suppose there are 3 processes in the main memory at a particular time, each process’s PCB shows process ID, program name, process state and the program counter. ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 20 Operating systems – PART 01 Program counter Each process maintains a PCB of its own. Program counter (or PC) indicates the address of the instruction to be executed next. Execution process of a process 1. Fetching the instruction indicated by the program counter After the PC indicating instruction is fetched, the PC increments by 1. 2. Decoding the fetched instruction The CU checks what the instruction says to follow 3. Executing the decoded instruction Execution is done by the ALU 4. Saving the result in registers and then in main memory ADVANCED LEVEL ICT - BHANUKA WICKRAMASINGHE 21

Use Quizgecko on...
Browser
Browser