Table of Contents

Booting linux on qemu-mpc85xx on x86

Even though qemu have ppce500_mpc8544ds board inside, it relies on kvm to manage MMU stuff. Thus to run it one need PPC host (correct me if I'm wrong). Let's try to emulate BookE MMU in qemu and boot linux.

Plan

PPC kernel

arch/powerpc/boot/crt0.S (basic platform init)
arch/powerpc/boot/main.c (unzip kernel to PA 0 and jump to it)
arch/powerpc/kernel/head_fsl_booke.S (MMU/vectors setup)

Qemu that can boot -M mpc8544ds -kernel

# Makefile.libfdt
#
# This is not a complete Makefile of itself.  Instead, it is designed to
# be easily embeddable into other systems of Makefiles.
#
LIBFDT_INCLUDES = fdt.h libfdt.h
LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o)

LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
LIBFDT_INCLUDES = fdt.h libfdt.h
LIBFDT_EXTRA = libfdt_internal.h
LIBFDT_LIB = libfdt/libfdt.a
LIBFDT_SHARED_LIB=libfdt.so

LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o)

CFLAGS += -fPIC -I .

$(LIBFDT_objdir)/$(LIBFDT_LIB): $(addprefix $(LIBFDT_objdir)/,$(LIBFDT_OBJS))

$(LIBFDT_SHARED_LIB): $(LIBFDT_OBJS)
        $(CC) -shared -o $(LIBFDT_SHARED_LIB) $^
clean:
        rm -f $(LIBFDT_SHARED_LIB) $(LIBFDT_OBJS)

Next steps

Ok, we've got to _start, but somehow stuck here.

References