> On Sep 21, 2018, at 11:15 AM, poxyran <poxyran...@gmail.com> wrote:
> 
> Hello again,
> 
> my question is: is it possible to create a SMM driver that
> installs/register a SMI handler (in order to call it from a usermode app
> in the OS) and test it in the UEFI Shell

poxyran,

Does "test it in the UEFI Shell" mean load the SMM driver from the UEFI Shell? 
The answer to that is no. 

It should be possible to communicate with SMM code from the UEFI Shell. The 
difference in testing from the OS is gEfiEventExitBootServicesGuid has fired an 
a lot of the UEFI Boot Services have been freed when running from an OS. It is 
also much easier to test the ACPI flows like S3 (suspend to RAM) from an OS.

On edk2 systems that support UEFI Secure Boot the UEFI Variable Services make 
SMM calls, since the variable write code lives in SMM. So when you write a 
variable at the UEFI Shell there is an SMM call going on. See: 
https://github.com/tianocore/edk2/blob/UDK2018/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf

Thanks,

Andrew Fish

> or do I need to setup up a
> dedicated machine with the SMM stack as described in official EDK II
> documentation [1]?
> 
> [1]
> 
> https://github.com/tianocore/tianocore.github.io/wiki/Testing-SMM-with-QEMU,-KVM-and-libvirt
> 
> On 9/20/2018 6:09 PM, Andrew Fish wrote:
>> 
>>> On Sep 20, 2018, at 7:30 AM, poxyran <poxyran...@gmail.com> wrote:
>>> 
>>> Hello,
>>> 
>>> I have a specific question regarding SMM drivers. I'm trying to create a
>>> mixed driver as mentioned here
>>> http://blog.cr4.sh/2015/07/building-reliable-smm-backdoor-for-uefi.html
>>> and my first try is to create a kind of 'Hello World'. My try is to
>>> install a SMI handler and call it from a user-mode app once the OS
>>> booted up. The testing aproach mentioned in the blog post is not
>>> practical, from my pooint of view. My question is, is it possible to
>>> test this kind of drivers from the UEFI shell? or do I need to setup a
>>> dedicated machine as mentioned here
>> poxyran,
>> 
>> I'm not sure what you are asking?  Indirectly referencing a 10,000 word 
>> article is not very helpful. Feel free to ask a specific question. 
>> 
>> Thanks,
>> 
>> Andrew Fish
>> 
>>> https://github.com/tianocore/tianocore.github.io/wiki/Testing-SMM-with-QEMU,-KVM-and-libvirt?
>>> 
>>> BR,
>>> poxyran
>>> 
>>> _______________________________________________
>>> edk2-devel mailing list
>>> edk2-devel@lists.01.org
>>> https://lists.01.org/mailman/listinfo/edk2-devel
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to