Chapter 3. Basic Concepts

  • 3.1 Context Switching

    • 3.1.1 Procedures

      • Intel x86 Stack Frames

      • SPARC Stack Frames

    • 3.1.2 Threads and Coroutines

    • 3.1.3 System Calls

    • 3.1.4 Interrupts

  • 3.2 Input/Output Architectures

  • 3.3 Dynamic Storage Allocation

    • 3.3.1 Best-Fit and First-Fit Algorithms

    • 3.3.2 Buddy System

    • 3.3.3 Slab Allocation

  • 3.4 Linking and Loading

    • 3.4.1 Static Linking and Loading

    • 3.4.2 Shared Libraries

  • 3.5 Booting

  • 3.6 Conclusions

  • 3.7 Exercises

  • 3.8 References

This chapter covers a number of basic concepts that, though not unique to operating systems, are essential for much of what comes later. We start with the architectural issues involved in context switching: subroutine, thread, user/privileged, and normal/interrupt-mode switching. We then discuss some other architectural issues: memory caches and basic I/O architecture. Finally, we briefly go over the software concepts of dynamic storage allocation and of program linking and loading.


We use the somewhat nebulous term "context" to mean the setting in which execution is currently taking place. This setting determines what information, in the form of storage contents, is available. For example, when a thread is executing within a procedure, it has available to it the procedure's local variables as well as all its process's global variables. When a thread has invoked a method of some object, then not only are local and global variables available, but so are instance variables. When a thread makes a system call, the processor switches ...

Get Operating Systems in Depth now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.