Page 1 of 1
Implementing a DOS extender
Posted: Wed Dec 07, 2011 5:48 am
by amd64pager
I am currently working on a DOS extender(for my graphical shell that is like win3.11) just for fun,but which are the best ways to do this?
Re: Implementing a DOS extender
Posted: Wed Dec 07, 2011 6:02 am
by Love4Boobies
Best ways to do what, in particular? If you know what a DOS extender does, it's just a matter of implementation. If you don't just ask what they do.
Re: Implementing a DOS extender
Posted: Wed Dec 07, 2011 11:53 am
by guyfawkes
The best i seen and used, was coded by some one off this forum.
Its was a 100% Dos comparable, but it was true 32bit DOS.
you could use any int 21h in PM just like realmode, but using 32bit regs and full 4GB address space.
It used a method thats looked down on this forum, but worked great.
Let me know if you want any more info.
Re: Implementing a DOS extender
Posted: Wed Dec 07, 2011 6:03 pm
by Combuster
Calling bios ints from custom protected mode is not any different than in a kernel context. The only difference is in functional goals. DOS with 32-bit apps have totally different needs than a 32-bit OS that lacks any legacy components.
But your question is too vague to the point of using "DOS Extender" because it sounds cool. What do you actually need?
Re: Implementing a DOS extender
Posted: Thu Dec 08, 2011 2:26 pm
by qw
If it is not your goal to learn how to write a DOS extender, I'd advise you to use one that already exists. There are quite a few. Tran's PMODE comes to mind, and Wuchsel's WDOSX, and CWSDPMI...
Re: Implementing a DOS extender
Posted: Thu Dec 08, 2011 2:41 pm
by rdos
I once had a multithreaded DOS-extender environment in RDOS. It could run some 16 and 32-bit DOS extender programs (I think WDOSX and some others). To build a DOS-extender environment that can run on both pure DOS (real mode) and popular DPMI-servers (like Windows) is a lot of work. To implement a single-threaded DPMI server + MS-DOS environment emulation in an OS is also a lot of work. It is even more work to support multithreaded DOS-extender apps.
I still have the source for both the DOS emulation and the DPMI-server in my source-tree. I don't know if it still works as I have not tried DOS-extender apps the last five years or so.
In fact, RDOS might have the only DPMI version 1.0 compliant server. Nobody else seemed to move past version 0.9, and probably for good reasons, as version 1.0 added some really nasty functions.
Re: Implementing a DOS extender
Posted: Thu Dec 08, 2011 3:38 pm
by guyfawkes
@rdos, is your OS ms dos compatible ?, if so where can i download it ? as i want to try dos2x on it
.
dos2x is cool
http://www.dex-os.com/dos2x/dos2x.jpg
Re: Implementing a DOS extender
Posted: Thu Dec 08, 2011 3:58 pm
by rdos
Let's say it once was pretty ms dos compatible, but that I'm pretty sure that this broken right now. The command shell, in fact, was first ported from FreeCom, but the DOS-calls were eliminated, and eventually it has been totally rewritten.
There is also not a lot of (correct) documentation of how to build RDOS, and you must also check-out both the code from my SVN-server (which is at
http://www.rdos.net/rdos), and use a snapshot of OpenWatcom (
http://www.openwatcom.org) (version 1.9 will not work) in order to build it. I could build a binary for you if you give me some hints at which hardware configuration you have. If you have grub installed, it is pretty easy to boot. It won't work on bochs, but it works on VirtualPC, unless something has happened.
I plan to provide binaries when version 2.0 of OpenWatcom is released, and will update the documentation as well, but this will not happen until March 2012.
Re: Implementing a DOS extender
Posted: Thu Dec 08, 2011 4:26 pm
by guyfawkes
Thanks, if i have a problem, i will let you know.
Re: Implementing a DOS extender
Posted: Thu Dec 15, 2011 7:25 am
by amd64pager
guyfawkes wrote:The best i seen and used, was coded by some one off this forum.
Its was a 100% Dos comparable, but it was true 32bit DOS.
you could use any int 21h in PM just like realmode, but using 32bit regs and full 4GB address space.
It used a method thats looked down on this forum, but worked great.
Let me know if you want any more info.
I would really like some more info.
Re: Implementing a DOS extender
Posted: Thu Dec 15, 2011 7:36 am
by amd64pager
Hobbes wrote:If it is not your goal to learn how to write a DOS extender, I'd advise you to use one that already exists. There are quite a few. Tran's PMODE comes to mind, and Wuchsel's WDOSX, and CWSDPMI...
I wanted to write a DOS extender to learn about extending DOS.(I've been using DOS for a very long time now)
Re: Implementing a DOS extender
Posted: Thu Dec 15, 2011 8:17 am
by Combuster
Basically if windows for workgroups is your goal, you basically make a protected operating system where the exit button will get you back to DOS instead of shutting down the computer. You also typically don't touch interrupt routing hardware so you don't break DOS and BIOS functions at the cost of stability issues.
Re: Implementing a DOS extender
Posted: Fri Dec 16, 2011 3:01 am
by qw
amd64pager wrote:I wanted to write a DOS extender to learn about extending DOS.(I've been using DOS for a very long time now)
Well, many DOS extenders come with source code, studying those might help.
DOS extenders are not the same as a DPMI server, but they usually install their own DPMI server if none is present. They typically first test for the presence of DPMI, then VCPI, then XMS, falling back on raw extended memory access if none is installed. You can build a protected mode API on top of that.
Re: Implementing a DOS extender
Posted: Fri Dec 16, 2011 6:19 am
by amd64pager
Combuster wrote:Basically if windows for workgroups is your goal, you basically make a protected operating system where the exit button will get you back to DOS instead of shutting down the computer. You also typically don't touch interrupt routing hardware so you don't break DOS and BIOS functions at the cost of stability issues.
IMHO a dos extender has to provide a way for protected mode drivers,executing DOS sysints,have a memory manager,etc.
And AFAIK wfw(windows for workgroups) has ways to use protected mode drivers,has it's own memory manager(DPMI was originally developed for wfw),IRQ handling,etc.And without touching the interrupt routing hardware and the IDT you can't use the mouse and can't provide syscalls(krnl386.exe and gdi386.exe provide many syscalls).