Jump to content

Overlay (programming)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 2603:3001:3501:9700:cd92:b4d6:38d0:1eed (talk) at 00:05, 25 December 2019 (Finished,). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In a general computing sense means "the process of transferring a program code or other data into main memory, replacing what is already stored". Overlaying is a programming method that allows programs to be larger than the computer's main memory. An embedded system would normally use overlays because of the limitation of physical memory, which is internal memory for a system-on-chip, and the lack of virtual memory facilities.


Constructing an overlay program involves manually dividing a program into self-contained object code blocks called over laid out in a tree structure. Sibling segments, those at the same depth level, share the same memory, called overlay region. An overlay manager, either part of the operating system or part of the overlay program, loads the required overlay from external memory into its destination region when it is needed. Often linkers provide support for overlays.

= The following shows the control statements that instruct the Linkage Editor to link an overlay program, indented to show structure

These statements define a tree consisting of the permanently resident segmen and two overlays A and B which will be loaded following the end. Overlay A itself consists of two overlay. At execution time overlays A and B will both utilize the same memory locations.



applications are intended to run on platforms with memory.  platform can design a program as if the memory constraint does not exist unless the program's working set exceeds the available physical memory. Most importantly, the architect can focus on the problem being solved without the added design difficulty of forcing the processing into steps constrained by the overlay size. Thus, the designer can use higher-level programming languages that do not allow the programmer much control over size 

overlays remain useful in embedded systems. Some low-cost processors used in embedded systems do not provide a memory management unit (MMU). In addition many embedded systems are real-time systems and overlays provide more determinate response-time

Even on platforms with memory, software components such as codecs overlays were popular because the operating system and many of the computer systems it ran on memory and had very little RAM by current standards: the original had between 16K and 64k. Overlays were a popular technique to load graphics screens.

overlays were popular because the operating system and many of the computer systems it ran memory and had very little RAM by current standards: the original had between 16K and 64K, depending on configuration. Overlays were a popular technique to load graphics screens. In order to detect when an overlay could be used.

"Several linkers in the 1980s supported overlays in a form nearly identical to that used 25 years earlier on mainframe computers."