Page 1 of 1
Upper or Lower 2GB
Posted: Tue Sep 17, 2002 3:05 am
by srg
Hi
I've noticed that OSs like Windows 2000 and Linux put the os code and data into the top 2GB of the Virtual Address Space.
What is the advantages of doing this? I thought that it would be more logical to have the os code and data in the lower 2GB and the apps in the Upper 2GB of Virtual space.
Thanks
Re:Upper or Lower 2GB
Posted: Tue Sep 17, 2002 3:23 am
by Pype.Clicker
For windows, i think this is because it must run some old progs in virtual mode (thus locking 0..1Mb address ranges). Having user code @ low addresses also allow easy implementation of 0-based user segments which is known to allow faster user-2-kernel switches
Re:Upper or Lower 2GB
Posted: Tue Sep 17, 2002 3:48 am
by srg
IC
Is this why Linux does it?
It seems that all the major os do this.
If I want to use v86 at any time will I have to do this then?
Thanks
Re:Upper or Lower 2GB
Posted: Tue Sep 17, 2002 5:03 am
by Tim
I don't see any reason for doing one or the other, except that V86-mode code always uses the bottom megabyte. That is, if you want to run V86-mode code, you will need to make the bottom megabyte accessible to user mode.
Also, Windows 95/98\Me must make at least the bottom 4MB accessible from user mode because DOS and the BIOS are still used.
Re:Upper or Lower 2GB
Posted: Tue Sep 17, 2002 6:11 am
by srg
Also, If the OS is using the top part of memory, what about DMA, that only uses the bottom 16MB.
Re:Upper or Lower 2GB
Posted: Tue Sep 17, 2002 8:29 am
by Tim
ISA DMA uses the bottom 16MB of the physical address space; in other words, it can only access the RAM chips that are placed below the 16MB mark. The bottom 16MB of RAM can be put anywhere in the virtual address space by means of paging.