* Re: how do you get a DOS returncode back into unix ?
[not found] <3D17A93E00465660@freesurfmta02.sunrise.ch>
@ 2002-08-04 15:35 ` Bart Oldeman
0 siblings, 0 replies; 3+ messages in thread
From: Bart Oldeman @ 2002-08-04 15:35 UTC (permalink / raw)
To: Per Jessen; +Cc: linux-msdos@vger.kernel.org
On Sun, 4 Aug 2002, Per Jessen wrote:
> How do people get a DOS returncode reflected back where dosemu
> was started from ? eg. a shell.
> Shouldn't it happen eg. when you use exitemu ? Like, if the most
> recent command/program you ran under DOSEMU returned rc=67, shouldn't
> perhaps exitemu percolate this rc to the caller ? Perhaps as an option
> on exitemu.
exitemu calls int e6, ax=ffff. The unix termination code is in BL. Well
it should be but I can't see it.
So it's easy to write your own exitemu if this actually works -- I'm not
sure why not yet. It can just call int21/ah=4d to get the DOS return
code. Maybe this should be an option, also using "exitemu 2" to exit
with code 2.
Bart
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: how do you get a DOS returncode back into unix ?
[not found] <3D17A93E00539992@freesurfmta02.sunrise.ch>
@ 2002-08-11 16:04 ` Bart Oldeman
0 siblings, 0 replies; 3+ messages in thread
From: Bart Oldeman @ 2002-08-11 16:04 UTC (permalink / raw)
To: Per Jessen; +Cc: linux-msdos@vger.kernel.org
On Sun, 11 Aug 2002, Per Jessen wrote:
> On Sun, 04 Aug 2002 19:15:21 +0200, Per Jessen wrote:
>
> >On Sun, 4 Aug 2002 16:35:56 +0100 (BST), Bart Oldeman wrote:
> >
> >>So it's easy to write your own exitemu if this actually works -- I'm not
> >>sure why not yet. It can just call int21/ah=4d to get the DOS return
> >>code. Maybe this should be an option, also using "exitemu 2" to exit
> >>with code 2.
>
> I've been trying to get this to work for the last few days - no luck.
> Whenever I call int21 ah=4D, I always get al=00 back. However, IF ERRORLEVEL
> works fine. As far as I can tell, the call is processed by DOS itself,
> ie. DOSEMU doesn't really touch it.
That's right. The problem is that - see RBIL:
"the word in which DOS stores the return code is cleared after being
read by this function, so the return code can only be retrieved once"
so you can only get it this way if you execute the program directly
using int21/ah=4b (DOS EXEC). Command.com has already stolen it in your
situation.
Hmm, now that I check it, FreeDOS does not clear the return code. That
might have confused me.
> Even the simplest setup - a program that sets the rc, and one that calls
> int21,4d to retrieve it doesn't work. Does anyone know where ERRORLEVEL
> gets the information from ?
int21/ah=4d ;)
> As far as I can tell, DOSEMU itself makes no use of int21,4d ?
No. What DOSEMU could do is to intercept int21,4d and "peek" the code
from DOS memory, at the SDA (obtained via int21/5d06), location 14h.
SDA=DOS Swappable Data Area, basically the current state of DOS,
combined with all its "static" variables and internal stacks.
The "Undocumented DOS" books attempt to do multitasking with DOS by
swapping the SDA. Of course multitasking with DOSEMU is trivial and not
nearly as dangerous and full of potholes :)
The SDA is already used by the redirector code, so DOSEMU knows its
location.
Bart
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: how do you get a DOS returncode back into unix ?
@ 2002-08-23 21:33 Stas Sergeev
0 siblings, 0 replies; 3+ messages in thread
From: Stas Sergeev @ 2002-08-23 21:33 UTC (permalink / raw)
To: linux-msdos
Hello.
Per Jessen wrote:
>>No. What DOSEMU could do is to intercept int21,4d and "peek" the code
>>from DOS memory, at the SDA (obtained via int21/5d06), location 14h.
>>SDA=DOS Swappable Data Area, basically the current state of DOS,
>>combined with all its "static" variables and internal stacks.
>>The "Undocumented DOS" books attempt to do multitasking with DOS by
>>swapping the SDA. Of course multitasking with DOSEMU is trivial and
>not
>>nearly as dangerous and full of potholes :)
>>The SDA is already used by the redirector code, so DOSEMU knows its
>>location.
> Thanks Bart - I'll have a think about it.
Just wondering: is it really worth doing it
that way? Can you just create a .bat file
that will execute your program and then exitemu
with an argument to depend on ERRORLEVEL?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-08-23 21:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-23 21:33 how do you get a DOS returncode back into unix ? Stas Sergeev
[not found] <3D17A93E00539992@freesurfmta02.sunrise.ch>
2002-08-11 16:04 ` Bart Oldeman
[not found] <3D17A93E00465660@freesurfmta02.sunrise.ch>
2002-08-04 15:35 ` Bart Oldeman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox