Einzelnen Beitrag anzeigen
Alt 31.07.2017, 21:26   #16
leecher
Moderator
Zitat:
Zitat von RalfFriedl Beitrag anzeigen
Thank you for the 32-Bit fix. With this fix, it works.
I have disassembled the BIOS, it seems it's doing 32-Bit I/O to addresses 0CF8, 0CFC, F000, F004. Ports 0CF8 and 0CFC seem to be PCI config, the result from those is used to determine ports F000 and F004. The BIOS area is writable and accessed via CS register.
Good to hear! So maybe I should release the fix on the download-page then as fix for your VGA BIOS-Version (as opposed to the Indelvidfix, I wonder if ppl can tell these fixes apart...).

Zitat:
Zitat von RalfFriedl Beitrag anzeigen
I still think it is a stupid idea from Microsoft to use the VGA BIOS at this point (or at all). For all we and Windows knows, the BIOS may pass the parameters to the GPU to do the real work, as the GPU is often faster that the main CPU, especially with Atom and Celeron CPUs. Not that the output speed is an indication of that.
I think fullscreen mode should also not use the BIOS. It is better and faster to require support in the Windows VGA Driver than to call the real mode BIOS and then trap and emulate the I/O access.
Every VGA card must be handled differently and as it also gets used in i.e. DOS it perfetly makes sense to use it in fullsreen, as you don't need to write a different driver for every VGA-Card out there. Imagine that this also has to work with standard VGA driver too.

Nevertheless, I haven't tried that, but I think if
in HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System
the Key "Identifier" contains "ARCx86", NTVDM uses emulated ROMs instead of the system ROMs.

Zitat:
Zitat von RalfFriedl Beitrag anzeigen
I also tried the following program to load a complete BIOS:
I tried to compile it with the compiler from the "SDK for Windows 7" with "cl -LD vgabios.c". This created a DLL, and I could verify with ProcMon that the DLL is loaded by NTVDM, but I saw no indication that it would try to open the BIOS file. Is this idea generally flawed, do I have to do something else to create a library that can be used by NTVDM, or is it generally no possible to access files this way from NTVDM? Can you tell me what is necessary to create a suitable DLL for NTVDM, or if special tools are necessary, compile the program for me?
Just a shot in the dark: Did you forget to set /entry:"VDDInitialize" in the linker flags?
You can learn more about VDDs by reading d_vdos.chm from the NTDDK.

Zitat:
Zitat von RalfFriedl Beitrag anzeigen
Do you know how NTVDM knows how to attach to a DOS command? When I called NTVDM directly, from the command line or in the debugger, it just exits. I also replaced it with a program to display the command line, it seems the NTDVM command line is empty, so there must be something else to tell NTVDM what to do.
NTVDM has to be initiated by the Windows NT Loader. It has to be that way, because NTVDM can actually execute other (i.e. NTVDM) programs within itself, i.e. if you type a command in command.com and it has to reuse its own instance instead of creating a new NTVDM for every new DOS appliation that gets executed. Here is a very short description how it works:
When you first execute a DOS executable, the Windows NT loader will recognize, that it's not a WIN32 PE-Executable. So it next checks if it is a NE-Executable, a Batch-File or even a headerless .COM program.
The loader sets an error code depending on the type of Non-WIN32 Executable the user tries to execute. It sets the error code STATUS_INVALID_IMAGE_PROTECT or STATUS_INVALID_IMAGE_NOT_MZ and passes the error on t the BasepProcessInvalidImage() function. This function then checks with BaseIsDosApplication(), whether the user wants to execute a DOS application or not. If this is the case, the loader does a BaseCheckVDM call to see if there is already an NTVDM here tht can be used to exeute the DOS or Win16 NE application with it. According to the results, it then registers the application to exeute with the CSRSS subsystem and if not present, start up NTVDM with an ID, and optionally also specifies a parameter whether NTVDM should execute as WOW16 layer or as DOS emulator.
NTVDM then in turn uses the GetNextVDMCommand() API call to check what's up next to execute and if it finds something, it executes the command with the given environment block.
So in short: No, you cannot run NTVDM.exe the way you tried

Zitat:
Zitat von RalfFriedl Beitrag anzeigen
The VGA BIOS for this adapter is almost 64kB, while the one from the Virtual Machine is just 32kB. Considering they don't want to support the 16-Bit BIOS, they made it quite big. And is seems to be assembly, not C, so that is not the reason why it is so big.
My guess is that this MMIO-Stuff which is in there maybe is better optimized for onboard VGA.

Zitat:
Zitat von RalfFriedl Beitrag anzeigen
I will send you the TeamViewer codes in case you are still interested.
I guess sending the VGA BIOS dump for my collection will be enough then, thanks
leecher ist offline   Mit Zitat antworten