OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 27, 2024 2:04 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Not calling ExitBootServices?
PostPosted: Tue Jan 02, 2024 9:32 am 
Offline

Joined: Thu Jul 07, 2022 3:30 pm
Posts: 3
Question: on BIOS systems there is no ExitBootServices involved, instead the OS just moves the CPU to protected mode and forgets that BIOS existed. What bad things can happen if I do the same to UEFI?

That is: not call ExitBootServices, instead just load my own GDT/IDT/page tables, reconfigure PIC/APIC/whatever and boot the OS. And maybe even keep calling the boot services in some emulated environment (this is just a random spin-off thought, please don't interpret it the way that I'm lazy to write drivers).

Watchdog might be one concern, are there others?


Top
 Profile  
 
 Post subject: Re: Not calling ExitBootServices?
PostPosted: Tue Jan 02, 2024 10:27 am 
Offline
Member
Member

Joined: Sat Feb 04, 2012 5:03 pm
Posts: 111
I think the question can be taken seriously. Is a UEFI BIOS likely to interfere if ExitBootServices is not called?

No one can give you a guarantee. You'd have to test it on real systems. But here are some things to watch out for:
  1. System Management Mode interrupts and ACPI System Control Interrupts (link) would transfer control to the UEFI BIOS and could lead to unexpected behavior.
  2. For servers, the BMC (link) would likely also behave in unexpected ways

It bears repeating: calling ExitBootServices does not mean the OS forgets all about the UEFI BIOS. The Boot Services are no longer available after that point, but the OS still accesses the UEFI BIOS when needed. Also, the things I mentioned above demonstrate how effectively the UEFI BIOS can assert itself when it wants something.


Top
 Profile  
 
 Post subject: Re: Not calling ExitBootServices?
PostPosted: Tue Jan 02, 2024 2:08 pm 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3195
SMIs are active even after ExitBootServices, and UEFI can reboot or take over your machine if it feels you haven't done what it wants you to do, like initialize ACPI as if you were a late Windows version. Happened to me on a laptop.


Top
 Profile  
 
 Post subject: Re: Not calling ExitBootServices?
PostPosted: Wed Jan 03, 2024 8:02 pm 
Offline

Joined: Thu Jul 07, 2022 3:30 pm
Posts: 3
> ACPI

Good point. Leaving the PC without working power management is probably not a good idea.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group