Ryan C. Gordon
2ee12b66a3
16-bit bridging code now protects %es register.
...
Fixes crash with Info-Zip's unzip.exe blowing up calling into ncurses
via VioGetMode().
2016-11-01 21:37:57 -04:00
Ryan C. Gordon
c4d2d5ee15
Some initial VIOCALLS support via ncurses, other 16-bit updates.
2016-10-29 02:05:01 -04:00
Ryan C. Gordon
d26519332f
Deal more correctly with process termination politics.
...
Now shared libraries run their termination entry points and deallocate,
the DosExitList functions can run, we free our stack selectors, etc.
2016-10-28 02:32:05 -04:00
Ryan C. Gordon
137ba61ecb
Generate missing-function-called trampolines for 16-bit APIs.
...
Much better than crashing out in arbitrary 16-bit application code!
2016-10-27 11:19:24 -04:00
Ryan C. Gordon
2481f59a28
Bunch of work on getting java.exe to start up. Not there yet.
...
Lots of fixes, improvements, and a few more APIs implemented.
2016-10-27 03:20:02 -04:00
Ryan C. Gordon
970cbbc0c2
Fixed lookups into the non-resident name table.
...
It uses a different base offset than the resident one.
2016-10-27 02:26:20 -04:00
Ryan C. Gordon
26a52988a6
16-bit support!
...
This gets us everything we need (I hope!) to support 16-bit code in LX
binaries and call into 16-bit OS/2 APIs. This is just enough to call
into VioGetMode() (which isn't otherwise implemented yet) as an example.
If this is ever used Winelib-style to provide an OS/2 API to native Linux
binaries, the 16-bit system APIs are 32-bit clean and C callable, as one
might expect them to be. All the tapdancing is to support existing LX
binaries in the loader and bridge between the 32-bit clean APIs and
existing 16-bit code that expects to call 16-bit APIs.
This was a staggering amount of effort, but yay!
Other fixes and improvements probably leaked into this commit, as a
lot of code got touched and a lot of research and debugging took place.
2016-10-27 01:44:26 -04:00
Ryan C. Gordon
29696db8b3
Implemented Thread Local Storage support.
...
This is still rough, but the basic idea seems to work!
2016-10-19 03:21:15 -04:00
Ryan C. Gordon
e8c5bc119e
Implemented support for "iterated" data pages.
...
Fixes initial load of jv12mi36.dll (Java 1.3 that ships with OS/2 Warp 4.52).
2016-10-18 01:06:31 -04:00
Ryan C. Gordon
460e454ff3
runLx* don't need to adjust the stack for the TIB space any more.
2016-10-17 21:55:20 -04:00
Ryan C. Gordon
c4a784b9dc
Whoops, unbroke my EMX hack.
2016-10-17 21:45:11 -04:00
Ryan C. Gordon
60e62a1306
Moved the path conversion code to lx_loader.c, and use it.
...
Fixes loading "emx.dll" when the loader asked for "EMX.dll", etc.
2016-10-17 21:10:29 -04:00
Ryan C. Gordon
2016af81a2
Added support for import-by-name fixup records.
...
Fixes Watcom C's wlink.exe not loading at all.
(...and now it actually links binaries!).
2016-10-17 20:06:52 -04:00
Ryan C. Gordon
cbffb2ff60
Initialize the PIB at startup.
...
Otherwise, it won't be available to DLL init code when run before the
main executable starts.
Fixes Watcom C's wlink.exe crashing because it gets a NULL command line.
2016-10-17 17:00:32 -04:00
Ryan C. Gordon
8047d55bcb
Wire up loading of LX name tables. Fixes DosQueryProcAddr() with strings.
2016-10-17 15:43:08 -04:00
Ryan C. Gordon
2c2526abe1
Fixed some details of DLL loading.
2016-10-17 12:00:57 -04:00
Ryan C. Gordon
e011e5cec1
Implemented more APIs; a little further into Watcom C's wcc386.exe now...
2016-10-17 10:56:50 -04:00
Ryan C. Gordon
b2e32aeb37
Separate TIB from OS/2 stack.
2016-10-16 12:24:38 -04:00
Ryan C. Gordon
ef4d529544
Pass actual selector (without shifting) so we deinit the segment correctly.
2016-10-16 12:23:24 -04:00
Ryan C. Gordon
d8f62859c7
Library init passes the library module handle on the stack, as it should.
2016-10-16 12:21:32 -04:00
Ryan C. Gordon
af2e92fa73
Pass the exe's module handle to the OS/2 process entry point.
2016-10-15 22:10:29 -04:00
Ryan C. Gordon
6454917556
Fixed environment/command line tables passed in at OS/2 process entry.
...
This worked before on EMX-based binaries, but this fix makes it also work
on binaries compiled with Watcom C.
2016-10-15 22:09:56 -04:00
Ryan C. Gordon
ea0a7618b1
Turned some error output back on.
2016-10-14 03:40:24 -04:00
Ryan C. Gordon
68aa18c5a1
Consolidate and turn off all the debug logging for now.
2016-10-14 02:51:37 -04:00
Ryan C. Gordon
0349122bd7
Bunch More Work: more APIs, subprocesses, multithreading.
...
EMX's GCC compiler can now build hello.c when run from lx_loader!
2016-10-14 02:39:17 -04:00
Ryan C. Gordon
ccad3a0dbb
Hooked up the FS register and TIB support.
2016-10-08 16:34:59 -04:00
Ryan C. Gordon
b04f032caa
Fixed passing of command lines to LX program.
2016-10-06 16:37:46 -04:00
Ryan C. Gordon
95d666c01b
Add native modules to the loaded modules list.
...
Otherwise we'd reload/reinit libdoscalls.so (etc) for every module!
2016-10-05 15:52:11 -04:00
Ryan C. Gordon
fae99dc048
Turn off some debug output. I'm sure I'll regret this soon. :)
2016-10-05 15:45:23 -04:00
Ryan C. Gordon
d9823705c0
Nop out the read of the FS register in EMX's syscall interface for now.
...
Eventually, we'll maybe need to set the FS register to be a proper TIB pointer,
but I'm mostly hoping that everything else was well-behaved enough to always
use DosGetInfoBlocks() instead. Yeah, right.
2016-10-02 18:21:51 -04:00
Ryan C. Gordon
f681be1b1f
Reworked the native module loading code.
2016-10-02 18:18:31 -04:00
Ryan C. Gordon
ebe5f95a3e
Put a real CMake project in here.
2016-09-30 18:08:36 -04:00
Ryan C. Gordon
bee2afe62b
Bunch More Work, mostly cleanup and organization.
...
Wanted to do this now before it gets out of hand.
Ideally, this can be used for a Winelib-like option eventually, too, where you
don't load OS/2 binaries at all but rather compile and link your OS/2-based
source code against this API reimplementation.
2016-09-30 15:58:48 -04:00
Ryan C. Gordon
6220544d06
Bunch More Work on getting an EMX-based "hello world" to run.
...
It looks like most of the remaining work for that is filling in dozens of
OS/2 APIs that EMX uses at startup just so we can get to our single
printf() call. :)
2016-09-30 10:36:33 -04:00
Ryan C. Gordon
08eaf1f59f
Fixed buffer overflow.
2016-09-27 10:07:47 -04:00
Ryan C. Gordon
3df4fc0544
Report caller address for missing functions.
2016-09-27 10:05:08 -04:00
Ryan C. Gordon
141ff8bdcd
More fixup fixes. We're now into EMX crt0.s, calling missing doscalls APIs.
2016-09-26 15:31:54 -04:00
Ryan C. Gordon
4c09b9b6f5
Call library init/termination code.
2016-09-26 12:14:45 -04:00
Ryan C. Gordon
d3e686276b
Fixups fixes.
2016-09-26 12:13:18 -04:00
Ryan C. Gordon
41e66c9071
Some more work on getting DLLs working.
2016-09-25 14:21:31 -04:00
Ryan C. Gordon
c3d9945942
Fixup source offsets are signed values (and sometimes negative!).
2016-09-25 14:20:20 -04:00
Ryan C. Gordon
17a64c9407
Don't load modules that are marked as non-loadable.
...
(Whatever that means in practice.)
2016-09-25 11:06:34 -04:00
Ryan C. Gordon
b82eabcdac
Try loading modules at random locations and see what happens.
2016-09-24 01:06:00 -04:00
Ryan C. Gordon
ce8215ff40
Realign the stack before calling _exit().
...
Just in case I ever get this working on macOS. :)
2016-09-24 01:05:33 -04:00
Ryan C. Gordon
acb3c5c42e
Get exported ordinals parsed, fixup correct pages.
2016-09-23 23:55:10 -04:00
Ryan C. Gordon
1a21e64a51
Fixed typo.
2016-09-23 23:54:36 -04:00
Ryan C. Gordon
dbda4e03d0
Corrected entry ordinals in lx_dump, a few other things.
2016-09-23 00:27:50 -04:00
Ryan C. Gordon
817af8d715
Load all the object pages into memory before fixing them up.
...
Otherwise, we might fixup a page that isn't loaded yet!
2016-09-22 10:46:42 -04:00
Ryan C. Gordon
443bcf2178
Huge reworking to get shared libraries (and native replacements) working.
...
Not there yet, but the framework is pretty close to what I want.
2016-09-21 03:38:20 -04:00
Ryan C. Gordon
1d8ad0ce35
Extremely initial work on dealing with external modules.
2016-09-20 00:48:56 -04:00