-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DJGPP and DOS #56
Comments
Hello @sduensin, The DJGPP port is contributed, and Makefile_nr not well maintained, I am sorry. However, the gcc output clearly shows that the file device.h, which exists in the microwindows/src/include directory, is not accessible. A quick look at Makefile_nr shows that perhaps Thank you! |
Thanks. I tried that. Tried setting MW_DIR_SRC on the command line, in the environment, changing the makefile, etc. It's not happy. If it doesn't actually run on DOS and nobody supports it, maybe not list it as a target platform? |
It does work, I guess I was just saying that I can't easily test it, as my development environments are macOS and Linux.
I can't see the full gcc command line in your screenshot, since it's scrolled off the screen. I can see the method of getting the includes is complicated, with INC=-I$(MW_DIR_SRC)/include being set, then CFLAGS += $(INC), then contrib/makefile_nr/Makefile-drivers being used in a separate make -f. Can you show me the portion of the screen that shows the gcc command line and the -I options? Thank you! |
I need to move my setup to a Windows box so I have scrollback. I'll see what I can do. Thanks again! |
lol I've tried that, and if you can even get it to compile, the mouse code is broken. |
The DOS port has not been maintained for several years, it has to be checked now with the latest DJGPP version plus the changes done for Microwindows during the last years. In 2014 it did work, see my XFDOS distribution which I did with Microwindows and FLTK based on it.
https://sourceforge.net/projects/fltk-dos/
I am currently working on a different project and do not have the time to test Microwindows for DOS.
Georg
From: Scott Duensing
Sent: Tuesday, November 24, 2020 2:12 AM
To: ghaerr/microwindows
Cc: Subscribed
Subject: Re: [ghaerr/microwindows] DJGPP and DOS (#56)
I need to move my setup to a Windows box so I have scrollback. I'll see what I can do. Thanks again!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Yeah, I tried to build XFDOS, too. :-( |
Try copying everything in microwindows\src\include to DJGPP\INCLUDE. That worked for me. |
Eventually, I need to get around to seeing why the mouse code is broken, because I'd love to see kind of a nice, in-process UI for (e.g. setup) applications that don't want to provide their own home-grown UI code, and could just fallback on nano-X. :D |
Anyone have time to help with this? There's coffee or beer in it for you. :-) |
Beer works for me, or a few weeks worth of snacks! xD |
I made a fork of Microwindows several years ago. https://github.com/georgp24/microwindows-android-bin This is a version which compiles with DJGPP (in the version of DJGPP at that time). It also worked with FLTK and is almost the version I used for XFDOS. |
@georgp24 can you help me get this building for DOS using DJGPP under Linux? I'll be your friend. 😀 |
I compiled it in a DOSBox of Windows XP, I never used DJGPP under Linux |
Hello @sduensin, what are you looking to get working? I haven't (yet) used DJGPP but would like to help. Are you trying to cross-compile Microwindows using DJGPP on Linux for a DOS target, or run DJGPP on DOS itself? Can DJGPP be run on a Linux or macOS system, to cross-compile for DOS? I don't have easy access to DOS, but it looks from your first screenshot that the include file directories are not setup properly on the DOS box. Perhaps DJGPP is not setup properly. Can it be used to compile other C programs on your DOS system? |
@ghaerr short version: I need a killer GUI for a DOS program I'm building. At this point, you can ignore the screenshot I posted. I had originally tried to build in DOS using the instructions in the repo. DJGPP and DOSBox don't exactly love each other and I can never seem to get a very reliable install of DJGPP fod DOS working. The way I'm going about it now is to code and test on Linux and then cross-compile for DOS using DJGPP. I used the following to get my copy of DJGPP: https://github.com/andrewwutw/build-djgpp I've had some initial luck with @georgp24 's fork. A few minor tweaks and I got some of the demos to run. In an ideal world, I'd be using the "official" branch with the GRX backend. (GRX: http://grx.gnu.de/) I can live without GRX as long as I can get backends to work for both DOS and Linux. The end goal is to run some kind of very lightweight window manager and FLKT (or similar) on top of it to allow creating a windowed GUI from C that runs in DOS. The project I'm working on is large enough without me needing to roll my own GUI (which is what I'm currently doing - very slowly). |
After you've played around a bit more with @georgp24's fork and have a feel for what works and doesn't, we can try to get things working from this repo, so feel free to share your experiences of what is working/not. I can do a In order for me to best help, I need to see specific error messages, which allow us to determine whether the problem is in tools setup, DJGPP itself, makefile(s), or a problem in the source code. Feel free to post that information.
How does the GRX backend fit within Microwindows? Are you using GRX only for the EGA/VGA screen drivers, and somehow hooking that into the engine code? Or are you trying to port Nano-X code on top of GRX? Thank you! |
I hope to get some more time to bang on it later today. At the moment, I have Nano-X building with JPEG and PNG support, and zlib for some font types. Freetype is next up and then FLTK. Only thing in the code I had to change was a backslash to a slash in an include statement. I think it was the DJGPP VESA header. I really butchered the makefile in the main src directory though. :-) Make is not my strong point. GRX isn't really needed. I just know it has really good VESA support and tends to be pretty fast. |
Okay! I have an update. I've managed to get Nano-X and NX11 to build. PX11, not so much. And none of the demos. Here's what I've learned... My original problem from waaaaaaaaay back where it can't find I'm using DJGPP on Linux Mint x86_64. I've made a tarball of my working directory hoping someone (hint, hint, @ghaerr ) feels like taking a look to see if they can make more progress and not make it an ugly mess like I fear I've done. I've made no changes to any of the files in the various source directories. Everything I've changed is contained in Running Everything is here: https://nextcloud.kangaroopunch.com/s/EPy4j6aEf9ZWFkd If you want to chat about this in mostly real time, I'm found on my support Discord at: https://kanga.world/chat/discord Long live DOS! |
Hello @sduensin, I've diff'd your Makefile.dos and the current (but old, originally named) Makefile_nr in this repo, and they are quite similar. I would be interested to know what stops working in your build, using this route. We could certainly make changes to eliminate the sed kluges etc in build.sh. I'm running on macOS, not Linux, so I won't be able to easily cross-compile using DJGPP, but I think I could probably get the regular macOS (or another gcc) compiler working on macOS using the single Makefile.dos (to be renamed later) with a different TOOLSPREFIX= or TOOLS= prefix. At this point, you're compiling the tree(s) from a Linux DJGPP compiler toolchain, correct? There may be other changes in @georgp24's tree that were never submitted, that could be required for using FLTK. After getting the basic Microwindows/Nano-X build working, we can What do you think? Thank you! |
Yeah, I started with After
You can see from the link that it's trying to link against |
Don't bother with libPX11, it isn't required and libNX11 can be used instead. libPX11 is not supported in the current repo. I can't remember exactly why @georgp24 originally created it, but libNX11 is now built to link directly with -lX11. The
|
It seems |
Whoo! This is working! It's very rough but it builds the demos and they run in DOSBox! |
Yes - I mentioned that it was added later than the georg's tree.
Are you starting with your Makefile.dos renamed, or using this repo's Makefile_nr? I suggest you use Makefile.dos from the other working tree first, then we'll replace this Makefile_nr with it.
Feel free to post linker output, and we'll get through it quickly. All of libz, FT, jpeg etc should come after the libnano-X.a (and libNX11). Are you using the version of FT specified in engine/font_freetype2.c (v2.3.12), or a later version? I recommend staying with the older 2.3.12 at first, we can then port a later version. |
Nice!! Is the mouse working? @lighth7015 mentioned that it wasn't working. Which version/where did you get the DJGPP compiler you are using? I am thinking about how I can test your Makefile.dos so I can help clean it up for commit. |
The mouse works fine in DOSBox Staging. I had issues in DOSBox-X but it has a zillion configuration options and I probably just haven't hit on the right one yet. I hope to try it on real hardware soon. The DJGPP I use came from here: https://github.com/andrewwutw/build-djgpp Still need to get FLTK to build but that shouldn't be too terribly difficult. Then I need to learn how to customize the entire thing so it looks decent and doesn't run like a rock. Dragging full windows around on a 486DX/100 is painful. Setting the defines in the makefile didn't change anything. But this is awesome! I'm excited! |
Me too. This issue has been open for a year and a half so its nice to get working finally!!
All the options XORMOVE, ERASEMOVE and UPDATEREGIONS in Makefile.dos only affect Win32 API programs. For nano-X, try editing include/nanowm.h and changing OUTLINE_MOVE to 1. There are a number of other configurable options in include/mwconfig.h you may want to look at. After you find options that work well, we can move them into -D options in a Makefile rather than having to run sed or edit a file, if needed.
It's a bit more complicated, but if NUKLEARUI is set to 1, a much newer window frame is drawn. We can also work on optimizing the blit code based on the actual hardware you want to draw on, and it's color setting. What is the graphics hardware and pixel setting you want to use on the target? (e.g. 32 bit ARGB, 16 bit 565, etc). |
Wow - that version is available for macOS, so I should be able to run the entire cross-compiler over here as well. That will help a lot. |
Yep. Easy fix.
|
Alright! With just your repo and these three files, it's all building until we run into needing buildcrossdos.sh.txt |
Not all the demos actually work under DOS (tuxchess for example), but I'm not terribly concerned. And some, like Tetris, don't do anything unless you're constantly wiggling the mouse around. :-) |
I'll fix that, thanks.
Let me know which ones do not. tuxchess needs to have the chess piece images available (which are by default) in images/demos/tuxchess/. What isn't working?
Actually, that helps a lot. That means that the GrGetNextEventTimeout() isn't working, which could affect some FLTK programs. I'm going to have to find a way to test the DOS DJGPP version of these executables. Are you using a DOS emulator to run these, and is there anything else required to be installed, other than, say MSDOS 6.22?
Wow! Thanks for fixing up buildcrossdos.sh, I'll add your changes. And probably produce a patch file for the other two FLTK .cxx files.
I'm thinking perhaps do the normal non-cross regular Linux build of FLTK, then copy |
For my testing, I'm using DOSBox Staging. It has it's own "DOS" built-in. You don't need anything else. The only thing I've done is adjust the config file to make it display at 3x on my screen and limit the "cycles" to approximate a 486DX4/100.
I like the FLTK idea. I need Linux builds of everything anyway, so that's not any extra work. I'll need to look at the makefiles some more and see if I can grok what they're doing. I can't express how much I appreciate all the help with this. There can't be that many crazy DOS programmers out there anymore. :-) |
Can you post your config file please, I'll download it and use your same settings. Let me know how the fluid build hack goes, we can probably write a script for that too once you find how to do it. I'll commit buildcrossdos.sh and I think you needed the export INSTALLED= to crossdos.sh as well.
I'm happy to help. It's about time this open outstanding issue got resolved, and I'm glad the Makefile_nr stuff is back into being maintained and used :) Definitely let me know about any other demos that don't work, or changes you make. We need to keep them in the repo so that it all works when we need it! |
Here's the shell script and config I use to run DOSBox. On Linux, I'm using a Flatpak so you'll have to adjust for Mac. |
OK, I'm confused. I did the following with FLTK:
The build removes my symlink (which I added after
(Undefined reference errors continue for pages.) |
I am guessing it is using the time/date stamp associated with the symbolic link to figure it needs to recompile fluid every time, with bad results. Perhaps forget the ln -s idea, and remove fluid target Makefile dependencies that try to build fluid's .o files, then replace the actual fluid target build line with a Hopefully the Makefile isn't too nasty. I am not a fan of autogen.sh or ./configure, as its very hard to decipher the resulting makefiles. |
Do you really need all the FLTK demos built? Even if you're using the fluid designer tool for your own applications, you should be able to write a script that uses the host fluid and DJGPP to compile and link the final binaries, right? |
I did remove the Fluid And, no, I don't need the demos. You just seem to like getting demos to build, so I figured I'd do the same. :-) |
Ah ha! The Sudoku caused some issues as well due to a non-existent resource compiler on DOS (it assumed "EXE" was Windows). This fixes both: |
I was going to make a list of demos that had issues but that's going to be "pretty much all of them". Add segfaults and redraw issues (RESIZE.EXE) to the list of problems. |
I just finished tracking down the nasty segfault bug where various applications would crash right on startup, but not always. It was an uninitialized pointer. I will be pushing that fix with the font setup fixes later tonight, along with fixes for the rest of your (smaller) reported problems. What exactly is the redraw issue with RESIZE.EXE? |
Thanks for the report on FLTK test/resize, @sduensin. I have pushed the fixes for the application crashes, and all the font fixes, and lots of other stuff. I am having big problems getting all the libraries cross-compiled for DOS using macOS, I can't even get past zlib, which is failing because macOS At this point, almost all the FLTK demos run, and work properly. Let me know what you find with the new code. If they don't run on DOS, that means we have porting issues, rather than actual Microwindows bugs. (yes, I'm sure we still have Microwindows bugs though :) I am also aware of some Microwindows demos not working properly on DOS, like ntetris. I hope to debug that, but ran into huge issues trying to get a home-brew installed version of DosBox Staging installed, which nearly wrecked my development system, causing QEMU to fail, and ultimately would not install. It seems I need Catalina in order to run DosBox Staging, which I can run on my laptop. So DOS testing is delayed at the moment, which means the Nano-X timer issues remain unfixed. |
You can also try DOSBox-X or just boring old vanilla DOSBox. We're not really using any of the newer features of X or Staging other than possibly some improved S3 video code. I'll get the latest built and test some of the demos and see what happens. |
How do you get the DOS programs loaded into DosBox-X? I notice DosBox Staging has a mount command that seems to auomatically add a host directory into a simulated FAT filesystem... is that available or DosBox-X, I do have that installed. |
@sduensin, I have the Microwindows demos cross-compiling for DOS and running on DosBox-X! However, the colors are wrong, and the mouse isn't working. How are you setting up the mouse to work within DosBox Staging? (and I assume the pixel layout too?) |
I also have mouse issues in DOSBox-X. There's some setting called "Internal Mouse" or some such that I haven't played with yet. I'll see what I can learn. I don't have color issues in either version of DOSBox. Maybe compare the Video/S3 settings in the config I posted for Staging to the defaults in X? |
I can't find anything on Video/S3 in your config file, other than 'machine=svga_s3'. Do you mean that? I set it under [dosbox] and no change. |
Also, tuxchess requires opening several .gif files for the board and chess pieces. I've just added them to be copied to demos/images/*.gif in Makefile_nr, and also enabled -DHAVE_GIF_SUPPORT=1, which was missing. However, it seems that the open code on those files may be failing. Does DOS require the open() to have the filenames in upper case? If so, that's our next problem. We also need a way to map DPRINTF calls to somewhere preferably outside the emulator onto the terminal somehow to enable better debugging... |
DOS is not case sensitive. It shouldn't care. If the names are more than 8 characters long that could upset it. I wish there was a way to write to the DOSBox console from a DOS program. Currently there is not. In my other apps I've just been logging to a file. |
I set up DOSBox-X and confirmed I'm using |
TUXCHESS still hangs at start. And every FLTK demo I tried hangs on exit. But nothing has outright blown up! |
Thanks, on the mouse, that works. The color is still not correct - I'm using the unmodified pixel format in Makefile_nr: Here is my "dosbox-x.conf":
I'm starting dosbox using:
|
Yes, I can't get tuxchess to display anything. I don't think its a hang - just that it isn't displaying any graphics. I just recently updated Makefile_nr to support GIFs, but adding -DHAVE_GIF_SUPPORT=1 and copying the *.gif files to demos/tuxchess/images. Did the FLTK demos work prior, and now they hang? That's also kind of strange, since I haven't really changed anything that should affect that. But at least most of them run now... ? |
Hello @sduensin, Ok, finally I have dosbox-x working. It required an upgrade to version 0.83.25 on macOS to fix the color issue, which luckily was just fixed 18 days ago. I can now test all Microwindows/Nano-X DJGPP binaries on DOS. Tuxchess is still not working because it can't load images, and then hangs when calling GrError, which tries to write to stderr. This must have something to do with trying to write text when the screen is in graphics mode in dosbox-x, or possible DOS as well. I've figured out the timeout fix and ntetris is now working. I can't test any of the FLTK directly on DJGPP/DOS, since still can't get external libraries cross-building on macOS, but that's ok. Is there a way to turn on long filenames in dosbox-x, so I can actually read the longer .exe filenames from the Nano-X demos? Thanks for your help! |
In the config file for DOSBox-X (look in |
I've fixed tuxchess, turns out the load image Tracking that done, found that GrError/GdError from Nano-X hung programs trying to write to stdout. Fixed by writing to log.txt and exiting. Adding lfn=true worked, except that causes dosbox-x to abort segfault after doing file I/O, so I'm leaving that option out for now. |
After installing DJGPP and reading the Microwindows FAQs and DJGPP PDF, running:
make -f Makefile_nr ARCH=DOS
results in:The text was updated successfully, but these errors were encountered: