diff options
author | Regia König | 2022-08-16 12:56:08 +0200 |
---|---|---|
committer | Regia König | 2022-08-16 12:56:08 +0200 |
commit | df931e3b4bc07ac752ab92075dfffc32bde5f50e (patch) | |
tree | a00dcfded303d3eeb23dc2437d89c74ec1c59e4a /GNU_efi_HelloWorld | |
parent | New documentation file to how to create a HelloWorl.efi with GNU-efi (diff) | |
download | memtest86-df931e3b4bc07ac752ab92075dfffc32bde5f50e.tar.gz memtest86-df931e3b4bc07ac752ab92075dfffc32bde5f50e.tar.xz memtest86-df931e3b4bc07ac752ab92075dfffc32bde5f50e.zip |
Minimal working example with GNU-efi
Diffstat (limited to 'GNU_efi_HelloWorld')
-rw-r--r-- | GNU_efi_HelloWorld/.gitignore | 1 | ||||
-rw-r--r-- | GNU_efi_HelloWorld/Makefile | 9 | ||||
-rw-r--r-- | GNU_efi_HelloWorld/hello.c | 1 | ||||
-rwxr-xr-x | GNU_efi_HelloWorld/hello.efi | bin | 0 -> 45555 bytes | |||
-rw-r--r-- | GNU_efi_HelloWorld/hello.o | bin | 1696 -> 1664 bytes | |||
-rwxr-xr-x | GNU_efi_HelloWorld/hello.so | bin | 0 -> 2170968 bytes |
6 files changed, 6 insertions, 5 deletions
diff --git a/GNU_efi_HelloWorld/.gitignore b/GNU_efi_HelloWorld/.gitignore new file mode 100644 index 0000000..ca4663b --- /dev/null +++ b/GNU_efi_HelloWorld/.gitignore @@ -0,0 +1 @@ +gnu-efi diff --git a/GNU_efi_HelloWorld/Makefile b/GNU_efi_HelloWorld/Makefile index 4f00d4a..31195ee 100644 --- a/GNU_efi_HelloWorld/Makefile +++ b/GNU_efi_HelloWorld/Makefile @@ -1,12 +1,11 @@ ARCH = $(shell uname -m | sed s,i[3456789]86,ia32,) -OBJS = main.o +OBJS = hello.o TARGET = hello.efi EFIINC = /usr/include/efi -EFFINCS = -I$(EFFINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -LIB = /usr/lib64 -EFILIB = /usr/lib64/gnuefi +EFFINCS = -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol +EFILIB = /usr/lib EFI_CRT_OBJS = $(EFILIB)/crt0-efi-$(ARCH).o EFI_LDS = $(EFILIB)/elf_$(ARCH)_efi.lds @@ -18,7 +17,7 @@ ifeq ($(ARCH),x86_64) endif LDFLAGS = -nostdlib -znocombreloc -T $(EFI_LDS) -shared \ - -Bsymbolic -L $(EFILIB) -L $(LIB) $(EFI_CRT_OBJS) + -Bsymbolic -L $(EFILIB) $(EFI_CRT_OBJS) all: $(TARGET) diff --git a/GNU_efi_HelloWorld/hello.c b/GNU_efi_HelloWorld/hello.c index 26cbd42..52c05b3 100644 --- a/GNU_efi_HelloWorld/hello.c +++ b/GNU_efi_HelloWorld/hello.c @@ -4,6 +4,7 @@ EFI_STATUS EFIAPI efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { + InitializeLib(ImageHandle, SystemTable); Print(L"Hello, world!\n"); diff --git a/GNU_efi_HelloWorld/hello.efi b/GNU_efi_HelloWorld/hello.efi Binary files differnew file mode 100755 index 0000000..27145e5 --- /dev/null +++ b/GNU_efi_HelloWorld/hello.efi diff --git a/GNU_efi_HelloWorld/hello.o b/GNU_efi_HelloWorld/hello.o Binary files differindex 6e14a71..22a8362 100644 --- a/GNU_efi_HelloWorld/hello.o +++ b/GNU_efi_HelloWorld/hello.o diff --git a/GNU_efi_HelloWorld/hello.so b/GNU_efi_HelloWorld/hello.so Binary files differnew file mode 100755 index 0000000..bc418e3 --- /dev/null +++ b/GNU_efi_HelloWorld/hello.so |