home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / linux / 22614 < prev    next >
Encoding:
Text File  |  1993-01-04  |  3.1 KB  |  85 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!world!jhallen
  3. From: jhallen@world.std.com (Joseph H Allen)
  4. Subject: Re: DOS emulation
  5. Message-ID: <C0BGJq.Lr5@world.std.com>
  6. Organization: The World Public Access UNIX, Brookline, MA
  7. References: <memo.837633@cix.compulink.co.uk>
  8. Date: Mon, 4 Jan 1993 06:26:14 GMT
  9. Lines: 74
  10.  
  11. In article <memo.837633@cix.compulink.co.uk> jburtona@cix.compulink.co.uk writes:
  12. >DOS emulation
  13.  
  14. >Rather than running a copy of MSDOS in an virual 8086, wouldn't it be 
  15. >nice to have a free dos-like operating system that was capable of
  16. >running DOS programs?
  17.  
  18. I was seriously considering doing this once.  The difficulty of the problem
  19. depends on the level of compatibility you wish to achieve:
  20.  
  21.     To implement documented DOS & BIOS calls:
  22.  
  23.         You need the translate the I/O calls into the proper linux
  24.         calls, you need to make the EXE file loader along with the
  25.         PSP management junk.  Also you have to implement the MS-DOS
  26.         heap stuff.
  27.  
  28.         All this would be tedious, but easy.  Unfortunately only a
  29.         few programs (like compilers) would work.
  30.  
  31.     To implement undocumented DOS stuff:
  32.  
  33.         A lot of programs make use of undocumented DOS calls which
  34.         give access to some of MS-DOS's internal structures.  Most
  35.         of this is for disk utilities, so you probably don't
  36.         have to implement all of it.  Luckily, finding information
  37.         on the undocumented stuff is not too hard.  I have a
  38.         collection of books and magazine articles which explain most
  39.         things.
  40.  
  41.         This stuff is necessary for getting TSRs and other process
  42.         control stuff to work.
  43.  
  44.     To implement hardware:
  45.  
  46.         This is a mess.  You really have to give DOS programs direct
  47.         access to video memory and registers.  Also you have to
  48.         somehow simulate a lot of other hardware: most importantly
  49.         the timers and the keyboard.  Many dos programs directly
  50.         access the hardware for this stuff.  If you want any dos
  51.         program to be able to use the serial ports, you have to
  52.         simulate those also.
  53.  
  54.         I know VP-IX just gives direct access to the hardware, but
  55.         then you might as well just run real MS-DOS (which VP-IX
  56.         does).
  57.  
  58.     More problems:
  59.  
  60.         You probably have to implement extended memory routines for
  61.         many programs to be useful.  Lotus 123, for example, really
  62.         needs this.
  63.  
  64.         You probably also have to be able to run some DOS device
  65.         drivers.
  66.  
  67.         Also many programs use DOS extenders to get access to 386
  68.         features...
  69.  
  70. So it ends up being quite a bit of work.  The ultimate in compatibility
  71. would be to get Windows to run in your MS-DOS, but it might actually be
  72. easier to simulate the Windows API then to simulate MS-DOS and run real
  73. Windows in it.
  74.  
  75. Rewriting a stand-alone version of MS-DOS is probably less difficult than
  76. making a hack for linux.  At least then you don't have to worry about the
  77. hardware compatibility.
  78.  
  79. See part II...
  80. -- 
  81. /*  jhallen@world.std.com (192.74.137.5) */               /* Joseph H. Allen */
  82. 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)
  83. +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
  84. ]?a[p+=a[p+=q]=q]=q:0:0;for(;q++-1817;)printf(q%79?"%c":"%c\n"," #"[!a[q-1]]);}
  85.