Misplaced Pages

Operating system: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editContent deleted Content addedVisualWikitext
Revision as of 18:22, 16 January 2007 view source12.110.196.254 (talk)No edit summary← Previous edit Latest revision as of 14:48, 31 December 2024 view source KMaster888 (talk | contribs)Extended confirmed users8,906 edits ce 
Line 1: Line 1:
{{Short description|Software that manages computer hardware resources}}
An '''operating system''' ('''OS''') is a ] that manages the ] and ] ] of a ]. At the foundation of all system software, the OS performs basic tasks such as controlling and allocating ], prioritizing system requests, controlling input and output devices, facilitating ], and managing ]s. It also may provide a ] or what we call a ]or ] for higher level functions.
{{pp-vandalism|small=yes}}
{{pp-move}}
{{Use dmy dates|date=July 2015}}
{{OS}}
An '''operating system''' ('''OS''') is ] that manages ] and ] resources, and provides common ] for ]s.


] operating systems ] for efficient use of the system and may also include accounting software for cost allocation of ], ], peripherals, and other resources.
==Services==
===Process management===
Every program running on a computer, be it background services or applications, is a ].


For hardware functions such as ] and ], the operating system acts as an intermediary between programs and the computer hardware,<ref>{{cite book | last = Stallings | title = Operating Systems, Internals and Design Principles | publisher = Prentice Hall | year = 2005 | location = Pearson |page=6}}</ref><ref>{{cite book | last = Dhotre| first = I.A.| title = Operating Systems. | publisher = Technical Publications | year = 2009 |page=1}}</ref> although the application code is usually executed directly by the hardware and frequently makes ]s to an OS function or is ]ed by it. Operating systems are found on many devices that contain a computer{{snd}}from cellular phones and video game consoles to ]s and ]s.
As long as a ] is used to build computers, only one process per ] can be run at a time. Older microcomputer OS such as MS-DOS did not attempt to bypass this limit, with the exception of interrupt processing, and only one process could be run under them (although DOS itself featured ] as a very partial and not too easy to use solution). Mainframe operating systems have had ] capabilities since the early 1960's. Modern operating systems enable concurrent execution of many processes at once via multitasking even with one CPU. Process management is an operating system's way of dealing with running multiple processes. Since most computers contain one processor with one core, multitasking is done by simply switching processes quickly. Depending on the operating system, as more processes run, either each time slice will become smaller or there will be a longer delay before each process is given a chance to run. Process management involves computing and distributing CPU time as well as other resources. Most operating sytems allow a process to be assigned a priority which affects its allocation of CPU time. Interactive operating systems also employ some level of feedback in which the task with which the user is working receives higher priority. Interrupt driven processes will normally run at a very high priority. In many systems there is a background process, such as the ''System Idle Process'' in Windows, which will run when no other process is waiting for the CPU.


