Sistemas Operativos, Manejo de la memoria 1 Introducción
Introduction to Memory Management
Overview of the Course
- The course focuses on memory management, based on Chapter 8 of Silver, Chatz, and Galvin's textbook.
- Topics include logical vs. physical address space, swapping, contiguous allocation, paging, segmentation, and combined segmentation with paging.
Process Execution
- Programs are loaded into memory as processes for execution; they enter a queue before being executed.
- User programs undergo several stages before execution; references in assembly code must be translated to corresponding memory addresses.
Address Translation Methods
Compilation Time Addressing
- Addresses can be determined at compile time (absolute code), requiring recompilation if any address changes occur. This is useful for software stored in ROM where no changes will happen post-compilation.
Load Time Addressing
- In load time addressing, the code becomes relocatable once loaded into memory but cannot be moved thereafter. This method allows flexibility during program loading but requires special hardware for dynamic relocation during execution.
Dynamic Loading Techniques
Dynamic Loading Explained
- Dynamic loading means routines are only loaded into memory when called upon; unused routines remain unloaded to optimize memory usage. This is particularly beneficial for large codes that handle infrequent cases without needing OS support for implementation design.
Historical Context: MS-DOS
- MS-DOS operated under significant limitations regarding functionality compared to modern operating systems; it utilized dynamic loading extensively due to limited available memory (e.g., 640 KB).
Dynamic Linking vs Static Linking
Understanding Dynamic Linking
Understanding Routine Invocation in Memory Management
The Role of the Operating System
- The discussion highlights how routines are now resident in memory, allowing programs to invoke them directly.
- It explains that when a routine is called, its address replaces the call instruction, enabling execution.
- The operating system plays a crucial role by checking if the routine resides in the process's memory addresses.
- This mechanism ensures efficient execution and management of routines within applications.