Started brainstorming the memory map.

This commit is contained in:
Garritt McCune
2025-02-06 16:13:29 -06:00
parent 43b8dd0119
commit 883c48270f
+23 -4
View File
@@ -98,10 +98,10 @@ In addition to the general purpose registers there is also a base pointer (bp),
\end{description}
\section{Memory}
The memory layout is quite simple, much like many modern machines it is a linear memory map. The address bus is thirty-two bits wide, the same width of the data bus, meaning at most there is 2\textsuperscript{32} of addressable memory. Like contemporary machines the top of memory starts at address 0x00000000 and grows downward toward 0xFFFFFFFF. By default the memory is mapped as shown in Figure \ref{fig:memorylayout}.
Memory is laid out as a contiguous linear block for a total of 2\textsuperscript{32} bytes of addressable memory. Addressing starts at 0x00000000 and grows downward toward 0xFFFFFFFF as shown in Figure \ref{fig:memoryhighlow}. The figure also shows the direction the stack grows along with the heap, which grows in the opposite direction.
% How memory mapped I/O works: https://superuser.com/questions/595672/how-is-memory-mapped-to-certain-hardware-how-is-mmio-accomplished-exactly
\begin{figure}
\begin{figure}[h]
\begin{tikzpicture}
\node [draw, fit={(0,0) (3, 6)}] (memory) {};
@@ -116,6 +116,25 @@ The memory layout is quite simple, much like many modern machines it is a linear
%\draw[dashed] ($(memory.north west)-(0.0,1.0)$) -- ($(memory.north east)-(0.0,1.0)$) node[right] {0x200800} node[midway, above] {Firmware - 2MiB};
%\draw[dashed] ($(memory.north west)-(0.0,1.5)$) node[left] {0x276100} -- ($(memory.north east)-(0.0,1.5)$) node[midway, above] {VRAM - 3.75MiB};
\end{tikzpicture}
\caption{Memory Map \& Layout}
\label{fig:memorylayout} % https://www.overleaf.com/learn/latex/Referencing_Figures
\caption{Memory Layout}
\label{fig:memoryhighlow} % https://www.overleaf.com/learn/latex/Referencing_Figures
\end{figure}
\subsection{Memory Mapping}
On initialization the CPU will load firmware from read-only memory, or \quotes{ROM}, starting at address 0xFFDFFFFF and ending at 0xFFFFFFFF. This leaves 2MiB (2,097,152) bytes of memory for the firmware code, barring some form of compression. From there the firmware itself will setup a simple memory map, as shown in Figure \ref{fig:memorymap}.
\begin{figure}[h]
\begin{tabularx}{\textwidth}{ | c | c | X | X | }
\hline
Start & End & Used For & Remark \\
\hline
0x00000000 & 0x000003FC & Interrupt Table & 255 Word Entries \\
\hline
0x00000400 & 0x000004FF & Keyboard Buffer & 255 Chars \\
\hline
0xFFDFFFFF & 0xFFFFFFFF & Firmware & 2MiB \\
\hline
\end{tabularx}
\caption{Initial Memory Map}
\label{fig:memorymap}
\end{figure}