libjwdpmi
This library aims to be a complete development framework for DPMI (32-bit DOS) applications, written in C++20.
It's still in the experimental stage. Anything may change at any time.
Features
Current features include:
- C++ interfaces to access many DPMI services.
- Interrupt handling, including dynamic IRQ assignment, IRQ sharing, and nested interrupts.
- CPU exception handling, also nested and re-entrant.
- Automatic translation of CPU exceptions to C++ language exceptions.
- Cooperative multi-threading and coroutines.
- Event-driven keyboard interface.
- Integrated GDB remote debugging backend.
- Access to PIT, RTC and RDTSC clocks using
std::chronointerface. - Yamaha OPL2/OPL3 driver with automatic channel allocation.
- MIDI protocol implementation and MPU-401 driver.
- VESA VBE3 graphics interface.
- Accurate analog game port driver.
- Serial port driver with
std::iostreaminterface.
Installing
-
Build and install gcc with
--target=i386-pc-msdosdjgpp, and install the djgpp standard library.
An easy to use build script is available here: https://github.com/jwt27/build-gcc -
Set your
PATHaccordingly:
$ export PATH=/usr/local/cross/bin:$PATH- Add this repository as a submodule in your own project
$ git submodule add https://github.com/jwt27/libjwdpmi.git ./lib/libjwdpmi
$ git submodule update --init- In your makefile, export your
AR,CXXandCXXFLAGS, and add a rule to buildlibjwdpmi:
AR:=i386-pc-msdosdjgpp-ar
CXX:=i386-pc-msdosdjgpp-g++
CXXFLAGS:=-std=gnu++2a -masm=intel
export AR CXX CXXFLAGS
libjwdpmi:
$(MAKE) -C lib/libjwdpmi/- Add the
include/directory to your global include path (-I) and link your program withlibjwdpmi.a, found in thebin/directory.
obj/%.o: src/%.cpp
$(CXX) $(CXXFLAGS) -o $@ -Ilib/libjwdpmi/include -c $<
bin/program.exe: $(OBJ) libjwdpmi
$(CXX) $(CXXFLAGS) -o $@ $(OBJ) -Llib/libjwdpmi/bin -ljwdpmi -Wl,@lib/libjwdpmi/tools/ldflagsUsing
See the wiki page, where I'm slowly adding documentation.
Read the header files in include/, most functions should be self-explanatory (I hope :)). The detail namespaces contain implementation details, you shouldn't need to use anything in it (file a feature request if you do).
License
It's GPLv3, for now. I may decide to move to a different (less restrictive) license in the future. Therefore I am unable to accept code contributions at this time.