etc:users:jcmvbkbc:mpc85xx-qemu-linux
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
etc:users:jcmvbkbc:mpc85xx-qemu-linux [2010/01/09 04:50] – создано jcmvbkbc | etc:users:jcmvbkbc:mpc85xx-qemu-linux [2016/08/08 20:53] (current) – ↷ Page moved from users:jcmvbkbc:mpc85xx-qemu-linux to etc:users:jcmvbkbc:mpc85xx-qemu-linux kel | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Booting linux on qemu-mpc85xx on x86 ====== | ====== 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 ===== | ||
+ | * build ppc linux kernel for mpc8544; | ||
+ | * build qemu that can boot this kernel; | ||
+ | * try to boot it and fix all that's broken along the way; | ||
+ | |||
+ | ===== PPC kernel ===== | ||
+ | * need dtc to compile it; | ||
+ | * description of FDT and how kernel expects it: Documentation/ | ||
+ | * modify arch/ | ||
+ | * boot sequence: | ||
+ | < | ||
+ | arch/ | ||
+ | arch/ | ||
+ | arch/ | ||
+ | </ | ||
+ | * use x/s sprint_buf to see what kernel prints (unless you see serial port output -- I don' | ||
+ | |||
+ | ===== Qemu that can boot -M mpc8544ds -kernel ===== | ||
+ | * need libfdt: take it from scripts/ | ||
+ | < | ||
+ | # Makefile.libfdt | ||
+ | # | ||
+ | # This is not a complete Makefile of itself. | ||
+ | # 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: | ||
+ | |||
+ | 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_SHARED_LIB=libfdt.so | ||
+ | |||
+ | LIBFDT_OBJS = $(LIBFDT_SRCS: | ||
+ | |||
+ | CFLAGS += -fPIC -I . | ||
+ | |||
+ | $(LIBFDT_objdir)/ | ||
+ | |||
+ | $(LIBFDT_SHARED_LIB): | ||
+ | $(CC) -shared -o $(LIBFDT_SHARED_LIB) $^ | ||
+ | clean: | ||
+ | rm -f $(LIBFDT_SHARED_LIB) $(LIBFDT_OBJS) | ||
+ | </ | ||
+ | * install libfdt.so, fdt.h, libfdt.h, libfdt_env.h | ||
+ | * configure qemu: ../ | ||
+ | * apply some patches :TODO: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Next steps ===== | ||
+ | Ok, we've got to _start, but somehow stuck here. | ||
+ | |||
+ | * what's the initial MMU setup on entry to kernel? see arch/ | ||
+ | * why exception in the first mfmsr? mmu_idx, mem_idx -- ?? | ||
+ | * implement tlbsx (done), tlbre (done), tlbwe (done), tlbivax (done) for BookE (needed by arch/ | ||
+ | * how softmmu works? how to substitute existing PPC softmmu by TLB-based one? | ||
+ | * what is hardware TLB entry replacement policy/hash function? | ||
+ | * need to refactor the whole TLB thing for BookE PPC | ||
+ | |||
+ | ===== References ===== | ||
+ | |||
+ | * [[http:// | ||
+ | * [[http:// |
etc/users/jcmvbkbc/mpc85xx-qemu-linux.1263001825.txt.gz · Last modified: 2010/01/09 04:50 by jcmvbkbc