Page 1 of 2

Exiting from DOS programs

Posted: Fri Oct 27, 2006 5:16 am
by M-Saunders
Lo all,

I'm writing a small 16-bit operating system in assembler, with rudimentary DOS compatibility (http://mikeos.sourceforge.net). Small DOS COM programs and games run OK, but most of them don't exit back to the OS correctly.

As I understand it, there are three ways a DOS program can hand control back to the OS:

1) Int 20h
2) Int 21h with AH = 0
3) Int 21h with AH = 4Ch

My OS handles these fine, and I've written test DOS COM programs to confirm they work. However, some things just refuse to quit, or end up with a black screen.

Is there anything else I should be aware of? Do some really old (as in, MS-DOS 1.x era) programs just JMP back somewhere into the OS? Or is there another method of exiting DOS programs that I'm not handling?

Sorry if the solution is staring me in the face, but I'm stumped!

Thanks in advance,
Mike

Posted: Fri Oct 27, 2006 6:00 am
by bubach
In a simple COM program, a RET might be used instead of any interrupt.

Posted: Fri Oct 27, 2006 6:03 am
by M-Saunders
Ah yes, I forgot to mention that I do handle apps finishing with RET too (indeed, that's how native MikeOS programs terminate).

Mike

Posted: Fri Oct 27, 2006 6:07 am
by bubach
So, you'r sure that it's working right up until they try to exit? Have you tried the bochs debugger?

Posted: Fri Oct 27, 2006 6:43 am
by M-Saunders
I haven't tried Bochs yet -- just wanted to see if there was something obvious before I delve into that. But I'll give Bochs a go later. Thanks!

M

Posted: Fri Oct 27, 2006 8:34 am
by Dex
Remember Google Code Search is your friend :wink:
Just click on the link at the top of this page :shock: .
http://digg.com/security/MS_DOS_6_0_app ... ode_Search

Posted: Fri Oct 27, 2006 9:18 am
by M-Saunders
Ooh, better not look at that, or MikeOS will be tainted! We've all seen what happened when SCO thought its code was being misused... :-)

M

Posted: Fri Oct 27, 2006 9:22 am
by Dex
:lol: :lol: :lol:
PS: I was always told that most of Dos was writte in C :?

Posted: Fri Oct 27, 2006 9:49 am
by Touch
OOh... MikeOS cannot be MS related :shock:

Posted: Fri Oct 27, 2006 10:17 am
by M-Saunders
Until I create the company Mike-o-Soft... :-)

M

Posted: Fri Oct 27, 2006 10:56 am
by Touch
:lol: :lol:

You wouldn't do that, I know you wouldn't... Or would you? :?: :?:

Posted: Fri Oct 27, 2006 12:07 pm
by Candy
M-Saunders wrote:Until I create the company Mike-o-Soft... :-)

M
Wouldn't try that. A guy named Mike Rowe got into trouble choosing the most obvious name.

Posted: Fri Oct 27, 2006 12:44 pm
by Touch
Lol.. So the O and the soft are copyrighted... M$ ARE SOOOO SAD!

Posted: Fri Oct 27, 2006 12:49 pm
by Touch
:shock: :shock:

Wow they really are, according to BBC news:

BBC M$ report

Posted: Fri Oct 27, 2006 2:11 pm
by Dex
Candy wrote:
M-Saunders wrote:Until I create the company Mike-o-Soft... :-)

M
Wouldn't try that. A guy named Mike Rowe got into trouble choosing the most obvious name.
I heard he got a Xbox and other goody's out of it :wink:
See here: http://itvibe.com/news/1217/
I would say he got a bad deal, as Lindows got 20 Million :lol:
http://www.geeknewscentral.com/archives/002945.html