FDOS/kernel

When allocating HMA the requested size is not rounded up to paragraph

andrewbird opened this issue · 6 comments

When using int2f/0x4a02 to get an HMA block the requested size is not rounded up with respect to paragraph, as it is on MS-DOS 6.22/7.0/7.1. This was recently fixed in FDPP dosemu2/fdpp@e7fe81d
See https://github.com/dosemu2/dosemu2/blob/7454efb873977214cd8605380954a4cc86a53441/test/func_memory_hma.py#L61 for an example test, where the requested size is 35 bytes, and the expectation is 48 bytes.

This patch as is will overflow for bx > 0FFF0h.

Well spotted.

updating the hma allocation functions are on my todo list along making sure that the kernel handles multiple umb providers. I am reworking some initialization code, which I plan to include memory management as part of, along with the gpt support I'm working on

updating the hma allocation functions are on my todo list

Will you support the Win9x HMA layout too, see http://www.ctyme.com/intr/rb-4818.htm?

yes

Cool, then that means the mcbs command in dosdebug can display it nicely.