Giter VIP home page Giter VIP logo

Comments (56)

stsp avatar stsp commented on June 17, 2024

A few days ago there were only fdpp
updates, so could you please check
if it is fdpp-specific?

from fdpp.

andrewbird avatar andrewbird commented on June 17, 2024

can't create local /var/run/user/0/dosemu2 directory

It's probably unconnected to your problem but that is very strange! What distro/hardware are you running on, or is it WSL?

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

@andrewbird: Ubuntu 22.04 LTS virtual machine running in VirtualBox with nested virtualization enabled.
Additionally I'm running dosemu with '-s' (sudo) to be able to expose ETH devices to dosemu.

from fdpp.

andrewbird avatar andrewbird commented on June 17, 2024

I guess that 0 in the path is down to using -s.

from fdpp.

stsp avatar stsp commented on June 17, 2024

Yes, -s should now be fixed.
Of course you are aware about slirp
and tap, both allowing to avoid -s?

As for windows, the log has things
like LFN: using WIN date/time -
never seen such. :) Andrew, do you
know what these do?

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

@stsp: I need a real ethernet interface for my stuff, and the bridge approach has stopped working after updating from 20.4 to 22.4 LTS. Attaching a tap device to a bridge returns EPERM, even as root.

Yes, w/out '-s' the warning goes away. I didn't pay attention and didn't file a bug. Thanks!

from fdpp.

stsp avatar stsp commented on June 17, 2024

man tunctl will hint you about
the -u option. And you can use
the pre-set tap under dosemu.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

It seems that I'd need some help to debug this w/out fdpp. With MS-DOS 6.22 I get "KERNEL: unsupported DPMI server" from WIN and I have no idea which kind of EMM386 do I have to load (if any?).

from fdpp.

andrewbird avatar andrewbird commented on June 17, 2024

@stsp something seems to be using int21/714e findfirst and it surprises me that WFW would do this. However I notice that there are no tests to cover these so I've no idea if those calls work with the 64bit time format http://www.ctyme.com/intr/rb-3203.htm.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

It might be 4DOS, which is my default shell. AFAIK it has some LFN support.

Edit: for the records: it's unrelated to 4DOS. With FreeCom same date/time issue.

from fdpp.

stsp avatar stsp commented on June 17, 2024

I installed windows and its barely
working. Multiple regressions again. :(
Will need to bisect.

from fdpp.

andrewbird avatar andrewbird commented on June 17, 2024

So I'm wondering now whether the file dates are changing, or just that we are returning bad data that 4DOS displays. Can you try switching to FreeCOM (which also has LFN support, but uses DOS date/time) and see what the timestamps are?

from fdpp.

andrewbird avatar andrewbird commented on June 17, 2024

@robert-j you anticipated my question, it seems!

from fdpp.

andrewbird avatar andrewbird commented on June 17, 2024

So run me through the procedure to create a bad timestamp on a file.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

okay, I've manged to configure & run MS-DOS 6.22: the error disappeared, so it's how @stsp predicted: a fdpp issue.

from fdpp.

stsp avatar stsp commented on June 17, 2024

What was the problem?
It doesn't work well with ms-dos 6.22
for me too now.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

It's fdpp related.

With MS-DOS 6.22 I can start the same pre-configured Windows, which I usually run under fdpp, then open WinFile and terminate Windows: date/time is still correct, error does not occur.

from fdpp.

stsp avatar stsp commented on June 17, 2024

But what was the problem about a
DPMI server?

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

Ah, this one: Well, I didn't configure the boot floppy correctly and one of the dosemu drivers was not loaded. This was my bad.

from fdpp.

stsp avatar stsp commented on June 17, 2024

OK, I bisected the windows problem
and opened dosemu2/dosemu2#2007
Hope Andrew can deal with the files
in a mean time. :)

from fdpp.

andrewbird avatar andrewbird commented on June 17, 2024

I think the lfn file time is a red herring, I didn't read the full thread until now. The issue appears to be that the system time changes.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

@andrewbird: the file times are correct, probably because they are solely controlled by dosemu.

dir > foo
dir foo

shows the current date/time of the system. It's probably only the int 21 getdate function, which is returning bad values.

Edit: not probably. 100% INT21 AH=2A is returning garbage.
Edit2: when I'm correcting the date with AH=2B then it remains correct until I start Windows+WinFile again.

