home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!world!jhallen
- From: jhallen@world.std.com (Joseph H Allen)
- Subject: Re: DOS emulation
- Message-ID: <C0BGJq.Lr5@world.std.com>
- Organization: The World Public Access UNIX, Brookline, MA
- References: <memo.837633@cix.compulink.co.uk>
- Date: Mon, 4 Jan 1993 06:26:14 GMT
- Lines: 74
-
- In article <memo.837633@cix.compulink.co.uk> jburtona@cix.compulink.co.uk writes:
- >DOS emulation
-
- >Rather than running a copy of MSDOS in an virual 8086, wouldn't it be
- >nice to have a free dos-like operating system that was capable of
- >running DOS programs?
-
- I was seriously considering doing this once. The difficulty of the problem
- depends on the level of compatibility you wish to achieve:
-
- To implement documented DOS & BIOS calls:
-
- You need the translate the I/O calls into the proper linux
- calls, you need to make the EXE file loader along with the
- PSP management junk. Also you have to implement the MS-DOS
- heap stuff.
-
- All this would be tedious, but easy. Unfortunately only a
- few programs (like compilers) would work.
-
- To implement undocumented DOS stuff:
-
- A lot of programs make use of undocumented DOS calls which
- give access to some of MS-DOS's internal structures. Most
- of this is for disk utilities, so you probably don't
- have to implement all of it. Luckily, finding information
- on the undocumented stuff is not too hard. I have a
- collection of books and magazine articles which explain most
- things.
-
- This stuff is necessary for getting TSRs and other process
- control stuff to work.
-
- To implement hardware:
-
- This is a mess. You really have to give DOS programs direct
- access to video memory and registers. Also you have to
- somehow simulate a lot of other hardware: most importantly
- the timers and the keyboard. Many dos programs directly
- access the hardware for this stuff. If you want any dos
- program to be able to use the serial ports, you have to
- simulate those also.
-
- I know VP-IX just gives direct access to the hardware, but
- then you might as well just run real MS-DOS (which VP-IX
- does).
-
- More problems:
-
- You probably have to implement extended memory routines for
- many programs to be useful. Lotus 123, for example, really
- needs this.
-
- You probably also have to be able to run some DOS device
- drivers.
-
- Also many programs use DOS extenders to get access to 386
- features...
-
- So it ends up being quite a bit of work. The ultimate in compatibility
- would be to get Windows to run in your MS-DOS, but it might actually be
- easier to simulate the Windows API then to simulate MS-DOS and run real
- Windows in it.
-
- Rewriting a stand-alone version of MS-DOS is probably less difficult than
- making a hack for linux. At least then you don't have to worry about the
- hardware compatibility.
-
- See part II...
- --
- /* jhallen@world.std.com (192.74.137.5) */ /* Joseph H. Allen */
- int a[1817];main(z,p,q,r){for(p=80;q+p-80;p-=2*a[p])for(z=9;z--;)q=3&(r=time(0)
- +r*57)/7,q=q?q-1?q-2?1-p%79?-1:0:p%79-77?1:0:p<1659?79:0:p>158?-79:0,q?!a[p+q*2
- ]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817;)printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);}
-