Mercurial > hg > Members > taiki > EFIKernel
changeset 4:cae91de64e26
gather boot file
author | Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 17 Dec 2012 22:22:18 +0900 |
parents | 744836a552cb |
children | 4b51f0c01fa7 |
files | boot/EFIkernel.img boot/Makefile boot/Makefile.def boot/bootx64.c boot/bootx64.efi boot/kernel_img.vmdk |
diffstat | 6 files changed, 47 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/boot/Makefile Mon Dec 17 22:22:18 2012 +0900 @@ -0,0 +1,34 @@ +ARCH =$(shell uname -m |sed s,i[3456789]86,ia32,) +LIB_PATH = /usr/lib64 +EFI_INCLUDE = /usr/include/efi +EFI_INCLUDES = -nostdinc -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol + +EFI_PATH = /usr/lib64/gnuefi +EFI_CRT_OBJS = $(EFI_PATH)/crt0-efi-$(ARCH).o +EFI_LDS = $(EFI_PATH)/elf_$(ARCH)_efi.lds + +CFLAGS = -fno-stack-protector -fpic -fshort-wchar -mno-red-zone $(EFI_INCLUDES) +ifeq ($(ARCH),x86_64) + CFLAGS += -DEFI_FUNCTION_WRAPPER +endif + +LDFLAGS = -nostdlib -znocombreloc -T $(EFI_LDS) -shared -Bsymbolic -L$(EFI_PATH) -L$(LIB_PATH) \ + $(EFI_CRT_OBJS) -lefi -lgnuefi + +TARGET = bootx64.efi +OBJS = bootx64.o +SOURCES = bootx64.c + +all: $(TARGET) + +bootx64.so: $(OBJS) + $(LD) -o $@ $(LDFLAGS) $^ $(EFI_LIBS) + +%.efi: %.so + objcopy -j .text -j .sdata -j .data \ + -j .dynamic -j .dynsym -j .rel \ + -j .rela -j .reloc -j .eh_frame \ + --target=efi-app-$(ARCH) $^ $@ + +clean: + rm -rf $(TARGET) *.o *.so
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/boot/Makefile.def Mon Dec 17 22:22:18 2012 +0900 @@ -0,0 +1,4 @@ +CC = elf-cbc-gcc-4.6.0 +LD = x86_64-elf-ld +EFI_TOOLS = /Users/taira/cross/EFI_TOOLS/bin +OBJCOPY = x86_64-pc-mingw32-objcopy