Contributed by johan on from the all-your-mem-are-belong-to-us dept.
Tobias Weingartner (weingart@) has committed largemem support for the amd64 OpenBSD port.
We asked Toby to elaborate a little bit on the topic, here's what he told us:
The amd64 memory handling and detection was still using the old BIOS routines to retrieve the amount of base and extended memory. So the re-writing of the memory detection routine required the use of the "new" E820 bios routine. This has a number of positive effects.
- it will tend to discover memory above 4G.
- It will tend to not use memory that is assigned to ACPI (which is a good thing).
- Many new BIOS will tend to do the right thing with E820, but screw up the others.
Unfortunately, rewriting the memory load routines ended up snowballing in a number of places:
ptoa() needed a cast to make sure that integers passed (constants) to it would sign extend the right way.
Various constants needed "UL" suffixes added to them to make things not complain.
The memory handling routine needed to be made aware of more holes in the memory map (to fix allowing mmap() of various X11/device things)
Along with the new memory loading things, the maximum data segment limit was bumped, so right now a process can use up to 8G of data segment. This of course means that malloc(3) may return pointers that are larger than 32 bits, which I'm sure some ports programs will not enjoy. In particular, the amd64 is an I32LP64 architecture, which means that an "int" will not be large enough to hold a pointer.
(Comments are closed)