PeterX wrote:
A Linux website claims that VESA mode setting is only possible in real mode. Is that true?
Yes. (Or as others have pointed out, you can also use a real mode emulator)
PeterX wrote:
And is it true for (U)EFI graphics, too?
Now this question makes no sense, because there's no VGA nor VESA under (U)EFI.
Read this. What Octorontrabass wrote works only on UEFI machines that also has CSM mode (but I'm not sure it works on all firmware where CSM exists, but disabled).
Otherwise you'll have to use UGA on EFI (ReactOS'
source, and some Nvidia
ROMs) or with UEFI the GOP protocol. This latter superseded both UGA and VESA, and soon will be the only one to be supported by video card manufacturers.
It looks like we don't have much on GOP in our wiki, but
this Assembly code shows how to query the modes, iterate on them and set one of them (pretty much the same functionality with VESA/VBE). For a C example, I can recommend my boot loader's relevant
GetLFB(). This code basically iterates on available modes, looking for the resolution
reqwidth x
reqheight x
32bit RGBA. It also does some other things that would seem insane at first, but required to workaround buggy firmware (e.g. setting the current, active resolution to get the current mode value). If compiled with GOP_DEBUG, it will also list available modes.
Cheers,
bzt