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
Go to gnu-efi source folder
```bash
make
make install
make
make install
```
[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.
```makefile
INCDIR = /usr/local/include
LIBDIR = /usr/local/lib
EFILIB = /usr/local/lib
INCDIR = /usr/local/include
LIBDIR = /usr/local/lib
EFILIB = /usr/local/lib
```
# NesUEFI on qemu :
@ -38,25 +38,25 @@ Change the following macros in makefile to locate GNU-EFI **libraries** and **he
### 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.
```makefile
OVMF_DIR = ../OVMF
OVMF_DIR = ../OVMF
```
Change **OVMF_DIR** directory in the makefile.
### Create Image
Add your roms here in the makefile to write it to your image. For example : test_1.nes, test_2.nes
```makefile
mcopy -i $(IMAGE).img splash.bmp ::
# Add your roms here
mcopy -i $(IMAGE).img test_1.nes ::
mcopy -i $(IMAGE).img test_2.nes ::
mcopy -i $(IMAGE).img splash.bmp ::
# Add your roms here
mcopy -i $(IMAGE).img test_1.nes ::
mcopy -i $(IMAGE).img test_2.nes ::
```
```bash
make img
make img
```
### Run
```bash
make run
make run
```
# NesUEFI on real hardware
**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/)
- **gcc-3.0 or newer**
```bash
gcc --version
gcc --version
```
- A version of **objcopy** that supports EFI applications :
```bash
objcopy --help
objcopy --help
```
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:
Go to gnu-efi source folder
```bash
make
make install
make
make install
```
## 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.
Change the following macros to locate the libraries and headers installed on the previous step.
```makefile
IMAGE = uefi_app
TARGET = main.efi
IMAGE = uefi_app
TARGET = main.efi
INCDIR = /usr/local/include
LIBDIR = /usr/local/lib
EFILIB = /usr/local/lib
INCDIR = /usr/local/include
LIBDIR = /usr/local/lib
EFILIB = /usr/local/lib
```
## Run on qemu :
### 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.
```makefile
OVMF_DIR = ../OVMF
OVMF_DIR = ../OVMF
```
Change the OVMF directory in the makefile.
### Create Image :
```bash
make img
make img
```
It will do the following tasks :
```bash
# Create a new image file that will contain the GNU-EFI application.
dd if=/dev/zero of=$(IMAGE).img bs=512 count=93750
# mformat to format it with FAT16.
mformat -i $(IMAGE).img -h 32 -t 32 -n 64 -c 1 ::
# Create directory
mmd -i $(IMAGE).img ::/EFI
mmd -i $(IMAGE).img ::/EFI/BOOT
# Copy image
mcopy -i $(IMAGE).img $(TARGET) ::/EFI/BOOT
# Copy the nsh script to load efi application automatically from fs0
mcopy -i $(IMAGE).img startup.nsh ::
# Create a new image file that will contain the GNU-EFI application.
dd if=/dev/zero of=$(IMAGE).img bs=512 count=93750
# mformat to format it with FAT16.
mformat -i $(IMAGE).img -h 32 -t 32 -n 64 -c 1 ::
# Create directory
mmd -i $(IMAGE).img ::/EFI
mmd -i $(IMAGE).img ::/EFI/BOOT
# Copy image
mcopy -i $(IMAGE).img $(TARGET) ::/EFI/BOOT
# Copy the nsh script to load efi application automatically from fs0
mcopy -i $(IMAGE).img startup.nsh ::
```
### Run :
```bash