How to compile this program for DOS? (Developers)
Hello rosegondon,
My proposed modified patch (for now) is as follows:
--- otp.c.orig 2021-09-18 18:49:22.723186562 +0000
+++ otp.c 2021-09-18 19:27:31.893487497 +0000
@@ -57,4 +57,10 @@
#endif
+#ifdef __DJGPP
+#define __far
+#define _intdos intdos
+#define _REGS REGS
+#endif
+
#ifdef unix
#include <sys/time.h>
@@ -311,8 +317,8 @@
ri.h.dl = 0; /* Default drive */
if (_intdos(&ri, &ro) != 0xFFFF) {
- trash[1] = (((int32_t) ro.x.ax) << 16) | ro.x.bx;
- trash[2] = (((int32_t) ro.x.cx) << 16) | ro.x.dx;
+ trash[5] = (((int32_t) ro.x.ax) << 16) | ro.x.bx;
+ trash[6] = (((int32_t) ro.x.cx) << 16) | ro.x.dx;
}
- trash[4] = (int32_t) (char __far *) trash;
+ trash[7] = (int32_t) (char __far *) trash;
#define OS_KNOWN 1
#endif
@@ -353,5 +359,7 @@
trash[4] = getpid();
trash[11] = getppid();
+#ifndef __DJGPP
trash[38] = gethostid();
+#endif
/* If the system implements /dev/random, obtain 16 bytes
of entropy thence. */
Further improvements are probably possible.
Thank you!
---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"
Complete thread:
- How to compile this program for DOS? - rosegondon, 18.09.2021, 02:50 (Developers)
- How to compile this program for DOS? - sezeroz, 18.09.2021, 14:47
- How to compile this program for DOS? - rosegondon, 18.09.2021, 18:37
- How to compile this program for DOS? - tkchia, 18.09.2021, 21:16
- How to compile this program for DOS? - tkchia, 18.09.2021, 21:31
- How to compile this program for DOS? - rosegondon, 19.09.2021, 01:28
- How to compile this program for DOS? (patch) - Rugxulo, 19.09.2021, 06:20
- How to compile this program for DOS? (patch) - rosegondon, 19.09.2021, 09:40
- How to compile this program for DOS? (patch) - Rugxulo, 19.09.2021, 06:20
- How to compile this program for DOS? - rosegondon, 19.09.2021, 01:28
- How to compile this program for DOS? - rosegondon, 18.09.2021, 18:37
- How to compile this program for DOS? - sezeroz, 18.09.2021, 14:47