Total Accessible Memory

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
slacker

Total Accessible Memory

Post by slacker »

according to Tim Robinson's memory management tutorial:

Without using paging, the x86 can only address 16MB of physical memory.

But in the Intel manual it says we can access up to 4gb just by setting the granularity bit in the GDT.

i am confused. anyone know the real size of memory available using segmentation and paging..?
Nairou

Re:Total Accessible Memory

Post by Nairou »

Umm yeah that doesn't make sense. Paging is used to create virtual address spaces, not to allow you to access all physical memory. You're right, all you have to do is set the correct base and limit for the selector in the GDT, and you'll have access to all physical memory it encompasses. There is no 16MB limit for anything other than DMA.
slacker

Re:Total Accessible Memory

Post by slacker »

Tim Robinson: you might want to update your tutorial...
Tim

Re:Total Accessible Memory

Post by Tim »

I thought I did... :)

Where did you see that mistake?
slacker

Re:Total Accessible Memory

Post by slacker »

memory management 1 tutorial
Tim

Re:Total Accessible Memory

Post by Tim »

Yes, I know which tutorial, but what was the location of the page? What was the URL?
Thunder

Re:Total Accessible Memory

Post by Thunder »

I have created memory definition with direct probing.
I have accessed all my 128 MB RAM without paging. There was mistake in Memory management... :P
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Total Accessible Memory

Post by Pype.Clicker »

the 286 was limited to 16MB of physical memory (hence the weird disposition of base_hi byte separated from other BASE bytes in descriptor tables). 386 had 32bits of physical address space and paging capabilities, but 4GB of memory can be used regardless of PG bit state (and this was wildly used by a large amount of MS-DOS games which needed all memory access, without the extra cost of paging (and page cache misses :))
slacker

Re:Total Accessible Memory

Post by slacker »

TIM: ITS RIGHT ABOVE THE "ORGANIZATION" HEADING

Most other 32-bit architectures split their 4GB address space into pages, as the 386 does. The x86 introduces segmentation, which allows the OS to reference memory as code, data, stack etc., but in this respect the x86 is different to most other processors. It would be nearly impossible to port a segmented x86 operating system to another architecture; also, no mainstream compilers can handle segmentation in 32-bit mode, so you?re restricted to assembler on a segmented OS.
Without using paging, the x86 can only address 16MB of physical memory. This comes back to the 286: as a 16-bit processor running on a 24-bit bus, it could only address 16MB. Without segmentation, you were restricted to 64KB. When the 386 came out it became possible to divide memory into 4KB pages, the advantage of which was that it was now able to look at the full 4GB address space allowed by a 32-bit processor. The disadvantage of this was that it was now not possible to allocate memory in blocks smaller than 4KB if you wanted more than 64KB (although, if you read on, this becomes less of a problem).
slacker

Re:Total Accessible Memory

Post by slacker »

ooh. its osdev.neopages.net/tutorials
slacker

Re:Total Accessible Memory

Post by slacker »

its also not updated on your home page...
Tim

Re:Total Accessible Memory

Post by Tim »

Thanks. There might be a short time before the web page you read gets updated, but I'll make the change.
Post Reply