Can Dosbox automatically quit from MS-DOS 6.22? (Yes, Solved.)

General information and assistance with DOSBox.

Can Dosbox automatically quit from MS-DOS 6.22? (Yes, Solved.)

Postby Magstriker » 2019-8-29 @ 22:52

Hello,

Serious apologies if this question has been answered elsewhere but I have scoured the internet and have not found one. If it has been asked please direct me to the solution before closing this thread.

Anyway, my friend has DOSBOX 0.74-3 installed on windows 10 with it booting off a hard disk image running MS-DOS 6.22. I am aware that many of DOSBOX's functions do not work once booted into a disk image but my friend wants to have that same auto-quit functionality like the dosbox.exe -exit "program path" feature. Is it possible to tell DOSBOX to quit within this MS-DOS 6.22 environment? Is there some known way to crash this version of dosbox to get it to quit that way? I would prefer to not force him to download a fork of dosbox since he gets frustrated somewhat easily, but emailing him a small batch, com or exe file to inject into his disk image would be nice since he already installed a bunch of games to the image already.

I have tried the -exit command to no avail.
I have attempted to use ACPI shutdown calls with some old assembly programs to no avail.
I have read all FAQs and wikis for DOSBOX, googled around and have asked in some discord servers to no avail.

Thank you in advance.
Last edited by Magstriker on 2019-8-30 @ 05:42, edited 1 time in total.
Magstriker
Newbie
 
Posts: 8
Joined: 2019-8-29 @ 22:28

Re: Can Dosbox automatically quit from MS-DOS 6.22?

Postby kjliew » 2019-8-29 @ 23:12

Ctrl-F9
kjliew
Member
 
Posts: 443
Joined: 2004-1-08 @ 03:03

Re: Can Dosbox automatically quit from MS-DOS 6.22?

Postby Magstriker » 2019-8-30 @ 01:01

Will that key combination work if I simulate the key presses inside DOS6.22 with some old dos programs or is that picked up externally?
Magstriker
Newbie
 
Posts: 8
Joined: 2019-8-29 @ 22:28

Re: Can Dosbox automatically quit from MS-DOS 6.22?

Postby jmarsh » 2019-8-30 @ 01:29

Try using a reboot sequence (int 19 comes to mind) instead of shutdown. It's not pretty but should work.
jmarsh
Member
 
Posts: 241
Joined: 2014-1-04 @ 09:17

Re: Can Dosbox automatically quit from MS-DOS 6.22?

Postby kjliew » 2019-8-30 @ 01:52

Magstriker wrote:Will that key combination work if I simulate the key presses inside DOS6.22 with some old dos programs or is that picked up externally?

That's for DOSBox itself.

The following ASM #1 and #2 code snippet will shutdown DOSBox within itself.
Code: Select all
;ASM #1
    jmp far f000:fff0

;ASM #2
    mov al, 01h
    out 92h, al
kjliew
Member
 
Posts: 443
Joined: 2004-1-08 @ 03:03

Re: Can Dosbox automatically quit from MS-DOS 6.22?

Postby Magstriker » 2019-8-30 @ 03:29

Okay. Thank you for the code. I have compiled this and both methods work. Both methods appear to vary in speed, but I will test on my own to find the best method for me. For those interested in compiling this yourself do the following:

1. Startup any version of DOS or DOS prompt.
2. Run DEBUG (DOSBox does not include this by default. I believe Windows XP has DEBUG but I could be wrong. DEBUG is covered under the default PATH so you can run it from anywhere.)
3. Type the following (It is the memory location you will start writing code to. It is 100 here because .COM files need the offset to be 100 for whatever reason.):
Code: Select all
a 100

4. For ASM1 type only the jmp line, for ASM2 type the mov and out lines in that order. Also with DEBUG all numbers are hex by default so be sure to remove the 'h' letters from ASM2. There is no need for using both methods in the same program. Just make one program for each and try both:
Code: Select all
jmp far f000:fff0
mov al, 01
out 92, al

5. The next blank line you get press enter again to drop back to the - prompt and type the following:
Code: Select all
r cx

6. Subtract 100 from the number after the colon on the blank line(This is how many bytes to write out. The number you subtract 100 from ought to be less than 110 for ASM1, 2, or both. Therefore, type:
Code: Select all
Some single digit number, not the words you are reading right now.
n filename.com
w
q

7. You are done! The file will be saved to your current directory. For reference, the n command gives the program a name (do not forget the 8.3 name limits and the file being made is going to be a .COM file), the w command writes our code to a file by that name, and the q command quits DEBUG.

Share and Enjoy! I have attached the compiled .COM files for those not interested in compiling it themselves in all combinations of the above two methods.
Attachments
Compiled COM Files.zip
(573 Bytes) Downloaded 5 times
Magstriker
Newbie
 
Posts: 8
Joined: 2019-8-29 @ 22:28


Return to DOSBox General

Who is online

Users browsing this forum: No registered users and 4 guests