FDOS / kernel

FreeDOS kernel - implements the core MS-DOS/PC-DOS (R) compatible operating system. It is derived from Pat Villani's DOS-C kernel and released under the GPL v2 or later. Please see http://www.freedos.org/ for more details about the FreeDOS (TM) Project.
http://kernel.fdos.org/
GNU General Public License v2.0
811 stars 144 forks source link

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

Closed andrewbird closed 1 year ago

andrewbird commented 1 year ago

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 https://github.com/dosemu2/fdpp/commit/e7fe81d458f7f68f9c331a22c788895cfd341156 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.

ecm-pushbx commented 1 year ago

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

andrewbird commented 1 year ago

Well spotted.

PerditionC commented 1 year ago

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

andrewbird commented 1 year ago

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?

PerditionC commented 1 year ago

yes

andrewbird commented 1 year ago

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