Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NTOS:INBV] Don't touch VGA I/O ports when /NOGUIBOOT specified #1837

Closed
wants to merge 1 commit into from

Conversation

binarymaster
Copy link
Member

Don't touch VGA I/O ports when /NOGUIBOOT specified.

JIRA issue: CORE-14625, CORE-16222

Copy link
Contributor

@HBelusca HBelusca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments.

@@ -415,6 +415,10 @@ InbvDriverInitialize(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
CommandLine = (LoaderBlock->LoadOptions ? _strupr(LoaderBlock->LoadOptions) : NULL);
ResetMode = (CommandLine == NULL) || (strstr(CommandLine, "BOOTLOGO") == NULL);
}
else if (InbvDisplayState == INBV_DISPLAY_STATE_DISABLED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self #1: InbvDisplayState is by default initialized to INBV_DISPLAY_STATE_DISABLED...
Note to self #2: We first call InbvEnableBootDriver(!NoGuiBoot), then InbvDriverInitialize().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does BSOD still display OK later on? (because if VidInitialize is not called it won't be possible to display it)
And since this function is in the INIT section (and thus unavailable for later) I claim we still need to call it in any case (and thus potentially playing with video registers) even if NOGUIBOOT is specified.
Indeed two observations:

  • NOGUIBOOT only means No GUI at boot, but you can still have "GUI" (graphics mode) for InbvDisplayString calls for later (for example, BSODs).
  • When InbvDisplayState is == INBV_DISPLAY_STATE_DISABLED, which is the case when InbvEnableBootDriver() has been previously called with its parameter set to FALSE (when NOGUIBOOT is specified), the ResetMode variable here is kept to FALSE, and according to the code of VidInitialize() : https://git.reactos.org/?p=reactos.git;a=blob;f=drivers/base/bootvid/i386/bootvid.c;hb=af0d1d2f98749ed382ab7e718b91a9f11fd8a073#l361 , only HAL functions are called to find VGA memory mapping; VGA registers are only used by VgaIsPresent(), but this helper should not change the video mode, and finally, since SetMode is FALSE , bootvid does not reset the screen.

@binarymaster
Copy link
Member Author

NOGUIBOOT only means No GUI at boot, but you can still have "GUI" (graphics mode) for InbvDisplayString calls for later (for example, BSODs)

I didn't know that, I thought it allows to fully disable bootvid for headless machines. I confirmed that Windows XP does initialize bootvid with NOGUIBOOT, so I close this.

@binarymaster binarymaster deleted the bootvid branch August 16, 2019 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants