fixed spacing

This commit is contained in:
shadlyd15 2022-05-07 23:13:30 +02:00
parent 5304b25940
commit ac81c1c17c
2 changed files with 34 additions and 34 deletions

View File

@ -19,8 +19,8 @@
## Compile and install GNU-EFI Library ## Compile and install GNU-EFI Library
Go to gnu-efi source folder Go to gnu-efi source folder
```bash ```bash
make make
make install make install
``` ```
[Here](compile_guide.md) is a guide you can follow for more details on how to compile and run gnu-efi applications. [Here](compile_guide.md) is a guide you can follow for more details on how to compile and run gnu-efi applications.
@ -28,9 +28,9 @@ Go to gnu-efi source folder
Change the following macros in makefile to locate GNU-EFI **libraries** and **headers** installed on the previous step. Change the following macros in makefile to locate GNU-EFI **libraries** and **headers** installed on the previous step.
```makefile ```makefile
INCDIR = /usr/local/include INCDIR = /usr/local/include
LIBDIR = /usr/local/lib LIBDIR = /usr/local/lib
EFILIB = /usr/local/lib EFILIB = /usr/local/lib
``` ```
# NesUEFI on qemu : # NesUEFI on qemu :
@ -38,25 +38,25 @@ Change the following macros in makefile to locate GNU-EFI **libraries** and **he
### Locate OVMF in Makefile: ### Locate OVMF in Makefile:
To run the compiled application in qemu we need OVMF for UEFI emulation. OVMF is a port of Intel's tianocore firmware to the qemu virtual machine. To run the compiled application in qemu we need OVMF for UEFI emulation. OVMF is a port of Intel's tianocore firmware to the qemu virtual machine.
```makefile ```makefile
OVMF_DIR = ../OVMF OVMF_DIR = ../OVMF
``` ```
Change **OVMF_DIR** directory in the makefile. Change **OVMF_DIR** directory in the makefile.
### Create Image ### Create Image
Add your roms here in the makefile to write it to your image. For example : test_1.nes, test_2.nes Add your roms here in the makefile to write it to your image. For example : test_1.nes, test_2.nes
```makefile ```makefile
mcopy -i $(IMAGE).img splash.bmp :: mcopy -i $(IMAGE).img splash.bmp ::
# Add your roms here # Add your roms here
mcopy -i $(IMAGE).img test_1.nes :: mcopy -i $(IMAGE).img test_1.nes ::
mcopy -i $(IMAGE).img test_2.nes :: mcopy -i $(IMAGE).img test_2.nes ::
``` ```
```bash ```bash
make img make img
``` ```
### Run ### Run
```bash ```bash
make run make run
``` ```
# NesUEFI on real hardware # NesUEFI on real hardware
**Do at your own risk. Under no circumstances shall the author be liable for any damage.** **Do at your own risk. Under no circumstances shall the author be liable for any damage.**

View File

@ -6,11 +6,11 @@
Download gnu-efi from here : [https://sourceforge.net/projects/gnu-efi/](https://sourceforge.net/projects/gnu-efi/) Download gnu-efi from here : [https://sourceforge.net/projects/gnu-efi/](https://sourceforge.net/projects/gnu-efi/)
- **gcc-3.0 or newer** - **gcc-3.0 or newer**
```bash ```bash
gcc --version gcc --version
``` ```
- A version of **objcopy** that supports EFI applications : - A version of **objcopy** that supports EFI applications :
```bash ```bash
objcopy --help objcopy --help
``` ```
Check if supported target contains elf64-x86-64 elf32-i386 elf32-x86-64 Check if supported target contains elf64-x86-64 elf32-i386 elf32-x86-64
@ -19,46 +19,46 @@ Check if supported target contains elf64-x86-64 elf32-i386 elf32-x86-64
## Compile and install GNU-EFI Library: ## Compile and install GNU-EFI Library:
Go to gnu-efi source folder Go to gnu-efi source folder
```bash ```bash
make make
make install make install
``` ```
## Compile GNU-EFI application : ## Compile GNU-EFI application :
Use this makefile to easily compile and run gnu-efi application. It will recursively compile all c files in the sub-directories. Use this makefile to easily compile and run gnu-efi application. It will recursively compile all c files in the sub-directories.
Change the following macros to locate the libraries and headers installed on the previous step. Change the following macros to locate the libraries and headers installed on the previous step.
```makefile ```makefile
IMAGE = uefi_app IMAGE = uefi_app
TARGET = main.efi TARGET = main.efi
INCDIR = /usr/local/include INCDIR = /usr/local/include
LIBDIR = /usr/local/lib LIBDIR = /usr/local/lib
EFILIB = /usr/local/lib EFILIB = /usr/local/lib
``` ```
## Run on qemu : ## Run on qemu :
### Locate OVMF in Makefile: ### Locate OVMF in Makefile:
To run the compiled application in qemu we need OVMF for UEFI emulation. OVMF is a port of Intel's tianocore firmware to the qemu virtual machine. Download it from here. To run the compiled application in qemu we need OVMF for UEFI emulation. OVMF is a port of Intel's tianocore firmware to the qemu virtual machine. Download it from here.
```makefile ```makefile
OVMF_DIR = ../OVMF OVMF_DIR = ../OVMF
``` ```
Change the OVMF directory in the makefile. Change the OVMF directory in the makefile.
### Create Image : ### Create Image :
```bash ```bash
make img make img
``` ```
It will do the following tasks : It will do the following tasks :
```bash ```bash
# Create a new image file that will contain the GNU-EFI application. # Create a new image file that will contain the GNU-EFI application.
dd if=/dev/zero of=$(IMAGE).img bs=512 count=93750 dd if=/dev/zero of=$(IMAGE).img bs=512 count=93750
# mformat to format it with FAT16. # mformat to format it with FAT16.
mformat -i $(IMAGE).img -h 32 -t 32 -n 64 -c 1 :: mformat -i $(IMAGE).img -h 32 -t 32 -n 64 -c 1 ::
# Create directory # Create directory
mmd -i $(IMAGE).img ::/EFI mmd -i $(IMAGE).img ::/EFI
mmd -i $(IMAGE).img ::/EFI/BOOT mmd -i $(IMAGE).img ::/EFI/BOOT
# Copy image # Copy image
mcopy -i $(IMAGE).img $(TARGET) ::/EFI/BOOT mcopy -i $(IMAGE).img $(TARGET) ::/EFI/BOOT
# Copy the nsh script to load efi application automatically from fs0 # Copy the nsh script to load efi application automatically from fs0
mcopy -i $(IMAGE).img startup.nsh :: mcopy -i $(IMAGE).img startup.nsh ::
``` ```
### Run : ### Run :
```bash ```bash