-
Notifications
You must be signed in to change notification settings - Fork 143
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
Is -DWIN31SUPPORT
ready yet?
#50
Comments
After some fiddling I got it working... OpenWatcom only for now, as building with GCC currently fails with "ELF format does not support segment base references" which I suspect is this one. Need to set |
sorry I've been a bit busy and getting over a cold; yes this is currently only tested with OW (ia16-gcc will be supported if possible), and I am glad you found that you were missing the flags from NASM portions. I will try to update the makefile based build to include the win31 option and time permitting add the missing response for win30. Currently I primarily build under DOS/Windows, but do have a Linux box or two I also test building under. My goal is to have a new release out in time for Halloween (end of October). |
borrowing my daughter's Chromebook, didn't mean to close |
Also having problems getting Windows 3.1 to work. Applied the defines to an Open Watcom v 1.9 build (Open-Watcom-v2 fails, but it builds FDOS-freecom). Tried running Windows himem.sys instead of FREEDOS' himemx.exe and was able to get windows 3.1 running in standard mode, but not 386 mode. The startup window just freezes after blanking out and never shows the startup logo. At this point, I just gave up. Wonder if there is a particular version of himem.sys that some are using to get their's working? Tried the himem.sys from Windows 3.1. |
What errors did you encounter when compiling? I did notice that with most recent source tree, using the most recent Open Watcom 2.0 snapshot would emit some type conversion related warnings similar to this one. Suppressing that warning via I suspect that was the reason behind 4e23a63. Maybe if you use that tagged version of Open Watcom (or earlier) you will not have that issue while building. I just tested building the most recent source tree using Aug 26 2022 Open Watcom snapshot with
I think Win3.x's HIMEM.SYS is still a good option. It's only XMS 2.0 complaint so you only have 64MB of XMS available which kind of avoids startup issues related to having too much RAM. This at least allowed me to complete the installation to the very last step. Looks like you've hit the same wall as I did. I recall I pretty much reached as far as you did even with a kernel that had PS: Japheth's HX has a DOSX replacement meant to be used with HDPMI16. I haven't tested, maybe it could improve the experience with Standard mode to some extent. PPS: I tried both 86 and 386 kernels. I'm not sure about the core differences, but it seems for my actual PC, only the 86 kernel could boot okay. 386 kernel would crash/hang with certain TSRs. With UMBPCI it'll simply hang there, while if using JEMM386, the crash in question would be caught by JEMM so it becomes apparent before the system actually hangs. |
the freeze during windows logo display sounds like missing adding InDOSPolling=true to system.ini I am working on the critical section handling so it's not needed but currently without it windows will fail to start in enhanced mode. Also currently only tested without fat32 support and with windows provided memory managers. I recommend 4dos over freecom as well. Each piece needs to work with windows and doing above limits effects to kernel incompatibility not other programs. |
I need to download a more recent compiler build so that I can fix the type error. My older versions don't have it. Currently I'm tracking down a memory corruption issue with some recent changes (not pushed) that rearrange some stuff to be more compatible and add optional initial GPT partition support. |
An update on my building of most recent commit (edd0732). I'm testing this with a VirtualBox Win3.1 VM configured at 256MB. I'm considering getting the functionality validated first in a VM before actually trying it in an actual system. Unfortunately the experiments were not successful. I still need MS Using 86 kernel (
But Win3.x Using 386 kernel ( Note that regardless of kernel CPU variant, a cold boot is needed if booted into default FreeDOS configurations (HIMEMX/JEMM386) to ensure I'm not sure if the compiler I'm using might be related, as I'm using latest OpenWatcom snapshot. From one of the commits it seems issues with |
Thanks for sharing your results on this! Regarding There are pre-built GCC based binaries, for example here. You may give them a try if you think it is a compiler related issue. |
I'm not sure about the EDR-DOS kernel. Can it be booted directly via GRUB4DOS just like FDOS kernel? On my actual system I'm already booting FreeDOS this way, loading the FDOS kernel file directly via GRUB4DOS without relying on a boot sector. Though EDR-DOS kernel being fine with Win3.1 is not necessarily within the scope of this issue... as that's a kernel of its own after all.
I know about the CI. It doesn't have |
GRUB4DOS isn't very well-behaved, for instance it checks for the short jump and "CONFIG" block signature at the beginning of kernel.sys (and a file size > 16 KiB) to detect a FreeDOS load. My single-file EDR-DOS drload or iniload stages won't be detected by that, and likewise MetaKern will not either. And even when found it seems it doesn't pass the load partition's BPB anywhere to the kernel, as opposed to the original FreeDOS loaders. In fact, BP isn't initialised at all. It also skips the initial loader of the MS-DOS v7 IO.SYS, which it detects as a file > 64 KiB with an "MZ" signature word at seek 0 and a zero word at seek 510. The relevant files are grub4dos-0.4.4/stage2/builtins.c and grub4dos-0.4.4/stage2/asm.S |
I'm currently using the most recent GRUB4DOS 0.4.6 versions. AFAIK FreeDOS kernel is the only DOS kernel that can be booted directly by it. I did try booting other kernels (MS-DOS, PC-DOS, etc.) directly before and unfortunately none worked, with or without the special arguments. I don't know if there's a capable bootloader which could correctly load and boot any DOS kernel of choice, that can be chained by GRUB4DOS or perhaps NTLDR/BOOTMGR. GRUB4DOS in its current state is capable enough to reduce a good amount of hassle I'm having with multibooting. |
Where can I find the sources for that version?
Did you try MS-DOS v7 or only earlier versions? According to what I read in the sources v7 and (compressed) v8 kernels should work. What arguments do you mean?
You can boot into lDebug (usable as a number of load files, its instsect program can install a loader to a DOS drive or into a chainloadable binary file). Then, load any supported kernel with a The To load Enhanced DR-DOS (my single-file revisions) you can use |
Here.
I did, mainly with MS-DOS 7.1. I recall there's some kind of
Thanks for the advice. Will try getting lDebug chainloaded and see how it works. |
I studied the sources some. Again builtins.c and asm.S are the files to check out.
From my study of this revision's sources, not 100% sure and didn't verify these claims with testing: MS-DOS v7 should be autodetected without any switch. In this version of GRUB4DOS's MS-DOS v6 load you have to place the BIO kernel module in the first file that matches the pattern Loading lDebug should succeed if you name it IBMBIO.COM and make sure to have it be the first file that matches What I also found during my study is that, absent the switches, all files are detected using magic numbers. The source doesn't make it easy to read them as text, but some of them are text. FreeDOS is detected from its short jump followed by CONFIG block signature, and a file size > 16 KiB. All other DOS kernels, except MS-DOS v7/v8, are detected using a bunch of magic numbers. These mostly include the very first instruction in every file. MS-DOS v7/v8 are detected by a file size > 64 KiB and the "MZ" signature at offset 0 as well as a zero word at offset 510. (Which is somewhat lucky, as this word is never zero in my iniload stage.) Unlike MS-DOS v6, the MS-DOS v7/v8 load doesn't depend on the filename and should allow loading from any kernel file. Also unlike the MS-DOS v6 load, this one skips the initial loader of the kernel and directly loads the file starting from seek offset 800h to linear 700h. If an MS-DOS v8 "CM" signature is found, then GRUB4DOS will also act as the depacker of the compressed kernel image. Finally, a lot of the code like this directory scanning uses a bunch of hardcoded numeric pointers as "variables" of sorts. This is baffling to me because it makes things very difficult to read for no upside I can imagine whatsoever. |
Okay... just tested booting MS-DOS IO.SYS with GRUB4DOS again and it worked this time. Don't know why it didn't back then... This is on my test VM, and I think I should try booting it from an actual system and see if it works there also...
Many thanks for the hint. I've been trying to get lDebug booted and so far have been unsuccessful (a single letter and a beep just like you said). Looks like I've indeed created the boot sector file wrong. I don't know which switch was recently added. I previously used lDebug6 and its INSTSECT complained about a switch not supported. With the just-released lDebug7 the command you mentioned works, and with the created bootsector file I succeeded in getting lDebug booted from GRUB4DOS. Perhaps I'll try loading it from NTLDR also. Anyway, I've succeeded in booting your single-file |
Do you recall which letter was displayed? R (sector read error) or F (file not found) perhaps?
The /G switch was added in 2024 February. It isn't necessarily needed (the default
That's good to know. If you run into any problems using lDebug, let me know. I also have a boot menu of sorts that I prepared a while ago, so do tell if you want to try it. |
Originally with lDebug6 on the test VM the letter was It seems the FSIBOOT wasn't needed. Back then I additionally included FSIBOOT ( With the following command you mentioned on lDebug7, everything is working on my test VM now. Will try this on my actual system later on.
EDIT: Yep. The generated binary works for both GRUB4DOS and NTLDR. |
The Does your non-VM system not use a FAT32 drive?
You do need FSIBOOT to run the boot32 loader. However, the loader's first stage expects to find its FSIBOOT in the actual file system FSINFO, not chainloaded behind it. The defaults for /I ( Albeit, if GRUB4DOS chainloads the entire 1024 Bytes file as created with
Then run:
Good to know! If you want, you can try the patchfsi Script for lDebug with |
Hmm, seems NTLDR will (usually?) load only 512 Bytes: https://forum.osdev.org/viewtopic.php?f=1&t=25883 |
I've been struggling to get Win3.x working on latest FreeDOS CI kernel but no avail.
I thought my configurations were wrong, only to realize that the CI artifacts were not actually built with
-DWIN31SUPPORT
.I tried building one myself but still not successful, even using a Ubuntu 20.04 VM with just the necessary stuffs for vanilla.
With
-DWIN31SUPPORT
(XCPU=86
orXCPU=386
doesn't matter), the build process complained about things like undefined reference to_winInstanced
",_winStartupInfo
and_winPatchTable
.Does building such variants require a Windows machine? As for now they were only present in
build.bat
...EDIT: It seems
ALLCFLAGS
only affects the C compiler and allnasm
jobs are still being done without that flag. Will figure out a way to add it to see if it makes any difference...The text was updated successfully, but these errors were encountered: