I recently started taking a shot at OS development, and so far everything's more or less come along well. I managed to get VESA working more recently, but I've run into some problems with trying to link my PSF object file when trying to get PSF working. When I run the ./iso.sh script, I get an error in my kernel directory's Makefile:
Code: Select all
i686-elf-gcc --sysroot=/home/zak/pb/root/sysroot -isystem=/usr/include -T arch/i386/linker.ld -o pb.kernel -O2 -g -ffreestanding -Wall -Wextra arch/i386/Lat2-Terminus16.o arch/i386/crti.o arch/i386/crtbegin.o arch/i386/boot.o arch/i386/tty.o kernel/kernel.o -nostdlib -lk -lgcc arch/i386/crtend.o arch/i386/crtn.o
arch/i386/Lat2-Terminus16.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
Makefile:58: recipe for target 'pb.kernel' failed
make: *** [pb.kernel] Error 1
I'll show the relevant parts of my Makefile (note: it's not heavily modified from the Meaty Skeleton kernel Makefile yet). Let me know if anything else may be needed to resolve the issue.
Code: Select all
KERNEL_OBJS=\
$(KERNEL_ARCH_OBJS) \
kernel/kernel.o \
OBJS=\
$(ARCHDIR)/Lat2-Terminus16.o \
$(ARCHDIR)/crti.o \
$(ARCHDIR)/crtbegin.o \
$(KERNEL_OBJS) \
$(ARCHDIR)/crtend.o \
$(ARCHDIR)/crtn.o \
LINK_LIST=\
$(LDFLAGS) \
$(ARCHDIR)/Lat2-Terminus16.o \
$(ARCHDIR)/crti.o \
$(ARCHDIR)/crtbegin.o \
$(KERNEL_OBJS) \
$(LIBS) \
$(ARCHDIR)/crtend.o \
$(ARCHDIR)/crtn.o \
.PHONY: all clean install install-headers install-kernel
.SUFFIXES: .o .c .S
all: pb.kernel
pb.kernel: $(OBJS) $(ARCHDIR)/linker.ld
$(CC) -T $(ARCHDIR)/linker.ld -o $@ $(CFLAGS) $(LINK_LIST)
grub-file --is-x86-multiboot pb.kernel
$(ARCHDIR)/crtbegin.o $(ARCHDIR)/crtend.o:
OBJ=`$(CC) $(CFLAGS) $(LDFLAGS) -print-file-name=$(@F)` && cp "$$OBJ" $@
$(ARCHDIR)/Lat2-Terminus16.o: $(ARCHDIR)/Lat2-Terminus16.psf
objcopy -O elf64-x86-64 -B i386 -I binary $(ARCHDIR)/Lat2-Terminus16.psf $(ARCHDIR)/Lat2-Terminus16.o