Commit Graph
176 Commits
Author SHA1 Message Date
arti a4401283cb build: find ncurses headers and the 32-bit ncurses lib on Arch
Build / Linux (push) Waiting to run
CMake 4.4's FindCurses leaves CURSES_HAVE_* unset on this system, so the
HAVE_CURSES_H fallback keeps viocalls compiling. Also fall back to
/usr/lib32/libncursesw.so.6 when the hard-coded Debian path is absent.
2026-11-01 00:13:45 +02:00
arti 91b78f215d lx_loader: treat the OS/2 null selector as a null pointer
gspac/gspcg pass 0003:0000 (selector index 0, RPL 3) as a null far
pointer; lxConvert1616to32 only special-cased addr1616 == 0 and asserted
on ldt[0]. Segment index 0 is the null selector by definition, so return
NULL. This unblocks the TMS340 C front end (gspac), optimizer (gspopt)
and code generator (gspcg) under 2ine.
2026-11-01 00:13:45 +02:00
opencode.energia.arti.ee 68f873784b tms34010: run TI TMS34010 OS/2 tools (gspa/gsplnk/gsprom) under 2ine
Build / Linux (push) Waiting to run
Fixes needed to run the 1990 TI 'TMS340 Family Code Generation Tools r5.01'
(16-bit OS/2 1.x NE, DOSCALLS-only) on 2ine:

* CMake: fall back to the system SDL2 headers when /usr/local/include/SDL2
  is absent; the hard-coded path broke the build on stock distros.

* doscalls16: implement the entry points these tools import
  - Dos16GetDateTime (33) with the OS/2 1.x *hours-first* 10-byte layout
    (the year-first 8-byte layout crashes gspa in asctime/localtime)
  - Dos16NewSize (68)
  - Dos16GetHugeShift (135) / Dos16HugeIncr (136)
  - Dos16CreateCSAlias (43), Dos16DevConfig (52), Dos16Move (67)

* lx_loader: walk NE fixup chains to the segment's 64K virtual size instead
  of its file size, so fixups pointing into the BSS tail are applied. gspa
  segfaulted in a lcall to its CRT exit handler because of this.

* doscalls: do not assert that the host PID fits in 16 bits (pid_max is
  4194304 on current kernels); the 16-bit API truncates anyway.

Verified: gspa assembles a 2,412-line TMS34010 source with 'No Errors,
No Warnings', gsplnk links it with rts.lib, gsprom converts to Tek-hex.
The C compiler child (gspac via gspcl) still hits the lxConvert1616to32
selector assertion; see TMS34010.md.
2026-10-31 20:50:11 +00:00
Ryan C. Gordon 1ca194f39b viocalls: Actually, VioGetMode() needs to initialize ncurses.
It needs the screen size, etc.

Now that 23e344a212 fixes unloading the
VIOCALLS module, we can tolerate this better.
2022-01-31 11:39:58 -05:00
Ryan C. Gordon 23e344a212 lib2ine_shutdown(): Don't zero out GLoaderState.
Otherwise, lxTerminate() can't finalize loaded modules, etc.
2022-01-31 11:39:04 -05:00
Ryan C. Gordon fa7901d918 vio: Don't init ncurses in VioGetMode().
Info-Zip unzip.exe uses this but doesn't actually _need_ anything but
stdout, so don't mess up the terminal if we don't have to.

