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
Morten Rønne morten.roenne@tdcadsl.dk wrote:
I would like to write some tests for the krnl386.exe16 part of wine, or more precisely the DOS parts of that.
Archives should have enough asnwers to question like this one, one of the attemps is here:
http://www.winehq.org/pipermail/wine-devel/2009-January/072560.html
TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../../.. SRCDIR = @srcdir@ VPATH = @srcdir@ TESTDLL = krnl386.dll IMPORTS = user32 kernel32
ASM =
C_SRCS = \ krnl386.c
# Rule for making 16 bit sources if assembler is available ifdef ASM ASM_SRCS = \ int21.asm
$(TESTDLL) : $(ASM_SRCS)
.com.asm: -$(ASM) -f bin -w+orphan-labels -o $@ $< endif
@MAKE_TEST_RULES@
Morten Rønne morten.roenne@tdcadsl.dk wrote:
I can't see what I should have missed in Makefile.in for this to fail. I would expect the needed rules would be made automatically when creating the final Makefile with make depend.
I can run tests in kernel32 just fine.
1. You went in the wrong direction by choosing to write the tests in asm. 2. It should be acceptable to add the tests in kernel32 (you won't be able to call 16-bit APIs directly or link to 16-bit libraries anyway).