Skip to content
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

DOSEMU2 support? #42

Closed
mateuszviste opened this issue Feb 19, 2024 · 17 comments
Closed

DOSEMU2 support? #42

mateuszviste opened this issue Feb 19, 2024 · 17 comments

Comments

@mateuszviste
Copy link

This is not necessarily a bug report, more an "information request" :-)

Apparently DOSEMU2 is able to recognize and load the EDR-DOS kernel. I simply placed the DRDOS.SYS and DRBIO.SYS files at the root of my (functional) DOSEMU2 SvarDOS installation, and after starting DOSEMU2 I landed on such screen:

image

So it seems that the kernel is being loaded, and apparently it is able to access at least my CONFIG.SYS because it complains about some invalid COUNTRY code. But then it asks for a shell processor (even though COMMAND.COM is present on the root of the drive + I also have an explicit SHELL directive in CONFIG.SYS). I tried suggesting C:\COMMAND.COM, but the kernel is does not like it for some reason.

So basically the question would be: is the EDR-DOS known to work with DOSEMU2?
If it's uncharted territory, then is there anything more I could check on my side?

This is my CONFIG.SYS:

;SWITCHES=/F
FILES=8
DOS=HIGH,UMB
DOSDATA=UMB
DEVICE=D:\dosemu\emufs.sys
DEVICE=D:\dosemu\umb.sys
;DEVICEHIGH=D:\dosemu\ems.sys
INSTALL=D:\dosemu\emufs.com
SHELL=C:\SVARDOS\BIN\CMD-PL.COM /P
;COUNTRY=033,,C:\SVARDOS\BIN\COUNTRY.SYS
COUNTRY=033,,C:\TEMP\COUNTRY.SYS
SHELL=C:\COMMAND.COM /E:400 /P
INSTALL=C:\SVARDOS\DISPLAY.COM

And this is how my root DOSEMU2 directory looks like (yes it is a bit messy, I know I should clean up my room, mom!):

