The shell does this be using SimpleTextInEx and registering for a CTRL-C 
keystroke.  Then the interrupt from that will set another event that some 
applications and all long commands are watching for in a polling loop such that 
things can be halted.

For example, the ls command checks if this second event is triggered between 
printing each file/directory entry ...  If the event was triggered, the command 
or application can abort itself.

-Jaben

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Andrew Fish
> Sent: Friday, September 11, 2015 8:38 AM
> To: Mang Chia Ho <laytom...@gmail.com>
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Application abort event for EFI_ABORTED
> 
> 
> > On Sep 11, 2015, at 4:49 AM, Mang Chia Ho <laytom...@gmail.com> wrote:
> >
> > Dear Sir,
> >
> > Here are some questions about terminating process command.
> > As we know, the Nt32Pkg with simulation support terminate the
> progressing
> > procees when pressing the ESC key.
> >
> 
> There is no process termination happening. There are no processes in EFI,
> there is only the currently running driver/application and events.
> 
> Thus the shell and application are the same “process” and some amount of
> cooperation is required to terminate a running application.
> 
> I don’t know how the shell does this off the top of my head, but you could
> grep for SCAN_ESC.
> 
> Thanks,
> 
> Andrew Fish
> 
> > Example:
> > A loop script or a application is proceeding...
> > Then user press ESC key, and it will be aborted as an EFI_ABORTED status.
> >
> > For this feature, does someone can give the tips for implementing this
> > feature in the custom shell source.
> > I have try keyboard hook, but it still can't implement the same feature as
> > the Nt32Pkg with simulation.
> > keyboard hook just been execute after the process finished.
> > But i want to terminate the process when i pressed the ESC key at the
> same
> > time.
> >
> > Thanks
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__lists.01.org_mailman_listinfo_edk2-
> 2Ddevel&d=BQICAg&c=eEvniauFctOgLOKGJOplqw&r=1HnUuXD1wDvw67rut
> 5_idw&m=V4KqqvBb7D9S0T7MeM9Wxh0dAvHIpXfJV3VGgUoSaxg&s=xe3zh
> ZtMRVH1ArzkthUBURab6WPtG7iTS_vrjd9yhb8&e=
> 
> _______________________________________________
> 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