I'm trying to coax my OS into listing the available pages to be later implemented in a memory manager. I'm essentially using the int15 h/e820h map to count the 4k pages in each segment, making sure that the base and length are divisible by 4k and clipping off any extra RAM.
My worry is the first segment of the e820 map registers 0 base (which is fine) but 0x9fc00 as the length. That's not easily divisible into pages (because of the excess 0xc00 bytes in the length). That's a whole 3kb that my OS won't currently be able to use.
So...are there any ways around that? The only way I can think of handling the extra 3/4 page is to map it as normal and then somehow note that it's not all the way there but that seems awfully inefficient.
Non-page aligned memory segments...
Re:Non-page aligned memory segments...
It's not worth worrying about -- you'd be looking at saving one 3KB block out of the whole of physical memory. In percentage terms, that's negligible. Consider how you'd have to modify your page allocator to be able to use that 3KB chunk. You'd have to give it the ability to allocate 4KB pages, and part pages, all for this little bit of memory.