1194 |
>> PAGE_SHIFT; |
>> PAGE_SHIFT; |
1195 |
|
|
1196 |
\end{verbatim} |
\end{verbatim} |
1197 |
Only memory below 16MB can be used for DMA (\textit{Direct Memory Access}) as |
Only memory below 16MB can be used for ISA DMA (\textit{Direct Memory Access}) |
1198 |
the x86 ISA DMA controller which interfaces with the ISA bus, has only 24 address-lines. In the above line, max\_dma is used to store the page frame number of 16MB. |
as the x86 ISA bus has only 24 address lines. In the above line, \textit{max\_dma} is |
1199 |
|
used to store the page frame number of 16MB. |
1200 |
\begin{verbatim} |
\begin{verbatim} |
1201 |
|
|
1202 |
low = max_low_pfn; |
low = max_low_pfn; |
1398 |
Fixmaps are compile time fixed virtual addresses which are used for some |
Fixmaps are compile time fixed virtual addresses which are used for some |
1399 |
special purposes. These virtual addresses are mapped to physical pages at boot time |
special purposes. These virtual addresses are mapped to physical pages at boot time |
1400 |
using the macro \texttt{set\_fixmap()}. These virtual addresses are allocated from the |
using the macro \texttt{set\_fixmap()}. These virtual addresses are allocated from the |
1401 |
very end of memory (0xFFFFE000, 4GB - 8k) backwards. The fixed addresses can be |
very top of address space (0xFFFFE000, 4GB - 8k) downwards. The fixed addresses can be |
1402 |
calculated using the enum \textit{fixed\_addresses}. |
calculated using the enum \textit{fixed\_addresses}. |
1403 |
\begin{verbatim} |
\begin{verbatim} |
1404 |
enum fixed_addresses { |
enum fixed_addresses { |
1432 |
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) |
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) |
1433 |
\end{verbatim} |
\end{verbatim} |
1434 |
\begin{description} |
\begin{description} |
1435 |
\item[FIXADDR\_TOP] \index{FIXADDR\_TOP} The top of the fixed address mappings. It starts just below the end of memory (leaving 2 pages worth memory) and grows down. |
\item[FIXADDR\_TOP] \index{FIXADDR\_TOP} The top of the fixed address mappings. It starts just below the end of memory (leaving 2 pages worth of address space) and grows down. |
1436 |
\item[FIXADDR\_SIZE]\index{FIXADDR\_SIZE}\begin{sloppypar} It is used to |
\item[FIXADDR\_SIZE]\index{FIXADDR\_SIZE}\begin{sloppypar} It is used to |
1437 |
calculate the number of pages required by fix\-map. It depends on the value of |
calculate the number of pages required by fix\-map. It depends on the value of |
1438 |
\textit{\_\_end\_of\_fixed\_addresses} which again depends on the var\-ious ifdef/endif |
\textit{\_\_end\_of\_fixed\_addresses} which again depends on the var\-ious ifdef/endif |
1559 |
The macro \texttt{kmap\_get\_fixmap\_pte()} is used to get the page table entry for the given entry. |
The macro \texttt{kmap\_get\_fixmap\_pte()} is used to get the page table entry for the given entry. |
1560 |
|
|
1561 |
\section{Memory Zones}\label{sec:zones} |
\section{Memory Zones}\label{sec:zones} |
1562 |
Physical\footnote{This explanation is from the FAQ on \#kernelnewbies, thanks to the contributor.} memory has been divided into different zones to differentiate between intended uses, and are generally used to model different characteristics of the memory. Eg. on the x86, there is only 16MB of DMA-able memory, so zoned allocator will try to save DMA pages for processes specifically requesting ZONE\_DMA. The available zones are: |
Physical\footnote{This explanation is from the FAQ on \#kernelnewbies, thanks |
1563 |
|
to the contributor.} memory has been divided into different zones to differentiate |
1564 |
|
between intended uses, and are generally used to model different characteristics of |
1565 |
|
the memory. Eg. on the x86, there is only 16MB of ISA DMA-able memory, so zone |
1566 |
|
allocator will try to save DMA pages for processes specifically requesting ZONE\_DMA. |
1567 |
|
The available zones are: |
1568 |
\begin{description} |
\begin{description} |
1569 |
\item[ZONE\_DMA] \index{ZONE\_DMA} ISA DMA capable memory.($<$16MB, directly |
\item[ZONE\_DMA] \index{ZONE\_DMA} ISA DMA capable memory.($<$16MB, directly |
1570 |
mapped by the kernel) |
mapped by the kernel) |