Writing test programs for dlls/krnl386.exe16

Morten Rønne morten.roenne at tdcadsl.dk
Sat Apr 17 05:28:44 CDT 2010


Hi

I would like to write some tests for the krnl386.exe16 part of wine, or 
more precisely the DOS parts of that.

But there is no starting point at the moment.

As far as I can understand other tests are run as 32/64 bit programs, 
which makes sense since they test the 32/64 parts of wine.

But in order to test the DOS part I need to run as 16 bit (32 bit might 
be ok) and use the old style int 21h functions and so on.

A "simple" solution to this would be to create a 32 bit program which 
executes the 16 bit DOS program through a fitting 32 bit windows call. 
The 16 bit program writes a file which the 32 bit program reads in order 
to do the reporting.

So what I have been trying to find out, is how to create programs that 
do exactly that.

For the windows part I hope this should be able to startup a 16 bit program:
    memset(&si, 0, sizeof(si));
    si.cb = sizeof(si);
    if (CreateProcessA(NULL, name, NULL, NULL, FALSE, 0, NULL, NULL, 
&si, &pi)) {
        CloseHandle(pi.hThread);
        CloseHandle(pi.hProcess);
        if(read_test_file())
            return TRUE;
    }

For the DOS part the most logical thing would be to use assembler 
langage, as this will allow me to write the most specific tests and know 
what is being tested. It might also be possible to find various "old" 
education samples or other tests that might form a base for testing.
I have no problem writing the programs in assembler.

The assembler can be done 2 ways as I see it, as true assembler (e.g. 
nasm or something like that) or written as inline assembler in a C program.

I am not sure which method is best for wine.

The other problems is how to link the programs into an executable DOS 
program. So far my searching on the internet hasn't provided me with 
anything that I could use.

So I looking for input on this work and how to move forward.
Can anyone give me some pointers on how to do this (within the wine 
enviroment)?
Can mingw used for the cross compiling also be used for this, given the 
correct parameters?

I believe that the tests should be able to be skipped if a proper 
enviroment isn't present, in case the building of the test requires 
something extra, .e.g, an assembler otherwise not needed for wine.

Best Regards

Morten Rønne







More information about the wine-devel mailing list