Linux MS DOS discussions
 help / color / mirror / Atom feed
* Re: Signaling dosemu application to kill itself from Linux
@ 2005-04-06 16:06 Stas Sergeev
  2005-04-06 22:16 ` tonyb
  0 siblings, 1 reply; 18+ messages in thread
From: Stas Sergeev @ 2005-04-06 16:06 UTC (permalink / raw)
  To: linux-msdos

Hello.

tonyb@thekrnl.sysdev.org wrote:
> The problem is that if dosemu is killed from Linux (crond), and
> the dosemu console is in focus, the screen/kbd could cause Linux
> to reboot
No! It can't! If it does this,
then it is a misconfiguration/
bug/outdated kernel/outdated dosemu/
dosemu with root privs/ or whatever,
but not the supposed behaviour.
With the sane setup such a things
simply cannot happen. Please explain
your problem in *much* more details.

> because they were left in a bad state by a dos tsr.
You can extend the dosemu startup
script, or start it from another
script, which, after dosemu exits,
will restore the keyboard and the
console state. But no, this have
nothing to do with rebootes etc,
so please explain your problem in
details.


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: Signaling dosemu application to kill itself from Linux
@ 2005-04-10  8:40 Stas Sergeev
  0 siblings, 0 replies; 18+ messages in thread
From: Stas Sergeev @ 2005-04-10  8:40 UTC (permalink / raw)
  To: linux-msdos

Hello.

tonyb@thekrnl.sysdev.org wrote:
> handles the I/O to 378h and 3f8h.  Since
> he was not using INT 14h, I didnt realize
> that your dosemu abstraction (emulation)
> would filter both port and IRQ I/O!
Thats actually a common problem here.
People assume that something doesn't
work without even trying it (even after
they were suggested to try), and the
serial ports is a most frequent casuality
of such a self-delusion.

> But when I was able to fire it up, the screen during
> dosemu kill was NO LONGER HANGING Linux. And the restarts
> occurred fine.
Good that is now works. But it would
be nice to understand where the problem
was, so that we can fix it. Your config
looks mostly safe, but there are still
those dangerous things like the hardware
ram and irqpassing (and I really think
that the hardware_ram thing was not
tested here for about something like 5
years or more, so it can easily be broken).
It would be nice if you try the things
as root again, but with the fresh dosemu.conf,
the one with everything is commented out,
and see whether it still hurts the linux
box or not. If it works without the
lookups/rebootes, then you can easily
locate an option of dosemu.conf that
made the problem for you. And it should
be the latest CVS code of dosemu to
make the testing more valueable.

> This might have also solved the PIT emulation
> going crazy, but wont know for 3 or 4 weeks.
This is very unlikely, but keep us
informed.

> The idea was
> to reset dosemu every week, to avoid the problem.
Quite pity that such a hacks are
still needed. Apparently dosemu was
never tested for such a long uptimes.

>> >> if you need an LPT too, then that's
>> >> a problem.
> I knew that wasnt emulated from some posts.
So how at the end you got the LPTs to
work without a root? To the best of
my knowledge, it is not possible right
now, unless you implemented the missing
emulation yourself. (I don't mean the
printing-only mode, which is how the
LPT emulation is implemented right now)

> We are not using INT 1A
OK, then please refresh my memory on
what you actually use and I'll take
another look at that code.

> I would add code to the TSR
> instead of having to do a dosemu kill and restart!
Yes, that should work.


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: Signaling dosemu application to kill itself from Linux
@ 2005-04-08  3:55 Stas Sergeev
  2005-04-10  0:32 ` tonyb
  0 siblings, 1 reply; 18+ messages in thread
From: Stas Sergeev @ 2005-04-08  3:55 UTC (permalink / raw)
  To: linux-msdos

Hello.

tonyb@thekrnl.sysdev.org wrote:
>> Why are you using the direct access
>> to the serial ports?
> Client requested it!
No, client couldn't request you
to use the direct access instead
of an emulated one, cause that's
silly. Emulated access works nearly
as fast in the CVS code, there is
no reason for using the direct access,
at least not before you made sure
the emulated access doesn't work
for you properly.

>> if you need an LPT too, then that's
>> a problem.
> Client requirement also
Client couldn't request you to enable
the direct access to an LPT either.
The problem here is that dosemu still
doesn't support an emulated access to
the LPT ports, so you had no choice.
This is something to change in the future.

> but will test as non-root,
> anyway.  Problem is that I believe we already did...
And that didn't fix the rebootes? Sorry,
I have troubles beleiving into this.

> So the PIT is goin crazy after about 3weeks of
> running???
Looks like that. I can't try myself
to tell for sure though.

> If that is so, then why is the Linux
> time correct
We are talking about dosemu here, and
of course I mean the PIT emulation of
dosemu only.

> while the dosemu one goes BAD,
> since with the timemode patch, dosemu is reading
> the linux time directly???
Because the timemode patch affects
only an RTC, and not PIT. Unfortunately
I think such an approach is not possible
for PIT at all.

Now looking into your report at SF,
you claim that you use int1a/ah=2, so
probably my guess about a PIT doesn't
apply, as the timemode patch affects
the int1a/ah=2 too.
If you are using FreeDOS, you can try
using MS-DOS instead. There are the
reports where the time gets wrong with
FreeDOS but not with MS/PC-DOS, which
I haven't looked up yet.


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: Signaling dosemu application to kill itself from Linux
@ 2005-04-07 17:59 Stas Sergeev
  0 siblings, 0 replies; 18+ messages in thread
From: Stas Sergeev @ 2005-04-07 17:59 UTC (permalink / raw)
  To: linux-msdos

Hello.

Andrew Brooks wrote:
> Not disappeared at all, still lurking.  But our patch was broken
> up when applied to CVS and we haven't found the time yet to work
> out which bits were applied, which changed and which left out :-(
What's the problem with that exactly?
I already pointed you the particular
commits. Now you only have to set up
the CVS tree before that commit and
apply your patch to it. Then setup
another tree, right after the commit
was done. Diffing these two trees
will immediately reveal what's missing.
10 minutes of work at most, I'd say.

> Actually I've got a patch for the patch; you should change
I haven't applied that part at all.
It needs a further review with some
kind of a bi-directional communication
with the authors, which so far wasn't
set up properly:)
But sure enough I fixed other bugs
of your patch in the parts that were
applied. In case you are wondering:
http://cvs.sourceforge.net/viewcvs.py/dosemu/dosemu/src/base/dev/misc/rtc.c?r1=1.6&r2=1.7&diff_format=u
http://cvs.sourceforge.net/viewcvs.py/dosemu/dosemu/src/base/dev/misc/rtc.c?r1=1.5&r2=1.6&diff_format=u


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: Signaling dosemu application to kill itself from Linux
@ 2005-04-07 17:50 Stas Sergeev
  2005-04-08  2:14 ` tonyb
  0 siblings, 1 reply; 18+ messages in thread
From: Stas Sergeev @ 2005-04-07 17:50 UTC (permalink / raw)
  To: linux-msdos

Hello.

tonyb@thekrnl.sysdev.org
> Negatory on that, no raw kbd or strange stuff,
> all vanilla...
Yes, your config looks pretty save.
Note: you don't need to uncomment
the options unless you are going to
change them.

Why are you using the direct access
to the serial ports? The emulated
access of the CVS dosemu is nearly
as fast as the real one.
I'd like you to revoke the root
privs from a dosemu process before
the further experementations, but
if you need an LPT too, then that's
a problem.

> Advantek i486 Cytrix tiny mobo.  I do have
> a serial port, can try logging on a getty
> there.
Yes, please do this and produce a
stack trace with gdb when dosemu is
hanging.
Alternatively, send a SIGSEGV to
dosemu when it is hanging, and it
will dump a stack trace into a log.

> just spinning.  There is an assembly language
> TSR that is running that I bet is holding
> the dosemu thread active or hung.
No DOS program should hold a dosemu
when it gets a SIGTERM, or it is a
bug. The stack trace can help.
Also, how exactly are you killing
it? SIGKILL can help too:)

> Is there a way (INT 1Ah?) to force dosemu to reset its time to
> Linux's, on request?
The mentioned patch was just reading
a linux time directly, so with the
$_timemode="linux" you don't need to
reset anything at all.
I am sure however your problem is not
related to RTC, it is a problem of the
PIT most likely. The patch won't help.
You'll have to dig a PIT code, which
is just a big mess :( It boils down to
the cputime.c at one point, but the
parts of it are all around the sources.
You'll certainly have fun tracking it.
One thing to try is $_rdtsc=on/off
(don't remember if I told you that
already)


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: Signaling dosemu application to kill itself from Linux
@ 2005-04-07  3:45 Stas Sergeev
  2005-04-07  9:07 ` Andrew Brooks
  2005-04-07 16:06 ` Gene Heskett
  0 siblings, 2 replies; 18+ messages in thread
From: Stas Sergeev @ 2005-04-07  3:45 UTC (permalink / raw)
  To: linux-msdos

Hello.

Gene Heskett wrote:
> Mmm, what is this time patch, and where can it be obtained?
Here:
http://sourceforge.net/tracker/index.php?func=detail&aid=1034800&group_id=49784&atid=457449
But I won't count too much on it,
as the guys who submitted it,
disappeared.


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: Signaling dosemu application to kill itself from Linux
@ 2005-04-07  3:38 Stas Sergeev
  2005-04-07  6:12 ` tonyb
  0 siblings, 1 reply; 18+ messages in thread
From: Stas Sergeev @ 2005-04-07  3:38 UTC (permalink / raw)
  To: linux-msdos

Hello.

tonyb@thekrnl.sysdev.org wrote:
> the screen is ok (the shell's) but the kbd is
> in echo strange characters mode and not passing to the original
> shell.
"strange character mode" is probably
the "raw" mode. You probably set
$_rawkeyboard=(1) in your dosemu.conf.
I suspect you also did some other
unsafe changes in dosemu.conf, which,
only coupled with the root privs,
causes a reboot. (without the root
privs the reboot is not possible by
any means)
To get out of the "raw" mode you can
use either the kbd_mode command (which
you have to put in your script), or the
Alt-PrtSc-r keycombo.

> dosemu is not restarted
That's strange. I think this means that
it is not really killed, and the process
is still spinning. You can ssh to your
PC and see what's going on in ps.

> however, if I switch to a 2nd tty and run top, I see dosemu.bin
> being restarted every 10min (for this test) and all is good!
You can also try xdosemu (if possible)
where all the like problems do not
exist.


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Signaling dosemu application to kill itself from Linux
@ 2005-04-06  7:14 tonyb
  0 siblings, 0 replies; 18+ messages in thread
From: tonyb @ 2005-04-06  7:14 UTC (permalink / raw)
  To: linux-msdos

The problem is that if dosemu is killed from Linux (crond), and
the dosemu console is in focus, the screen/kbd could cause Linux
to reboot because they were left in a bad state by a dos tsr.

Anyone has a mechanism such that, by signaling with a file touch or
somthing else from crontabs/root, will allow the tsr/app to exit
gracefully before a kill...

Thanks
TonyB

--
  __      __  _     I N C.               http://www.sysdev.org
/ __|\\// __||  \  __   __          /         tonyb@sysdev.org
\__ \ \/\__ \||)|/ O_)\/ /        \/  System Tools / Utilities
|___/ || ___/|_ /\___|\_/        WIntel / Linux Device Drivers


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2005-04-10  8:40 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-06 16:06 Signaling dosemu application to kill itself from Linux Stas Sergeev
2005-04-06 22:16 ` tonyb
2005-04-07  0:47   ` Gene Heskett
  -- strict thread matches above, loose matches on Subject: below --
2005-04-10  8:40 Stas Sergeev
2005-04-08  3:55 Stas Sergeev
2005-04-10  0:32 ` tonyb
2005-04-07 17:59 Stas Sergeev
2005-04-07 17:50 Stas Sergeev
2005-04-08  2:14 ` tonyb
2005-04-07  3:45 Stas Sergeev
2005-04-07  9:07 ` Andrew Brooks
2005-04-07 16:23   ` tonyb
2005-04-07 17:25     ` Gene Heskett
2005-04-07 16:06 ` Gene Heskett
2005-04-07 16:35   ` Andrew Brooks
2005-04-07  3:38 Stas Sergeev
2005-04-07  6:12 ` tonyb
2005-04-06  7:14 tonyb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox