Greetings folks,

This is a start at my suggestion for how DOSEMU should probably evolve.

(A)  DOSEMU phases

I think that things should be more or less divided into three 'phases',
call them phase0, phase1, and phase2.

phase0:  all information relative to the current unix, the configuration
         files, console/terminal setup, detection of console, etc.

phase1:  set up all hardware emulation (cpu, serial ports, lpt ports, dma,
         pic, pit, rtc, pos, etc.)
         set up the base 1Meg memory
         set up BIOS, initialize the interrupt vectors, initialize the
         0x0040 BIOS storage area.

phase2:  set up all "dos-specific" emulation.  (int 0x33 for mouse,
         ems, xms, hma, interrupt chain handlers, garrot values, etc.)

Most of this is relatively clear.  However, it's going to take a bit of
time before we can separate the phase0 and phase1 code from the video
modules, for example.

Thus, when porting, you change phase0.  If you want to boot something other
than DOS, you just do phase0 & phase1.  Tada!

(B)  New directory structure (not finished)

I have been trying to reorganize the directory structure to better reflect
the phases described above.  The work is far from done (for instance, I
wasn't 100% clear on where to locate some of the code.  Is the video code
and 'io device?'  Probably.)  Comments are welcome.

(C)  Bochs integration

There is some nice code in Bochs.  In that vein, I have been trying to
move some of the functionality to be a little more "Bochs-like."  (I hope
this does not upset the author of Bochs.)

To this end, I have set up the Bit8u, Bit16u & Bit32u types and have begun
using them in some of the code.

(D)  New PORT code

I took the inb/outb code from BOCHS (because it's rather nice) and have
been working to get it set up in DOSEMU.  (The emu_inb/emu_outb functions.)

The video code is going to be a bit of a pain to migrate because the s3,
diamond, & other code is a royal mess.

(E)  New BIOS code

There is a new beta-BIOS that you can take a look at in bios/new_bios.S
This will hopefully become the new DOSEMU BIOS.

(F)  New TIMER code

There is new timer code in ./dosemu/timers.c  You can registers a callback
function to be called back after xxx usecs or register a callback to be
regularly called back every yyy usecs.

The Programmable Interrupt Timer (PIT -- int 0x08) code now makes use of
these timers.  Hopefully the serial code, the floppy_sync code, and others
will one day use it too.  (Mark???)

(G)  New HLT code

The new BIOS will include a 4K HLT block at 0xFC00:0000 (that is, 4K of
HLT's).  What I envision is registering HLT handlers (like the port code
handlers) which will then handle the HLT statements.

(H)  New INTERRUPT handler code (started)

I am trying to rewrite the code in ./dosemu/int.c during the BIOS rewrite.
There are a number of functions which aren't used.  The code could also be
made much clearer.  I am trying to make it more obvious to new programmers
how to intercept and interrupt and chain to its results.

(I)  New MAKEFILEs (started)

I'm trying to get the Makefile's to look more like those of Linux.  This
includes the LibConfig statement and such.


<whew!>  Is that enough?

Well, I'm ready for feedback.  The code won't compile in the current state
and there are big problems with the make files.  (For instance, it's looking
like I'll have to take out the .depend stuff and go back to the .d files)

Are there comments on ANY of this?

The Makefile's don't work yet.  The code won't compile yet and there are
big holes.  But it's a start.  I'm open to commentary.

<putting on flame-retardent suit>

Scott Buchholz  <scottb@eecs.nwu.edu>

