INTRODUCTION SYSTEMS TO OPERATING Basic Knowledge Name- Ankit Rawat Course- BCA Section- B Class Roll no.-8 Student Id.- 21041257 What is an Operating System? An Operating system is basically a intermediary agent between the user and the computer hardware. Manages the computer’s resources (hardware, abstract resources, software) It’s a resource allocator. It is also used to control programs to prevent errors and improper computer use. It is interrupt driven. Operating System Benefits Simplifies hardware control for applications Enforcer of sharing, fairness and security with the goal of better overall performance Trade-off between fairness and performance Trade-off between optimal algorithms and lean algorithms – OS is overhead. Provides abstract resources Sockets Inter-process communication History of Operating Systems Earliest computers had no Operating System Batch Processing A typical computer in the 1960s and 70s was a large machine. Its processing was managed by a human operator. The operator would organize various jobs from multiple users into batches. Timesharing A timesharing system allows multiple users to interact with a computer at the same time Multiprogramming allowed multiple processes to be active at once, which gave rise to the ability for programmers to interact with the computer system directly, while still sharing its resources In a timesharing system, each user has his or her own virtual machine, in which all system resources are (in effect) available for use System Concepts: Processes Processes are a very important concept in Operating Systems and lie at the heart of most of its tasks. A process, which is a program in execution, goes through the cycle of starting, performing its task and then exiting. When are processes created? 1. On system startup. Daemons, or background processes, are automatically started by the Operating System when the system is initialized and they work in the background either listening for events to occur or maintaining some part of the system. 2. On system calls. A process that is already running may wish to give birth to additional processes to help it in a particular task. The latter processes are known as child processes and the former is the parent. It is common to have such a hierarchy of processes. 3. On user requests. Double clicking on a program icon or executing it via the command line automatically creates a process for that program. It is more than likely that it will then generate child processes When are processes terminated? 1. When they're done. After it completes its tasks, a process voluntarily exits. 2. When an error occurs. If an error occurs that the process cannot ignore or avoid, it voluntarily exits. 3. When a fatal error occurs. A program directly referencing memory (in a language such as C, which allows this) may be referring to data that is nonexistent. In such a case, the system has no option but to kill the process to prevent it from corrupting other processes' data. Operating System Concepts: Memory Management Memory management is an extremely important part of an Operating System's responsibilities. Memory is a limited resource, and as such, it has to be carefully managed. The OS must: 1. Keep track of memory that's in use and memory that isn't. 2. Allocate and deallocate memory to processes that require it. 3. Swap data between main memory and disk when main memory fills up. There are three types of memory in every system: 1. Volatile: Fast, expensive and small cache memory, made up of the same material as the CPU. 2. Volatile: Medium-speed and medium-size Random Access Memory Operating systems must accomplish the following tasks: Processor management. The operating system needs to allocate enough of the processor's time to each process and application so that they can run as efficiently as possible. This is particularly important for multitasking. When the user has multiple applications and processes running, it is up to the operating system to ensure that they have enough resources to run properly. Memory storage and management. The operating system needs to ensure that each process has enough memory to execute the process, while also ensuring that one process does not use the memory allocated to another process. Device management. Most computers have additional hardware, such as printers and scanners, connected to them. These devices require drivers, or special programs that translate the electrical signals sent from the operating system or application program to the hardware device. The operating system manages the input to and output from the computer. It often assigns high-priority blocks to drivers so that the hardware can be released and available for the next use as soon as possible. Application interface. Programmers use application program interfaces (APIs) to control the computer and operating system. As software developers write applications, they can insert these API functions in their programs. As the operating system encounters these API functions, it takes the desired action, so the programmer does not need to know the details of controlling the hardware. User interface. The user interface sits as a layer above the operating system. It is the part of the application through which the user interacts with the application. Some operating systems, such as Microsoft Windows and Apple Macintosh, use graphical user interfaces. Other operating systems, such as Unix, use shells. The most popular operating system today is Microsoft's Windows operating system. Macintosh computers have their own operating system, the most recent of which is called Mac OS X. There are also open source operating systems such as Linux.