Page 1 of 1
I am confused about the memory
Posted: Mon Feb 04, 2008 3:09 pm
by packet50071
I am really confused about the 4GB deal that we can access in PM mode and also I have a few questions thats i am not no clear about
1. where will my kernel load ?
2. where will I load other programs ?
3. whats happen in the 4gb space ?
thx in advance for all your help ( i did a search and Google and a lot of reading but still not clear )
Posted: Mon Feb 04, 2008 3:22 pm
by jerryleecooper
memory is a linear space between 0x00000000 and the amount of ram you have in your computer. So you can put your kernel whereever you want to into this memory space. For example, if you have 128 mb of ram, you can put your kernel at, if it's not bigger than 512kb, at 0x8000000 - 512kb maximum, or 0x0000 minimum, but be careful with addresses lower than 1mb, because they are called lower memory, where the bios and text and vga memory are located.
My own kernel loads at 1mb, each programs loads after each other, like a stack, kernel + program + program.
Paging is what's takes some pages, chunks of 4kb aligned addresses, and assembles them to pretend they are bigger pieces of data. It's the inverse of a stack.
Paging is to RAM what disk fragmentation is to hard drives.
Posted: Mon Feb 04, 2008 4:03 pm
by packet50071
thx for clearing that
Whats up with the 4gb thing?
Posted: Mon Feb 04, 2008 4:06 pm
by mathematician
You can load your kernel anywhere you link it to load, but generally speaking it can only load in one place because there is no way of relocating the memory references it contains.
Similarly, you can load applications anywhere you want, but once the OS is up and running you can relocate them by using paging - that is the hardware and OS between them conspire to fool the application into thinking that it is loaded at one address when it is in fact loaded at another, and perhaps not even in contiguous memory.
4Gb is simply the maximum amount of memory you can address with 32 bits.
Posted: Mon Feb 04, 2008 4:35 pm
by Brynet-Inc
packet50071 wrote:Whats up with the 4gb thing?
Well, What's 2^32?
Posted: Mon Feb 04, 2008 6:40 pm
by packet50071
true
thx
So how can i figure out where grub loaded my OS !
the variables that i declared in my kernel where will they be ?
Posted: Mon Feb 04, 2008 10:16 pm
by bewing
In the message where grub loads your kernel, it says what the load address is. It's almost always at 1M (0x100000).