mateusz@mateusz:~/.dosemu/install/svardos/drive_c> ll
total 1136
drwxrwxr-x 1 mateusz users    172 Nov 23 16:18 advcomp
drwxrwxr-x 1 mateusz users    708 Feb 21  2022 alncarng
drwxrwxr-x 1 mateusz users     64 Jun 19  2023 ambpack
-rw-r--r-- 1 mateusz users   1020 Feb 14 23:09 AUTOEXEC.BAT
drwxr-xr-x 1 mateusz users    104 Sep 21  2017 bc3
drwxrwxr-x 1 mateusz users     32 Feb  1 23:24 bsum
-rw-r--r-- 1 mateusz users  52486 Jan 17 21:37 command.bak
-rw-r--r-- 1 mateusz users  55666 Feb 19 08:49 command.com
-rw-r--r-- 1 mateusz users    340 Feb 19 08:54 CONFIG.SYS
drwxrwxr-x 1 mateusz users    264 Mar 18  2022 curl
drwxrwxr-x 1 mateusz users    164 Jan 31 17:06 devel
drwxrwxr-x 1 mateusz users    354 Feb  2 10:08 dn
-rw-r--r-- 1 mateusz users 758241 Feb  2 10:06 dn.svp
drwxrwxr-x 1 mateusz users     82 Feb 16  2022 dosmid
-rw-r--r-- 1 mateusz users  35557 Feb  8 21:08 drbio.sys
-rw-r--r-- 1 mateusz users  36891 Feb  8 21:08 drdos.sys
drwxrwxr-x 1 mateusz users     26 Jun 20  2023 drivers
drwxrwxr-x 1 mateusz users    428 Feb 16  2022 drmind
-rw-r--r-- 1 mateusz users  85456 Feb 19 12:01 edrdos.svp
-rw-r--r-- 1 mateusz users  13537 Jun 20  2023 etherdfs.svp
drwxrwxr-x 1 mateusz users    130 Feb 25  2022 fmines
drwxrwxr-x 1 mateusz users    124 Feb 22  2022 greedy
drwxr-xr-x 1 mateusz users    148 Nov 12 20:41 hello
drwxrwxr-x 1 mateusz users    228 Jan 22  2022 infoplus
drwxrwxr-x 1 mateusz users     90 Feb 26  2022 insight
-rw-r--r-- 1 mateusz users  45329 Nov 24  2016 KERNEL.SYS
drwxrwxr-x 1 mateusz users    106 Apr 24  2022 less
drwxrwxr-x 1 mateusz users     86 Feb 26  2022 linkln
drwxr-xr-x 1 mateusz users     88 Apr  2  2023 lure
drwxr-xr-x 1 mateusz users    206 Nov  9 21:54 mcrt_com
drwxr-xr-x 1 mateusz users     36 Nov  9 10:28 mcrt_exe
drwxrwxr-x 1 mateusz users     92 Feb 21  2022 nesticle
drwxrwxr-x 1 mateusz users    228 Feb 23  2022 pcae
drwxr-xr-x 1 mateusz users     92 Jun 19  2023 qb
drwxr-xr-x 1 mateusz users     34 Dec  5  2006 qbx
drwxrwxr-x 1 mateusz users     78 Feb 21  2022 robbo
drwxrwxr-x 1 mateusz users    210 Feb 23  2022 stella
drwxrwxr-x 1 mateusz users    220 Feb 19 12:01 SVARDOS
-rw-r--r-- 1 mateusz users  52332 Sep 13  2022 svcom.com
drwxr-xr-x 1 mateusz users    146 Jan 15 22:26 svn
drwxr-xr-x 1 mateusz users   1104 Aug  1  2023 tc
drwxr-xr-x 1 mateusz users    126 Jul 25  2014 tc3
drwxrwxr-x 1 mateusz users    184 Feb 19 08:53 temp
drwxr-xr-x 1 mateusz users    552 Feb 19 12:01 tmp
drwxrwxr-x 1 mateusz users    140 Mar  7  2022 upx
drwxrwxr-x 1 mateusz users     92 Jun 27  2023 utf8tocp
drwxrwxr-x 1 mateusz users    400 Nov 12 19:59 vice
drwxrwxr-x 1 mateusz users    230 Aug  4  2023 watcom
drwxrwxr-x 1 mateusz users     94 Feb 23  2022 z26
mateusz@mateusz:~/.dosemu/install/svardos/drive_c>

any suggestions?

@andrewbird
Copy link

Add -D+d to the command line, try again, then check the boot.log file to see if there was an attempt to open command.com. Dosemu2 is tested weekly against OpenDOS 7.01, see https://github.com/dosemu2/dosemu2/actions/runs/7952449641/job/21707053392#step:6:1210 so at least that should work. However the boot support is implemented inside dosemu2 itself, so consequently any DR-DOS boot block is not used (by default). If there have been any changes in this area then it's quite possible dosemu2 will need to be updated.

@andrewbird
Copy link

Slight follow up to my previous post. Looking at the boot code in dosemu2, it seems that the OpenDOS 7.01 that gets tested is following a different code path to an EDR kernel. I know I had EDR-DOS 7.01.7 working okay in the past. There were troubles with EDR-DOS 7.01.8 WIP version, but they manifested after boot.

@andrewbird
Copy link

Also see this issue dosemu2/dosemu2#589 and try commenting out the SHELL please?

@mateuszviste
Copy link
Author

Thank you for stopping by, Andrew!

Also see this issue dosemu2/dosemu2#589 and try commenting out the SHELL please?

I commented out the SHELL=C:\SVARDOS\BIN\CMD-PL.COM /P directive and then indeed - it works. I won't pretend that I understand why, though. It works without any SHELL directive, and it also works with SHELL=C:\COMMAND.COM /E:512 /P. I suppose this is an EDR-DOS bug, unrelated to DOSEMU, right? Also the fact that EDR-DOS asks for a shell but refuses to actually load it is very suspicious.

