That's easy to work around - if the BIOS and/or UEFI doesn't support the corresponding "get EDID" service you either assume the monitor is too old (and that only safe video modes like VGA 640*480 are safe) or allow the user to provide the EDID as a file.rdos wrote:That implies the OS can get the preferred resolution of the monitor, which might not be supported (my case), or might not be supported for the particular monitor.Brendan wrote:I'm not sure why you think anything I've said has anything to do with any windowing API. Typically the monitor says what its preferred resolution is (to avoid scaling) and the video mode should be set that exact same resolution. No other software (applications, GUI, whatever) should have any reason to care what that video mode might be - software just tells the video driver to draw lines, rectangles, textures, etc using a (virtual) coordinate system (and hopes that one day it will all be hardware accelerated).
In my experience the BIOS and/or UEFI "get EDID" service does work in almost all cases; excluding a few cases where a dodgy equipment (e.g. KVM) is between the computer and monitor, and most emulators (where there isn't an actual monitor).
Text mode should've been banned 20 years ago (doesn't support Unicode/internationalisation, italics, bold, different font styles and sizes, anti-aliasing, etc). The right way is to for the application to tell the video driver what to draw. For example, application could tell the video driver to draw the string "Hello world" at virtual coords (x, y) using a mono-space font, and for the video driver can ask the font engine to convert it into an alpha mask for the video driver to display (and maybe cache for next time). No video mode switches are needed (and if anyone writes a native driver the font data could be cached in the video card's RAM and drawn with fast "vram to vram bit blit" without requiring changes to the application).rdos wrote:The OS can decide to always set the same resolution when it knows about the preferred resolution. The resolution and bit-organisation that the application asks for is only a guide.
But even disregarding that, text mode still requires switching between video modes when there are applications running in both text mode and graphics mode.
From PicoGUI's web site:rdos wrote:Part of it, but not all. The graphics API was not built for games or visual design. It was built for simple embedded uses, and is modeled around PicoGUI.Brendan wrote:Only for less popular OS's that are *designed* to be less popular forever. I'd be willing to bet that if someone wanted to write a native video driver for your OS (complete with all the acceleration, MPEG decoder, multi-monitor, GPGPU, etc) and asked for documentation for any/all APIs they need, you'd have no choice but to tell them those APIs don't exist and that it's a waste of time because your OS and applications can't support any of it anyway.
With PicoGUI (or something like it) built into the video driver the application wouldn't need to know or care which video mode the video driver felt like using. Application just sends "high-level commands" (and I'd expect that a native video driver could use hardware acceleration to do the rendering of those high level commands).PicoGUI wrote:
- PicoGUI's theme engine isn't there just to look pretty, it's there to enforce a separation of content and presentation. This way the application only specifies high-level commands, and it's completely up to the theme to specify which pixel goes where. This allows the same application binary to run on a true color display, 160x16 grayscale LCD, or an ASCII device
If the video driver isn't responsible for drawing (e.g. rendering graphics based on high-level commands) then the abstraction provided by the video driver is not adequate - the rendering can't use hardware acceleration and the application has to care about things like which video mode is being used.
If the abstraction provided by the video driver is adequate (hardware acceleration is possible and applications don't care about things like which video mode is being used); then there is no need to switch video modes after boot (and no need for virtual 8086 mode and/or emulation and/or code that you can't guarantee won't break on different systems and/or code that will break in future UEFI systems).
Cheers,
Brendan