This is a simple UEFI-bootable program which prints an image of specific size on screen using the GOP protocol which is provided by the UEFI firmware. This project was done as a hobby.
- The image must be
.bmp
image. - The image must be mirror-inverted to print it upright and correctly. A sample of the mirror-inverted image is the
image.bmp
(provided in the source). It is also the default image file that is used by the program. - The resolution of the image must be 2560x1440 as the default graphics mode has the same resolution. This could be changed if a different graphics mode is used.
- Unix environment.
- make.
- Qemu (virtual machine).
- UEFI firmware for qemu.[Provided in the OVMF folder]
- gdisk.
- edk2.
- Download the EDK II source and build tools.
$ git clone https://github.com/tianocore/edk2.git
, or - Download the latest .zip UDK2017 Download release (or Latest UDK release).
$ sudo apt-get install build-essential uuid-dev iasl git gcc-5 nasm python3-distutils
- Follow instructions at https://github.com/tianocore/tianocore.github.io/wiki/Getting-Started-with-EDK-II and https://github.com/tianocore/tianocore.github.io/wiki/Common-instructions to build the edk2 tree.
- Open the file
edk2/DuetPkg/DuetPkgX64.dsc
and add our application to the the[Components]
section and before the[BuildOptions]
section. Just add the absolute path ofmain.inf
file betweem[Components]
section and the[BuildOptions]
section. - To build the UEFI application:
$ build -a X64 -p DuetPkg/DuetPkgX64.dsc
It will take a while to build. - To create the disk image
$ make set_disk
- on the first entry, enter :n, to create a new partition.
- on the second entry, enter :1, for one partition.
- on the third entry, enter :set default sector size.
- on the fourth entry, enter :set the default last setor.
- on the fifth entry, enter :ef00, this implies an efi partition.
- on the sixth entry, enter :w, this marks the changes to be written on the disk.
- on the seventh entry, enter :Y, to perform the final write operation. The disk will be created.
- To prepare the disk
$ make prep_disk
This will create/efi/boot
and/img
directories and also copy the.efi
application and the image file to the disk. - To run the application on the qemu VM.
$ make run-qemu
.