More digging into physical memory layout
Well, we have discussed the physical memory layout in my last blog.We have understood that among the first 640KB some areas are not usable. Lets try to find out the exact memory count which is not usable by the operating system, rather, that area is used by ROM and IVT (interrupt vector table).
Lets try to find out the first 31kb of memory. We know the memory layout is something as follows.
....
31Kb 0x07c0:0000 |-->>07C0:0 Boot code is loaded here.
0 Kb 0x0000:0000 | Working RAM LIMIT start +System information like
(Interrupt vector table)
If you tried to find out the exact memory usage by the BIOS, we will find that
the data is allocated at the maximum of segment number 0x0070:00 which is less than 1K.
[REF]
http://www.frontiernet.net/~fys/rombios.htm
http://heim.ifi.uio.no/~stanisls/helppc/bios_data_area.html
Hence rest of the memory up to 640KB can be used by the Operating system. In fact DOS2+ used that area.
!!! Lets find out how Linux treats those memory !!!
Linux always believes in cooperative environment. It's does not try to eat
market share of other. So what does the Linux do in case of memory
utilization?
As we all know that the physical memory is logically divided into chunks
called "page frame". 1 page frame == 4KB . As all system data require
approximately 1KB, Linux tried to mark the first page frame as not usable.
The rest of the pages upto the page frame number 0x9f(i.e. 640 KB) is
marked as "usable" and page frames from 0x9f to 0x100 (UMA, 1MB) are
marked as "not usable". Then the kernel code is loaded in the first byte of the
second megabyte of the physical memory. The starting of the kernel code is
identified by the symbol "_text" and the end of the kernel code identified by
the symbol "_etext". All these symbols can be found in Symbols.map file after
compiling the kernel.
Lets try to visualize the memory layout from the point of view of Linux 2.4 OS.
[REF: "Understanding Linux kernel."]

Lets try to find out the first 31kb of memory. We know the memory layout is something as follows.
....
31Kb 0x07c0:0000 |-->>07C0:0 Boot code is loaded here.
0 Kb 0x0000:0000 | Working RAM LIMIT start +System information like
(Interrupt vector table)
If you tried to find out the exact memory usage by the BIOS, we will find that
the data is allocated at the maximum of segment number 0x0070:00 which is less than 1K.
[REF]
http://www.frontiernet.net/~fys/rombios.htm
http://heim.ifi.uio.no/~stanisls/helppc/bios_data_area.html
Hence rest of the memory up to 640KB can be used by the Operating system. In fact DOS2+ used that area.
!!! Lets find out how Linux treats those memory !!!
Linux always believes in cooperative environment. It's does not try to eat
market share of other. So what does the Linux do in case of memory
utilization?
As we all know that the physical memory is logically divided into chunks
called "page frame". 1 page frame == 4KB . As all system data require
approximately 1KB, Linux tried to mark the first page frame as not usable.
The rest of the pages upto the page frame number 0x9f(i.e. 640 KB) is
marked as "usable" and page frames from 0x9f to 0x100 (UMA, 1MB) are
marked as "not usable". Then the kernel code is loaded in the first byte of the
second megabyte of the physical memory. The starting of the kernel code is
identified by the symbol "_text" and the end of the kernel code identified by
the symbol "_etext". All these symbols can be found in Symbols.map file after
compiling the kernel.
Lets try to visualize the memory layout from the point of view of Linux 2.4 OS.
[REF: "Understanding Linux kernel."]

Labels: Technical Details

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home