Commit Graph
78 Commits
Author SHA1 Message Date
Ryan C. Gordon 20d2bfa3ff Split out OS2EXPORT from OS2API.
Otherwise, "SomeObj * OS2API FunctionName()" won't work.
2017-12-20 18:31:48 -05:00
Ryan C. Gordon 93448975c2 Whoops, DosCloseMutexSem() needs to free memory we previously allocated. 2017-09-15 10:49:26 -04:00
Ryan C. Gordon ceb7900db7 Implemented DosCloseMutexSem().
This gets PhysicsFS's test_physfs.exe to run (although it's still broken in
other ways).
2017-09-14 23:51:04 -04:00
Ryan C. Gordon 4e6452445e More work on getting Java to run. Still not there. 2016-11-01 21:38:48 -04:00
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 9251abfe4f Filled in stubs for QUECALLS library. 2016-10-29 23:53:47 -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 411c204ccb Just enough to get wasm.exe to not crash prompting for the Any key.
This lets the program survive if you run it without command line arguments.
2016-10-27 03:17:23 -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 aa322a5409 Forgot to add DosSleep() to the DOSCALLS export table. 2016-10-19 01:54:55 -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 7dcce0cbd8 Removed some commented-out incorrect code. 2016-10-17 15:53:11 -04:00
Ryan C. Gordon 47f074837a Whoops, that's not what waitpid() returns. 2016-10-17 15:51:22 -04:00
Ryan C. Gordon 1c1e6de400 Implemented DosQueryAppType(). 2016-10-17 15:44:47 -04:00
Ryan C. Gordon b9a799e22e Fixes to DosQueryCurrentDir().
This API shouldn't return a drive letter or initial path separator,
and also shouldn't leak memory.
2016-10-17 15:44:20 -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 dc00a7e998 Implemented more APIs. Watcom C's "wasm.exe" works now. 2016-10-17 02:35:39 -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 544033f2ae Some APIs that Watcom's wasm.exe needs to start up. 2016-10-15 22:08:00 -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 b4d0e571e7 Implemented some file i/o APIs and stubbed some threading primitives.
Now EMX's build of cpp.exe (GNU's C preprocessor) runs on Linux...granted,
it picks up the Linux /usr/include headers, but this is still a triumph!
2016-10-09 13:45:58 -04:00
Ryan C. Gordon 086e05dd0c DosFlatToSel() is called like any other OS/2 API.
I must have been reading docs for device drivers, or something...?

Now it returns the top word of the linear pointer, in hopes that this will
just get mushed back together later, knock on wood.
2016-10-09 13:44:10 -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 c00940caf0 This is me trying to figure out how to change the %fs register on Linux. :) 2016-10-07 20:25:03 -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 fa77133baf Added program to test command line and environment variable passing. 2016-10-06 16:37:13 -04:00
Ryan C. Gordon 262b428f51 Implemented DosGetDateTime() and DosOpen(). 2016-10-06 15:56:20 -04:00
Ryan C. Gordon 97ced670ce Added FIXME and STUBBED macros 2016-10-06 15:55:37 -04:00
Ryan C. Gordon a13361e080 Added -D_FILE_OFFSET_BITS=64 2016-10-06 15:55:09 -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 88ca89f160 Implemented some HFILE-related code better. tests/helloc.exe now works! 2016-10-05 15:44:29 -04:00