Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
cupnes committed Jun 13, 2018
0 parents commit 316a5a2
Show file tree
Hide file tree
Showing 21 changed files with 1,714 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*~
*.o
*.a
*.bin
*.efi
*.img
*.map
*.bgra
GPATH
GRTAGS
GSYMS
GTAGS
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
CC = x86_64-w64-mingw32-gcc
OBJCOPY = x86_64-w64-mingw32-objcopy
CFLAGS = -Wall -Wextra
CFLAGS += -nostdinc -nostdlib -fno-builtin -fno-common
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

clean:
rm -f *~ *.o *.efi
make -C libuefi clean

.PHONY: clean
22 changes: 22 additions & 0 deletions include/common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#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 long long hexstrtoull(char *str);
unsigned char check_warn_error(unsigned long long status, unsigned short *name);
void assert(unsigned long long status, unsigned short *message);

#endif
Loading

0 comments on commit 316a5a2

Please sign in to comment.