Answer the question
In order to leave comments, you need to log in
How to work with functions correctly?
Good afternoon,
Faced with the difficulties of recreating "according to" a lesson from DarkTiger .
At the moment:
Let's insert the output of our string into the EntryPoint() function of our driver. In the variable declaration area, we add our variable of type CHAR16 (using double-byte character encoding UCS-2) in the MyFirstDriverDriverEntryPoint() function in MyFirstDriver.c:
CHAR16 *MyString = L"I have written my first UEFI driver\r\n";
After, at the very end of the MyFirstDriverDriverEntryPoint() function, paste the output code of our text variable to the output console (default screen, in our case):
gST->ConOut->OutputString(gST->ConOut, MyString);
EFI_STATUS
EFIAPI
MyFirstDriverDriverEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
CHAR16 *MyString = L"I have written my first UEFI driver\r\n";
)
{
EFI_STATUS Status;
Status = EFI_SUCCESS;
//
// Install UEFI Driver Model protocol(s).
//
Status = EfiLibInstallDriverBindingComponentName2 (
ImageHandle,
SystemTable,
&gMyFirstDriverDriverBinding,
ImageHandle,
&gMyFirstDriverComponentName,
&gMyFirstDriverComponentName2
);
ASSERT_EFI_ERROR (Status);
return Status;
}
gST->ConOut->OutputString(gST->ConOut, MyString);
Insert the output of our string into a functionDoes that mean put the given code inside the brackets () ?
After, at the very end of the MyFirstDriverDriverEntryPoint() functionDoes that mean before the next function starts? Or at the end of the parenthesis?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question