We might actually _need_ to query terminal characteristics at some point
in a complete implementation of VioGetMode, but for now this is fine.
2022-01-31 10:28:49 -05:00
Ryan C. Gordon 86446d8d9c msg: Stub implementation for 32-bit DosTrueGetMessage(). 2022-01-31 10:13:52 -05:00
Ryan C. Gordon fc4154b166 doscalls: fixes to DosQueryPathInfo(x, FIL_QUERYFULLNAME, ...).
This gets unzip.exe (and self-extracting zip files) to mostly work.
2022-01-31 10:12:42 -05:00
Ryan C. Gordon 44a4efd45b Updated copyright for 2022. 2022-01-29 16:35:17 -05:00
Ryan C. Gordon d1c19eadba doscalls: Added a missing TRACE_NATIVE macro. 2022-01-29 16:34:14 -05:00
Ryan C. Gordon 908587878a doscalls: Fixed a memory leak. 2022-01-29 16:33:54 -05:00
Ryan C. Gordon e993edf411 doscalls: Implemented DosCreateDir and Dos16MkDir
Not sure what Dos16MkDir2 is--probably a large extended attributes struct?--
but the real OS/2 toolkit defines DosMkDir and DosMkDir2 to be DosCreateDir,
so hopefully this is fine in general.
2022-01-29 16:31:06 -05:00
Ryan C. Gordon e301ebf8d9 cmake: Needed some tweaks to build on Ubuntu 21.10. 2022-01-29 16:29:39 -05:00
Ryan C. Gordon f7d6515978 Convert .hgignore to .gitignore 2021-08-14 00:52:11 -04:00
Ryan C. Gordon e080a6bedb Create main.yml 2021-07-03 17:06:43 -04:00
Ryan C. Gordon 249c37e68a Hack to make this work on my Linux box for now. 2021-07-03 16:50:20 -04:00
Ryan C. Gordon d5f94592c7 Update README.md 2021-07-02 16:36:33 -04:00
Ryan C. Gordon 793876f985 Update and rename README.txt to README.md 2021-07-02 16:36:13 -04:00
Ryan C. Gordon 1b3c9239af Update LICENSE.txt
Reformatted so GitHub recognizes zlib license.
2021-07-02 15:26:33 -04:00
Ryan C. Gordon e91f8bdd25 Create FUNDING.yml 2021-07-02 15:19:06 -04:00
Ryan C. Gordon c970615447 lxapigen.sh: Report diffs of new files instead of a weird error. 2018-07-12 01:43:54 -04:00
Ryan C. Gordon 666c2ed7e4 A DosBeep() test program. 2018-07-11 01:13:42 -04:00
Ryan C. Gordon b8f67643dc Make DosBeep volume configurable. 2018-07-10 02:00:31 -04:00
Ryan C. Gordon 1fd6bab8eb Report OS version as OS/2 Warp 4.5, not 4.0.
It's the last official release (and even what modern spins, like ArcaOS 5,
report).
2018-07-10 01:45:05 -04:00
Ryan C. Gordon 490702cc45 Implemented DosBeep in doscalls and a simple audio mixer in lib2ine. 2018-07-10 01:33:11 -04:00
Ryan C. Gordon 8c5d43f997 pmwin: Added a few WinIs* APIs. 2018-07-10 01:27:30 -04:00
Ryan C. Gordon e31492cc16 pmwin: Changed a bunch of printf things from "unsigned int" to "uint". 2018-07-10 01:26:40 -04:00
Ryan C. Gordon 536bf684cb Implemented more robust current dir/disk APIs. 2018-07-10 01:30:01 -04:00
Ryan C. Gordon 1ce68d5bcf GLoaderState.running shouldn't be set here. 2018-07-10 01:20:08 -04:00
Ryan C. Gordon 0894e3d69d More work on mapping OS/2 drive letters to the Unix filesystem. 2018-07-10 01:19:37 -04:00
Ryan C. Gordon 8c8f41634f lxapigen.pl: Strip whitespace from function names when parsing headers. 2018-06-29 23:38:27 -04:00
Ryan C. Gordon 25ddf52ad7 lxapigen.pl doesn't need the native dir specified on the command line now. 2018-07-03 22:47:58 -04:00
Ryan C. Gordon 0a6a7208d8 Added a perl script that will filter os2imports.pl.
It filters out APIs that are implemented in 2ine, so you can see just what's
missing.
2018-07-03 22:47:19 -04:00
Ryan C. Gordon afc9e0846f Fixed exepack2 decompression.
Now 4os2.exe runs without a weird crash during startup (but still fails on a
missing API call a little later).
2018-06-29 22:05:06 -04:00
Ryan C. Gordon ec49615ef3 Fixed incorrect stack setup in NE loader. 2018-06-27 18:52:42 -04:00
Ryan C. Gordon 14073f3361 Added a basic config file parser to lib2ine.
This will let the app set up some state about the OS/2 "system", like what
Unix paths are mapped to which OS/2 drive letters, system vars, etc.

This reads from /etc/2ine.cfg, and then tries a copy in the user's local
config dir to add/override settings.

This mostly doesn't do anything yet, but the framework is there for adding
stuff, and the drive letter mapping is done, even if nothing is using it.
2018-06-24 02:40:36 -04:00
Ryan C. Gordon 9860532454 Cleanup *INFOSEG creation. 2018-06-19 13:59:21 -04:00
cracyc 35d2162ba4 fix last few export names 2018-06-19 12:05:24 -04:00
cracyc c7f212d035 build fixes 2018-06-19 11:59:46 -04:00
cracyc 8457fc0e22 Implemented a whole bunch of 16-bit APIs. OS/2 1.0's cmd.exe sort of works!
(Most of this work was cracyc's effort, but I started tweaking it before
I thought to perform a commit.  --ryan.)
2018-06-18 15:52:58 -04:00
cracyc 5ae85f2426 Use OS2PATH instead of Ryan's hardcoded hack. 2018-06-18 15:29:36 -04:00
Ryan C. Gordon 3e83a67d48 Let OS2APIINFO optionally take key/value pairs, use it for export names.
This lets me remove my tcpip32 hack, and will let me export old symbols
as all caps for OS/2's use and something more sane for regular use
(like VioGetCurPos() in modern times is VIOGETCURPOS in viocalls.dll, etc).
2018-06-17 22:21:52 -04:00
Ryan C. Gordon fcbedae5d1 Fixed comment. 2018-06-17 00:23:53 -04:00
cracyc 1b885afc0b Deal better with proc lookup into 16-bit bridge entry points. 2018-06-16 23:46:42 -04:00
cracyc a13726b2b7 Allocate the full 64k segment for the environment.
This is read/write memory owned by the process, which can reallocate it,
which CMD.EXE does.

(FIXME comment by ryan, rest of the patch was from cracyc.)
2018-06-16 23:45:07 -04:00
cracyc 241c4ea590 CMakeLists.txt: check for ncursesw/curses.h. 2018-06-16 23:31:51 -04:00
cracyc 38ae18c0fe Accept NE EXE type 0 or 1 (really old 16-bit OS/2 apps use 0). 2018-06-16 21:48:31 -04:00
Ryan C. Gordon a80afaa0c1 Be aggressive about saving registers in the 16-bit bridge.
Fixes a lot of stuff.  :)
2018-06-14 12:25:38 -04:00
Ryan C. Gordon cdaf533140 Fixed typo in Dos16Write's TRACE_NATIVE line. 2018-06-14 12:24:57 -04:00
Ryan C. Gordon 4ab1d427b7 lx_loader: deal with iterated segments in NE executables. 2018-06-13 01:46:41 -04:00