This interview with "Qbix" goes into more depth on how DOSBox works:
http://www.classicdosgames.com/interviews/peterveenstra.html
As I've mentioned previously, DOSBox with SDL could be used as an OS:
http://groups.google.com/group/alt.os.development/msg/fec484c7a0c0b4af
With modifications, it could be used as the 16-bit layer for video BIOS
calls, or as a QEMU replacement...
Quotes from the interview I thought might be interesting to OS developers
(out of order). The last quote should be interesting to assembly
programmers...
(Interviewer) "I've been impressed by how well Windows 3.1 runs in DOSBox
...."
(Qbix) "Using disk images, it is even possible to run Windows 95 running
Starcraft on DOSBox. That is kind of nice, but not currently a goal of
DOSBox. With some patches (that are currently developer-only) you can even
run (to some degree) Linux, NetBSD and Windows NT4 in DOSBox. A nice test
for our hardware emulation, but again not a goal of DOSBox."
(Qbix) "DOSBox is mostly OS independent, CD-ROM sup****t using your real
drive is an exception though."
(Qbix) "DOSBox isn't a VDM, DOSBox is actually a full-blown PC emulator.
So
we emulate the CPU, timer, interrupt controller, sounds cards, video
cards,
BIOS, videobios and to make things easier to the end user: DOS, EMS
client,
XMS client, Mouse driver."
(Qbix) "The emulation of the mouse, EMS, XMS and DOS happens with C/C++
code and not Assembly. This makes DOSBox different from other full PC
emulators (and results in a lot of free conventional memory). To make
this
possible we have introduced an extra CPU instruction that isn't present on
a
real CPU. When this special instruction is emulated, DOSBox looks up the
next instruction which contains a number of which C function should be
executed. (All those C functions are stored in a table with their
number).
This makes it possible for us to code a mouse driver in C (which is
easier/faster to write than ASM) and make it behave like a real loaded
mouse
driver. From these functions it is possible to read and modify the
emulated
CPU registers and the emulated memory. This system is also used to
emulate
most of the BIOS and VIDEO BIOS functions."
Rod Pemberton


|