from fdpp.

stsp avatar stsp commented on June 17, 2024

Edit2: when I'm correcting the date with AH=2B then it remains correct until I start
Windows+WinFile again.

Please see what changes on a native
FS are seen from these actions.

from fdpp.

andrewbird avatar andrewbird commented on June 17, 2024

@stsp I think this might be a packing issue with struct dosdate it seems it's used to set registers!

fdpp/kernel/inthndlr.c

Lines 705 to 707 in 926b7c1

case 0x2a:
lr.AL = DosGetDate((struct dosdate *)&lr.CX);
break;

from fdpp.

stsp avatar stsp commented on June 17, 2024
struct dosdate
{
  unsigned short year;
  unsigned char monthday, month;
};

I don't see the packing problems
here (members are sorted by size),
and sizeof() gives 4.

from fdpp.

andrewbird avatar andrewbird commented on June 17, 2024

Sizes look okay here, but I wondered if the version of clang used would affect things?

from fdpp.

stsp avatar stsp commented on June 17, 2024

No because sizes are sorted properly:
"short" goes before smaller "char".
You may want to read about alignment
and padding rules, they are not essentially
trivial. :)

from fdpp.

andrewbird avatar andrewbird commented on June 17, 2024

You may want to read about alignment
and padding rules, they are not essentially
trivial. :)

Yes I've been a bit lazy on that front. I have it boiled down to just two options:
I don't care about alignment and padding as the struct is internal, so let the compiler do whatever,
and I do care because the struct has to be portable, so pack it.

from fdpp.

stsp avatar stsp commented on June 17, 2024

