Undo is an interaction technique which is implemented in many computer programs. It erases the last change done to the document, reverting it to an older state. In some more advanced programs, such as graphic processing , undo will negate the last command done to the file being edited. With the possibility of undo, users can explore and work without fear of making mistakes, because they can easily be undone.
75-416: The expectations for undo are easy to understand: to have a predictable functionality, and to include all "undoable" commands. Usually undo is available until the user undoes all executed operations. But there are some actions which are not stored in the undo list, and thus they cannot be undone. For example, save file is not undoable, but is queued in the list to show that it was executed. Another action which
150-495: A Programmer's Assistant as part of BBN-LISP with an Undo function, by 1971. The Xerox PARC Bravo text editor had an Undo command in 1974. A 1976 research report by Lance A. Miller and John C. Thomas of IBM , Behavioral Issues in the Use of Interactive Systems , noted that "it would be quite useful to permit users to 'take back' at least the immediately preceding command (by issuing some special 'undo' command)." The programmers at
225-428: A system call to perform a block I/O write operation, then the system call might execute the following instructions: 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
300-416: A command can be skipped. The command which is skipped is marked as skipped but not deleted. When new commands are executed, the history list is retained, so the order of the executed commands can be reproducible with that. The order can be described through a history tree which is a directed graph, "because it is possible to continue redoing commands from another branch creating a link in the graph". Even though
375-645: A computer even if they are not compatible with the base operating system. 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
450-585: 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
525-458: A do method which is called when a command is executed. The undo-method implements the reverse operation of the do-method. To implement the reverse, there are several different strategies. Operating system 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
600-484: 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,
675-442: A library with no protection between applications, such as eCos . 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
750-447: 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,
825-420: A number of steps, rotate the redo list, and then redo a number of steps". For redo the list has to be rotated until the wanted command is above. Jakubec et al. say that selective undo is a feature which a model can offer but for selective undo there is no clear definition. The authors selected functions which a model should have when it supports selective undo. It should be possible to "undo any executed action in
SECTION 10
#1732794552057900-455: 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
975-503: 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
1050-408: 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
1125-440: 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
1200-400: A script of commands. The history list of the executed commands are interpreted "as a script, the effect of an undo is defined to be the same as if the undone action had never occurred in the first place." As the result of undo the state has to be the way as if the undone command was never executed. A disadvantage of this model is that the user has to know the connection between undone command and
1275-470: 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.) When a computer user types a key on the keyboard, typically the character appears immediately on the screen. Likewise, when
1350-402: 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
1425-417: 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. Devices such as hard disk drives , solid-state drives , and magnetic tape drives can transfer data at a rate high enough that interrupting
1500-453: 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
1575-418: 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 . In the personal computer market, as of September 2024 , Microsoft Windows holds a dominant market share of around 73%. macOS by Apple Inc. is in second place (15%), Linux is in third place (5%), and ChromeOS
SECTION 20
#17327945520571650-562: 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. 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
1725-450: Is a software design pattern which encapsulates information from the operation into command objects. This means that every action is stored in an object. The abstract command class implements an abstract execute operation, so every command object has an execute operation. For undo there also have to be unexecuted operation, which undoes the effect of the executed command, which are stored in a history list. Undo and redo are implemented so that
1800-484: 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
1875-422: 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
1950-415: Is implemented with a stack (last in first out (LIFO) data structure) that stores a history of all executed commands. When a new command is executed it is added to the top of stack. Therefore, only the last executed command can be undone and removed from the history. Undo can be repeated as long as the history is not empty. The restricted linear model is an augmentation of the linear undo model. It satisfies
2025-896: Is in fourth place (2%). In the mobile sector (including smartphones and tablets ), as of September 2023 , Android's share is 68.92%, followed by Apple's iOS and iPadOS with 30.42%, and other operating systems with .66%. 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). An operating system
2100-443: 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
2175-499: 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. The invention of large scale integration enabled the production of personal computers (initially called microcomputers ) from around 1980. For around five years,
2250-473: 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 . A real-time operating system is an operating system that guarantees to process events or data by or at
2325-401: Is that undone commands can be outside of the originally context. Through this there can be dead references which have to be handled. The second issue that modified commands can be undone and so it has to be solved which state after undo will be presented. The third issue is discarding command problems. Selective undo has no pointer in the lists, so this means that no command should be discarded of
Undo - Misplaced Pages Continue
2400-435: 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 ,
2475-420: Is usually not stored, and thus not undoable, is scrolling or selection . The opposite of to undo is to redo . The redo command reverses the undo or advances the buffer to a more recent state. The common components of undo functionality are the commands which were executed of the user, the history buffer(s) which stores the completed actions, the undo/redo manager for controlling the history buffer, and
2550-542: 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
2625-504: 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 . 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
2700-530: The Xerox PARC research center assigned the keyboard shortcut Ctrl-Z to the undo command, which became a crucial feature of text editors and word processors in the personal computer era. In 1980, Larry Tesler of Xerox PARC began working at Apple Computer . There, he and Bill Atkinson advocated for the presence of an undo command as a standard fixture on the Apple Lisa . Atkinson was able to convince
2775-420: 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
2850-406: The user interface for interacting with the user. In most graphical applications for the majority of the mainstream operating systems (such as Microsoft Windows , Linux and BSDs ), the keyboard shortcut for the undo command is Ctrl+Z or Alt+Backspace, and the shortcut for redo is Ctrl+Y or Ctrl + Shift +Z. In most macOS applications, the shortcut for the undo command is Command -Z, and
2925-706: The 1980s, allowing the users to take back a series of actions, not just the most recent one. EMACS and other timeshared screen editors had it before personal computer software. CygnusEd was the first Amiga text editor with an unlimited undo/redo feature. AtariWriter , a word-processing application introduced in 1982, featured undo. NewWord, another word-processing program released by NewStar in 1984, had an unerase command. IBM's VisiWord also had an undelete command. Undo models can be categorized as linear or non-linear. The non-linear undo model can be sub-classified in script model, us&r model, triadic model, and selective undo. Some common properties of models are: Linear undo
3000-410: 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
3075-474: 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
Undo - Misplaced Pages Continue
3150-400: The above described stable execution property for linear undo, because this model does not keep the property if a command is done while the history list includes other commands. The restricted linear model clears the history list before a new command is added. But other restrictions are available, too. For example, the size of the history list can be restricted or when a defined size is reached,
3225-611: The action history. The number of previous actions that can be undone varies by program, version, and hardware or software capabilities. For example, the default undo/redo stack size in Adobe Photoshop is 20 but can be changed by the user. As another example, earlier versions of Microsoft Paint only allowed up to three edits to be undone; the version introduced in Windows 7 increased this limit to 50. Simplistic, single-edit undo features sometimes do away with "redo" by treating
3300-538: 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 . An interrupt (also known as an abort , exception , fault , signal , or trap ) provides an efficient way for most operating systems to react to
3375-403: The caretaker requests a memento of the originator and then applying the undo. The most part of undo mechanism can implemented without dependency to specific applications or command classes. This includes "the management of history list, the history scroller, menu entries for undo and redo and update of the menu entries depending on the name of the next available command." Every command class has
3450-453: 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
3525-433: The current state to avoid side effects. One of this can be for example duplication. Other problems are that if "subsequent commands are redone in a different state that they were originally executed in direct manipulation interfaces, this reinterpretation of the original user action is not always obvious or well defined". The special feature of this model is that it has the option of skipping a command. This means that redoing
3600-471: 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: 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
3675-422: 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
3750-421: The first executed command is deleted from the list. The main difference between linear undo and non-linear undo is the possibility of the user to undo the executed commands in an arbitrary order. They have the chance to undo not the most recently command but rather choose a command from the list. For non linear model there are subclasses which implement this model. The script model handles user actions as editing
3825-410: 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. The operating system provides an interface between an application program and the computer hardware, so that an application program can interact with
SECTION 50
#17327945520573900-493: 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
3975-419: The history buffer. Actions independent of the action being undone should be left untouched". Just like that redo has to be possible to any undone command. The third function for selective undo is that "no command can be automatically discarded from history buffer without direct user’s request." For selective undo applies that undo and redo is executable outside of any context. There are three main issues. The first
4050-418: 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. 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
4125-554: The individual developers of the Lisa's application software to include a single level of undo and redo, but was unsuccessful in lobbying for multiple levels. When Apple introduced the Lisa's successor, the Macintosh , it stipulated that all standard applications should include an “Undo” as the first command in the “Edit” menu, which has remained the standard on macOS and Windows to this day. Multi-level undo commands were introduced in
4200-404: The interrupt request, the operating system will: When the writing process has its time slice expired, the operating system will: With the program counter now reset, the interrupted process will resume its time slice. 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
4275-431: The kernel—and applications—all other software. There are three main purposes that an operating system fulfills: 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
4350-421: The latest action made to the document, regardless of who performed the edit. Local multi-user undo only reverts actions done by the local user, which requires a non-linear undo implementation. Where undo can be used to backtrack through multiple edits, the redo command goes forward through the action history. Making a new edit usually clears the redo list. If a branching redo model is used, the new edit branches
4425-421: The list is run through forwards and backwards when the execute or unexecute command is called. For single undo only the executed command is stored. In contrast to the multi level undo where not only the history list with the commands is saved but also the number of undo levels can be determined of the maximum length of the list. With memento pattern the internal state of an object is stored. The object in which
4500-400: 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
4575-408: 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. 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
SECTION 60
#17327945520574650-408: 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. 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. The kernel
4725-421: The piping. Signals may be classified into 7 categories. The categories are: 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
4800-417: The redo operations. The rotate operation sets the last command of the redo list in front of it. On one hand this means that the next command to be redone can be selected by placing it in front. On the other hand, rotation can be used "to select the place in the redo list where the next undo operation will put the command". The list of redo is therefore unordered. "To undo an isolated command, the user has to undo
4875-418: 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
4950-401: The set of commands is simple and easy to understand, the complex structure with skipping and linking branches is hard to comprehend and to remember, when the user wants to undo more than one step. This non-linear undo model has besides undo and redo the possibility to rotate. It has the same data structure as the above-mentioned models with a history list and a separated redo list which includes
5025-518: The shortcut for redo is Command - Shift -Z. On all platforms, the undo/redo functions can also be accessed via the Edit menu . The ability to undo an operation on a computer was independently invented multiple times, in response to how people used computers. The File Retrieval and Editing System , developed starting in 1968 at Brown University , is reported to be the first computer-based system to have had an "undo" feature. Warren Teitelman developed
5100-400: 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
5175-400: 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
5250-428: The stack. Direct selective undo is an extension of restricted linear undo with a history tree. The operation creates a copy of the selected command, executes this and add it to the history list. There two non-linear operations selective undo and selective redo are defined, so it is more symmetric. When multiple users can edit the same document simultaneously, a multi-user undo is needed. Global multi-user undo reverts
5325-430: The state is saved, is called memento and is organized through the memento originator. This returns a memento, initialized with information of the current state, when undo is executed, so that the state can be checked. The memento is only visible for the originator. In memento pattern the undo mechanism is called caretaker. It is responsible for the safekeeping of the mementos but never change the contents of these. For undo
5400-442: 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
5475-422: The undo command itself as an action that can be undone. This is known as the flip undo model, because the user can flip between two program states using the undo command. This was the standard model prior to the widespread adoption of multiple-level undo in the early 1990s. Undo can be implemented through different patterns. The most common patterns are command pattern and memento pattern . The command pattern
5550-473: 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 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
5625-406: 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
#56943