adjusting cstrt386.asm for HX #1242
Replies: 4 comments 1 reply
-
I'm not familiar with the HX extender, but I've looked into this idea of adding support for it to OW in the past. Anyway if you have code for OW 1.9 then it should work with OW 2.0 because there should not be big difference in C run-time library. OW 2.0 CRTL is mostly extended for better POSIX support. If there are some problems then it should be reported to be fixed or changed. |
Beta Was this translation helpful? Give feedback.
-
Yes, that works ( mostly, IIRC the "spawn" family of functions have problems ). I just wonder what the new "extender type" X_HX is good for.
That's true. It's more a technical problem: if new externals are added to cstrt386.asm, those have to be added to the modified code as well. |
Beta Was this translation helpful? Give feedback.
-
X_HX it was done in the past if I was thinking about adding HX DOS extender to supported Extenders.
It is not problem to implement it into OW2.0 code that it will be maintained by OW developers if such situation appears. |
Beta Was this translation helpful? Give feedback.
-
I played around with OW2.0 and some 32.bit DOS applications created using HX - works very well. There's a little mystery, though: I've made a special PE loader that changes the page attribute of non-writeable section to R/O ( with DPMI function 0x507 ). That works well with the _TEXT section ( code ), but causes a page fault if I also want to protect CONST & CONST2 segments: Here's the relevant part of the map file:
The reason for the page fault is in file clib/doslfn/c/inirmlfn.c:
There are 2 variables, __lfn_rm_tb_linear and __lfn_rm_tb_segm, declared as "const", but nevertheless modified here. Is there a reason for this strange definition? Shouldn't the compiler complain? Nevertheless, after replacing this file with a modified one without that "const" attribute for the 2 variables, everything works. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm currently trying to adjust cstrt386.asm for the hx dos extender to make it run with OW v2. I did this for v1.9 and that version works.
For OW v2, the modifications are done insofar as the program starts and exits without crash. However, memory allocation doesn't work yet. What variables except _curbrk have to be setup in v2.0?
Edit: it seems to depend on the "extender type" that is set. If I set X_RATIONAL, memory allocation works. First I selected the new X_HX setting, which causes the problem. Therefore I guess memory allocation for flat model may somehow depend on the DS segment limit?
Beta Was this translation helpful? Give feedback.
All reactions