--- /dev/null
+TOOLCHAIN=powerpc64-linux-gnu
+CC=$(TOOLCHAIN)-gcc
+AS=$(TOOLCHAIN)-as
+AFLAGS=-mpwr9
+
+all: sim
+
+sim: kernel.bin
+ pypowersim -i kernel.bin
+
+clean:
+ rm *.o *.elf *.bin
+
+kernel.elf: test.o
+ $(TOOLCHAIN)-ld $^ -EL -o $@ -T memmap
+
+kernel.bin: kernel.elf
+ $(TOOLCHAIN)-objcopy $< -I elf64-little -O binary $@
+
+%.o: %.s
+ $(AS) $(AFLAGS) -c $< -le -o $@
--- /dev/null
+
+MEMORY
+{
+ ram : ORIGIN = 0x20000000, LENGTH = 128M
+}
+
+SECTIONS
+{
+ .text : { *(.text*) } > ram
+ .bss : { *(.text*) } > ram
+}