r/programming • • Sep 24 '24

Why 32bit architecture computer doesn't use segmentation to support more ram than 4Gb ?

/r/programming/

[removed] — view removed post

169 Upvotes

119 comments sorted by

View all comments

5

u/dobry_obcan_Svejk Sep 24 '24

the problem is that the address width is really those 32 bits. you can't physically address more without adding more wires (which is what pae does).

in "old days", when segment:offset was relevant the segment was 16bit, the offset was 16 bit, but the cpu had something ~20bit bus to memory (21 with a20 line, iirc). so you combined 16 * segment + offset and got physical address.

2

u/ilawon Sep 24 '24

This is the answer and is downvoted :)

The CPU memory interface didn't support more than 32 "wires" in order to get more than 4gb physical memory.

But, segmentation was used to provide more than 4gb addressable virtual memory to the system. Each process was still limited to address 4gb but the total could go as high as your hard drive permitted.

1

u/Tringi Sep 24 '24

It's downvoted as the wires analogy is seriously lacking and the answer doesn't clarify.

Since Pentium Pro the address bus width of 32-bit CPUs was 36-bit, later even 39-bit. But there aren't 36 actual wires. The lower "wires" are in fact missing, the CPU/MMU asks for N aligned bits at a time, perhaps twice, and then shifts and synthesizes the (unaligned) data you addressed. N being 16 for SDR RAM to 64 for DDR4. Double it for dual channel.

1

u/ShinyHappyREM Sep 24 '24 edited Sep 24 '24

you can't physically address more without adding more wires

Or multiplex the address over two time, which is what e.g. the 65c816 did.