Quote:
Originally Posted by tarunchawla
I want to know what is 32 bit OS and how it effects the size of RAM and Hardisk it can access, how 32 bit OS can address upto 4 gb of RAM.
There are also servers who can address 48 Gb of RAM ,please explain me all these things.
|
In x86, a 16bit OS might be either:
* Real mode (like DOS) in which all addresses had two 16 bit parts that were combined overlapped to form a 20 bit physical address, so up to 1MB of address space was available, but due to design decisions by IBM (that were widely and incorrectly attributed to Bill Gates) only 640KB of ram could be addressed withing the 1MB address space.
* Protected mode (such as 16bit Windows) in which addresses had two 16 bit parts that were combined in a more complicated way providing more physical address range and protection between processes.
32bit X86 OS's might be "flat" or "segmented", but all the important ones are "flat". Both the kernel and user space in a flat OS are mapped through a paging table, so every address directly used in a program is virtual and is translated to a physical address (by TLB's backed by a page table structure). The virtual addresses are 32 bit across the whole architecture. So a 4GB virtual address space is a fundamental aspect of the architecture. But the mapping hardware evolved over the lifetime of the architecture from an initial 24 bit physical up to a final 36 bit physical.
Only a tiny part of the OS is involved in managing the page tables and needs to be aware of the size of a physical address. The rest of the OS and user mode code works with 32 bit virtual addresses. When the hardware has over 4GB (up to 64GB) ram, the fixed mapped portion of the kernel (which is almost all of it in ordinary Linux) plus any one process can't add up to more than 4GB. But counting other processes and file caching etc., the system can make good use of much more than 4GB.
But for 48GB, you need a different design of kernel, which was an important option in RHEL4, but is largely gone from Linux now. In that design, most of the kernel is normally unmapped, so the kernel is effectively in its own 4GB virtual space rather than limited to a quarter (typically) of each process's virtual space. Most of the 48GB of ram is normally unmapped at any given moment, but the kernel at least has enough address space to map all the data structures it uses to keep track of all the pages of physical ram.
In a 64 bit OS, virtual addresses are 48 bits that must be represented by 64bit pointers. The pointer consists of 17 identical copies of a bit that tells whether it is a user mode or kernel mode address, followed by 47 bits that give the offset within that space.
As in 32 bit OS's, all virtual addresses are translated into physical by TLBs backed by a page table structure. The number of physical address bits is again a detail varying by specific model of CPU chip and only a small part of the OS needs to worry about that detail.
32 bit X86 has three different page table designs, two of which (original and PAE) are in common use.
Original translates a 32 bit virtual address into up to 32 bits of physical address.
PAE translates a 32 bit virtual address into up to 36 bits of physical address.
64 bit X86, so far, has only one page table design (which is very similar to 32 bit PAE), which translates a 48 bit virtual address into a physical address of up to 40 bits (but specific chip models might support fewer than 40 bits). 64 bit X86 was designed to allow evolution to more physical and virtual address bits in future chip versions without needing any code change to user mode code nor to most kernel mode code.
Up to 11 bits could be added to physical addresses with only a tiny change in page table structure. Virtual addresses could be changed from 48 bit to 57 bit with a bigger change to page tables, or all the way to 64 bit with an even bigger change. A fundamental change in page table structure would be needed for over 51 bits physical, but even that would still need changes only in the page table management section of the OS, not in any user mode code.