Implementing a DOS extender

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
amd64pager
Member
Member
Posts: 73
Joined: Fri Nov 25, 2011 8:27 am
Location: In the 266 squadron of the RFC,near Maranique in the Southern Front in the WW1

Implementing a DOS extender

Post 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?
It's surprising what the semiconductor industry's definition of macro is and what the CS description is.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Implementing a DOS extender

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
guyfawkes
Member
Member
Posts: 93
Joined: Mon Jul 18, 2011 9:47 am

Re: Implementing a DOS extender

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Implementing a DOS extender

Post 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?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Implementing a DOS extender

Post 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...
rdos
Member
Member
Posts: 3308
Joined: Wed Oct 01, 2008 1:55 pm

Re: Implementing a DOS extender

Post 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.
guyfawkes
Member
Member
Posts: 93
Joined: Mon Jul 18, 2011 9:47 am

Re: Implementing a DOS extender

Post 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
rdos
Member
Member
Posts: 3308
Joined: Wed Oct 01, 2008 1:55 pm

Re: Implementing a DOS extender

Post by rdos »

guyfawkes wrote:@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
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.
guyfawkes
Member
Member
Posts: 93
Joined: Mon Jul 18, 2011 9:47 am

Re: Implementing a DOS extender

Post by guyfawkes »

Thanks, if i have a problem, i will let you know.
User avatar
amd64pager
Member
Member
Posts: 73
Joined: Fri Nov 25, 2011 8:27 am
Location: In the 266 squadron of the RFC,near Maranique in the Southern Front in the WW1

Re: Implementing a DOS extender

Post 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.
It's surprising what the semiconductor industry's definition of macro is and what the CS description is.
User avatar
amd64pager
Member
Member
Posts: 73
Joined: Fri Nov 25, 2011 8:27 am
Location: In the 266 squadron of the RFC,near Maranique in the Southern Front in the WW1

Re: Implementing a DOS extender

Post 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)
It's surprising what the semiconductor industry's definition of macro is and what the CS description is.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Implementing a DOS extender

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Implementing a DOS extender

Post 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.
User avatar
amd64pager
Member
Member
Posts: 73
Joined: Fri Nov 25, 2011 8:27 am
Location: In the 266 squadron of the RFC,near Maranique in the Southern Front in the WW1

Re: Implementing a DOS extender

Post 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).
It's surprising what the semiconductor industry's definition of macro is and what the CS description is.
Post Reply