On a semi-related note, DOSEMU+EDRDOS makes my KDE session crash when I try to load some of the DOSEMU drivers (emufs or umb.sys, I'm not sure yet - have to make more test)

@mateuszviste
Copy link
Author

mateuszviste commented Feb 19, 2024

It is actually a bit more complicated than what I wrote above.


FreeCOM

SHELL=C:\SVARDOS\BIN\CMD-PL.COM /P

Executes the FreeCOM shell alright, but then the shell is unable to load its strings:

image
(hitting ENTER leads nowhere, as FreeCOM complains about being unable to find itself and asks for a reboot)


FreeCOM + emufs.sys

DEVICE=D:\dosemu\emufs.sys
SHELL=C:\SVARDOS\BIN\CMD-PL.COM /P

Fails to load FreeCOM, asks for a shell but still refuses to load it.
image


FreeCOM + emufs.sys + emufs.com

DEVICE=D:\dosemu\emufs.sys
INSTALL=D:\dosemu\emufs.com
SHELL=C:\SVARDOS\BIN\CMD-PL.COM /P

This one just freezes.

image


SvarCOM alone

SHELL=C:\COMMAND.COM /E:512 /P

This one works fine. Well, at least it boots alright and is able to execute autoexec.bat, haven't tested more than that but I suppose the missing emufs driver will lead to troubles sooner or later.


DEVICE=D:\dosemu\emufs.sys
DEVICEHIGH=D:\dosemu\ems.sys
SHELL=C:\SVARDOS\BIN\CMD-PL.COM /P

This one makes DOSEMU abort immediately with this in boot.log:

MFS: Finished dos_fs_redirect
MFS: Entering dos_fs_redirect, FN=08, 'Read file'
MFS: selecting drive
MFS: selected drive 3: /home/mateusz/bin/dosemu2-devel/commands/
MFS: Read file fd=22, dta=0x9eac2, cnt=8192
MFS: Read file pos = 0
MFS: Handle cnt 1
MFS: Actual pos 0
MFS: Read returned : 1029
MFS: Read file pos (fseek) after = 1029
MFS: Finished dos_fs_redirect
ERROR: general protection at 0x7f37e8f5e6c0: 0
Real-mode state dump:
EIP: 6f6c:00010000 ESP: 965e:000087f9  VFLAGS(b): 00011 01110100 10000110
EAX: 00000405 EBX: 00006f20 ECX: 0000646c EDX: 0000202c VFLAGS(h): 00037486
ESI: 00006d65 EDI: 00002e73 EBP: 00007973 DS: 2073 ES: 6f6e FS: 0000 GS: 0000
FLAGS: PF SF IF DF NT RF VM  IOPL: 3
STACK: 73 20 6e 6f 74 20 6c 6f 60 64 -> 65 64 2e 0d 0a 24 57 41 52 4e 
OPS  : 00 00 00 00 00 00 00 00 00 00 -> 00 00 00 00 00 00 00 00 00 00 
        0000                6f6c:0000 add  [bx+si],al
00| 0070:0204->000904   01| 0070:02a7->0009a7   02| f000:f104->0ff104
03| 0070:02a7->0009a7   04| 00f1:0400->001310   05| 7002:a7f0->07a810
06| f000:f108->0ff108   07| 02a7:f000->011a70   08| 02a7:0070->002ae0
09| f000:e987->0fe987   0a| a700:7002->0ae002   0b| 0700:7002->00e002
0c| f000:f10e->0ff10e   0d| 0070:02a7->0009a7   0e| f000:f107->0ff107
0f| f000:f111->0ff111   10| 00f1:0700->001610   11| 00f1:08f0->001800
12| f000:f114->0ff114   13| f108:f000->100080   14| f109:f000->100090
15| f000:f117->0ff117   16| 09f0:00f1->009ff1   17| b3f0:00f1->0b3ff1
18| f000:f11a->0ff11a   19| f000:f109->0ff109   1a| f000:feb3->0ffeb3
1b| 0070:02a0->0009a0   1c| 00fe:b3f0->00c3d0   1d| 00e9:87f0->009680
1e| 0000:0522->000522   1f| e987:f000->0f8870   20| f55c:f000->1045c0
21| f000:f62b->0ff62b   22| 5cf0:00e9->05cfe9   23| 0df0:00f5->00dff5
24| 0100:0073->001073   25| f000:f55c->0ff55c   26| f000:f10d->0ff10d
27| 0100:0091->001091   28| 00f1:0df0->001d00   29| 00f1:0ef0->001e00
2a| 0100:0000->001000   2b| f10e:f000->1000e0   2c| f10f:f000->1000f0
2d| 0100:000f->00100f   2e| 0ff0:00f1->00fff1   2f| 10f0:00f1->010ff1
30| 0000:9bea->009bea   31| f000:f10f->0ff10f   32| f000:f110->0ff110
33| efff:e11e->0fe10e   34| 00f1:10f0->002000   35| 00f1:11f0->002100
leavedos(vm86_GP_fault:388|0) called - shutting down

@andrewbird
Copy link

Can you post the edr bios/dos boot files here, please? It's quite possible that I have something wrong in the dosemu boot setup that's causing memory corruption, and that the SHELL command is only triggering the problem.

@ecm-pushbx
Copy link

Can you post the edr bios/dos boot files here, please? It's quite possible that I have something wrong in the dosemu boot setup that's causing memory corruption, and that the SHELL command is only triggering the problem.

The current FreeDOS SYS allows to patch the loaders to create EDR-DOS loaders, by patching loadsegoff to 70h:0, patching the kernel name to DRBIO.SYS, and passing the load unit in DL (which the most recent FreeDOS kernel's loaders do unconditionally). The boot loaders are in https://github.com/FDOS/kernel/tree/8552d833bbca657591fa8e6f7276d307d7d0c7c6/boot and SYS's /OEM:EDR settings are in https://github.com/FDOS/kernel/blob/8552d833bbca657591fa8e6f7276d307d7d0c7c6/sys/sys.c#L438

I described both the FreeDOS and EDR-DOS load protocols in https://pushbx.org/ecm/doc/ldosboot.htm

@ecm-pushbx
Copy link

Oh, I may have misread what you were asking for. Shame on me. Perhaps https://github.com/SvarDOS/edrdos/releases or http://svardos.org/repo/?a=pull&p=edrdos are useful.

@ecm-pushbx
Copy link

My single-file load can be obtained from https://pushbx.org/ecm/download/edrdos.zip but it is missing some late January to February patches from this repo until I pick those.

@boeckmann
Copy link
Collaborator

Time to setup a CI pipeline to build the EDR kernel automatically. I am wondering if DOSEMU could be used for that :-)

@andrewbird
Copy link

@ecm-pushbx thanks, as ever both your replies are most useful!

@boeckmann , yes I recently made a draft PR FDOS/kernel#137 for FreeDOS kernel CI to build under DOS using Dosemu2. The reason it's not submitted yet is because somehow I need to figure out how to be able to use the Turbo C 2.01 compiler from Github Actions, whilst not distributing the software generally.

@andrewbird
Copy link

I seems to be a regression in Dosemu2 as I'm unable to boot EDR 7.01.07 now. Will investigate...

@mateuszviste
Copy link
Author

I seems to be a regression in Dosemu2 as I'm unable to boot EDR 7.01.07 now. Will investigate...

From the little I can tell it seems the problem is not necessarily Dosemu2 itself, but rather the emufs driver (or the way DRDOS tries to use the redirector API) . Without emufs the boot works fine for me, it's when I try to load emufs that troubles start.

@andrewbird
Copy link

Yes I agree. I'm trying to bisect now to find the breakage, but it seems to have been broken for a long time and it's becoming more difficult to build the further I go back.

@andrewbird
Copy link

Hi, just a quick heads up here. I understand that this problem has now been fixed in dosemu2, though I didn't yet get a chance to test it myself. See dosemu2/dosemu2#2156

@boeckmann
Copy link
Collaborator

Is this still an issue? Cannot test it myself under Mac.

@mateuszviste
Copy link
Author

It's actually worse now, since we moved to the KERNEL.SYS filename DOSEMU2 not only does not work, but crashes horribly - to the point it also crashes my X session. But I doubt this is something that we should keep pending here, since that's not EDR's fault. I propose to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants