wishedtobe wrote:
I think it is possible to use GOP after exiting boot services by pretending your program as UEFI and execute the video expansion ROM.
You don't need to pretend anything, rather opposite, - read the spec and you'll know, how one could use GOP correctly, without pretending. If by "using" GOP, you mean being able to call the protocol's functions after ExitBootServices(), then, no, you can't do it, at least because all the protocols code and data belong to the EfiBootServicesCode and EfiBootServicesData types and after ExitBootServices(), your OS is free to use these pages as it wants, they won't be properly mapped in the new address space anyway and overall, Boot Services have shutdown themselves and aren't accessible for many reasons, hidden behind implementation details. If you mean accessing the framebuffer, reported by GOP, with the set resolution, then you can access it, given you mapped it correctly in your environment address space (virtual, process, processor, whatever you call it).
But how does UEFI execute it?By the way,I found that my video card's expansion ROM contains nothing except a great deal of 0xff.I found the ROM header 0xaa55 in the mapping area of its BAR.Then I started wondering what the BIOS did.Many thanks for your answer.
On UEFI platforms, you don't have to bother with all this - expansion ROM etc, just use GOP reported resources. Only when your fully fledged display controller driver is ready to get its hands dirty in handling its hardware, you start to worry about proper setting/configuring the hardware in question, reading its specification, given such exists.
Of course, if your goal is a normal OS, not some frankenstein, that would want to "pretend" of being a UEFI application or something else.