{{as of|2024|09|}}, ] is the most popular operating system with a 46% market share, followed by ] at 26%, ] and ] at 18%, ] at 5%, and ] at 1%. Android, iOS, and iPadOS are mobile operating systems, while Windows, macOS, and Linux are desktop operating systems.<ref>{{Cite web |title=Operating System Market Share Worldwide |url=https://gs.statcounter.com/os-market-share |access-date=2024-12-20 |website=StatCounter Global Stats |language=en}}</ref> ]s are dominant in the server and supercomputing sectors. Other specialized classes of operating systems (special-purpose operating systems),<ref name="auto">{{Cite web|url=https://www.oreilly.com/library/view/operating-system-concepts/9780471694663/pt07.html|title=VII. Special-Purpose Systems - Operating System Concepts, Seventh Edition |website=www.oreilly.com|access-date=8 February 2021|archive-date=13 June 2021|archive-url=https://web.archive.org/web/20210613190049/https://www.oreilly.com/library/view/operating-system-concepts/9780471694663/pt07.html|url-status=live}}</ref><ref>{{Cite web|url=https://www.acs.eonerc.rwth-aachen.de/cms/E-ON-ERC-ACS/Studium/Lehrveranstaltungen/~lrhs/Spezial-Betriebssysteme/?lidx=1|title=Special-Purpose Operating Systems - RWTH AACHEN UNIVERSITY Institute for Automation of Complex Power Systems - English|website=www.acs.eonerc.rwth-aachen.de|access-date=8 February 2021|archive-date=14 June 2021|archive-url=https://web.archive.org/web/20210614034001/https://www.acs.eonerc.rwth-aachen.de/cms/E-ON-ERC-ACS/Studium/Lehrveranstaltungen/~lrhs/Spezial-Betriebssysteme/?lidx=1|url-status=live}}</ref> such as ] and real-time systems, exist for many applications. ]s also exist. Some operating systems have low system requirements (e.g. ]). Others may have higher system requirements.
===Memory management===
According to ], "Data expands to fill the space available for storage". Programmers prefer a memory of '''infinite size''' and '''infinite speed'''. Current computer architectures arrange the computer's memory in a hierarchical manner, starting from the fastest ], ], ] and ]. The '''memory manager''' in an OS coordinates the memories by tracking which one is available, which is to be allocated or deallocated and how to swap between the main memory and secondary memories. This activity, which is usually referred to as ''virtual memory management'', increases the amount of memory available for each process by making the disk storage seem like main memory. There is a speed penalty associated with swapping RAM to disk or other slower storage, however. If running processes require significantly more RAM than is available the system may start ]. This can happen either because one process requires a large amount of RAM or because two or more processes compete for a larger amount of memory than is available. This then leads to constant swapping of each process to slower storage.


Some operating systems require installation or may come pre-installed with purchased computers (]-installation), whereas others may run directly from media (i.e. ]) or flash memory (i.e. ] stick).
Another important part of memory management is managing virtual addresses. If multiple processes are in memory at once, they must be prevented from interfering with each other's memory (unless there is an explicit request to share a limited amount of memory, in controlled ways). This is achieved by having separate address spaces. Each process sees the whole virtual address space, typically from address 0 up to the maximum size of virtual memory, as uniquely assigned to it. The operating system maintains tables, so-called page tables, that match virtual addresses to physical addresses.


==Definition and purpose==
The operating system can also write inactive memory pages to secondary storage. This process is called "paging".
An operating system is difficult to define,{{sfn|Tanenbaum|Bos|2023|p=4}} but has been called "the ] that manages a computer's resources for its users and their ]s".{{sfn|Anderson|Dahlin|2014|p=6}} Operating systems include the software that is always running, called a ]—but can include other software as well.{{sfn|Tanenbaum|Bos|2023|p=4}}{{sfn|Silberschatz et al.|2018|p=6}} The two other types of programs that can run on a computer are ]s—which are associated with the operating system, but may not be part of the kernel—and applications—all other software.{{sfn|Silberschatz et al.|2018|p=6}}


There are three main purposes that an operating system fulfills:{{sfn|Anderson|Dahlin|2014|p=7}}
The operating system tracks all memory used by each process so that when a process terminates, all memory used by that process can be made available for other processes.
*Operating systems allocate resources between different applications, deciding when they will receive ] (CPU) time or space in ].{{sfn|Anderson|Dahlin|2014|p=7}} On modern personal computers, users often want to run several applications at once. In order to ensure that one program cannot monopolize the computer's limited hardware resources, the operating system gives each application a share of the resource, either in time (CPU) or space (memory).{{sfn|Anderson|Dahlin|2014|pp=9–10}}{{sfn|Tanenbaum|Bos|2023|pp=6-7}} The operating system also must isolate applications from each other to protect them from errors and security vulnerabilities in another application's code, but enable communications between different applications.{{sfn|Anderson|Dahlin|2014|p=10}}
*Operating systems provide an interface that abstracts the details of accessing ] details (such as physical memory) to make things easier for programmers.{{sfn|Anderson|Dahlin|2014|p=7}}{{sfn|Tanenbaum|Bos|2023|p=5}} ] also enables the operating system to mask limited hardware resources; for example, ] can provide a program with the illusion of nearly unlimited memory that exceeds the computer's actual memory.{{sfn|Anderson|Dahlin|2014|p=11}}
*Operating systems provide common services, such as an interface for accessing network and disk devices. This enables an application to be run on different hardware without needing to be rewritten.{{sfn|Anderson|Dahlin|2014|pp=7, 9, 13}} Which services to include in an operating system varies greatly, and this functionality makes up the great majority of code for most operating systems.{{sfn|Anderson|Dahlin|2014|pp=12–13}}


===Disk and file systems=== ==Types of operating systems==
===Multicomputer operating systems===
Operating systems have a variety of native file systems. Linux has a greater range of native file systems, those being: ], ], ], ], ], ], ], ], ] and ]. Linux also has full support for ] and ], along with the ] file systems, and ]. Windows, on the other hand, has limited file system support which only includes: FAT12, FAT16, FAT32, and NTFS. The NTFS file system is the most efficient and reliable of the four Windows systems. All the FAT systems are older than NTFS and have limitations on the partition and file size that can cause a variety of problems.
With ]s multiple CPUs share memory. A ] or ] has multiple CPUs, each of which ]. Multicomputers were developed because large multiprocessors are difficult to engineer and prohibitively expensive;{{sfn|Tanenbaum|Bos|2023|p=557}} they are universal in ] because of the size of the machine needed.{{sfn|Tanenbaum|Bos|2023|p=558}} The different CPUs often need to send and receive messages to each other;{{sfn|Tanenbaum|Bos|2023|p=565}} to ensure good performance, the operating systems for these machines need to minimize this copying of ]s.{{sfn|Tanenbaum|Bos|2023|p=562}} Newer systems are often ]—separating groups of users into separate ]s—to reduce the need for packet copying and support more concurrent users.{{sfn|Tanenbaum|Bos|2023|p=563}} Another technique is ], which enables each CPU to access memory belonging to other CPUs.{{sfn|Tanenbaum|Bos|2023|p=565}} Multicomputer operating systems often support ]s where a CPU can call a ] on another CPU,{{sfn|Tanenbaum|Bos|2023|p=569}} or ], in which the operating system uses ] to generate shared memory that does not physically exist.{{sfn|Tanenbaum|Bos|2023|p=571}}


===Distributed systems===
For most of the above file systems, there are two ways it can be allocated. Each system can be ] or non-journaled, journaled being the safer alternative under the circumstances of a system crash. If a system comes to an abrupt stop in a system crash scenario, the non-journaled system will need to undergo an examination from the system check utilities, whereas the journaled file systems recovery is automatic. Microsoft's NTFS is journaled along with most Linux file systems including ext3, reiserfs and JFS (except ext2).
A ] is a group of distinct, ] computers—each of which might have their own operating system and file system. Unlike multicomputers, they may be dispersed anywhere in the world.{{sfn|Tanenbaum|Bos|2023|p=579}} ], an additional software layer between the operating system and applications, is often used to improve consistency. Although it functions similarly to an operating system, it is not a true operating system.{{sfn|Tanenbaum|Bos|2023|p=581}}


===Embedded===
Most modern file systems are made up of similar directories and subdirectories. Along with the operating systems file system similarities, there are subtle differences. Microsoft separates its directories with a backslash and its file names are case insensitive whereas Unix/Linux-derived operating systems use the forward slash and their file names generally are case sensitive.
]s are designed to be used in ], whether they are ] objects or not connected to a network. Embedded systems include many household appliances. The distinguishing factor is that they do not load user-installed software. Consequently, they do not need protection between different applications, enabling simpler designs. Very small operating systems might run in less than 10 ],{{sfn|Tanenbaum|Bos|2023|pp=37-38}} and the smallest are for ].{{sfn|Tanenbaum|Bos|2023|p=39}} Examples include ], ], ], and the extra-small systems ] and ].{{sfn|Tanenbaum|Bos|2023|p=38}}


===Networking=== ===Real-time===
A ] is an operating system that guarantees to process ] or data by or at a specific moment in time. Hard real-time systems require exact timing and are common in ], ], military, and other similar uses.{{sfn|Tanenbaum|Bos|2023|p=38}} With soft real-time systems, the occasional missed event is acceptable; this category often includes audio or multimedia systems, as well as smartphones.{{sfn|Tanenbaum|Bos|2023|p=38}} In order for hard real-time systems be sufficiently exact in their timing, often they are just a library with no protection between applications, such as ].{{sfn|Tanenbaum|Bos|2023|p=38}}
Most current operating systems are capable of using the TCP/IP networking protocols. This means that one system can appear on a network of the other and share resources such as files, printers, and scanners using either wired or wireless connections.


===Hypervisor===
Many operating systems also support one or more vendor-specific legacy networking protocols as well, for example, ] on ] systems, ] on systems from ], and Microsoft-specific protocols on Windows. Specific protocols for specific tasks may also be supported such as ] for file access.
A ] is an operating system that runs a ]. The virtual machine is unaware that it is an application and operates as if it had its own hardware.{{sfn|Anderson|Dahlin|2014|p=11}}{{sfn|Silberschatz et al.|2018|pp=701}} Virtual machines can be paused, saved, and resumed, making them useful for operating systems research, development,{{sfn|Silberschatz et al.|2018|pp=705}} and debugging.{{sfn|Anderson|Dahlin|2014|p=12}} They also enhance portability by enabling applications to be run on a computer even if they are not compatible with the base operating system.{{sfn|Anderson|Dahlin|2014|p=11}}


===Security=== ===Library===
A ''library operating system'' (libOS) is one in which the services that a typical operating system provides, such as networking, are provided in the form of ] and composed with a single application and configuration code to construct a ]:
Many operating systems include some level of security. Security is based on the two ideas that:
<ref name="Unikernels">{{cite magazine
* The operating system provides access to a number of resources, directly or indirectly, such as files on a local disk, privileged system calls, personal information about users, and the services offered by the programs running on the system;
|last1=Madhavapeddy |first1=Anil
* The operating system is capable of distinguishing between some requesters of these resources who are authorized (allowed) to access the resource, and others who are not authorized (forbidden). While some systems may simply distinguish between "privileged" and "non-privileged", systems commonly have a form of requester ''identity'', such as a user name. Requesters, in turn, divide into two categories:
|last2=Scott |first2=David J
:*Internal security: an already running program. On some systems, a program once it is running has no limitations, but commonly the program has an identity which it keeps and is used to check all of its requests for resources.
|date=November 2013
:*External security: a new request from outside the computer, such as a login at a connected console or some kind of network connection. To establish identity there may be a process of ''authentication''. Often a username must be quoted, and each username may have a password. Other methods of authentication, such as magnetic cards or biometric data might be used instead. In some cases, especially connections from the network, resources may be accessed with no authentication at all.
|title=Unikernels: Rise of the Virtual Library Operating System: What if all the software layers in a virtual appliance were compiled within the same safe, high-level language framework?
|magazine=Queue |volume=11 |issue=11
|pages=30–44
|location=New York, NY, USA
|publisher=ACM
|issn=1542-7730
|url=https://doi.org/10.1145/2557963.2566628
|doi=10.1145/2557963.2566628
|access-date=2024-08-07
}}</ref> a specialized (only the absolute necessary pieces of code are extracted from libraries and bound together
<ref name="Unikraft-Build-Process">{{cite web
|url=https://unikraft.org/docs/concepts/build-process
|access-date=2024-08-08
|title=Build Process - Unikraft
|archive-date=2024-04-22
|archive-url=https://web.archive.org/web/20240422183734/https://unikraft.org/docs/concepts/build-process
|url-status=live
}}</ref>), ], machine image that can be deployed to cloud or embedded environments.


The operating system code and application code are not executed in separated ] (there is only a single application running, at least conceptually, so there is no need to prevent interference between applications) and OS services are accessed via simple library calls (potentially ] them based on compiler thresholds), without the usual overhead of ]es,
In addition, to the allow/disallow model of security, a system with a high level of security will also offer auditing options. These would allow tracking of requests for access to resources (such as, "who has been reading this file?").
<ref name="rise-of-libOS">{{cite web
|url=https://www.sigarch.org/leave-your-os-at-home-the-rise-of-library-operating-systems/
|access-date=2024-08-07
|title=Leave your OS at home: the rise of library operating systems
|date=2017-09-14
|publisher=]
|archive-date=2024-03-01
|archive-url=https://web.archive.org/web/20240301072916/https://www.sigarch.org/leave-your-os-at-home-the-rise-of-library-operating-systems/
|url-status=live
}}</ref> in a way similarly to embedded and real-time OSes. Note that this overhead is not negligible: to the direct cost of mode switching it's necessary to add the indirect pollution of important processor structures (like ]s, the ], and so on) which affects both user-mode and kernel-mode performance.
<ref name="FlexSC">{{cite conference
|url=https://www.usenix.org/conference/osdi10/flexsc-flexible-system-call-scheduling-exception-less-system-calls
|title=FlexSC: Flexible System Call Scheduling with Exception-Less System Calls
|last1=Soares |first1=Livio Baldini <!-- https://liviosoares.github.io/ -->
|last2=Stumm |first2=Michael <!-- https://www.eecg.toronto.edu/~stumm/index.html -->
|date=2010-10-04
|conference=OSDI '10, 9th USENIX Symposium on Operating System Design and Implementation
|conference-url=https://www.usenix.org/legacy/events/osdi10/
|publisher=]
|access-date=2024-08-09
|quote=Synchronous implementation of system calls negatively impacts the performance of system intensive workloads, both in terms of the ''direct'' costs of mode switching and, more interestingly, in terms of the ''indirect'' pollution of important processor structures which affects both user-mode and kernel-mode performance. A motivating example that quantifies the impact of system call pollution on application performance can be seen in Figure 1. It depicts the user-mode instructions per cycles (kernel cycles and instructions are ignored) of one of the SPEC CPU 2006 benchmarks (Xalan) immediately before and after a <code>pwrite</code> system call. There is a significant drop in instructions per cycle (IPC) due to the system call, and it takes up to 14,000 cycles of execution before the IPC of this application returns to its previous level. As we will show, this performance degradation is mainly due to interference caused by the kernel on key processor structures.
|quote-page=2
}}</ref>


==History==
Security of operating systems has long been a concern because of highly sensitive data held on computers, both of a commercial and military nature. The ] ] ] (DoD) created the '']'' (TCSEC), which is a standard that sets basic requirements for assessing the effectiveness of security. This became of vital importance to operating system makers, because the TCSEC was used to evaluate, classify and select computer systems being considered for the processing, storage and retrieval of sensitive or ].
{{Main|History of operating systems}}
] used by the operating system to communicate with the operator.]]


The first computers in the late 1940s and 1950s were directly programmed either with ]s or with ] inputted on media such as ]s, without ]s or operating systems.{{sfn|Tanenbaum|Bos|2023|p=8}} After the introduction of the ] in the mid-1950s, ]s began to be built. These still needed professional operators{{sfn|Tanenbaum|Bos|2023|p=8}} who manually do what a modern operating system would do, such as scheduling programs to run,<ref name="OSTEP book">{{cite book |last1=Arpaci-Dusseau |first1=Remzi |last2=Arpaci-Dusseau |first2=Andrea |year=2015 |url=http://pages.cs.wisc.edu/~remzi/OSTEP/ |title=Operating Systems: Three Easy Pieces |access-date=25 July 2016 |archive-date=25 July 2016 |archive-url=https://web.archive.org/web/20160725012948/http://pages.cs.wisc.edu/~remzi/OSTEP/ |url-status=live }}</ref> but mainframes still had rudimentary operating systems such as ] (FMS) and ].{{sfn|Tanenbaum|Bos|2023|p=10}} In the 1960s, ] introduced the first series of intercompatible computers (]). All of them ran the same operating system—]—which consisted of millions of lines of ] that had thousands of ]s. The OS/360 also was the first popular operating system to support ], such that the CPU could be put to use on one job while another was waiting on ] (I/O). Holding multiple jobs in ] necessitated memory partitioning and safeguards against one job accessing the memory allocated to a different one.{{sfn|Tanenbaum|Bos|2023|pp=11–12}}
====Internal security====


Around the same time, ]s began to be used as ]s so multiple users could access the computer simultaneously. The operating system ] was intended to allow hundreds of users to access a large computer. Despite its limited adoption, it can be considered the precursor to ]. The ] operating system originated as a development of MULTICS for a single user.{{sfn|Tanenbaum|Bos|2023|pp=13–14}} Because UNIX's ] was available, it became the basis of other, incompatible operating systems, of which the most successful were ]'s ] and the ]'s ] (BSD).{{sfn|Tanenbaum|Bos|2023|pp=14–15}} To increase compatibility, the ] released the ] standard for operating system ]s (APIs), which is supported by most UNIX systems. ] was a stripped-down version of UNIX, developed in 1987 for educational uses, that inspired the commercially available, ] ]. Since 2008, MINIX is used in controllers of most ] ], while Linux is widespread in ]s and ] smartphones.{{sfn|Tanenbaum|Bos|2023|p=15}}
Internal security can be thought of as protecting the computer's resources from the programs concurrently running on the system. Most operating systems set programs running natively on the computer's processor, so the problem arises of how to stop these programs doing the same task and having the same privileges as the operating system (which is after all just a program too). Processors used for general purpose operating systems generally have a hardware concept of privilege. Generally less privileged programs are automatically blocked from using certain hardware instructions, such as those to read or write from external devices like disks. Instead, they have to ask the privileged program (operating system) to read or write. The operating system therefore gets the chance to check the program's identity and allow or refuse the request.


===Microcomputers===
An alternative strategy, and the only strategy available where the operating system and user programs have the same hardware privilege, is the operating system not running user programs as native code, but instead either ] a processor or provides a host for a ] based system such as Java.
] of the ] operating system]]
] of a ]]]
The invention of ] enabled the production of ]s (initially called ]s) from around 1980.{{sfn|Tanenbaum|Bos|2023|pp=15–16}} For around five years, the ] (Control Program for Microcomputers) was the most popular operating system for microcomputers.{{sfn|Tanenbaum|Bos|2023|p=16}} Later, IBM bought the ] (Disk Operating System) from ]. After modifications requested by IBM, the resulting system was called ] ({{not a typo|Micro|Soft}} Disk Operating System) and was widely used on IBM microcomputers. Later versions increased their sophistication, in part by borrowing features from UNIX.{{sfn|Tanenbaum|Bos|2023|p=16}}


]'s ] was the first popular computer to use a ] (GUI). The GUI proved much more ] than the text-only ] earlier operating systems had used. Following the success of Macintosh, MS-DOS was updated with a GUI overlay called ]. Windows later was rewritten as a stand-alone operating system, borrowing so many features from another (]) that a large ] was paid.{{sfn|Tanenbaum|Bos|2023|p=17}} In the twenty-first century, Windows continues to be popular on personal computers but has less ] of servers. UNIX operating systems, especially Linux, are the most popular on ]s and servers but are also used on ]s and many other computer systems.{{sfn|Tanenbaum|Bos|2023|p=18}}
Internal security is especially relevant for multi-user systems; it allows each user of the system to have private files that the other users cannot tamper with or read. Internal security is also vital if auditing is to be of any use, since a program can potentially bypass the operating system, inclusive of bypassing auditing.


On mobile devices, ] was dominant at first, being usurped by ] (introduced 2002) and ] for ]s (from 2007). Later on, the open-source ] operating system (introduced 2008), with a Linux kernel and a C library (]) partially based on BSD code, became most popular.{{sfn|Tanenbaum|Bos|2023|pp=19–20}}
==== External security ====


==Components==
<!-- Major rewrite pending on the following -->
The components of an operating system are designed to ensure that various parts of a computer function cohesively. With the de facto obsoletion of ], all user ] must interact with the operating system to access hardware.
Typically an operating system offers (hosts) various services to other network computers and users. These services are usually provided through ports or numbered access points beyond the operating systems network address. Typically services include offerings such as file sharing, print services, email, web sites, and file transfer protocols.
At the front line of security are hardware devices known as ]. At the operating system level, there are various software firewalls. A software firewall is configured to allow or deny traffic to a service running on top of the operating system. Therefore, one can install and be running an insecure service, such as Telnet or FTP, and not have to be threatened by a security breach because the firewall would deny all traffic trying to connect to the service on that port.


===Kernel===
===Graphical user interfaces===
{{Main|Kernel (operating system)}}
]


The kernel is the part of the operating system that provides ] between different applications and users. This protection is key to improving reliability by keeping errors isolated to one program, as well as security by limiting the power of ] and protecting private data, and ensuring that one program cannot monopolize the computer's resources.{{sfn|Anderson|Dahlin|2014|pp=39–40}} Most operating systems have two modes of operation:{{sfn|Tanenbaum|Bos|2023|p=2}} in ], the hardware checks that the software is only executing legal instructions, whereas the kernel has ] and is not subject to these checks.{{sfn|Anderson|Dahlin|2014|pp=41, 45}} The kernel also manages ] for other processes and controls access to ] devices.{{sfn|Anderson|Dahlin|2014|pp=52-53}}
Today, most modern operating systems contain ] (GUIs, pronounced ''goo-eez''). A few older operating systems tightly integrated the GUI to the ]—for example, the original implementations of Windows and Mac OS. More modern operating systems are ], separating the graphics subsystem from the kernel (as is now done in Linux, and Mac OS X, and to a limited extent Windows).


====Program execution====
Many operating systems allow the user to install or create any user interface they desire. The ] in conjunction with ] or ] is a commonly found setup on most Unix and Unix derivative (BSD, Linux, ]) systems. However, some operating systems do not give such a flexible GUI, such as Windows—these operating systems require the use of software to modify the existing GUI, and more often than not, they are only able to change simple attributes such as menu style, colours, etc.
The operating system provides an interface between an application program and the computer hardware, so that an application program can interact with the hardware only by obeying rules and procedures programmed into the operating system. The operating system is also a set of services which simplify development and execution of application programs. Executing an application program typically involves the creation of a ] by the operating system ], which assigns memory space and other resources, establishes a priority for the process in multi-tasking systems, loads program binary code into memory, and initiates execution of the application program, which then interacts with the user and with hardware devices. However, in some systems an application can request that the operating system execute another application within the same process, either as a subroutine or in a separate thread, e.g., the '''LINK''' and '''ATTACH''' facilities of ].


====Interrupts====
GUIs tend to change with time. For example, Windows has modified its GUI every time a new major version of Windows is released and the Mac OS GUI changed dramatically with the introduction of Mac OS X.
{{Main|Interrupt}}


An ] (also known as an ], ], ''fault'', ],<ref name="lpi-ch20-p388_quote1">{{cite book
===Device drivers===
| last = Kerrisk
A ] is a specific type of computer software developed to allow interaction with hardware devices. Typically this constitutes an interface for communicating with the device, through the specific computer bus or communications subsystem that the hardware is connected to, providing commands to and/or receiving data from the device, and on the other end, the requisite interfaces to the operating system and software applications. It is a specialized hardware-dependent computer program which is also operating system specific that enables another program, typically an operating system or applications software package or computer program running under the operating system kernel, to interact transparently with a hardware device, and usually provides the requisite interrupt handling necessary for any necessary asynchronous time-dependent hardware interfacing needs.
| first = Michael
| title = The Linux Programming Interface
| publisher = No Starch Press
| year = 2010
| page = 388
| isbn = 978-1-59327-220-3
| quote = A signal is a notification to a process that an event has occurred. Signals are sometimes described as software interrupts.
}}</ref> or ''trap'')<ref name="Hyde_1996">{{cite book
|last1 = Hyde
|first1 = Randall
|chapter-url = https://www.plantation-productions.com/Webster/www.artofasm.com/DOS/ch17/CH17-1.html#HEADING1-0
|access-date = 22 December 2021
|date = 1996
|title = The Art Of Assembly Language Programming
|chapter = Chapter Seventeen: Interrupts, Traps and Exceptions (Part 1)
|publisher = No Starch Press
|quote = The concept of an interrupt is something that has expanded in scope over the years. The 80x86 family has only added to the confusion surrounding interrupts by introducing the int (software interrupt) instruction. Indeed, different manufacturers have used terms like exceptions, faults, aborts, traps and interrupts to describe the phenomena this chapter discusses. Unfortunately there is no clear consensus as to the exact meaning of these terms. Different authors adopt different terms to their own use.
|archive-date = 22 December 2021
|archive-url = https://web.archive.org/web/20211222205623/https://www.plantation-productions.com/Webster/www.artofasm.com/DOS/ch17/CH17-1.html#HEADING1-0
|url-status = live
}}</ref> provides an efficient way for most operating systems to react to the environment. Interrupts cause the ] (CPU) to have a ] change away from the currently running program to an ], also known as an interrupt service routine (ISR).<ref name="sco-ch5-p308_a">{{cite book
| last = Tanenbaum
| first = Andrew S.
| title = Structured Computer Organization, Third Edition
| publisher = Prentice Hall
| year = 1990
| page =
| isbn = 978-0-13-854662-5
| url = https://archive.org/details/structuredcomput00tane/page/308
| quote = Like the trap, the interrupt stops the running program and transfers control to an interrupt handler, which performs some appropriate action. When finished, the interrupt handler returns control to the interrupted program.
}}</ref><ref name="osc-ch2-p32_a">{{cite book
| last = Silberschatz
| first = Abraham
| title = Operating System Concepts, Fourth Edition
| publisher = Addison-Wesley
| year = 1994
| page = 32
| isbn = 978-0-201-50480-4
| quote = When an interrupt (or trap) occurs, the hardware transfers control to the operating system. First, the operating system preserves the state of the CPU by storing registers and the program counter. Then, it determines which type of interrupt has occurred. For each type of interrupt, separate segments of code in the operating system determine what action should be taken.}}</ref> An interrupt service routine may cause the ] (CPU) to have a ].<ref name="osc-ch4-p105">{{cite book
| last = Silberschatz
| first = Abraham
| title = Operating System Concepts, Fourth Edition
| publisher = Addison-Wesley
| year = 1994
| page = 105
| isbn = 978-0-201-50480-4
| quote = Switching the CPU to another process requires saving the state of the old process and loading the saved state for the new process. This task is known as a context switch.}}</ref>{{efn|Modern CPUs provide instructions (e.g. SYSENTER) to invoke selected kernel services without an interrupts. Visit https://wiki.osdev.org/SYSENTER for more information.}} The details of how a computer processes an interrupt vary from architecture to architecture, and the details of how interrupt service routines behave vary from operating system to operating system.<ref name="osc-ch2-p31">{{cite book
| last = Silberschatz
| first = Abraham
| title = Operating System Concepts, Fourth Edition
| publisher = Addison-Wesley
| year = 1994
| page = 31
| isbn = 978-0-201-50480-4
}}</ref> However, several interrupt functions are common.<ref name="osc-ch2-p31"/> The architecture and operating system must:<ref name="osc-ch2-p31"/>
# transfer control to an interrupt service routine.
# save the state of the currently running process.
# restore the state after the interrupt is serviced.


=====Software interrupt=====
The key design goal of device drivers is abstraction. Every model of hardware (even within the same class of device) is different. Newer models also are released by manufacturers that provide more reliable or better performance and these newer models are often controlled differently. Computers and their operating systems cannot be expected to know how to control every device, both now and in the future. To solve this problem, OSes essentially dictate how every type of device should be controlled. The function of the device driver is then to translate these OS mandated function calls into device specific calls. In theory a new device, which is controlled in a new manner, should function correctly if a suitable driver is available. This new driver will ensure that the device appears to operate as usual from the operating systems' point of view for any person.
A software interrupt is a message to a ] that an event has occurred.<ref name="lpi-ch20-p388_quote1"/> This contrasts with a ''hardware interrupt'' — which is a message to the ] (CPU) that an event has occurred.<ref name="osc-ch2-p30">{{cite book
| last = Silberschatz
| first = Abraham
| title = Operating System Concepts, Fourth Edition
| publisher = Addison-Wesley
| year = 1994
| page = 30
| isbn = 978-0-201-50480-4
| quote = Hardware may trigger an interrupt at any time by sending a signal to the CPU, usually by way of the system bus.
}}</ref> Software interrupts are similar to hardware interrupts — there is a change away from the currently running process.<ref name="lpi-ch20-p388_quote2">{{cite book
| last = Kerrisk
| first = Michael
| title = The Linux Programming Interface
| publisher = No Starch Press
| year = 2010
| page = 388
| isbn = 978-1-59327-220-3
| quote = Signals are analogous to hardware interrupts in that they interrupt the normal flow of execution of a program; in most cases, it is not possible to predict exactly when a signal will arrive.
}}</ref> Similarly, both hardware and software interrupts execute an ].


Software interrupts may be normally occurring events. It is expected that a ] will occur, so the kernel will have to perform a ].<ref name="lpi-ch20-p388_quote3">{{cite book
==History==
| last = Kerrisk
{{main|History of operating systems}}
| first = Michael
| title = The Linux Programming Interface
| publisher = No Starch Press
| year = 2010
| page = 388
| isbn = 978-1-59327-220-3
| quote = Among the types of events that cause the kernel to generate a signal for a process are the following: A software event occurred. For example, ... the process's CPU time limit was exceeded
}}</ref> A ] may set a timer to go off after a few seconds in case too much data causes an algorithm to take too long.<ref name="lpi-ch20-p388">{{cite book
| last = Kerrisk
| first = Michael
| title = The Linux Programming Interface
| publisher = No Starch Press
| year = 2010
| page = 388
| isbn = 978-1-59327-220-3
}}</ref>


Software interrupts may be error conditions, such as a malformed ].<ref name="lpi-ch20-p388"/> However, the most common error conditions are ] and ].<ref name="lpi-ch20-p388"/>
The first computers did not have operating systems. By the early 1960s, commercial computer vendors were supplying quite extensive tools for streamlining the development, scheduling, and execution of jobs on ] systems. Examples were produced by ] and ], amongst others.


] can send messages to the kernel to modify the behavior of a currently running process.<ref name="lpi-ch20-p388"/> For example, in the ], pressing the ''interrupt character'' (usually ]) might terminate the currently running process.<ref name="lpi-ch20-p388"/>
Through the 1960s, several major concepts were developed, driving the development of operating systems. The development of the ] ] produced a family of ]s available in widely differing capacities and price points, for which a single operating system ] was planned (rather than developing ad-hoc programs for every individual model). This concept of a single OS spanning an entire product line was crucial for the success of System/360 and, in fact, IBM's current mainframe operating systems are distant descendants of this original system; applications written for the OS/360 can still be run on modern machines. OS/360 also contained another important advance: the development of the ] permanent storage device (which IBM called ]). Another key development was the concept of ]: the idea of sharing the resources of expensive computers amongst multiple computer users interacting in real time with the system. Time sharing allowed all of the users to have the illusion of having exclusive access to the machine; the ] timesharing system was the most famous of a number of new operating systems developed to take advantage of the concept.


To generate ''software interrupts'' for ] CPUs, the ] ] instruction is available.<ref name="intel-developer">{{cite web
Multics, particularly, was an inspiration to a number of operating systems developed in the 1970s, notably ] by Dennis Richie and Ken Thompson. Another commercially-popular ] operating system was ].
|url=https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
|access-date=2022-05-05
|title=Intel® 64 and IA-32 Architectures Software Developer's Manual
|volume=2
|date=September 2016
|publisher=]
|page=610
|archive-date=23 March 2022
|archive-url=https://web.archive.org/web/20220323231921/https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
|url-status=live
}}</ref> The syntax is <code>INT X</code>, where <code>X</code> is the offset number (in ] format) to the ].


=====Signal=====
The first ]s did not have the capacity or need for the elaborate operating systems that had been developed for mainframes and minis; minimalistic operating systems were developed, often loaded from ] and known as ''Monitors''. One notable early disk-based operating system was ], which was supported on many early microcomputers and was largely cloned in creating ], which became wildly popular as the operating system chosen for the ] (IBM's version of it was called IBM-DOS or ]), its successors making ] one of the world's most profitable companies. The major alternative throughout the 1980s in the microcomputer market was ], tied intimately to the ] computer.
To generate ''software interrupts'' in ] operating systems, the <code>kill(pid,signum)</code> ] will send a ] to another process.<ref name="duos-p200">{{cite book
| last = Bach
| first = Maurice J.
| title = The Design of the UNIX Operating System
| publisher = Prentice-Hall
| year = 1986
| page = 200
| isbn = 0-13-201799-7
}}</ref> <code>pid</code> is the ] of the receiving process. <code>signum</code> is the signal number (in ] format){{efn|Examples include ], ], and ].}} to be sent. (The abrasive name of <code>kill</code> was chosen because early implementations only terminated the process.)<ref name="lpi-ch20-p400">{{cite book
| last = Kerrisk
| first = Michael
| title = The Linux Programming Interface
| publisher = No Starch Press
| year = 2010
| page = 400
| isbn = 978-1-59327-220-3
}}</ref>


In Unix-like operating systems, ''signals'' inform processes of the occurrence of asynchronous events.<ref name="duos-p200"/> To communicate asynchronously, interrupts are required.<ref name="sco-ch5-p308_b">{{cite book
By the 1990s, the microcomputer had evolved to the point where, as well as extensive ] facilities, the robustness and flexibility of operating systems of larger computers became increasingly desirable. Microsoft's response to this change was the development of ], which served as the basis for Microsoft's entire operating system line starting in 1999. Apple rebuilt their operating system on top of a ] core as ], released in 2001. Hobbyist-developed reimplementations of Unix, assembled with the tools from the ], also became popular; versions based on the ] kernel are by far the most popular, with the ] derived UNIXes holding a small portion of the server market.
| last = Tanenbaum
| first = Andrew S.
| title = Structured Computer Organization, Third Edition
| publisher = Prentice Hall
| year = 1990
| page =
| isbn = 978-0-13-854662-5
| url = https://archive.org/details/structuredcomput00tane/page/308
}}</ref> One reason a process needs to asynchronously communicate to another process solves a variation of the classic ].<ref name="osc-p182">{{cite book
| last = Silberschatz
| first = Abraham
| title = Operating System Concepts, Fourth Edition
| publisher = Addison-Wesley
| year = 1994
| page = 182
| isbn = 978-0-201-50480-4
}}</ref> The writer receives a pipe from the ] for its output to be sent to the reader's input stream.<ref name="usp-ch6-p153">{{cite book
| last1 = Haviland
| first1 = Keith
| last2 = Salama
| first2 = Ben
| title = UNIX System Programming
| publisher = Addison-Wesley Publishing Company
| year = 1987
| page = 153
| isbn = 0-201-12919-1
}}</ref> The ] syntax is <code>alpha | bravo</code>. <code>alpha</code> will write to the pipe when its computation is ready and then sleep in the wait queue.<ref name="usp-ch6-p148">{{cite book
| last1 = Haviland
| first1 = Keith
| last2 = Salama
| first2 = Ben
| title = UNIX System Programming
| publisher = Addison-Wesley Publishing Company
| year = 1987
| page = 148
| isbn = 0-201-12919-1
}}</ref> <code>bravo</code> will then be moved to the ] and soon will read from its input stream.<ref name="usp-ch6-p149">{{cite book
| last1 = Haviland
| first1 = Keith
| last2 = Salama
| first2 = Ben
| title = UNIX System Programming
| publisher = Addison-Wesley Publishing Company
| year = 1987
| page = 149
| isbn = 0-201-12919-1
}}</ref> The kernel will generate ''software interrupts'' to coordinate the piping.<ref name="usp-ch6-p149"/>


''Signals'' may be classified into 7 categories.<ref name="duos-p200"/> The categories are:
The growing complexity of embedded devices has led to increasing use of ].
# when a process finishes normally.
# when a process has an error exception.
# when a process runs out of a system resource.
# when a process executes an illegal instruction.
# when a process sets an alarm event.
# when a process is aborted from the keyboard.
# when a process has a tracing alert for debugging.


=====Hardware interrupt=====
==Today==
] (I/O) ] are slower than the CPU. Therefore, it would slow down the computer if the CPU had to ] for each I/O to finish. Instead, a computer may implement interrupts for I/O completion, avoiding the need for ] or busy waiting.<ref name="sco-ch5-p292">{{cite book
]
| last = Tanenbaum
Modern operating systems usually have a ] (GUI) which uses a pointing device such as a mouse or stylus for input in addition to the keyboard. Older models and Operating Systems not designed for direct-human interaction (such as ]) generally use a ] (or CLI) typically with only the keyboard for input. Both models are centered around a "]" which accepts and processes commands from the user (eg. clicking on a button, or a typed command at a prompt). The choice of OS may depend on the hardware architecture, specifically the CPU, with only ] and ] running on almost any CPU. Windows NT, which is no longer supported, was ported to the ] and ]. Since the early 1990s, the choice for personal computers has largely been limited to the ] family, the ] family and Linux, of which Linux and Mac OS X are becoming the major alternatives. Mainframe computers and ]s use a variety of different operating systems, many with no direct connection to Windows or Unix.
| first = Andrew S.
| title = Structured Computer Organization, Third Edition
| publisher = Prentice Hall
| year = 1990
| page =
| isbn = 978-0-13-854662-5
| url = https://archive.org/details/structuredcomput00tane/page/292
}}</ref>


Some computers require an interrupt for each character or word, costing a significant amount of CPU time. ] (DMA) is an architecture feature to allow devices to bypass the CPU and access ] directly.<ref name=A22-6821-7-storage>{{cite book
===Personal computers===
|author = IBM
*] - Microsoft Windows, Unix variants, and Linux variants.
|title = IBM System/360 Principles of Operation
*] - Mac OS X (a Unix variant), Windows (] variants only), Linux and BSD
|date = September 1968
===Mainframe computers===
|version = Eighth Edition
The earliest operating systems were developed for ] architectures in the 1960's. The enormous investment in software for these systems caused most of the original computer manufacturers to continue to develop hardware and operating systems that are compatible with those early operating systems. Those early sytems pioneered many of the features of modern operating systems. Mainframe operating systems that are still supported include:
|url = http://bitsavers.org/pdf/ibm/360/princOps/A22-6821-7_360PrincOpsDec67.pdf
*]-- ],1961 to ] Clearpath/MCP, present.
|section = Main Storage
*IBM ] -- ], 1964 to ], present
|section-url = http://bitsavers.org/pdf/ibm/360/princOps/A22-6821-7_360PrincOpsDec67.pdf#page=8
*UNIVAC ] -- ], 1964, to ] Clearpath IX, present.
|mode = cs2
|page = 7
|access-date = 13 April 2022
|archive-date = 19 March 2022
|archive-url = https://web.archive.org/web/20220319083255/http://bitsavers.org/pdf/ibm/360/princOps/A22-6821-7_360PrincOpsDec67.pdf
|url-status = live
}}</ref> (Separate from the architecture, a device may perform direct memory access{{efn|often in the form of a DMA chip for smaller systems and I/O channels for larger systems}} to and from main memory either directly or via a bus.)<ref name="sco-ch5-p294">
{{cite book
| last = Tanenbaum
| first = Andrew S.
| title = Structured Computer Organization, Third Edition
| publisher = Prentice Hall
| year = 1990
| page =
| isbn = 978-0-13-854662-5
| url = https://archive.org/details/structuredcomput00tane/page/294
}}</ref>{{efn|Modern ]s have a DMA controller. Additionally, a device may also have one. Visit ].}}


====Input/output====
Modern mainframes typically also run Linux or Unix variants.


===Embedded systems=== =====Interrupt-driven I/O=====
{{Expand section|date=April 2022}}
]s use a variety of dedicated operating systems and limited versions of Linux or other operating systems. In some cases, the "operating system" software is directly linked to the application to produce a monolithic special-purpose program. In the simplest embedded systems, there is no distinction between the OS and the application. Embedded systems that have certain time requirements are known as ]s.
When a ] types a key on the keyboard, typically the character appears immediately on the screen. Likewise, when a user moves a ], the ] immediately moves across the screen. Each keystroke and mouse movement generates an ''interrupt'' called ''Interrupt-driven I/O''. An interrupt-driven I/O occurs when a process causes an interrupt for every character<ref name="sco-ch5-p294"/> or word<ref>{{cite book
|title = Users Handbook - PDP-7
|id = F-75
|year = 1965
|url = http://bitsavers.org/pdf/dec/pdp7/F-75_PDP-7userHbk_Jun65.pdf
|section = Program Interrupt Controller (PIC)
|section-url = http://bitsavers.org/pdf/dec/pdp7/F-75_PDP-7userHbk_Jun65.pdf#page=62
|pages =
|publisher = ]
|access-date = April 20, 2022
|archive-date = 10 May 2022
|archive-url = https://web.archive.org/web/20220510164742/http://bitsavers.org/pdf/dec/pdp7/F-75_PDP-7userHbk_Jun65.pdf
|url-status = live
}}</ref> transmitted.


=====Direct memory access=====
===Unix-like===
Devices such as ]s, ]s, and ] drives can transfer data at a rate high enough that interrupting the CPU for every byte or word transferred, and having the CPU transfer the byte or word between the device and memory, would require too much CPU time. Data is, instead, transferred between the device and memory independently of the CPU by hardware such as a ] or a ] controller; an interrupt is delivered only when all the data is transferred.<ref>{{cite book|url=http://bitsavers.org/pdf/dec/pdp1/F25_PDP1_IO.pdf|title=PDP-1 Input-Output Systems Manual|publisher=]|pages=19–20|access-date=16 August 2022|archive-date=25 January 2019|archive-url=https://web.archive.org/web/20190125050839/http://bitsavers.org/pdf/dec/pdp1/F25_PDP1_IO.pdf|url-status=live}}</ref>
] desktop running under ].]]
The '']'' family is a diverse group of operating systems, with several major sub-categories including ], ], and ]. The name "UNIX" is a trademark of ] which licenses it for use with any operating system that has been shown to conform to their definitions. "Unix-like" is commonly used to refer to the large set of operating systems which resemble the original Unix.


If a ] executes a ] to perform a block I/O ''write'' operation, then the system call might execute the following instructions:
Unix systems run on a wide variety of machine architectures. They are used heavily as ] systems in business, as well as ]s in academic and engineering environments. ] Unix variants, such as ] and ], are increasingly popular. They are used in the desktop market as well, for example ], but mostly by hobbyists.
* Set the contents of the CPU's ] (including the ]) into the ].<ref name="osc-ch2-p32_b">{{cite book
| last = Silberschatz
| first = Abraham
| title = Operating System Concepts, Fourth Edition
| publisher = Addison-Wesley
| year = 1994
| page = 32
| isbn = 978-0-201-50480-4
}}</ref>
* Create an entry in the device-status table.<ref name="osc-ch2-p34">{{cite book
| last = Silberschatz
| first = Abraham
| title = Operating System Concepts, Fourth Edition
| publisher = Addison-Wesley
| year = 1994
| page = 34
| isbn = 978-0-201-50480-4
}}</ref> The operating system maintains this table to keep track of which processes are waiting for which devices. One field in the table is the ] of the process control block.
* Place all the characters to be sent to the device into a ].<ref name="sco-ch5-p308_b"/>
* Set the memory address of the memory buffer to a predetermined device register.<ref name="sco-ch5-p295">{{cite book
| last = Tanenbaum
| first = Andrew S.
| title = Structured Computer Organization, Third Edition
| publisher = Prentice Hall
| year = 1990
| page =
| isbn = 978-0-13-854662-5
| url = https://archive.org/details/structuredcomput00tane/page/295
}}</ref>
* Set the buffer size (an integer) to another predetermined register.<ref name="sco-ch5-p295"/>
* Execute the ] to begin the writing.
* Perform a ] to the next process in the ].


While the writing takes place, the operating system will context switch to other processes as normal. When the device finishes writing, the device will ''interrupt'' the currently running process by ''asserting'' an ]. The device will also place an integer onto the data bus.<ref name="sco-ch5-p309">{{cite book
Some Unix variants like HP's ] and IBM's ] are designed to run only on that vendor's proprietary hardware. Others, such as ], can run on both proprietary hardware and on commodity ] PCs. Apple's ], a microkernel BSD variant derived from ], ], and ], has replaced Apple's earlier (non-Unix) Mac OS. Over the past several years, free Unix systems have supplanted proprietary ones in most instances. For instance, scientific modeling and computer animation were once the province of ]'s ]. Today, they are dominated by Linux-based or ] clusters. {{fact}}
| last = Tanenbaum
| first = Andrew S.
| title = Structured Computer Organization, Third Edition
| publisher = Prentice Hall
| year = 1990
| page =
| isbn = 978-0-13-854662-5
| url = https://archive.org/details/structuredcomput00tane/page/309
}}</ref> Upon accepting the interrupt request, the operating system will:
* Push the contents of the ] (a register) followed by the ] onto the ].<ref name="osc-ch2-p31"/>
* Push the contents of the other registers onto the call stack. (Alternatively, the contents of the registers may be placed in a system table.)<ref name="sco-ch5-p309"/>
* Read the integer from the data bus. The integer is an offset to the ]. The vector table's instructions will then:
:* Access the device-status table.
:* Extract the process control block.
:* Perform a context switch back to the writing process.


When the writing process has its ] expired, the operating system will:<ref name="sco-ch5-p310">{{cite book
The team at ] that designed and developed Unix went on to develop ] and ], which were designed for modern distributed environments. They had graphics built-in, unlike Unix counterparts that added it to the design later. Plan 9 did not become popular because, unlike many Unix distributions, it was not originally free. It has since been released under Free Software and Open Source ], and has an expanding community of developers. Inferno was sold to ] and has been released under a GPL/MIT license.
| last = Tanenbaum
| first = Andrew S.
| title = Structured Computer Organization, Third Edition
| publisher = Prentice Hall
| year = 1990
| page =
| isbn = 978-0-13-854662-5
| url = https://archive.org/details/structuredcomput00tane/page/310
}}</ref>
* Pop from the call stack the registers other than the status register and program counter.
* Pop from the call stack the status register.
* Pop from the call stack the address of the next instruction, and set it back into the program counter.


With the program counter now reset, the interrupted process will resume its time slice.<ref name="osc-ch2-p31"/>
===Microsoft Windows===
]
The '']'' family of operating systems originated as a graphical layer on top of the older ] environment for the ]. Modern versions are based on the newer ] core that first took shape in ] and borrowed from ]. Windows runs on 32-bit and 64-bit ] and ] processors, although earlier versions also ran on the ], ], and ] architectures (some work was done to port it to the ] architecture).


====Memory management====
As of 2006, Windows held a near-] of around 94% of the worldwide desktop ], although some predict this to dwindle due to the increased interest in ] operating systems. {{fact}} It is also used on low-end and mid-range servers, supporting applications such as ]s and ]. In recent years, Microsoft has spent significant marketing and R&D money to demonstrate that Windows is capable of running any enterprise application (see the ] article).
{{Main|Memory management}}


Among other things, a multiprogramming operating system ] must be responsible for managing all system memory which is currently in use by the programs. This ensures that a program does not interfere with memory already in use by another program. Since programs time share, each program must have independent access to memory.
The most recent addition to the Microsoft Windows family is ], released on October 25, 2001. The latest stable release is Windows XP Service Pack 2, released on August 6, 2004.


Cooperative memory management, used by many early operating systems, assumes that all programs make voluntary use of the ]'s memory manager, and do not exceed their allocated memory. This system of memory management is almost never seen any more, since programs often contain bugs which can cause them to exceed their allocated memory. If a program fails, it may cause memory used by one or more other programs to be affected or overwritten. Malicious programs or viruses may purposefully alter another program's memory, or may affect the operation of the operating system itself. With cooperative memory management, it takes only one misbehaved program to ] the system.
Microsoft is currently releasing a new version of Windows, ] (formerly codenamed "Longhorn"), which contains new functionalities, particularly in security, network administration, and ]. The GUI has been updated, as well; In addition to a new look for its standard 2D desktop interface, systems with sufficient processing power can use a 3D interface called ].


] enables the ] to limit a process' access to the computer's memory. Various methods of memory protection exist, including ] and ]. All methods require some level of hardware support (such as the ] MMU), which does not exist in all computers.
===Other===
Mainframe operating systems, such as ]'s ], and ] operating systems such as ], ], and ], are usually unrelated to Unix and Windows, except for ], ] and ] which are descendants of Windows, and several *]s, and ] distributions tailored for ] systems. ] from ] (formerly ]), is still under active development.


In both segmentation and paging, certain ] registers specify to the CPU what memory address it should allow a running program to access. Attempts to access other addresses trigger an interrupt, which causes the CPU to re-enter ], placing the ] in charge. This is called a ] or Seg-V for short, and since it is both difficult to assign a meaningful result to such an operation, and because it is usually a sign of a misbehaving program, the ] generally resorts to terminating the offending program, and reports the error.
Older operating systems which are still used in niche markets include ] from IBM; ], the non-Unix precursor to Apple's Mac OS X; ]; ].


Windows versions 3.1 through ME had some level of memory protection, but programs could easily circumvent the need to use it. A ] would be produced, indicating a segmentation violation had occurred; however, the system would often crash anyway.
Popular prior to the Dot COM era, operating systems such as ] and ] continue to be developed as minority platforms for enthusiast communities and specialist applications.


====Virtual memory====
Research and development of new operating systems continues. ] is designed to be backwards compatible with Unix, but with enhanced functionality and a microkernel architecture. ] is a research project to develop an operating system with better ] based on the .Net managed code model.
{{Main|Virtual memory}}
{{Further|Page fault}}
]

The use of virtual memory addressing (such as paging or segmentation) means that the kernel can choose what memory each program may use at any given time, allowing the operating system to use the same memory locations for multiple tasks.

If a program tries to access memory that is not accessible{{efn|There are several reasons that the memory might be inaccessible
* The address might be out of range
* The address might refer to a page or segment that has been moved to a backing store
* The address might refer to memory that has restricted access due to, e.g., ], ].}} memory, but nonetheless has been allocated to it, the kernel is interrupted {{See above|{{Section link||Memory management}}}}. This kind of interrupt is typically a ].

When the kernel detects a page fault it generally adjusts the virtual memory range of the program which triggered it, granting it access to the memory requested. This gives the kernel discretionary power over where a particular application's memory is stored, or even whether or not it has been allocated yet.

In modern operating systems, memory which is accessed less frequently can be temporarily stored on a disk or other media to make that space available for use by other programs. This is called ], as an area of memory can be used by multiple programs, and what that memory area contains can be swapped or exchanged on demand.

Virtual memory provides the programmer or the user with the perception that there is a much larger amount of RAM in the computer than is really there.<ref name="Operating System">{{cite book|last=Stallings|first=William|title=Computer Organization & Architecture|year=2008|publisher=Prentice-Hall of India Private Limited|location=New Delhi|isbn=978-81-203-2962-1|page=267}}</ref>

===Concurrency===
{{see also|Computer multitasking|Process management (computing)}}

] refers to the operating system's ability to carry out multiple tasks simultaneously.{{sfn|Anderson|Dahlin|2014|p=129}} Virtually all modern operating systems support concurrency.{{sfn|Silberschatz et al.|2018|p=159}}

]s enable splitting a process' work into multiple parts that can run simultaneously.{{sfn|Anderson|Dahlin|2014|p=130}} The number of threads is not limited by the number of processors available. If there are more threads than processors, the operating system ] schedules, suspends, and resumes threads, controlling when each thread runs and how much CPU time it receives.{{sfn|Anderson|Dahlin|2014|p=131}} During a ] a running thread is suspended, its state is saved into the ] and stack, and the state of the new thread is loaded in.{{sfn|Anderson|Dahlin|2014|pp=157, 159}} Historically, on many systems a thread could run until it relinquished control (]). Because this model can allow a single thread to monopolize the processor, most operating systems now can ] a thread (]).{{sfn|Anderson|Dahlin|2014|p=139}}

Threads have their own thread ID, ] (PC), a ] set, and a ], but share code, ] data, and other resources with other threads of the same process.{{sfn|Silberschatz et al.|2018|p=160}}{{sfn|Anderson|Dahlin|2014|p=183}} Thus, there is less overhead to create a thread than a new process.{{sfn|Silberschatz et al.|2018|p=162}} On single-CPU systems, concurrency is switching between processes. Many computers have multiple CPUs.{{sfn|Silberschatz et al.|2018|pp=162–163}} ] with multiple threads running on different CPUs can speed up a program, depending on how much of it can be executed concurrently.{{sfn|Silberschatz et al.|2018|p=164}}

===File system===
{{Main|File system}}
{{see also|Virtual file system}}
]s allow users and programs to organize and sort files on a computer, often through the use of ] (or folders).]]

Permanent storage devices used in twenty-first century computers, unlike ] ] (DRAM), are still accessible after a ] or ]. Permanent (]) storage is much cheaper per byte, but takes several orders of magnitude longer to access, read, and write.{{sfn|Anderson|Dahlin|2014|pp=492, 517}}{{sfn|Tanenbaum|Bos|2023|pp=259–260}} The two main technologies are a ] consisting of ]s, and ] (a ] that stores data in electrical circuits). The latter is more expensive but faster and more durable.{{sfn|Anderson|Dahlin|2014|pp=517, 530}}{{sfn|Tanenbaum|Bos|2023|p=260}}

]s are an ] used by the operating system to simplify access to permanent storage. They provide human-readable ] and other ], increase performance via ] of accesses, prevent multiple threads from accessing the same section of memory, and include ] to identify ].{{sfn|Anderson|Dahlin|2014|pp=492–493}} File systems are composed of files (named collections of data, of an arbitrary size) and ] (also called folders) that list human-readable filenames and other directories.{{sfn|Anderson|Dahlin|2014|p=496}} An absolute ] begins at the ] and lists ] divided by punctuation, while a relative path defines the location of a file from a directory.{{sfn|Anderson|Dahlin|2014|pp=496–497}}{{sfn|Tanenbaum|Bos|2023|pp=274–275}}

]s (which are sometimes ] by libraries) enable applications to create, delete, open, and close files, as well as link, read, and write to them. All these operations are carried out by the operating system on behalf of the application.{{sfn|Anderson|Dahlin|2014|pp=502–504}} The operating system's efforts to reduce latency include storing recently requested blocks of memory in a ] and ] data that the application has not asked for, but might need next.{{sfn|Anderson|Dahlin|2014|p=507}} ]s are software specific to each ] (I/O) device that enables the operating system to work without modification over different hardware.{{sfn|Anderson|Dahlin|2014|p=508}}{{sfn|Tanenbaum|Bos|2023|p=359}}

Another component of file systems is a ] that maps a file's name and metadata to the ] where its contents are stored.{{sfn|Anderson|Dahlin|2014|p=545}} Most file systems use directories to convert file names to file numbers. To find the block number, the operating system uses an ] (often implemented as a ]).{{sfn|Anderson|Dahlin|2014|p=546}} Separately, there is a free space ] to track free blocks, commonly implemented as a ].{{sfn|Anderson|Dahlin|2014|p=546}} Although any free block can be used to store a new file, many operating systems try to group together files in the same directory to maximize performance, or periodically reorganize files to reduce ].{{sfn|Anderson|Dahlin|2014|p=547}}

Maintaining data reliability in the face of a computer crash or hardware failure is another concern.{{sfn|Anderson|Dahlin|2014|pp=589, 591}} File writing protocols are designed with atomic operations so as not to leave permanent storage in a partially written, inconsistent state in the event of a crash at any point during writing.{{sfn|Anderson|Dahlin|2014|pp=591–592}} Data corruption is addressed by redundant storage (for example, RAID—]){{sfn|Tanenbaum|Bos|2023|pp=385–386}}{{sfn|Anderson|Dahlin|2014|p=592}} and ] to detect when data has been corrupted. With multiple layers of checksums and backups of a file, a system can recover from multiple hardware failures. Background processes are often used to detect and recover from data corruption.{{sfn|Anderson|Dahlin|2014|p=592}}

===Security===
{{Main|Computer security}}

Security means protecting users from other users of the same computer, as well as from those who seeking remote access to it over a network.{{sfn|Tanenbaum|Bos|2023|pp=605-606}} <!-- A ] is when a bug can be exploited to compromise the system or its data; an ] is the signal needed to trigger the bug causing the vulnerability.{{sfn|Tanenbaum|Bos|2023|p=606}} Often the goal of the attacker is to install ], whether in the form of a ], ], or ].{{sfn|Tanenbaum|Bos|2023|p=607}} --> Operating systems security rests on achieving the ]: confidentiality (unauthorized users cannot access data), integrity (unauthorized users cannot modify data), and availability (ensuring that the system remains available to authorized users, even in the event of a ]).{{sfn|Tanenbaum|Bos|2023|p=608}} As with other computer systems, isolating ]s—in the case of operating systems, the kernel, processes, and ]s—is key to achieving security.{{sfn|Tanenbaum|Bos|2023|p=609}} Other ways to increase security include simplicity to minimize the ], locking access to resources by default, checking all requests for authorization, ] (granting the minimum privilege essential for performing a task), ], and reducing shared data.{{sfn|Tanenbaum|Bos|2023|pp=609–610}}

Some operating system designs are more secure than others. Those with no isolation between the kernel and applications are least secure, while those with a ] like most general-purpose operating systems are still vulnerable if any part of the kernel is compromised. A more secure design features ]s that separate the kernel's privileges into many separate security domains and reduce the consequences of a single kernel breach.{{sfn|Tanenbaum|Bos|2023|p=612}} ]s are another approach that improves security by minimizing the kernel and separating out other operating systems functionality by application.{{sfn|Tanenbaum|Bos|2023|p=612}}

Most operating systems are written in ] or ], which create potential vulnerabilities for exploitation. Despite attempts to protect against them, vulnerabilities are caused by ] attacks, which are enabled by the lack of ].{{sfn|Tanenbaum|Bos|2023|pp=648, 657}} <!-- Other types of vulnerability in operating systems written in C and C++ include ]s, which exploit lack of ] to ],{{sfn|Tanenbaum|Bos|2023|pp=658, 661}} ]s that rely on ],{{sfn|Tanenbaum|Bos|2023|p=661}} and ]s that an attacker can exploit to crash a computer.{{sfn|Tanenbaum|Bos|2023|p=664}} --> Hardware vulnerabilities, some of them ], can also be used to compromise the operating system.{{sfn|Tanenbaum|Bos|2023|pp=668–669, 674}} There are known instances of operating system programmers deliberately implanting vulnerabilities, such as ]s.{{sfn|Tanenbaum|Bos|2023|pp=679–680}}

Operating systems security is hampered by their increasing complexity and the resulting inevitability of bugs.{{sfn|Tanenbaum|Bos|2023|pp=605, 617–618}} Because ] of operating systems may not be feasible, developers use operating system ] to reduce vulnerabilities,{{sfn|Tanenbaum|Bos|2023|pp=681–682}} e.g. ], ],{{sfn|Tanenbaum|Bos|2023|p=683}} ]s,{{sfn|Tanenbaum|Bos|2023|p=685}} and other techniques.{{sfn|Tanenbaum|Bos|2023|p=689}} There are no restrictions on who can contribute code to open source operating systems; such operating systems have transparent change histories and distributed governance structures.{{sfn|Richet|Bouaynaya|2023|p=92}} Open source developers strive to work collaboratively to find and eliminate security vulnerabilities, using ] and ] to expunge malicious code.{{sfn|Richet|Bouaynaya|2023|pp=92–93}}{{sfn|Berntsso|Strandén|Warg|2017|pp=130–131}} ] advises releasing the ] of all operating systems, arguing that it prevents developers from placing trust in secrecy and thus relying on the unreliable practice of ].{{sfn|Tanenbaum|Bos|2023|p=611}}

===User interface===
{{Main|Shell (computing){{!}}Operating system user interface}}

A ] (UI) is essential to support human interaction with a computer. The two most common user interface types for any computer are

*], where computer commands are typed, line-by-line,
*] (GUI) using a visual environment, most commonly a combination of the window, icon, menu, and pointer elements, also known as ].

For personal computers, including ]s and ]s, and for ]s, user input is typically from a combination of ], ], and ] or ], all of which are connected to the operating system with specialized software.{{sfn|Tanenbaum|Bos|2023|pp=396, 402}} Personal computer users who are not software developers or coders often prefer GUIs for both input and output; GUIs are supported by most personal computers.{{sfn|Tanenbaum|Bos|2023|pp=395, 408}} The software to support GUIs is more complex than a command line for input and plain text output. Plain text output is often preferred by programmers, and is easy to support.{{sfn|Tanenbaum|Bos|2023|p=402}}

==Operating system development as a hobby==
{{Main|Hobbyist operating system}}
A hobby operating system may be classified as one whose code has not been directly derived from an existing operating system, and has few users and active developers.<ref>{{cite web |last1=Holwerda |first1=Thom |title=My OS Is Less Hobby than Yours |url=https://www.osnews.com/story/22638/my-os-is-less-hobby-than-yours/ |website=OS News |access-date=4 June 2024 |date=20 December 2009}}</ref>

In some cases, hobby development is in support of a "]" computing device, for example, a simple ] powered by a ]. Or, development may be for an architecture already in widespread use. Operating system development may come from entirely new concepts, or may commence by modeling an existing operating system. In either case, the hobbyist is her/his own developer, or may interact with a small and sometimes unstructured group of individuals who have like interests.

Examples of hobby operating systems include ] and ].

==Diversity of operating systems and portability==
If an application is written for use on a specific operating system, and is ] to another OS, the functionality required by that application may be implemented differently by that OS (the names of functions, meaning of arguments, etc.) requiring the application to be adapted, changed, or otherwise ].<!--There really ought to be a discussion of ''software modules'' somewhere, such as those that are neither API's nor Plug-Ins (not sure what those are), but which are either hard (on cartridge), soft (on diskette), or otherwise installable by downloading). -->

This cost in supporting operating systems diversity can be avoided by instead writing applications against ]s such as ] or ]. These abstractions have already borne the cost of adaptation to specific operating systems and their ].

Another approach is for operating system vendors to adopt standards. For example, ] and ] provide commonalities that reduce porting costs.

==Popular operating systems==

{{Further|Usage share of operating systems|Comparison of operating systems}}
{{as of|2024|09|}}, ] is the most popular operating system with a 46% market share, followed by ] at 26%, ] and ] at 18%, ] at 5%, and ] at 1%. Android, iOS, and iPadOS are ]s, while Windows, macOS, and Linux are desktop operating systems.<ref>{{Cite web |title=Operating System Market Share Worldwide |url=https://gs.statcounter.com/os-market-share |access-date=2024-12-20 |website=StatCounter Global Stats |language=en}}</ref>

===Linux===
{{Main|Linux}}
]s of a Linux system]]
] is a ] distributed under the ] (GPL), which means that all of its derivatives are legally required to release their ].{{sfn|Silberschatz et al.|2018|pp=779–780}} Linux was designed by programmers for their own use, thus emphasizing simplicity and consistency, with a small number of basic elements that can be combined in nearly unlimited ways, and avoiding redundancy.{{sfn|Tanenbaum|Bos|2023|pp=713–714}}

Its design is similar to other UNIX systems not using a ].{{sfn|Silberschatz et al.|2018|p=780}} It is written in ]<ref>{{cite news |last1=Vaughan-Nichols |first1=Steven |title=Linus Torvalds prepares to move the Linux kernel to modern C |url=https://www.zdnet.com/article/linus-torvalds-prepares-to-move-the-linux-kernel-to-modern-c/ |access-date=7 February 2024 |work=ZDNET |date=2022 |language=en}}</ref> and uses ] syntax, but also supports ] syntax. Linux supports standard UNIX networking features, as well as the full suite of UNIX tools, while ] and employing ]. Initially of a minimalist design, Linux is a flexible system that can work in under 16 ] of ], but still is used on large ] systems.{{sfn|Silberschatz et al.|2018|p=780}} Similar to other UNIX systems, Linux ]s are composed of a ], ], and ].{{sfn|Silberschatz et al.|2018|p=781}} Linux has a ] (GUI) with a desktop, folder and file icons, as well as the option to access the operating system via a ].{{sfn|Tanenbaum|Bos|2023|pp=715–716}}

] is a partially open-source operating system closely based on Linux and has become the most widely used operating system by users, due to its popularity on ] and, to a lesser extent, ]s needing a GUI, such as "]es, ]s, airplane seatbacks, ], and ]s".{{sfn|Tanenbaum|Bos|2023|pp=793–794}} Unlike Linux, much of Android is written in ] and uses ].{{sfn|Tanenbaum|Bos|2023|p=793}}

===Microsoft Windows===
{{Main|Microsoft Windows}}
]
Windows is a ] operating system that is widely used on desktop computers, laptops, tablets, phones, ]s, ]s, and ] consoles.{{sfn|Tanenbaum|Bos|2023|p=871}} The operating system was designed for "security, reliability, compatibility, high performance, extensibility, portability, and international support"—later on, ] and support for ]s also became priorities.{{sfn|Silberschatz et al.|2018|p=826}}

] works via ] for important data structures like processes, threads, and sections (memory objects, for example files).{{sfn|Tanenbaum|Bos|2023|p=1035}} The operating system supports ] of ], which speeds up I/O for many applications. I/O ] use the ].{{sfn|Tanenbaum|Bos|2023|p=1035}} The ] file system has a master table and each file is represented as a ] with ].{{sfn|Tanenbaum|Bos|2023|p=1036}} The scheduling includes ].{{sfn|Silberschatz et al.|2018|p=821}} Windows has many security features;{{sfn|Silberschatz et al.|2018|p=827}} especially important are the use of ]s and ]. Every process has an authentication token and each object is given a security descriptor. Later releases have added even more security features.{{sfn|Tanenbaum|Bos|2023|p=1036}}


==See also== ==See also==
{{div col}}
===General topics===
* ]
*]
* ]
*]
*] * ]
*] * ]
*] * ]
* ]
*]
* ]
*]
*] * ]
* ]
*]
* ]
*]
* ]
*] - computer clichés in movies and television
* ]
* ]
{{div col end}}


===Other topics=== ==Notes==
{{Notelist}}
*] ] &ndash; ] &ndash; ] &ndash; ] &ndash; ] &ndash; ]
*] and ] ] (SMP) &ndash; ] &ndash; ]
*] &ndash; ] &ndash; ] &ndash; ] &ndash; ] &ndash; ]
*] capabilities versus ]s
*]
*]s
*]
*] OS - Operating Systems bootable from a CD without need of hard disk installation.
*]
*] (] of operating systems)


==References== ==References==
{{section-stub}} {{Reflist|30em}}

*{{cite book
==Further reading==
| last = Deitel
{{Refbegin}}
| first = Harvey M.
*{{cite book |last1=Anderson |first1=Thomas |last2=Dahlin |first2=Michael |author1-link=Thomas E. Anderson |title=Operating Systems: Principles and Practice |date=2014 |publisher=Recursive Books |isbn=978-0-9856735-2-9 |language=en}}
| coauthors = Deitel, Paul; Choffnes, David
* {{cite journal |last1=Auslander |first1=M. A. |last2=Larkin |first2=D. C. |last3=Scherr |first3=A. L. |title=The Evolution of the MVS Operating System |journal=IBM Journal of Research and Development |date=September 1981 |volume=25 |issue=5 |pages=471–482 |doi=10.1147/rd.255.0471|issn=0018-8646 }}
| title = Operating Systems
*{{cite book |last1=Berntsson |first1=Petter Sainio |last2=Strandén |first2=Lars |last3=Warg |first3=Fredrik |title=Evaluation of Open Source Operating Systems for Safety-Critical Applications |date=2017 |publisher=Springer International Publishing |isbn=978-3-319-65948-0 |pages=117–132 |language=en}}
| publisher = Pearson/Prentice Hall
* {{cite book | last = Deitel | first = Harvey M. | author2 = Deitel, Paul | author3 = Choffnes, David | title = Operating Systems | date = 25 December 2015 | publisher = Pearson/Prentice Hall | isbn = 978-0-13-092641-8 | url-access = registration | url = https://archive.org/details/modernoperatings00tane }}
| year = 2004
* {{cite book | last = Bic| first = Lubomur F. |author2=Shaw, Alan C. | title = Operating Systems | publisher = ] | year = 2003 | location = Pearson }}
| location = Upper Saddle River, NJ
* {{cite book | last = Silberschatz | first = Avi |author2=Galvin, Peter |author3=Gagne, Greg | title = Operating Systems Concepts | publisher = ] | year = 2008 | isbn = 978-0-470-12872-5 }}
| id = ISBN 0-13-182827-4 }}
* O'Brien, J. A., & Marakas, G. M.(2011). ''Management Information Systems''. 10e. McGraw-Hill Irwin.
*{{cite book
* {{cite book |last1=Leva |first1=Alberto |last2=Maggio |first2=Martina |last3=Papadopoulos |first3=Alessandro Vittorio |last4=Terraneo |first4=Federico |title=Control-based Operating System Design |publisher=] |year=2013 |isbn=978-1-84919-609-3}}
| last = Silberschatz
*{{cite journal |last1=Richet |first1=Jean-Loup |last2=Bouaynaya |first2=Wafa |title=Understanding and Managing Complex Software Vulnerabilities: An Empirical Analysis of Open-Source Operating Systems |journal=Systèmes d'information & management |date=2023 |volume=28 |issue=1 |pages=87–114 |doi=10.54695/sim.28.1.0087 |doi-broken-date=1 November 2024 |url=https://www.cairn.info/revue-systemes-d-information-et-management-2023-1-page-87.htm.}}
| first = Abraham
*{{cite book |last1=Silberschatz |first1=Abraham |last2=Galvin |first2=Peter B. |last3=Gagne |first3=Greg |title=Operating System Concepts |date=2018 |publisher=Wiley |isbn=978-1-119-32091-3 |edition=10 |url=https://archive.org/details/operating-system-concepts-10th |language=en-us|ref={{sfnref|Silberschatz et al.|2018}}}}
| coauthors = Galvin, Peter Baer; Gagne, Greg
*{{cite book |last1=Tanenbaum |first1=Andrew S. |last2=Bos |first2=Herbert |title=Modern Operating Systems, Global Edition |date=2023 |publisher=Pearson Higher Ed |isbn=978-1-292-72789-9 |language=en}}
| title = Operating System Concepts
{{Refend}}
| publisher = John Wiley & Sons
| year = 2004
| location = Hoboken, NJ
| pages =
| id = ISBN 0-471-69466-5 }}
*{{cite book
| last = Tanenbaum
| first = Andrew S.
| coauthors = Woodhull, Albert S.
| title = Operating Systems. Design and Implementation
| publisher = Pearson/Prentice Hall
| year = 2006
| location = Upper Saddle River, N.J.
| id = ISBN 0-13-142938-8 }}


==External links== ==External links==
{{wiktionary}} {{Wiktionary}}
{{Commons category|Operating systems}}
*
{{Wikiversity|Operating Systems}}
* and the history of operating systems
* and the history of operating systems


] {{Operating system}}
{{Link FA|zh}} {{Computer science}}
{{Authority control}}


]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]
]

Latest revision as of 14:48, 31 December 2024

Software that manages computer hardware resources

Operating systems
UserApplicationOperating systemHardware
Common features

An operating system (OS) is system software that manages computer hardware and software resources, and provides common services for computer programs.

Time-sharing operating systems schedule tasks for efficient use of the system and may also include accounting software for cost allocation of processor time, mass storage, peripherals, and other resources.

For hardware functions such as input and output and memory allocation, the operating system acts as an intermediary between programs and the computer hardware, although the application code is usually executed directly by the hardware and frequently makes system calls to an OS function or is interrupted by it. Operating systems are found on many devices that contain a computer – from cellular phones and video game consoles to web servers and supercomputers.

As of September 2024, Android is the most popular operating system with a 46% market share, followed by Microsoft Windows at 26%, iOS and iPadOS at 18%, macOS at 5%, and Linux at 1%. Android, iOS, and iPadOS are mobile operating systems, while Windows, macOS, and Linux are desktop operating systems. Linux distributions are dominant in the server and supercomputing sectors. Other specialized classes of operating systems (special-purpose operating systems), such as embedded and real-time systems, exist for many applications. Security-focused operating systems also exist. Some operating systems have low system requirements (e.g. light-weight Linux distribution). Others may have higher system requirements.

Some operating systems require installation or may come pre-installed with purchased computers (OEM-installation), whereas others may run directly from media (i.e. live CD) or flash memory (i.e. USB stick).

Definition and purpose

An operating system is difficult to define, but has been called "the layer of software that manages a computer's resources for its users and their applications". Operating systems include the software that is always running, called a kernel—but can include other software as well. The two other types of programs that can run on a computer are system programs—which are associated with the operating system, but may not be part of the kernel—and applications—all other software.

There are three main purposes that an operating system fulfills:

  • Operating systems allocate resources between different applications, deciding when they will receive central processing unit (CPU) time or space in memory. On modern personal computers, users often want to run several applications at once. In order to ensure that one program cannot monopolize the computer's limited hardware resources, the operating system gives each application a share of the resource, either in time (CPU) or space (memory). The operating system also must isolate applications from each other to protect them from errors and security vulnerabilities in another application's code, but enable communications between different applications.
  • Operating systems provide an interface that abstracts the details of accessing hardware details (such as physical memory) to make things easier for programmers. Virtualization also enables the operating system to mask limited hardware resources; for example, virtual memory can provide a program with the illusion of nearly unlimited memory that exceeds the computer's actual memory.
  • Operating systems provide common services, such as an interface for accessing network and disk devices. This enables an application to be run on different hardware without needing to be rewritten. Which services to include in an operating system varies greatly, and this functionality makes up the great majority of code for most operating systems.

Types of operating systems

Multicomputer operating systems

With multiprocessors multiple CPUs share memory. A multicomputer or cluster computer has multiple CPUs, each of which has its own memory. Multicomputers were developed because large multiprocessors are difficult to engineer and prohibitively expensive; they are universal in cloud computing because of the size of the machine needed. The different CPUs often need to send and receive messages to each other; to ensure good performance, the operating systems for these machines need to minimize this copying of packets. Newer systems are often multiqueue—separating groups of users into separate queues—to reduce the need for packet copying and support more concurrent users. Another technique is remote direct memory access, which enables each CPU to access memory belonging to other CPUs. Multicomputer operating systems often support remote procedure calls where a CPU can call a procedure on another CPU, or distributed shared memory, in which the operating system uses virtualization to generate shared memory that does not physically exist.

Distributed systems

A distributed system is a group of distinct, networked computers—each of which might have their own operating system and file system. Unlike multicomputers, they may be dispersed anywhere in the world. Middleware, an additional software layer between the operating system and applications, is often used to improve consistency. Although it functions similarly to an operating system, it is not a true operating system.

Embedded

Embedded operating systems are designed to be used in embedded computer systems, whether they are internet of things objects or not connected to a network. Embedded systems include many household appliances. The distinguishing factor is that they do not load user-installed software. Consequently, they do not need protection between different applications, enabling simpler designs. Very small operating systems might run in less than 10 kilobytes, and the smallest are for smart cards. Examples include Embedded Linux, QNX, VxWorks, and the extra-small systems RIOT and TinyOS.

Real-time

A real-time operating system is an operating system that guarantees to process events or data by or at a specific moment in time. Hard real-time systems require exact timing and are common in manufacturing, avionics, military, and other similar uses. With soft real-time systems, the occasional missed event is acceptable; this category often includes audio or multimedia systems, as well as smartphones. In order for hard real-time systems be sufficiently exact in their timing, often they are just a library with no protection between applications, such as eCos.

Hypervisor

A hypervisor is an operating system that runs a virtual machine. The virtual machine is unaware that it is an application and operates as if it had its own hardware. Virtual machines can be paused, saved, and resumed, making them useful for operating systems research, development, and debugging. They also enhance portability by enabling applications to be run on a computer even if they are not compatible with the base operating system.

Library

A library operating system (libOS) is one in which the services that a typical operating system provides, such as networking, are provided in the form of libraries and composed with a single application and configuration code to construct a unikernel: a specialized (only the absolute necessary pieces of code are extracted from libraries and bound together ), single address space, machine image that can be deployed to cloud or embedded environments.

The operating system code and application code are not executed in separated protection domains (there is only a single application running, at least conceptually, so there is no need to prevent interference between applications) and OS services are accessed via simple library calls (potentially inlining them based on compiler thresholds), without the usual overhead of context switches, in a way similarly to embedded and real-time OSes. Note that this overhead is not negligible: to the direct cost of mode switching it's necessary to add the indirect pollution of important processor structures (like CPU caches, the instruction pipeline, and so on) which affects both user-mode and kernel-mode performance.

History

Main article: History of operating systems
IBM System/360 Model 50 operator's console and CPU; the operator's console is a terminal used by the operating system to communicate with the operator.

The first computers in the late 1940s and 1950s were directly programmed either with plugboards or with machine code inputted on media such as punch cards, without programming languages or operating systems. After the introduction of the transistor in the mid-1950s, mainframes began to be built. These still needed professional operators who manually do what a modern operating system would do, such as scheduling programs to run, but mainframes still had rudimentary operating systems such as Fortran Monitor System (FMS) and IBSYS. In the 1960s, IBM introduced the first series of intercompatible computers (System/360). All of them ran the same operating system—OS/360—which consisted of millions of lines of assembly language that had thousands of bugs. The OS/360 also was the first popular operating system to support multiprogramming, such that the CPU could be put to use on one job while another was waiting on input/output (I/O). Holding multiple jobs in memory necessitated memory partitioning and safeguards against one job accessing the memory allocated to a different one.

Around the same time, teleprinters began to be used as terminals so multiple users could access the computer simultaneously. The operating system MULTICS was intended to allow hundreds of users to access a large computer. Despite its limited adoption, it can be considered the precursor to cloud computing. The UNIX operating system originated as a development of MULTICS for a single user. Because UNIX's source code was available, it became the basis of other, incompatible operating systems, of which the most successful were AT&T's System V and the University of California's Berkeley Software Distribution (BSD). To increase compatibility, the IEEE released the POSIX standard for operating system application programming interfaces (APIs), which is supported by most UNIX systems. MINIX was a stripped-down version of UNIX, developed in 1987 for educational uses, that inspired the commercially available, free software Linux. Since 2008, MINIX is used in controllers of most Intel microchips, while Linux is widespread in data centers and Android smartphones.

Microcomputers

Command-line interface of the MS-DOS operating system
Graphical user interface of a Macintosh

The invention of large scale integration enabled the production of personal computers (initially called microcomputers) from around 1980. For around five years, the CP/M (Control Program for Microcomputers) was the most popular operating system for microcomputers. Later, IBM bought the DOS (Disk Operating System) from Microsoft. After modifications requested by IBM, the resulting system was called MS-DOS (MicroSoft Disk Operating System) and was widely used on IBM microcomputers. Later versions increased their sophistication, in part by borrowing features from UNIX.

Apple's Macintosh was the first popular computer to use a graphical user interface (GUI). The GUI proved much more user friendly than the text-only command-line interface earlier operating systems had used. Following the success of Macintosh, MS-DOS was updated with a GUI overlay called Windows. Windows later was rewritten as a stand-alone operating system, borrowing so many features from another (VAX VMS) that a large legal settlement was paid. In the twenty-first century, Windows continues to be popular on personal computers but has less market share of servers. UNIX operating systems, especially Linux, are the most popular on enterprise systems and servers but are also used on mobile devices and many other computer systems.

On mobile devices, Symbian OS was dominant at first, being usurped by BlackBerry OS (introduced 2002) and iOS for iPhones (from 2007). Later on, the open-source Android operating system (introduced 2008), with a Linux kernel and a C library (Bionic) partially based on BSD code, became most popular.

Components

The components of an operating system are designed to ensure that various parts of a computer function cohesively. With the de facto obsoletion of DOS, all user software must interact with the operating system to access hardware.

Kernel

Main article: Kernel (operating system)
A kernel connects the application software to the hardware of a computer.

The kernel is the part of the operating system that provides protection between different applications and users. This protection is key to improving reliability by keeping errors isolated to one program, as well as security by limiting the power of malicious software and protecting private data, and ensuring that one program cannot monopolize the computer's resources. Most operating systems have two modes of operation: in user mode, the hardware checks that the software is only executing legal instructions, whereas the kernel has unrestricted powers and is not subject to these checks. The kernel also manages memory for other processes and controls access to input/output devices.

Program execution

The operating system provides an interface between an application program and the computer hardware, so that an application program can interact with the hardware only by obeying rules and procedures programmed into the operating system. The operating system is also a set of services which simplify development and execution of application programs. Executing an application program typically involves the creation of a process by the operating system kernel, which assigns memory space and other resources, establishes a priority for the process in multi-tasking systems, loads program binary code into memory, and initiates execution of the application program, which then interacts with the user and with hardware devices. However, in some systems an application can request that the operating system execute another application within the same process, either as a subroutine or in a separate thread, e.g., the LINK and ATTACH facilities of OS/360 and successors.

Interrupts

Main article: Interrupt

An interrupt (also known as an abort, exception, fault, signal, or trap) provides an efficient way for most operating systems to react to the environment. Interrupts cause the central processing unit (CPU) to have a control flow change away from the currently running program to an interrupt handler, also known as an interrupt service routine (ISR). An interrupt service routine may cause the central processing unit (CPU) to have a context switch. The details of how a computer processes an interrupt vary from architecture to architecture, and the details of how interrupt service routines behave vary from operating system to operating system. However, several interrupt functions are common. The architecture and operating system must:

  1. transfer control to an interrupt service routine.
  2. save the state of the currently running process.
  3. restore the state after the interrupt is serviced.
Software interrupt

A software interrupt is a message to a process that an event has occurred. This contrasts with a hardware interrupt — which is a message to the central processing unit (CPU) that an event has occurred. Software interrupts are similar to hardware interrupts — there is a change away from the currently running process. Similarly, both hardware and software interrupts execute an interrupt service routine.

Software interrupts may be normally occurring events. It is expected that a time slice will occur, so the kernel will have to perform a context switch. A computer program may set a timer to go off after a few seconds in case too much data causes an algorithm to take too long.

Software interrupts may be error conditions, such as a malformed machine instruction. However, the most common error conditions are division by zero and accessing an invalid memory address.

Users can send messages to the kernel to modify the behavior of a currently running process. For example, in the command-line environment, pressing the interrupt character (usually Control-C) might terminate the currently running process.

To generate software interrupts for x86 CPUs, the INT assembly language instruction is available. The syntax is INT X, where X is the offset number (in hexadecimal format) to the interrupt vector table.

Signal

To generate software interrupts in Unix-like operating systems, the kill(pid,signum) system call will send a signal to another process. pid is the process identifier of the receiving process. signum is the signal number (in mnemonic format) to be sent. (The abrasive name of kill was chosen because early implementations only terminated the process.)

In Unix-like operating systems, signals inform processes of the occurrence of asynchronous events. To communicate asynchronously, interrupts are required. One reason a process needs to asynchronously communicate to another process solves a variation of the classic reader/writer problem. The writer receives a pipe from the shell for its output to be sent to the reader's input stream. The command-line syntax is alpha | bravo. alpha will write to the pipe when its computation is ready and then sleep in the wait queue. bravo will then be moved to the ready queue and soon will read from its input stream. The kernel will generate software interrupts to coordinate the piping.

Signals may be classified into 7 categories. The categories are:

  1. when a process finishes normally.
  2. when a process has an error exception.
  3. when a process runs out of a system resource.
  4. when a process executes an illegal instruction.
  5. when a process sets an alarm event.
  6. when a process is aborted from the keyboard.
  7. when a process has a tracing alert for debugging.
Hardware interrupt

Input/output (I/O) devices are slower than the CPU. Therefore, it would slow down the computer if the CPU had to wait for each I/O to finish. Instead, a computer may implement interrupts for I/O completion, avoiding the need for polling or busy waiting.

Some computers require an interrupt for each character or word, costing a significant amount of CPU time. Direct memory access (DMA) is an architecture feature to allow devices to bypass the CPU and access main memory directly. (Separate from the architecture, a device may perform direct memory access to and from main memory either directly or via a bus.)

Input/output

Interrupt-driven I/O
This section needs expansion. You can help by making an edit requestadding to it . (April 2022)

When a computer user types a key on the keyboard, typically the character appears immediately on the screen. Likewise, when a user moves a mouse, the cursor immediately moves across the screen. Each keystroke and mouse movement generates an interrupt called Interrupt-driven I/O. An interrupt-driven I/O occurs when a process causes an interrupt for every character or word transmitted.

Direct memory access

Devices such as hard disk drives, solid-state drives, and magnetic tape drives can transfer data at a rate high enough that interrupting the CPU for every byte or word transferred, and having the CPU transfer the byte or word between the device and memory, would require too much CPU time. Data is, instead, transferred between the device and memory independently of the CPU by hardware such as a channel or a direct memory access controller; an interrupt is delivered only when all the data is transferred.

If a computer program executes a system call to perform a block I/O write operation, then the system call might execute the following instructions:

  • Set the contents of the CPU's registers (including the program counter) into the process control block.
  • Create an entry in the device-status table. The operating system maintains this table to keep track of which processes are waiting for which devices. One field in the table is the memory address of the process control block.
  • Place all the characters to be sent to the device into a memory buffer.
  • Set the memory address of the memory buffer to a predetermined device register.
  • Set the buffer size (an integer) to another predetermined register.
  • Execute the machine instruction to begin the writing.
  • Perform a context switch to the next process in the ready queue.

While the writing takes place, the operating system will context switch to other processes as normal. When the device finishes writing, the device will interrupt the currently running process by asserting an interrupt request. The device will also place an integer onto the data bus. Upon accepting the interrupt request, the operating system will:

  • Push the contents of the program counter (a register) followed by the status register onto the call stack.
  • Push the contents of the other registers onto the call stack. (Alternatively, the contents of the registers may be placed in a system table.)
  • Read the integer from the data bus. The integer is an offset to the interrupt vector table. The vector table's instructions will then:
  • Access the device-status table.
  • Extract the process control block.
  • Perform a context switch back to the writing process.

When the writing process has its time slice expired, the operating system will:

  • Pop from the call stack the registers other than the status register and program counter.
  • Pop from the call stack the status register.
  • Pop from the call stack the address of the next instruction, and set it back into the program counter.

With the program counter now reset, the interrupted process will resume its time slice.

Memory management

Main article: Memory management

Among other things, a multiprogramming operating system kernel must be responsible for managing all system memory which is currently in use by the programs. This ensures that a program does not interfere with memory already in use by another program. Since programs time share, each program must have independent access to memory.

Cooperative memory management, used by many early operating systems, assumes that all programs make voluntary use of the kernel's memory manager, and do not exceed their allocated memory. This system of memory management is almost never seen any more, since programs often contain bugs which can cause them to exceed their allocated memory. If a program fails, it may cause memory used by one or more other programs to be affected or overwritten. Malicious programs or viruses may purposefully alter another program's memory, or may affect the operation of the operating system itself. With cooperative memory management, it takes only one misbehaved program to crash the system.

Memory protection enables the kernel to limit a process' access to the computer's memory. Various methods of memory protection exist, including memory segmentation and paging. All methods require some level of hardware support (such as the 80286 MMU), which does not exist in all computers.

In both segmentation and paging, certain protected mode registers specify to the CPU what memory address it should allow a running program to access. Attempts to access other addresses trigger an interrupt, which causes the CPU to re-enter supervisor mode, placing the kernel in charge. This is called a segmentation violation or Seg-V for short, and since it is both difficult to assign a meaningful result to such an operation, and because it is usually a sign of a misbehaving program, the kernel generally resorts to terminating the offending program, and reports the error.

Windows versions 3.1 through ME had some level of memory protection, but programs could easily circumvent the need to use it. A general protection fault would be produced, indicating a segmentation violation had occurred; however, the system would often crash anyway.

Virtual memory

Main article: Virtual memory Further information: Page fault
Many operating systems can "trick" programs into using memory scattered around the hard disk and RAM as if it is one continuous chunk of memory, called virtual memory.

The use of virtual memory addressing (such as paging or segmentation) means that the kernel can choose what memory each program may use at any given time, allowing the operating system to use the same memory locations for multiple tasks.

If a program tries to access memory that is not accessible memory, but nonetheless has been allocated to it, the kernel is interrupted (see § Memory management). This kind of interrupt is typically a page fault.

When the kernel detects a page fault it generally adjusts the virtual memory range of the program which triggered it, granting it access to the memory requested. This gives the kernel discretionary power over where a particular application's memory is stored, or even whether or not it has been allocated yet.

In modern operating systems, memory which is accessed less frequently can be temporarily stored on a disk or other media to make that space available for use by other programs. This is called swapping, as an area of memory can be used by multiple programs, and what that memory area contains can be swapped or exchanged on demand.

Virtual memory provides the programmer or the user with the perception that there is a much larger amount of RAM in the computer than is really there.

Concurrency

See also: Computer multitasking and Process management (computing)

Concurrency refers to the operating system's ability to carry out multiple tasks simultaneously. Virtually all modern operating systems support concurrency.

Threads enable splitting a process' work into multiple parts that can run simultaneously. The number of threads is not limited by the number of processors available. If there are more threads than processors, the operating system kernel schedules, suspends, and resumes threads, controlling when each thread runs and how much CPU time it receives. During a context switch a running thread is suspended, its state is saved into the thread control block and stack, and the state of the new thread is loaded in. Historically, on many systems a thread could run until it relinquished control (cooperative multitasking). Because this model can allow a single thread to monopolize the processor, most operating systems now can interrupt a thread (preemptive multitasking).

Threads have their own thread ID, program counter (PC), a register set, and a stack, but share code, heap data, and other resources with other threads of the same process. Thus, there is less overhead to create a thread than a new process. On single-CPU systems, concurrency is switching between processes. Many computers have multiple CPUs. Parallelism with multiple threads running on different CPUs can speed up a program, depending on how much of it can be executed concurrently.

File system

Main article: File system See also: Virtual file system
File systems allow users and programs to organize and sort files on a computer, often through the use of directories (or folders).

Permanent storage devices used in twenty-first century computers, unlike volatile dynamic random-access memory (DRAM), are still accessible after a crash or power failure. Permanent (non-volatile) storage is much cheaper per byte, but takes several orders of magnitude longer to access, read, and write. The two main technologies are a hard drive consisting of magnetic disks, and flash memory (a solid-state drive that stores data in electrical circuits). The latter is more expensive but faster and more durable.

File systems are an abstraction used by the operating system to simplify access to permanent storage. They provide human-readable filenames and other metadata, increase performance via amortization of accesses, prevent multiple threads from accessing the same section of memory, and include checksums to identify corruption. File systems are composed of files (named collections of data, of an arbitrary size) and directories (also called folders) that list human-readable filenames and other directories. An absolute file path begins at the root directory and lists subdirectories divided by punctuation, while a relative path defines the location of a file from a directory.

System calls (which are sometimes wrapped by libraries) enable applications to create, delete, open, and close files, as well as link, read, and write to them. All these operations are carried out by the operating system on behalf of the application. The operating system's efforts to reduce latency include storing recently requested blocks of memory in a cache and prefetching data that the application has not asked for, but might need next. Device drivers are software specific to each input/output (I/O) device that enables the operating system to work without modification over different hardware.

Another component of file systems is a dictionary that maps a file's name and metadata to the data block where its contents are stored. Most file systems use directories to convert file names to file numbers. To find the block number, the operating system uses an index (often implemented as a tree). Separately, there is a free space map to track free blocks, commonly implemented as a bitmap. Although any free block can be used to store a new file, many operating systems try to group together files in the same directory to maximize performance, or periodically reorganize files to reduce fragmentation.

Maintaining data reliability in the face of a computer crash or hardware failure is another concern. File writing protocols are designed with atomic operations so as not to leave permanent storage in a partially written, inconsistent state in the event of a crash at any point during writing. Data corruption is addressed by redundant storage (for example, RAID—redundant array of inexpensive disks) and checksums to detect when data has been corrupted. With multiple layers of checksums and backups of a file, a system can recover from multiple hardware failures. Background processes are often used to detect and recover from data corruption.

Security

Main article: Computer security

Security means protecting users from other users of the same computer, as well as from those who seeking remote access to it over a network. Operating systems security rests on achieving the CIA triad: confidentiality (unauthorized users cannot access data), integrity (unauthorized users cannot modify data), and availability (ensuring that the system remains available to authorized users, even in the event of a denial of service attack). As with other computer systems, isolating security domains—in the case of operating systems, the kernel, processes, and virtual machines—is key to achieving security. Other ways to increase security include simplicity to minimize the attack surface, locking access to resources by default, checking all requests for authorization, principle of least authority (granting the minimum privilege essential for performing a task), privilege separation, and reducing shared data.

Some operating system designs are more secure than others. Those with no isolation between the kernel and applications are least secure, while those with a monolithic kernel like most general-purpose operating systems are still vulnerable if any part of the kernel is compromised. A more secure design features microkernels that separate the kernel's privileges into many separate security domains and reduce the consequences of a single kernel breach. Unikernels are another approach that improves security by minimizing the kernel and separating out other operating systems functionality by application.

Most operating systems are written in C or C++, which create potential vulnerabilities for exploitation. Despite attempts to protect against them, vulnerabilities are caused by buffer overflow attacks, which are enabled by the lack of bounds checking. Hardware vulnerabilities, some of them caused by CPU optimizations, can also be used to compromise the operating system. There are known instances of operating system programmers deliberately implanting vulnerabilities, such as back doors.

Operating systems security is hampered by their increasing complexity and the resulting inevitability of bugs. Because formal verification of operating systems may not be feasible, developers use operating system hardening to reduce vulnerabilities, e.g. address space layout randomization, control-flow integrity, access restrictions, and other techniques. There are no restrictions on who can contribute code to open source operating systems; such operating systems have transparent change histories and distributed governance structures. Open source developers strive to work collaboratively to find and eliminate security vulnerabilities, using code review and type checking to expunge malicious code. Andrew S. Tanenbaum advises releasing the source code of all operating systems, arguing that it prevents developers from placing trust in secrecy and thus relying on the unreliable practice of security by obscurity.

User interface

Main article: Operating system user interface

A user interface (UI) is essential to support human interaction with a computer. The two most common user interface types for any computer are

For personal computers, including smartphones and tablet computers, and for workstations, user input is typically from a combination of keyboard, mouse, and trackpad or touchscreen, all of which are connected to the operating system with specialized software. Personal computer users who are not software developers or coders often prefer GUIs for both input and output; GUIs are supported by most personal computers. The software to support GUIs is more complex than a command line for input and plain text output. Plain text output is often preferred by programmers, and is easy to support.

Operating system development as a hobby

Main article: Hobbyist operating system

A hobby operating system may be classified as one whose code has not been directly derived from an existing operating system, and has few users and active developers.

In some cases, hobby development is in support of a "homebrew" computing device, for example, a simple single-board computer powered by a 6502 microprocessor. Or, development may be for an architecture already in widespread use. Operating system development may come from entirely new concepts, or may commence by modeling an existing operating system. In either case, the hobbyist is her/his own developer, or may interact with a small and sometimes unstructured group of individuals who have like interests.

Examples of hobby operating systems include Syllable and TempleOS.

Diversity of operating systems and portability

If an application is written for use on a specific operating system, and is ported to another OS, the functionality required by that application may be implemented differently by that OS (the names of functions, meaning of arguments, etc.) requiring the application to be adapted, changed, or otherwise maintained.

This cost in supporting operating systems diversity can be avoided by instead writing applications against software platforms such as Java or Qt. These abstractions have already borne the cost of adaptation to specific operating systems and their system libraries.

Another approach is for operating system vendors to adopt standards. For example, POSIX and OS abstraction layers provide commonalities that reduce porting costs.

Popular operating systems

Further information: Usage share of operating systems and Comparison of operating systems

As of September 2024, Android is the most popular operating system with a 46% market share, followed by Microsoft Windows at 26%, iOS and iPadOS at 18%, macOS at 5%, and Linux at 1%. Android, iOS, and iPadOS are mobile operating systems, while Windows, macOS, and Linux are desktop operating systems.

Linux

Main article: Linux
Layers of a Linux system

Linux is a free software distributed under the GNU General Public License (GPL), which means that all of its derivatives are legally required to release their source code. Linux was designed by programmers for their own use, thus emphasizing simplicity and consistency, with a small number of basic elements that can be combined in nearly unlimited ways, and avoiding redundancy.

Its design is similar to other UNIX systems not using a microkernel. It is written in C and uses UNIX System V syntax, but also supports BSD syntax. Linux supports standard UNIX networking features, as well as the full suite of UNIX tools, while supporting multiple users and employing preemptive multitasking. Initially of a minimalist design, Linux is a flexible system that can work in under 16 MB of RAM, but still is used on large multiprocessor systems. Similar to other UNIX systems, Linux distributions are composed of a kernel, system libraries, and system utilities. Linux has a graphical user interface (GUI) with a desktop, folder and file icons, as well as the option to access the operating system via a command line.

Android is a partially open-source operating system closely based on Linux and has become the most widely used operating system by users, due to its popularity on smartphones and, to a lesser extent, embedded systems needing a GUI, such as "smart watches, automotive dashboards, airplane seatbacks, medical devices, and home appliances". Unlike Linux, much of Android is written in Java and uses object-oriented design.

Microsoft Windows

Main article: Microsoft Windows
Security descriptor for a file that is read-only by default, specified no access for Elvis, read/write access for Cathy, and full access for Ida, the owner of the file

Windows is a proprietary operating system that is widely used on desktop computers, laptops, tablets, phones, workstations, enterprise servers, and Xbox consoles. The operating system was designed for "security, reliability, compatibility, high performance, extensibility, portability, and international support"—later on, energy efficiency and support for dynamic devices also became priorities.

Windows Executive works via kernel-mode objects for important data structures like processes, threads, and sections (memory objects, for example files). The operating system supports demand paging of virtual memory, which speeds up I/O for many applications. I/O device drivers use the Windows Driver Model. The NTFS file system has a master table and each file is represented as a record with metadata. The scheduling includes preemptive multitasking. Windows has many security features; especially important are the use of access-control lists and integrity levels. Every process has an authentication token and each object is given a security descriptor. Later releases have added even more security features.

See also

Notes

  1. Modern CPUs provide instructions (e.g. SYSENTER) to invoke selected kernel services without an interrupts. Visit https://wiki.osdev.org/SYSENTER for more information.
  2. Examples include SIGINT, SIGSEGV, and SIGBUS.
  3. often in the form of a DMA chip for smaller systems and I/O channels for larger systems
  4. Modern motherboards have a DMA controller. Additionally, a device may also have one. Visit SCSI RDMA Protocol.
  5. There are several reasons that the memory might be inaccessible
    • The address might be out of range
    • The address might refer to a page or segment that has been moved to a backing store
    • The address might refer to memory that has restricted access due to, e.g., key, ring.

References

  1. Stallings (2005). Operating Systems, Internals and Design Principles. Pearson: Prentice Hall. p. 6.
  2. Dhotre, I.A. (2009). Operating Systems. Technical Publications. p. 1.
  3. "Operating System Market Share Worldwide". StatCounter Global Stats. Retrieved 20 December 2024.
  4. "VII. Special-Purpose Systems - Operating System Concepts, Seventh Edition [Book]". www.oreilly.com. Archived from the original on 13 June 2021. Retrieved 8 February 2021.
  5. "Special-Purpose Operating Systems - RWTH AACHEN UNIVERSITY Institute for Automation of Complex Power Systems - English". www.acs.eonerc.rwth-aachen.de. Archived from the original on 14 June 2021. Retrieved 8 February 2021.
  6. ^ Tanenbaum & Bos 2023, p. 4.
  7. Anderson & Dahlin 2014, p. 6.
  8. ^ Silberschatz et al. 2018, p. 6.
  9. ^ Anderson & Dahlin 2014, p. 7.
  10. Anderson & Dahlin 2014, pp. 9–10.
  11. Tanenbaum & Bos 2023, pp. 6–7.
  12. Anderson & Dahlin 2014, p. 10.
  13. Tanenbaum & Bos 2023, p. 5.
  14. ^ Anderson & Dahlin 2014, p. 11.
  15. Anderson & Dahlin 2014, pp. 7, 9, 13.
  16. Anderson & Dahlin 2014, pp. 12–13.
  17. Tanenbaum & Bos 2023, p. 557.
  18. Tanenbaum & Bos 2023, p. 558.
  19. ^ Tanenbaum & Bos 2023, p. 565.
  20. Tanenbaum & Bos 2023, p. 562.
  21. Tanenbaum & Bos 2023, p. 563.
  22. Tanenbaum & Bos 2023, p. 569.
  23. Tanenbaum & Bos 2023, p. 571.
  24. Tanenbaum & Bos 2023, p. 579.
  25. Tanenbaum & Bos 2023, p. 581.
  26. Tanenbaum & Bos 2023, pp. 37–38.
  27. Tanenbaum & Bos 2023, p. 39.
  28. ^ Tanenbaum & Bos 2023, p. 38.
  29. Silberschatz et al. 2018, pp. 701.
  30. Silberschatz et al. 2018, pp. 705.
  31. Anderson & Dahlin 2014, p. 12.
  32. Madhavapeddy, Anil; Scott, David J (November 2013). "Unikernels: Rise of the Virtual Library Operating System: What if all the software layers in a virtual appliance were compiled within the same safe, high-level language framework?". Queue. Vol. 11, no. 11. New York, NY, USA: ACM. pp. 30–44. doi:10.1145/2557963.2566628. ISSN 1542-7730. Retrieved 7 August 2024.
  33. "Build Process - Unikraft". Archived from the original on 22 April 2024. Retrieved 8 August 2024.
  34. "Leave your OS at home: the rise of library operating systems". ACM SIGARCH. 14 September 2017. Archived from the original on 1 March 2024. Retrieved 7 August 2024.
  35. Soares, Livio Baldini; Stumm, Michael (4 October 2010). FlexSC: Flexible System Call Scheduling with Exception-Less System Calls. OSDI '10, 9th USENIX Symposium on Operating System Design and Implementation. USENIX. Retrieved 9 August 2024. p. 2: Synchronous implementation of system calls negatively impacts the performance of system intensive workloads, both in terms of the direct costs of mode switching and, more interestingly, in terms of the indirect pollution of important processor structures which affects both user-mode and kernel-mode performance. A motivating example that quantifies the impact of system call pollution on application performance can be seen in Figure 1. It depicts the user-mode instructions per cycles (kernel cycles and instructions are ignored) of one of the SPEC CPU 2006 benchmarks (Xalan) immediately before and after a pwrite system call. There is a significant drop in instructions per cycle (IPC) due to the system call, and it takes up to 14,000 cycles of execution before the IPC of this application returns to its previous level. As we will show, this performance degradation is mainly due to interference caused by the kernel on key processor structures.
  36. ^ Tanenbaum & Bos 2023, p. 8.
  37. Arpaci-Dusseau, Remzi; Arpaci-Dusseau, Andrea (2015). Operating Systems: Three Easy Pieces. Archived from the original on 25 July 2016. Retrieved 25 July 2016.
  38. Tanenbaum & Bos 2023, p. 10.
  39. Tanenbaum & Bos 2023, pp. 11–12.
  40. Tanenbaum & Bos 2023, pp. 13–14.
  41. Tanenbaum & Bos 2023, pp. 14–15.
  42. Tanenbaum & Bos 2023, p. 15.
  43. Tanenbaum & Bos 2023, pp. 15–16.
  44. ^ Tanenbaum & Bos 2023, p. 16.
  45. Tanenbaum & Bos 2023, p. 17.
  46. Tanenbaum & Bos 2023, p. 18.
  47. Tanenbaum & Bos 2023, pp. 19–20.
  48. Anderson & Dahlin 2014, pp. 39–40.
  49. Tanenbaum & Bos 2023, p. 2.
  50. Anderson & Dahlin 2014, pp. 41, 45.
  51. Anderson & Dahlin 2014, pp. 52–53.
  52. ^ Kerrisk, Michael (2010). The Linux Programming Interface. No Starch Press. p. 388. ISBN 978-1-59327-220-3. A signal is a notification to a process that an event has occurred. Signals are sometimes described as software interrupts.
  53. Hyde, Randall (1996). "Chapter Seventeen: Interrupts, Traps and Exceptions (Part 1)". The Art Of Assembly Language Programming. No Starch Press. Archived from the original on 22 December 2021. Retrieved 22 December 2021. The concept of an interrupt is something that has expanded in scope over the years. The 80x86 family has only added to the confusion surrounding interrupts by introducing the int (software interrupt) instruction. Indeed, different manufacturers have used terms like exceptions, faults, aborts, traps and interrupts to describe the phenomena this chapter discusses. Unfortunately there is no clear consensus as to the exact meaning of these terms. Different authors adopt different terms to their own use.
  54. Tanenbaum, Andrew S. (1990). Structured Computer Organization, Third Edition. Prentice Hall. p. 308. ISBN 978-0-13-854662-5. Like the trap, the interrupt stops the running program and transfers control to an interrupt handler, which performs some appropriate action. When finished, the interrupt handler returns control to the interrupted program.
  55. Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 32. ISBN 978-0-201-50480-4. When an interrupt (or trap) occurs, the hardware transfers control to the operating system. First, the operating system preserves the state of the CPU by storing registers and the program counter. Then, it determines which type of interrupt has occurred. For each type of interrupt, separate segments of code in the operating system determine what action should be taken.
  56. Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 105. ISBN 978-0-201-50480-4. Switching the CPU to another process requires saving the state of the old process and loading the saved state for the new process. This task is known as a context switch.
  57. ^ Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 31. ISBN 978-0-201-50480-4.
  58. Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 30. ISBN 978-0-201-50480-4. Hardware may trigger an interrupt at any time by sending a signal to the CPU, usually by way of the system bus.
  59. Kerrisk, Michael (2010). The Linux Programming Interface. No Starch Press. p. 388. ISBN 978-1-59327-220-3. Signals are analogous to hardware interrupts in that they interrupt the normal flow of execution of a program; in most cases, it is not possible to predict exactly when a signal will arrive.
  60. Kerrisk, Michael (2010). The Linux Programming Interface. No Starch Press. p. 388. ISBN 978-1-59327-220-3. Among the types of events that cause the kernel to generate a signal for a process are the following: A software event occurred. For example, ... the process's CPU time limit was exceeded
  61. ^ Kerrisk, Michael (2010). The Linux Programming Interface. No Starch Press. p. 388. ISBN 978-1-59327-220-3.
  62. "Intel® 64 and IA-32 Architectures Software Developer's Manual" (PDF). Intel Corporation. September 2016. p. 610. Archived (PDF) from the original on 23 March 2022. Retrieved 5 May 2022.
  63. ^ Bach, Maurice J. (1986). The Design of the UNIX Operating System. Prentice-Hall. p. 200. ISBN 0-13-201799-7.
  64. Kerrisk, Michael (2010). The Linux Programming Interface. No Starch Press. p. 400. ISBN 978-1-59327-220-3.
  65. ^ Tanenbaum, Andrew S. (1990). Structured Computer Organization, Third Edition. Prentice Hall. p. 308. ISBN 978-0-13-854662-5.
  66. Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 182. ISBN 978-0-201-50480-4.
  67. Haviland, Keith; Salama, Ben (1987). UNIX System Programming. Addison-Wesley Publishing Company. p. 153. ISBN 0-201-12919-1.
  68. Haviland, Keith; Salama, Ben (1987). UNIX System Programming. Addison-Wesley Publishing Company. p. 148. ISBN 0-201-12919-1.
  69. ^ Haviland, Keith; Salama, Ben (1987). UNIX System Programming. Addison-Wesley Publishing Company. p. 149. ISBN 0-201-12919-1.
  70. Tanenbaum, Andrew S. (1990). Structured Computer Organization, Third Edition. Prentice Hall. p. 292. ISBN 978-0-13-854662-5.
  71. IBM (September 1968), "Main Storage" (PDF), IBM System/360 Principles of Operation (PDF), Eighth Edition, p. 7, archived (PDF) from the original on 19 March 2022, retrieved 13 April 2022
  72. ^ Tanenbaum, Andrew S. (1990). Structured Computer Organization, Third Edition. Prentice Hall. p. 294. ISBN 978-0-13-854662-5.
  73. "Program Interrupt Controller (PIC)" (PDF). Users Handbook - PDP-7 (PDF). Digital Equipment Corporation. 1965. pp. 48. F-75. Archived (PDF) from the original on 10 May 2022. Retrieved 20 April 2022.
  74. PDP-1 Input-Output Systems Manual (PDF). Digital Equipment Corporation. pp. 19–20. Archived (PDF) from the original on 25 January 2019. Retrieved 16 August 2022.
  75. Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 32. ISBN 978-0-201-50480-4.
  76. Silberschatz, Abraham (1994). Operating System Concepts, Fourth Edition. Addison-Wesley. p. 34. ISBN 978-0-201-50480-4.
  77. ^ Tanenbaum, Andrew S. (1990). Structured Computer Organization, Third Edition. Prentice Hall. p. 295. ISBN 978-0-13-854662-5.
  78. ^ Tanenbaum, Andrew S. (1990). Structured Computer Organization, Third Edition. Prentice Hall. p. 309. ISBN 978-0-13-854662-5.
  79. Tanenbaum, Andrew S. (1990). Structured Computer Organization, Third Edition. Prentice Hall. p. 310. ISBN 978-0-13-854662-5.
  80. Stallings, William (2008). Computer Organization & Architecture. New Delhi: Prentice-Hall of India Private Limited. p. 267. ISBN 978-81-203-2962-1.
  81. Anderson & Dahlin 2014, p. 129.
  82. Silberschatz et al. 2018, p. 159.
  83. Anderson & Dahlin 2014, p. 130.
  84. Anderson & Dahlin 2014, p. 131.
  85. Anderson & Dahlin 2014, pp. 157, 159.
  86. Anderson & Dahlin 2014, p. 139.
  87. Silberschatz et al. 2018, p. 160.
  88. Anderson & Dahlin 2014, p. 183.
  89. Silberschatz et al. 2018, p. 162.
  90. Silberschatz et al. 2018, pp. 162–163.
  91. Silberschatz et al. 2018, p. 164.
  92. Anderson & Dahlin 2014, pp. 492, 517.
  93. Tanenbaum & Bos 2023, pp. 259–260.
  94. Anderson & Dahlin 2014, pp. 517, 530.
  95. Tanenbaum & Bos 2023, p. 260.
  96. Anderson & Dahlin 2014, pp. 492–493.
  97. Anderson & Dahlin 2014, p. 496.
  98. Anderson & Dahlin 2014, pp. 496–497.
  99. Tanenbaum & Bos 2023, pp. 274–275.
  100. Anderson & Dahlin 2014, pp. 502–504.
  101. Anderson & Dahlin 2014, p. 507.
  102. Anderson & Dahlin 2014, p. 508.
  103. Tanenbaum & Bos 2023, p. 359.
  104. Anderson & Dahlin 2014, p. 545.
  105. ^ Anderson & Dahlin 2014, p. 546.
  106. Anderson & Dahlin 2014, p. 547.
  107. Anderson & Dahlin 2014, pp. 589, 591.
  108. Anderson & Dahlin 2014, pp. 591–592.
  109. Tanenbaum & Bos 2023, pp. 385–386.
  110. ^ Anderson & Dahlin 2014, p. 592.
  111. Tanenbaum & Bos 2023, pp. 605–606.
  112. Tanenbaum & Bos 2023, p. 608.
  113. Tanenbaum & Bos 2023, p. 609.
  114. Tanenbaum & Bos 2023, pp. 609–610.
  115. ^ Tanenbaum & Bos 2023, p. 612.
  116. Tanenbaum & Bos 2023, pp. 648, 657.
  117. Tanenbaum & Bos 2023, pp. 668–669, 674.
  118. Tanenbaum & Bos 2023, pp. 679–680.
  119. Tanenbaum & Bos 2023, pp. 605, 617–618.
  120. Tanenbaum & Bos 2023, pp. 681–682.
  121. Tanenbaum & Bos 2023, p. 683.
  122. Tanenbaum & Bos 2023, p. 685.
  123. Tanenbaum & Bos 2023, p. 689.
  124. Richet & Bouaynaya 2023, p. 92.
  125. Richet & Bouaynaya 2023, pp. 92–93.
  126. Berntsso, Strandén & Warg 2017, pp. 130–131. sfn error: no target: CITEREFBerntssoStrandénWarg2017 (help)
  127. Tanenbaum & Bos 2023, p. 611.
  128. Tanenbaum & Bos 2023, pp. 396, 402.
  129. Tanenbaum & Bos 2023, pp. 395, 408.
  130. Tanenbaum & Bos 2023, p. 402.
  131. Holwerda, Thom (20 December 2009). "My OS Is Less Hobby than Yours". OS News. Retrieved 4 June 2024.
  132. "Operating System Market Share Worldwide". StatCounter Global Stats. Retrieved 20 December 2024.
  133. Silberschatz et al. 2018, pp. 779–780.
  134. Tanenbaum & Bos 2023, pp. 713–714.
  135. ^ Silberschatz et al. 2018, p. 780.
  136. Vaughan-Nichols, Steven (2022). "Linus Torvalds prepares to move the Linux kernel to modern C". ZDNET. Retrieved 7 February 2024.
  137. Silberschatz et al. 2018, p. 781.
  138. Tanenbaum & Bos 2023, pp. 715–716.
  139. Tanenbaum & Bos 2023, pp. 793–794.
  140. Tanenbaum & Bos 2023, p. 793.
  141. Tanenbaum & Bos 2023, pp. 1021–1022.
  142. Tanenbaum & Bos 2023, p. 871.
  143. Silberschatz et al. 2018, p. 826.
  144. ^ Tanenbaum & Bos 2023, p. 1035.
  145. ^ Tanenbaum & Bos 2023, p. 1036.
  146. Silberschatz et al. 2018, p. 821.
  147. Silberschatz et al. 2018, p. 827.

Further reading

External links

Operating systems
General
Variants
Kernel
Architectures
Components
Process management
Concepts
Scheduling
algorithms
Memory management,
resource protection
Storage access,
file systems
Supporting concepts
Computer science
Note: This template roughly follows the 2012 ACM Computing Classification System.
Hardware
Computer systems organization
Networks
Software organization
Software notations and tools
Software development
Theory of computation
Algorithms
Mathematics of computing
Information systems
Security
Human–computer interaction
Concurrency
Artificial intelligence
Machine learning
Graphics
Applied computing
Category: