Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
20 changed files
with
1,686 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*~ | ||
*.o | ||
*.a | ||
*.efi | ||
fs | ||
GPATH | ||
GRTAGS | ||
GSYMS | ||
GTAGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
CC = x86_64-w64-mingw32-gcc | ||
OBJCOPY = x86_64-w64-mingw32-objcopy | ||
CFLAGS = -Wall -Wextra | ||
CFLAGS += -nostdinc -nostdlib -fno-builtin | ||
CFLAGS += -Wl,--subsystem,10 | ||
|
||
poiboot.efi: poiboot.o libuefi/libuefi.a | ||
$(CC) $(CFLAGS) -e efi_main -o $@ $+ | ||
|
||
poiboot.o: poiboot.c | ||
$(CC) $(CFLAGS) -Iinclude -c -o $@ $< | ||
|
||
libuefi/libuefi.a: | ||
make -C libuefi CC=$(CC) CFLAGS="$(CFLAGS)" | ||
|
||
deploy: poiboot.efi | ||
mkdir -p ../fs/EFI/BOOT | ||
cp $< ../fs/EFI/BOOT/BOOTX64.EFI | ||
|
||
run: | ||
qemu-system-x86_64 -bios OVMF.fd -hda fat:../fs -m 2G -nographic | ||
|
||
clean: | ||
rm -f *~ *.o *.efi | ||
make -C libuefi clean | ||
|
||
.PHONY: clean run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef _COMMON_H_ | ||
#define _COMMON_H_ | ||
|
||
#define NULL (void *)0 | ||
#define TRUE 1 | ||
#define FALSE 0 | ||
#define SC_OFS 0x1680 | ||
#define SC_ESC (SC_OFS + 0x0017) | ||
|
||
void putc(unsigned short c); | ||
void puts(unsigned short *s); | ||
void puth(unsigned long long val, unsigned char num_digits); | ||
unsigned short getc(void); | ||
unsigned int gets(unsigned short *buf, unsigned int buf_size); | ||
int strcmp(const unsigned short *s1, const unsigned short *s2); | ||
void strncpy(unsigned short *dst, unsigned short *src, unsigned long long n); | ||
unsigned long long strlen(unsigned short *str); | ||
unsigned char check_warn_error(unsigned long long status, unsigned short *name); | ||
void assert(unsigned long long status, unsigned short *message); | ||
|
||
#endif |
Oops, something went wrong.