Windows and EFI

What are the main details on how Windows interact with EFI?

I can understand that Windows boot loader is a EFI app. But what else? what occurs after the boot stage?

Can ACPI and EFI coexist? if not - then am I correct that MS has the full replacement for acpi.sys which uses EFI tables instead of ACPI ones?

Is there a custom HAL for EFI? for things like, say, EFI’s NVRAM real-time clock access?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

>I can understand that Windows boot loader is a EFI app. But what else? what occurs after the boot >stage?
I believe Windows follows all standard UEFI boot procedures. During the installation Windows creates a System Partition where it keeps all UEFI boot files. In additional to that it creates a Boot entry in <system partion>\EFI\Boot\bootx64.efi . During the boot this entry executed and bootx64.efi file loads others files from <system partition>\Microsoft\Boot. After loading Windows device drivers with Start=0 the UEFI driver shutdown all UEFI boot drivers and start Windows OS boot services. Later, Windows OS components continue to communicate with UEFI by using UEFI Runtime services. The most important Runtime services are GetVariable() and SetVariable. For example, using these UEFI services Windows could retrieve and modify Boot entries.

>Can ACPI and EFI coexist?
EFI uses ACPI information in DevicePath protocol. DevicePath protocol defines location of each instance of hardware and Windows uses such information, for example during the installation.

>Is there a custom HAL for EFI?
UDK package, which is an open source project for developing EFI stuff, contains libraries which provide access to hardware. For example, they provide full PCI access but don’t support interrupt. You need to do polling. There is not also thread support in UEFI. All UEFI drivers are single threading.
Time support is limited. I know there is Stall() function with resolution one microsecond.
Unfortunately there is not much information about UEFI in general and almost nothing about using UEFI in Windows. The main source of UEFI dvelopment is UDK source open project.

Igor Sharovar

Tianocore is another open project funded by Intel. Many commercial BIOSes
are based on this code as well.

t.

On Thu, 22 Sep 2011, xxxxx@hotmail.com wrote:

> I can understand that Windows boot loader is a EFI app. But what else? what occurs after the boot >stage?
I believe Windows follows all standard UEFI boot procedures. During the installation Windows creates a System Partition where it keeps all UEFI boot files. In additional to that it creates a Boot entry in <system partion>\EFI\Boot\bootx64.efi . During the boot this entry executed and bootx64.efi file loads others files from <system partition>\Microsoft\Boot. After loading Windows device drivers with Start=0 the UEFI driver shutdown all UEFI boot drivers and start Windows OS boot services. Later, Windows OS components continue to communicate with UEFI by using UEFI Runtime services. The most important Runtime services are GetVariable() and SetVariable. For example, using these UEFI services Windows could retrieve and modify Boot entries.
>
>> Can ACPI and EFI coexist?
> EFI uses ACPI information in DevicePath protocol. DevicePath protocol defines location of each instance of hardware and Windows uses such information, for example during the installation.
>
>> Is there a custom HAL for EFI?
> UDK package, which is an open source project for developing EFI stuff, contains libraries which provide access to hardware. For example, they provide full PCI access but don’t support interrupt. You need to do polling. There is not also thread support in UEFI. All UEFI drivers are single threading.
> Time support is limited. I know there is Stall() function with resolution one microsecond.
> Unfortunately there is not much information about UEFI in general and almost nothing about using UEFI in Windows. The main source of UEFI dvelopment is UDK source open project.
>
> Igor Sharovar
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

Windows (or for that matter any other OS) will interact with the
platform (assuming it is an EFI based platform) via the EFI system table.

ACPI and EFI do coexist . The EFI system table has a table for the ACPI
routines which can be accessed through a guid.

there are some features of EFI which persist even after platform boot -
called as the Runtime. The OS can access these runtime features if it is an
EFI aware OS. The clock is also one of them. The OS uses GetTime () /
SetTime() features to access the clock via EFI .

There are no EFI specific HAl as far as I know.

On Thu, Sep 22, 2011 at 11:54 PM, Maxim S. Shatskih
wrote:

> What are the main details on how Windows interact with EFI?
>
> I can understand that Windows boot loader is a EFI app. But what else?
> what occurs after the boot stage?
>
> Can ACPI and EFI coexist? if not - then am I correct that MS has the
> full replacement for acpi.sys which uses EFI tables instead of ACPI ones?
>
> Is there a custom HAL for EFI? for things like, say, EFI’s NVRAM
> real-time clock access?
>
> –
> Maxim S. Shatskih
> Windows DDK MVP
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>



- ab