That approach doesn't work if you
use -Wpacking option. It will warn
on redundant packing, which, on
clang-16, is not redundant at all!
So what clang-16 does, contradicts
itself. Of course, after I reported that,
they decided to break also -Wpacking
option, instead of fixing things up.
Because the "bug" is not following
gcc these days, rather than what
actually breaks things. :(

from fdpp.

stsp avatar stsp commented on June 17, 2024

There are more problems to that
approach. Namely, whatever is packed,
is treated by gcc as misaligned! Even
when its actually not. So fdpp won't
even compile if you pack too much.
And unfortunately clang devs almost
threaten me with porting that bug from
gcc too. :(

from fdpp.

stsp avatar stsp commented on June 17, 2024

So overall you can't pack w/o actually
reading about alignment and padding
rules.
If you do, you will either get a punishment
from -Wpacking, or, in case it is gcc -
will drown in its bugs, but your code won't
work.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

Is there a DPMI layer on top of the real mode INT 21 handler in dosemu? I'm asking because INT 21 2A/2B need a real mode to protected mode translation. Maybe is that place the culprit.

Edit: scratch this, the APIs are solely register-based.

from fdpp.

stsp avatar stsp commented on June 17, 2024

Is there a DPMI layer on top of the real mode INT 21 handler in dosemu?

Yes.

I'm asking because INT 21 2A/2B need a real mode to protected mode translation.

Not above the one mandated by dpmi
specs, where the register values are
propagated to PM as-is.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

I've tried this:

  • start Windows+WinFile
  • terminate Windows
  • check date: yes, it's wrong
  • write to a DOS-native file system, mounted as a floppy
  • got this crash:

ERROR: fdpp: abort at /build/fdpp-xbqHwh/fdpp-1.6-1352/fdpp/farptr.hpp:571

This is 100% reproducible.

Observations:

  • when I start Windows and don't execute WinFile: no crash.
  • when I run any other app in place of WinFile (Office, Delphi, Borland Pascal): no crash.
  • EDIT: when I run WinFile and correct the date with INT 21 AH=2A2B after Windows' termination: crash!

Another observation: When I check INT 21 AH=2A in Windows using a Windows protected mode app, then
the date is correct before invoking WinFile, wrong during WinFile and wrong after WinFile terminates.

from fdpp.

stsp avatar stsp commented on June 17, 2024

Please attach the log of the crash.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

bug-222.log.xz.zip, actually an xz file.

I've redacted everything containing /drive_c/ for privacy reasons.

from fdpp.

stsp avatar stsp commented on June 17, 2024

Please don't use -s when doing this log.
Also you need to install the dbgsym package
for fdpp and dosemu2. See this comment on how to:
dosemu2/dosemu2#1987 (comment)

You need to grep the resulting log for
"No debugging symbols found"
and
"Could not attach to process."
strings. Once they are not there, the log
should be good.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

bug-222-2.log.xz.zip, actually an xz file.

It looks like it contains the backtraces you want.

from fdpp.

stsp avatar stsp commented on June 17, 2024

Hmm, it seems fdpp compiler got confused
with this statement at fatfs.c:408:
j = sp->sftt_count, sftp = sp->sftt_table.
Its too difficult for him. :)
Could you please try this change:

diff --git a/kernel/fatfs.c b/kernel/fatfs.c
index 79498de..5ddec1e 100644
--- a/kernel/fatfs.c
+++ b/kernel/fatfs.c
@@ -405,7 +405,8 @@ STATIC int merge_file_changes(f_node_ptr fnp, int collect)
   i = 0;
   for (sp = sfthead; sp != (sfttbl FAR *) - 1; sp = sp->sftt_next)
   {
-    for(j = sp->sftt_count, sftp = sp->sftt_table; --j >= 0; sftp++, i++)
+    sftp = sp->sftt_table;
+    for(j = sp->sftt_count; --j >= 0; sftp++, i++)
     {
       if (i != fnp->f_sft_idx && sftp->sft_count != 0
           && fnp->f_dpb == sftp->sft_dcb

That would reduce the complexity and
our dumb compiler will probably understand.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

How do I configure dosemu2 to use my custom fdpp from /usr/local?

from fdpp.

stsp avatar stsp commented on June 17, 2024

Just remove fdpp and dosemu2 packages
with apt-get, and in an absence of an alternative,
dosemu2 will find it in /usr/local.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

It's now crashing in sftp = sp->sftt_table;

from fdpp.

stsp avatar stsp commented on June 17, 2024

Could you please provide a ready to
reproduce hd image?

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

Not an hd image but a "drive_c" together with the FD image file on which it crashes when I try to write on it after Windows terminates. Is this okay?

from fdpp.

stsp avatar stsp commented on June 17, 2024

If fd image alone is enough (I have
win3.1 here too), then that alone.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

The image could be a new, empty one. I've just created a new one and it seems that the bug is not related to my image at all.

My .dosemurc is just this:

$_cpu_vm = "kvm"
$_floppy_a = "dos622.img"
$_attrs_support = (off)

dos622.img is the empty (but formatted) image.

from fdpp.

stsp avatar stsp commented on June 17, 2024

So what needs to be done?
Is copying of some file to floppy
in winfile is enough?

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

I've sent you an e-mail with the subject "FDPP Bug 222".

No, it's much easier:

  • start Windows
  • start WinFile
  • close WinFile
  • exit Windows

Then:

cd a:
dir > test

Translation (as it's a German Windows): WinFile is called "Datei-Manager" and can be found in the "Hauptgruppe" ;)

from fdpp.

stsp avatar stsp commented on June 17, 2024

OK, it appeared to have nothing to
do with the compilation process. Its
a genuine freedos bug.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

@stsp, thank you!

The actual issue (date in the future) of this bug entry isn't fixed, though. You can reproduce the same way as the SFT bug:

  • start Windows
  • start WinFile
  • exit Windows
  • type date at the command prompt when back in DOS.

The SFT issue arose while we were arguing about the date bug.

from fdpp.

stsp avatar stsp commented on June 17, 2024

So date shows the correct date and time.
What should I see?

from fdpp.

stsp avatar stsp commented on June 17, 2024

I've sent you an e-mail with the subject "FDPP Bug 222"

The URL from mail shows error.

from fdpp.

robert-j avatar robert-j commented on June 17, 2024

Yes, I have deleted the link when the bug was closed ;) I've sent you a new one.

You should see a date in the future: 2025-2028. I believe the time remains correct, although I did not explicitly check it.

from fdpp.

stsp avatar stsp commented on June 17, 2024

Will try later.

from fdpp.

stsp avatar stsp commented on June 17, 2024

Should now be fixed, good catch!

from fdpp.

stsp avatar stsp commented on June 17, 2024

Also we recently fixed many other
windows regressions, and I suppose
windows support is in a good shape
again. :)

from fdpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.