* A question about shell-application's argument make system blocked; @ 2019-01-10 6:12 krishnaLee 2019-01-10 15:15 ` Carsey, Jaben 0 siblings, 1 reply; 6+ messages in thread From: krishnaLee @ 2019-01-10 6:12 UTC (permalink / raw) To: edk2-devel Hi everybody, I meet a question,a special arg can make system blocked,follow is my steps. 1,go to uefi shell v2.2(uefi v2.70),run this application in QEMU-ovmf: testapp.efi 2,the output is "index:0,string:FS0:\testapp.efi" 3,testapp.efi #abc. 4,the output is same as step 2. ///< I had read the uefi shell specification 2.2,the '#' is a comment remark,so I think it is ok. 5 testapp.efi "#abc" 6,the system blocked(dead). ///< I think it is a bug. //follow is the testapp.efi source code: EFI_STATUS EFIAPI UefiMain ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS status; EFI_SHELL_PARAMETERS_PROTOCOL* param; status=SystemTable->BootServices->HandleProtocol(ImageHandle,&gEfiShellParametersProtocolGuid,¶m); if(status!=EFI_SUCCESS) { return0; } for(UINTN i=0;i< param->Argc;i++) { Print(L"index:%d,string:%s\n",i,param->Argv[i]); } return EFI_SUCCESS; } //test environment: //QEMU v2.10.95 + edk2-2018-ovmf-x64. //shell command line: //"D:\qemu\qemu-system-x86_64.exe" -machine pc-q35-2.9 -pflash "D:\qemu\bios\OVMF_x64_debug.fd" -serial stdio -hda fat:rw:G:\temp -net none //end thanks, krishna. \x16�& ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A question about shell-application's argument make system blocked; 2019-01-10 6:12 A question about shell-application's argument make system blocked; krishnaLee @ 2019-01-10 15:15 ` Carsey, Jaben 2019-01-10 23:33 ` Jim.Dailey 0 siblings, 1 reply; 6+ messages in thread From: Carsey, Jaben @ 2019-01-10 15:15 UTC (permalink / raw) To: krishnaLee, edk2-devel@lists.01.org Is this in a script file? I don't remember how "comments" work on raw command lines where the user types them. -Jaben > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > krishnaLee > Sent: Wednesday, January 09, 2019 10:13 PM > To: edk2-devel@lists.01.org > Subject: [edk2] A question about shell-application's argument make system > blocked; > Importance: High > > Hi everybody, > I meet a question,a special arg can make system blocked,follow is my steps. > 1,go to uefi shell v2.2(uefi v2.70),run this application in QEMU-ovmf: > testapp.efi > 2,the output is "index:0,string:FS0:\testapp.efi" > > > 3,testapp.efi #abc. > 4,the output is same as step 2. ///< I had read the uefi shell specification > 2.2,the '#' is a comment remark,so I think it is ok. > > > 5 testapp.efi "#abc" > 6,the system blocked(dead). ///< I think it is a bug. > > > //follow is the testapp.efi source code: > EFI_STATUS > EFIAPI > UefiMain ( > IN EFI_HANDLE ImageHandle, > IN EFI_SYSTEM_TABLE *SystemTable > ) > { > EFI_STATUS status; > EFI_SHELL_PARAMETERS_PROTOCOL* param; > status=SystemTable->BootServices- > >HandleProtocol(ImageHandle,&gEfiShellParametersProtocolGuid,¶m); > if(status!=EFI_SUCCESS) > { > return0; > } > > > for(UINTN i=0;i< param->Argc;i++) > { > Print(L"index:%d,string:%s\n",i,param->Argv[i]); > } > > > return EFI_SUCCESS; > } > > > //test environment: > //QEMU v2.10.95 + edk2-2018-ovmf-x64. > //shell command line: > //"D:\qemu\qemu-system-x86_64.exe" -machine pc-q35-2.9 -pflash > "D:\qemu\bios\OVMF_x64_debug.fd" -serial stdio -hda fat:rw:G:\temp -net > none > //end > > > > > > > thanks, > krishna. > > > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A question about shell-application's argument make system blocked; 2019-01-10 15:15 ` Carsey, Jaben @ 2019-01-10 23:33 ` Jim.Dailey 2019-01-11 0:02 ` Carsey, Jaben 0 siblings, 1 reply; 6+ messages in thread From: Jim.Dailey @ 2019-01-10 23:33 UTC (permalink / raw) To: jaben.carsey; +Cc: sssky307, edk2-devel Jaben, The shell does not parse properly (my opinion) in some instances. That is one of the reasons I wrote a separate parser for the shell I maintain here at Dell. One of the areas I feel the parsing is wrong is when an unescaped "#" is inside a quoted string: FS0:\> echo "This should # work." Command Error Status: Invalid Parameter FS0:\> echo "This should ^# work." This should # work. FS0:\> The first command is parsed as if this were the command line: FS0:\> echo "This should Command Error Status: Invalid Parameter FS0:\> I think many people would expect certain characters inside a quoted string, like "#" for example, to NOT need escaping. The only ones that should need escaping (again IMHO) are: ", ^, and %. Regards, Jim -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Carsey, Jaben Sent: Thursday, January 10, 2019 9:16 AM To: krishnaLee; edk2-devel@lists.01.org Subject: Re: [edk2] A question about shell-application's argument make system blocked; Is this in a script file? I don't remember how "comments" work on raw command lines where the user types them. -Jaben > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > krishnaLee > Sent: Wednesday, January 09, 2019 10:13 PM > To: edk2-devel@lists.01.org > Subject: [edk2] A question about shell-application's argument make system > blocked; > Importance: High > > Hi everybody, > I meet a question,a special arg can make system blocked,follow is my steps. > 1,go to uefi shell v2.2(uefi v2.70),run this application in QEMU-ovmf: > testapp.efi > 2,the output is "index:0,string:FS0:\testapp.efi" > > > 3,testapp.efi #abc. > 4,the output is same as step 2. ///< I had read the uefi shell specification > 2.2,the '#' is a comment remark,so I think it is ok. > > > 5 testapp.efi "#abc" > 6,the system blocked(dead). ///< I think it is a bug. > > > //follow is the testapp.efi source code: > EFI_STATUS > EFIAPI > UefiMain ( > IN EFI_HANDLE ImageHandle, > IN EFI_SYSTEM_TABLE *SystemTable > ) > { > EFI_STATUS status; > EFI_SHELL_PARAMETERS_PROTOCOL* param; > status=SystemTable->BootServices- > >HandleProtocol(ImageHandle,&gEfiShellParametersProtocolGuid,¶m); > if(status!=EFI_SUCCESS) > { > return0; > } > > > for(UINTN i=0;i< param->Argc;i++) > { > Print(L"index:%d,string:%s\n",i,param->Argv[i]); > } > > > return EFI_SUCCESS; > } > > > //test environment: > //QEMU v2.10.95 + edk2-2018-ovmf-x64. > //shell command line: > //"D:\qemu\qemu-system-x86_64.exe" -machine pc-q35-2.9 -pflash > "D:\qemu\bios\OVMF_x64_debug.fd" -serial stdio -hda fat:rw:G:\temp -net > none > //end > > > > > > > thanks, > krishna. > > > > _______________________________________________ > 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A question about shell-application's argument make system blocked; 2019-01-10 23:33 ` Jim.Dailey @ 2019-01-11 0:02 ` Carsey, Jaben 2019-01-11 2:59 ` krishnaLee 2019-01-11 12:27 ` Jim.Dailey 0 siblings, 2 replies; 6+ messages in thread From: Carsey, Jaben @ 2019-01-11 0:02 UTC (permalink / raw) To: Jim.Dailey@dell.com; +Cc: sssky307@163.com, edk2-devel@lists.01.org Agreed. That seems like a bug that needs a Bugzilla filed. My question is if the comment character is valid on a command line typed in versus in a script file. > -----Original Message----- > From: Jim.Dailey@dell.com [mailto:Jim.Dailey@dell.com] > Sent: Thursday, January 10, 2019 3:34 PM > To: Carsey, Jaben <jaben.carsey@intel.com> > Cc: sssky307@163.com; edk2-devel@lists.01.org > Subject: RE: [edk2] A question about shell-application's argument make > system blocked; > Importance: High > > Jaben, > > The shell does not parse properly (my opinion) in some instances. > That is one of the reasons I wrote a separate parser for the shell I > maintain here at Dell. > > One of the areas I feel the parsing is wrong is when an unescaped "#" > is inside a quoted string: > > FS0:\> echo "This should # work." > Command Error Status: Invalid Parameter > FS0:\> echo "This should ^# work." > This should # work. > FS0:\> > > The first command is parsed as if this were the command line: > > FS0:\> echo "This should > Command Error Status: Invalid Parameter > FS0:\> > > I think many people would expect certain characters inside a quoted > string, like "#" for example, to NOT need escaping. The only ones > that should need escaping (again IMHO) are: ", ^, and %. > > Regards, > Jim > > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Carsey, Jaben > Sent: Thursday, January 10, 2019 9:16 AM > To: krishnaLee; edk2-devel@lists.01.org > Subject: Re: [edk2] A question about shell-application's argument make > system blocked; > > > Is this in a script file? I don't remember how "comments" work on raw > command lines where the user types them. > > -Jaben > > > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > > krishnaLee > > Sent: Wednesday, January 09, 2019 10:13 PM > > To: edk2-devel@lists.01.org > > Subject: [edk2] A question about shell-application's argument make system > > blocked; > > Importance: High > > > > Hi everybody, > > I meet a question,a special arg can make system blocked,follow is my steps. > > 1,go to uefi shell v2.2(uefi v2.70),run this application in QEMU-ovmf: > > testapp.efi > > 2,the output is "index:0,string:FS0:\testapp.efi" > > > > > > 3,testapp.efi #abc. > > 4,the output is same as step 2. ///< I had read the uefi shell specification > > 2.2,the '#' is a comment remark,so I think it is ok. > > > > > > 5 testapp.efi "#abc" > > 6,the system blocked(dead). ///< I think it is a bug. > > > > > > //follow is the testapp.efi source code: > > EFI_STATUS > > EFIAPI > > UefiMain ( > > IN EFI_HANDLE ImageHandle, > > IN EFI_SYSTEM_TABLE *SystemTable > > ) > > { > > EFI_STATUS status; > > EFI_SHELL_PARAMETERS_PROTOCOL* param; > > status=SystemTable->BootServices- > > > >HandleProtocol(ImageHandle,&gEfiShellParametersProtocolGuid,¶m); > > if(status!=EFI_SUCCESS) > > { > > return0; > > } > > > > > > for(UINTN i=0;i< param->Argc;i++) > > { > > Print(L"index:%d,string:%s\n",i,param->Argv[i]); > > } > > > > > > return EFI_SUCCESS; > > } > > > > > > //test environment: > > //QEMU v2.10.95 + edk2-2018-ovmf-x64. > > //shell command line: > > //"D:\qemu\qemu-system-x86_64.exe" -machine pc-q35-2.9 -pflash > > "D:\qemu\bios\OVMF_x64_debug.fd" -serial stdio -hda fat:rw:G:\temp - > net > > none > > //end > > > > > > > > > > > > > > thanks, > > krishna. > > > > > > > > _______________________________________________ > > 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A question about shell-application's argument make system blocked; 2019-01-11 0:02 ` Carsey, Jaben @ 2019-01-11 2:59 ` krishnaLee 2019-01-11 12:27 ` Jim.Dailey 1 sibling, 0 replies; 6+ messages in thread From: krishnaLee @ 2019-01-11 2:59 UTC (permalink / raw) To: edk2-devel@lists.01.org Jaben, >My question is if the comment character is valid on a command line typed in versus in a script file. Maybe when parsing a script file,it should record a in-script-file-status, and this command [ testapp.efi #abc ] in command line(not in a script file) maybe looked as two argument (not one argument in current implementation). thanks, krishna. At 2019-01-11 08:02:35, "Carsey, Jaben" <jaben.carsey@intel.com> wrote: >Agreed. That seems like a bug that needs a Bugzilla filed. > >My question is if the comment character is valid on a command line typed in versus in a script file. > >> -----Original Message----- >> From: Jim.Dailey@dell.com [mailto:Jim.Dailey@dell.com] >> Sent: Thursday, January 10, 2019 3:34 PM >> To: Carsey, Jaben <jaben.carsey@intel.com> >> Cc: sssky307@163.com; edk2-devel@lists.01.org >> Subject: RE: [edk2] A question about shell-application's argument make >> system blocked; >> Importance: High >> >> Jaben, >> >> The shell does not parse properly (my opinion) in some instances. >> That is one of the reasons I wrote a separate parser for the shell I >> maintain here at Dell. >> >> One of the areas I feel the parsing is wrong is when an unescaped "#" >> is inside a quoted string: >> >> FS0:\> echo "This should # work." >> Command Error Status: Invalid Parameter >> FS0:\> echo "This should ^# work." >> This should # work. >> FS0:\> >> >> The first command is parsed as if this were the command line: >> >> FS0:\> echo "This should >> Command Error Status: Invalid Parameter >> FS0:\> >> >> I think many people would expect certain characters inside a quoted >> string, like "#" for example, to NOT need escaping. The only ones >> that should need escaping (again IMHO) are: ", ^, and %. >> >> Regards, >> Jim >> >> -----Original Message----- >> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >> Carsey, Jaben >> Sent: Thursday, January 10, 2019 9:16 AM >> To: krishnaLee; edk2-devel@lists.01.org >> Subject: Re: [edk2] A question about shell-application's argument make >> system blocked; >> >> >> Is this in a script file? I don't remember how "comments" work on raw >> command lines where the user types them. >> >> -Jaben >> >> >> > -----Original Message----- >> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >> > krishnaLee >> > Sent: Wednesday, January 09, 2019 10:13 PM >> > To: edk2-devel@lists.01.org >> > Subject: [edk2] A question about shell-application's argument make system >> > blocked; >> > Importance: High >> > >> > Hi everybody, >> > I meet a question,a special arg can make system blocked,follow is my steps. >> > 1,go to uefi shell v2.2(uefi v2.70),run this application in QEMU-ovmf: >> > testapp.efi >> > 2,the output is "index:0,string:FS0:\testapp.efi" >> > >> > >> > 3,testapp.efi #abc. >> > 4,the output is same as step 2. ///< I had read the uefi shell specification >> > 2.2,the '#' is a comment remark,so I think it is ok. >> > >> > >> > 5 testapp.efi "#abc" >> > 6,the system blocked(dead). ///< I think it is a bug. >> > >> > >> > //follow is the testapp.efi source code: >> > EFI_STATUS >> > EFIAPI >> > UefiMain ( >> > IN EFI_HANDLE ImageHandle, >> > IN EFI_SYSTEM_TABLE *SystemTable >> > ) >> > { >> > EFI_STATUS status; >> > EFI_SHELL_PARAMETERS_PROTOCOL* param; >> > status=SystemTable->BootServices- >> > >> >HandleProtocol(ImageHandle,&gEfiShellParametersProtocolGuid,¶m); >> > if(status!=EFI_SUCCESS) >> > { >> > return0; >> > } >> > >> > >> > for(UINTN i=0;i< param->Argc;i++) >> > { >> > Print(L"index:%d,string:%s\n",i,param->Argv[i]); >> > } >> > >> > >> > return EFI_SUCCESS; >> > } >> > >> > >> > //test environment: >> > //QEMU v2.10.95 + edk2-2018-ovmf-x64. >> > //shell command line: >> > //"D:\qemu\qemu-system-x86_64.exe" -machine pc-q35-2.9 -pflash >> > "D:\qemu\bios\OVMF_x64_debug.fd" -serial stdio -hda fat:rw:G:\temp - >> net >> > none >> > //end >> > >> > >> > >> > >> > >> > >> > thanks, >> > krishna. >> > >> > >> > >> > _______________________________________________ >> > 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A question about shell-application's argument make system blocked; 2019-01-11 0:02 ` Carsey, Jaben 2019-01-11 2:59 ` krishnaLee @ 2019-01-11 12:27 ` Jim.Dailey 1 sibling, 0 replies; 6+ messages in thread From: Jim.Dailey @ 2019-01-11 12:27 UTC (permalink / raw) To: jaben.carsey; +Cc: sssky307, edk2-devel My recollection is that the code that parses a command line is basically the same whether the line is in a script or not. Certainly there are places where that code checks to see if a script is active, but I don't think it does so when it looks to eliminate comments. -----Original Message----- From: Carsey, Jaben [mailto:jaben.carsey@intel.com] Sent: Thursday, January 10, 2019 6:03 PM To: Dailey, Jim Cc: sssky307@163.com; edk2-devel@lists.01.org Subject: RE: [edk2] A question about shell-application's argument make system blocked; Agreed. That seems like a bug that needs a Bugzilla filed. My question is if the comment character is valid on a command line typed in versus in a script file. > -----Original Message----- > From: Jim.Dailey@dell.com [mailto:Jim.Dailey@dell.com] > Sent: Thursday, January 10, 2019 3:34 PM > To: Carsey, Jaben <jaben.carsey@intel.com> > Cc: sssky307@163.com; edk2-devel@lists.01.org > Subject: RE: [edk2] A question about shell-application's argument make > system blocked; > Importance: High > > Jaben, > > The shell does not parse properly (my opinion) in some instances. > That is one of the reasons I wrote a separate parser for the shell I > maintain here at Dell. > > One of the areas I feel the parsing is wrong is when an unescaped "#" > is inside a quoted string: > > FS0:\> echo "This should # work." > Command Error Status: Invalid Parameter > FS0:\> echo "This should ^# work." > This should # work. > FS0:\> > > The first command is parsed as if this were the command line: > > FS0:\> echo "This should > Command Error Status: Invalid Parameter > FS0:\> > > I think many people would expect certain characters inside a quoted > string, like "#" for example, to NOT need escaping. The only ones > that should need escaping (again IMHO) are: ", ^, and %. > > Regards, > Jim > > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Carsey, Jaben > Sent: Thursday, January 10, 2019 9:16 AM > To: krishnaLee; edk2-devel@lists.01.org > Subject: Re: [edk2] A question about shell-application's argument make > system blocked; > > > Is this in a script file? I don't remember how "comments" work on raw > command lines where the user types them. > > -Jaben > > > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > > krishnaLee > > Sent: Wednesday, January 09, 2019 10:13 PM > > To: edk2-devel@lists.01.org > > Subject: [edk2] A question about shell-application's argument make system > > blocked; > > Importance: High > > > > Hi everybody, > > I meet a question,a special arg can make system blocked,follow is my steps. > > 1,go to uefi shell v2.2(uefi v2.70),run this application in QEMU-ovmf: > > testapp.efi > > 2,the output is "index:0,string:FS0:\testapp.efi" > > > > > > 3,testapp.efi #abc. > > 4,the output is same as step 2. ///< I had read the uefi shell specification > > 2.2,the '#' is a comment remark,so I think it is ok. > > > > > > 5 testapp.efi "#abc" > > 6,the system blocked(dead). ///< I think it is a bug. > > > > > > //follow is the testapp.efi source code: > > EFI_STATUS > > EFIAPI > > UefiMain ( > > IN EFI_HANDLE ImageHandle, > > IN EFI_SYSTEM_TABLE *SystemTable > > ) > > { > > EFI_STATUS status; > > EFI_SHELL_PARAMETERS_PROTOCOL* param; > > status=SystemTable->BootServices- > > > >HandleProtocol(ImageHandle,&gEfiShellParametersProtocolGuid,¶m); > > if(status!=EFI_SUCCESS) > > { > > return0; > > } > > > > > > for(UINTN i=0;i< param->Argc;i++) > > { > > Print(L"index:%d,string:%s\n",i,param->Argv[i]); > > } > > > > > > return EFI_SUCCESS; > > } > > > > > > //test environment: > > //QEMU v2.10.95 + edk2-2018-ovmf-x64. > > //shell command line: > > //"D:\qemu\qemu-system-x86_64.exe" -machine pc-q35-2.9 -pflash > > "D:\qemu\bios\OVMF_x64_debug.fd" -serial stdio -hda fat:rw:G:\temp - > net > > none > > //end > > > > > > > > > > > > > > thanks, > > krishna. > > > > > > > > _______________________________________________ > > 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-01-11 12:27 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-01-10 6:12 A question about shell-application's argument make system blocked; krishnaLee 2019-01-10 15:15 ` Carsey, Jaben 2019-01-10 23:33 ` Jim.Dailey 2019-01-11 0:02 ` Carsey, Jaben 2019-01-11 2:59 ` krishnaLee 2019-01-11 12:27 ` Jim.Dailey
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox