mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
efi: Add support for a hello world test program
It is useful to have a basic sanity check for EFI loader support. Add a 'bootefi hello' command which loads HelloWord.efi and runs it under U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org> [agraf: Fix documentation, add unfulfilled kconfig dep] Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
bb1ae55948
commit
c7ae3dfdcc
7 changed files with 107 additions and 6 deletions
24
lib/efi_loader/helloworld.c
Normal file
24
lib/efi_loader/helloworld.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* EFI hello world
|
||||
*
|
||||
* Copyright (c) 2016 Google, Inc
|
||||
* Written by Simon Glass <sjg@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <part_efi.h>
|
||||
#include <efi_api.h>
|
||||
|
||||
efi_status_t EFIAPI efi_main(efi_handle_t handle,
|
||||
struct efi_system_table *systable)
|
||||
{
|
||||
struct efi_simple_text_output_protocol *con_out = systable->con_out;
|
||||
struct efi_boot_services *boottime = systable->boottime;
|
||||
|
||||
con_out->output_string(con_out, L"Hello, world!\n");
|
||||
boottime->exit(handle, 0, 0, NULL);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue