=========== Supplements [TOC] =========== Memory layout of a loaded program ================================= Before a program gets executed the loader for the ULM reads in an executable and initializes the memory of the ULM. In general the memory layout of a program consists of a text, data and BSS segment: ---- TIKZ ---------------------------------------------------------------------- \begin{tikzpicture} \input{memory.tex} \renewcommand\MemCellWidth { 0.2 } %\DrawMemLabel{0}{Entry Point} \DrawMemRange{0}{30} \DrawMemVariable[gray!50]{0}{30}{ Text segment} \DrawMemRange{30}{50} \DrawMemVariable[orange]{30}{50}{ Data segment } \DrawMemRange{50}{75} \DrawMemVariable[blue!50]{50}{75}{ BSS segment } \DrawMemArrayOpenRight{75}{100} \end{tikzpicture} -------------------------------------------------------------------------------- The loader setup the segments from the information provided in the program file. The general format of a program file consists of sections that can be empty: ---- TIKZ ---------------------------------------------------------------------- \begin{tikzpicture} \node at (0, 0.25) {\color{white}.}; \node at (0, -5.25) {\color{white}.}; \node at (-.25, 0) {\color{white}.}; \node at (5.25, 0) {\color{white}.}; \draw (0,0) rectangle (5,-1); \node at (2.5, -0.5) {text segment}; \draw (0,-1) rectangle (5,-2); \node at (2.5, -1.5) {data segment}; \draw (0,-2) rectangle (5,-3); \node at (2.5, -2.5) {BSS segment}; \draw (0,-3) rectangle (5,-4); \node at (2.5, -3.5) {symbol table}; \draw (0,-4) rectangle (5,-5); \node at (2.5, -4.5) {relocatable table}; \end{tikzpicture} -------------------------------------------------------------------------------- :navigate: up -> doc:index back -> doc:session08/page05