Re: [edk2] About PXE Discover

2014-07-05 Thread Andrew Fish

On Jul 4, 2014, at 9:50 PM, Gurinder Singh  wrote:

> Hi guys,
> 
> I need a little help with PXE Discover.
> 
> Here's the background:
> 
> We have a PXE boot server that we have written. We are trying to boot UEFI 
> machines with it. We wish to have these machines booted using bootmgfw.efi, 
> which is Microsoft's bootloader. However, we'd like to display some of our 
> own branding before bootmgfw.efi starts.
> 
> For this purpose, we're writing a thin shim loader. The idea is, this shim is 
> the first loader our PXE server serves. It runs on the client and displays 
> our branding. Then it downloads bootmgfw.efi and runs it.
> 
> The way I'm implementing this is that:
> 1. The shim, when it runs on the client, will trigger a PXE Discover.
> 2. In the Pxe REQUEST message it'll somehow add a special DHCP option.
> 3. My server will recognize this option and advertise bootmgf.efi in the PXE 
> ACK.
> 4. The client will then (I'm hoping) automatically download bootmgf.efi and 
> run it.
> 

Not sure why you would want to change the DHCP handshakes? Why not just have 
the shim do a TFTP read to get the extra info. 

Thanks,

Andrew Fish

> 
> My first question is will this work as I'm expecting it to?
> 
> Secondly, I've written the following code in the shim to achieve this:
> 
> 
> EFI_PXE_BASE_CODE_CALLBACK_STATUS 
> PxeCallback(EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *This, 
> EFI_PXE_BASE_CODE_FUNCTION Function, BOOLEAN Received, UINT32 PacketLen, 
> EFI_PXE_BASE_CODE_PACKET *Packet)
> {
> Print(L"Callback invoked. Doing %d. Received %d, Packet len %d\n", 
> Function, Received, PacketLen);
> return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE;
> }
> 
> 
> /* Shim Entry Point */
> 
> EFI_STATUS
> EFIAPI
> UefiMain(
> IN EFI_HANDLEImageHandle,
> IN EFI_SYSTEM_TABLE  *SystemTable
> )
> {
> 
> // 
> 
> gBS->OpenProtocol(ImageHandle, &gEfiPxeBaseCodeProtocolGuid, 
> &pxeProtocol, ImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
> gBS->OpenProtocol(ImageHandle, &gEfiPxeBaseCodeCallbackProtocolGuid, 
> &pxeCallbackProtocol, ImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
> pxeCallbackProtocol->Callback = PxeCallback;
> pxeProtocol->Start(pxeProtocol, FALSE);
>
> bootLayer = EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL;
> pxeProtocol->Discover(pxeProtocol, 
> EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS, &bootLayer, FALSE, NULL);
> 
> return EFI_SUCCESS;
> }
> 
> It does seem to seem to cause a full DORA sequence as well as PXE discover. 
> However, how do I set my special DHCP option in the PXE REQUEST packet before 
> starting the Discover? Will PxeCallback be of any help in that?
> 
> Thanks for your help in advance.
> 
> Cheers,
> Gurinder
> --
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft___
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel


--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


[edk2] Vfr.vfr Question with Regard to "text"

2014-07-05 Thread Tim Lewis
In DriverSampleDxe's vfr.vfr, there is the following text statement:

text
  help   = STRING_TOKEN(0x0053),
  text   = STRING_TOKEN(0x0053),
text   = STRING_TOKEN(0x0053),
  flags  = INTERACTIVE,
  key= 0x1237;

Notice that (a) this has the INTERACTIVE flag set (making it an ACTION opcode) 
but (b) it also has a 2nd "text" statement.

As far as I can tell, this should be illegal. Here is the corresponding 
statement in VfrSyntax.g:

CIfrAction AObj;

mCVfrQuestionDB.RegisterQuestion (NULL, NULL, QId);
AObj.SetLineNo 
(F->getLine());
AObj.SetQuestionId 
(QId);
AObj.SetPrompt 
(_STOSID(S2->getText()));
AObj.SetHelp 
(_STOSID(S1->getText()));

_PCATCH(AObj.SetFlags (Flags), F->getLine());
AssignQuestionKey 
(AObj, KN);
CRT_END_OP (KN);

You can see the basic question header being created but there is no reference 
to the 2nd text. Here, on the other hand, is the code for the EFI_IFR_TEXT, 
which does use the 2nd text item.

CIfrText TObj;
TObj.SetLineNo 
(T->getLine());
TObj.SetHelp 
(_STOSID(S1->getText()));
TObj.SetPrompt 
(_STOSID(S2->getText()));
TObj.SetTextTwo 
(TxtTwo);

In my opinion, the 2nd text item should generate an error with VfrCompile, 
because it will not and cannot ever be used for a "text" statement that has the 
INTERACTIVE flag set.

Tim

--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel