2. The Main group of Modules

These files are used to start DOSEMU as well as hold globally called functions and global vars.

2.1. Functions in dos.c

These are the functions defined in dos.c.

2.1.1. dosemu

Arguments are:

  • argc - Count of argumnents.

  • argc - Actual arguments.

Function created by entry point into libdosemu. Called to jump into the emulate function of DOSEMU.

2.2. Functions in emu.c

These are the functions defined in emu.c.

2.2.1. jmp_emulate

call the emulate function by way of the dll headers. Always make sure that this line is the first of emu.c and link emu.o as the first object file to the lib

2.2.2. emulate

Arguments are:

  • argc - Argument count.

  • argv - Arguments.

Emulate gets called from dos.c. It initializes DOSEMU to prepare it for running in vm86 mode. This involves catching signals, preparing memory, calling all the initialization functions for the I/O subsystems (video/serial/etc...), getting the boot sector instructions and calling vm86().

2.3. Remarks in emu.c

DOSEMU must not work within the 1 meg DOS limit, so start of code is loaded at a higher address, at some time this could conflict with other shared libs. If DOSEMU is compiled statically (without shared libs), and org instruction is used to provide the jump above 1 meg.

2.4. Remarks in include/emu.h

The `vm86_struct` is used to pass all the necessary status/registers to DOSEMU when running in vm86 mode.

-----

DOSEMU keeps system wide configuration status in a structure called config.

-----

The var `fatalerr` can be given a true value at any time to have DOSEMU exit on the next return from vm86 mode.

-----

The var 'running_DosC' is set by the DosC kernel and is used to handle some things differently, e.g. the redirector. It interfaces via INTe6,0xDC (DOS_HELPER_DOSC), but only if running_DosC is !=0. At the very startup DosC issues a INTe6,0xdcDC to set running_DosC with the contents of BX (which is the internal DosC version).