[Paper Review] State and history in operating systems
This paper introduces a formal, sequence-based method for modeling and reasoning about complex state transitions in operating systems, using event sequences and state-dependent functions to capture process switching behavior. It demonstrates how abstract state processes and Moore machine representations can model OS concurrency and communication, with a key contribution being a rigorous framework for verifying correctness in low-level system code like the UNIX process switch routine.
A method of using recursive functions to describe state change is applied to process switching in UNIX-like operating systems.
Motivation & Objective
- To provide a formal, mathematically rigorous framework for understanding complex state changes in operating systems, particularly in low-level code like the UNIX process switch.
- To address the opacity and complexity of classic OS code—such as Dennis Ritchie’s infamous 'You are not expected to understand this'—by introducing a sequence-based formalism.
- To model process scheduling and inter-process communication using abstract state processes and event sequences, enabling verification of behavioral properties.
- To establish a connection between sequence-dependent functions and Moore state machines, offering a foundation for formal verification of system behavior.
Proposed method
- Uses finite event sequences (w ∈ B*) to model system evolution, where w represents the history of events up to a given state.
- Defines state-dependent functions such as Loc(w; p) for current line and function, and V(w; p; x) for variable values in process p’s context.
- Introduces abstract state processes f that map sequences to states (e.g., running, waiting, sending), with constraints on transitions and self-messages.
- Applies the Moore machine formalism: each sequence function f corresponds to a Moore machine Mf = (B, Sf, [κ]f, δf, φf), enabling state machine modeling of system behavior.
- Constructs a general product of state machines to model interconnected processes, where transitions depend on outputs of other processes via a function ɣ.
- Uses algebraic structures like congruence classes and monoids to explore deeper properties, including invertibility and semigroup structure.
Experimental results
Research questions
- RQ1How can we formally specify and verify the behavior of low-level OS code, such as the UNIX process switch, using sequence-based state modeling?
- RQ2What formal conditions ensure that a process switch correctly restores execution after suspension and resumption?
- RQ3How can abstract state processes be composed to model synchronous communication between multiple processes in a concurrent system?
- RQ4What is the relationship between sequence-dependent functions and classical Moore state machines in modeling system behavior?
- RQ5How do algebraic structures like monoids and congruence classes arise from sequence functions, and what do they reveal about system behavior?
Key findings
- The paper proves that any sequence-dependent function f can be represented as a Moore machine, establishing a formal isomorphism between functional and state machine models.
- A formal specification is provided for the UNIX process switch: if process p1 calls switch with next = p2, then p1 will only return after p2 (or another process pk) resumes p1, with intermediate states captured via event sequences.
- The model ensures that a process cannot resume itself and that communication is properly synchronized through state transitions, preventing invalid or deadlocked states.
- The framework supports formal reasoning about non-deterministic behavior without assuming fundamental non-determinism, treating it instead as a methodological limitation.
- The use of sequence functions enables verification of complex properties like correct resumption and message passing without enumerating all system states.
- The algebraic structure of sequence functions forms a monoid under congruence, and under certain constraints (e.g., no feedback), it aligns with Krohn-Rhodes theory, suggesting deeper algebraic invariants in system design.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.