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

sys: fix, work on DOS versions that clobber di in int 25h/26h #159

Closed ecm-pushbx closed 6 months ago

ecm-pushbx commented 6 months ago

Running on DR-DOS v7.03, the int 25h call zeroes di leading to a crash here when di is expected to preserve the stack pointer. So push di twice and pop it twice. The second pop always gets the saved sp, regardless of whether int 21h or int 25h/26h are used.

Refer to https://github.com/SvarDOS/edrdos/issues/57#issuecomment-2119360035