Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Dec 2000 17:59:05 -0800
From:      "Jeremiah Gowdy" <data@irev.net>
To:        <freebsd-questions@FreeBSD.ORG>, <freebsd-hackers@FreeBSD.ORG>
Subject:   DOS Emulation KLD
Message-ID:  <002701c06896$1a899060$aa240018@cx443070b>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
I've had this idea kicking around for some time, so I decided I would throw it out there and see if anyone was interested or had any ideas.

I'm wondering why we can't write basic DOS emulation as a KLD.  DOS programs are x86 code, a majority of it usually doing basic mundane (userland acceptable) things.  The only problems would come about when interrupts were called and system memory locations were written to.  It is my understanding that under x86-32 virtual machines, such instructions are "illegal" and therefore caught by the OS's virtual machine driver, and emulated.  I think for basic int 21h services, and BIOS keyboard and text functions, this wouldn't be that difficult to do, and would allow simple text based DOS programs to run under FreeBSD.  The DOS programs would see the file system in an 8.3 format, case insensitive, and would be able to use and save files without any real major modification.  The same way VFAT handles long file names, DOS could handle FFS file names (eg: alongfilename.txt becomes alongf~1.txt).  With the file system emulated, the basic interrupts caught and emulated, and everything else stubbed, many simple dos programs would function under FreeBSD.  For example, although of course we have midnight commander, there is no real reason why the original Norton Commander could not run under FreeBSD.  I'm not suggesting NC would be better than MC, but what I am suggesting is that a simple program like NC, which writes to the screen and manages files, should have no problem running in the BSD environment.  I know there are emulation programs available in ports, but I was thinking along the lines of a KLD, which is automatically loaded when a DOS exe file is executed from the prompt.  I'm going to look into this, and maybe with some help, draft a simple implementation to see if it's feasible.

Any comments or suggestions welcome.


[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4522.1800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I've had this idea kicking around for some time, so 
I decided I would throw it out there and see if anyone was interested or had any 
ideas.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I'm wondering why we can't&nbsp;write basic DOS 
emulation as a KLD.&nbsp; DOS programs are x86 code, a majority of it usually 
doing basic mundane (userland acceptable) things.&nbsp; The only problems would 
come about when interrupts were called and system memory locations were written 
to.&nbsp; It is my understanding that under x86-32 virtual machines, such 
instructions are "illegal" and therefore caught by the OS's virtual machine 
driver, and emulated.&nbsp; I think for basic int 21h services, and BIOS 
keyboard and text functions, this wouldn't be that difficult to do, and would 
allow simple text based DOS programs to run under FreeBSD.&nbsp; The DOS 
programs would see the file system in an 8.3 format, case insensitive, and would 
be able to use and save files without any real major modification.&nbsp; The 
same way VFAT handles long file names, DOS could handle FFS file names (eg: 
alongfilename.txt becomes alongf~1.txt).&nbsp; With the file system emulated, 
the basic interrupts caught and emulated, and everything else stubbed, many 
simple dos programs would function under FreeBSD.&nbsp; For example, although of 
course we have midnight commander, there is no real reason why the original 
Norton Commander could not run under FreeBSD.&nbsp; I'm not suggesting NC would 
be better than MC, but what I am suggesting is that a simple program like NC, 
which writes to the screen and manages files, should have no problem running in 
the BSD environment.&nbsp; I know there are emulation programs available in 
ports, but I was thinking along the lines of a KLD, which is automatically 
loaded when a DOS exe file is executed from the prompt.&nbsp; I'm going to look 
into this, and maybe with some help, draft a simple implementation to see if 
it's feasible.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Any comments or suggestions welcome.</FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002701c06896$1a899060$aa240018>