Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

x86 32-bit is actually capable of addressing any amount of memory, using the right compilation model. Flat 32-bit has a 4GB limit sure. But segemented, it can access any amount of virtual memory, with the caveat of only 4GB per allocation.

Probably no OS supports this any more. But the instructions set and memory management units support it, or used to in early Pentium days.



Take a look at PAE nearly every modern kernel supports it.


But do any languages? When was the last time you compiled to anything but flat?


Segment:Offset addresses are converted to 32 bit linear addresses; the segment base address in the segment descriptor is a 32 bit value.


> Segment:Offset addresses are converted to 32 bit linear addresses

That's true, but segment descriptors have a not-present bit, which allows you to implement segment-level swapping.


On a 64-bit architecture its 64-bit. 32-bit programs run there.

Also, as noted elsewhere, on 32-bit architectures there's segment swapping too. In fact I wrote an OS that segment swapped before the 386 came out, when the 286 was king. Probably the only one out there; a pretty crazy notion and the 386 came out a year later with paging.


Even in 64-bit mode the base address for code and data segments remains 32 bits - it is only expanded to 64 bits for call gate descriptors, IDT gate descriptors, LDT descriptors and TSS descriptors. The base address for the FS and GS selectors can be set to a 64 bit value, but the upper 32 bits are ignored in compatibility mode (ie when a 32 bit task is running).

The point about being able to implement segment-swapping is well-taken however.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: