[pok-devel] Trouble running examples/partition-scheduling on Qemu-emulated PowerPC/Prep

[ Thread Index | Date Index | More lists.tuxfamily.org/pok-devel Archives ]


Hi list,

I have been playing with POK for quite a while now and still cannot manage to get examples/partition-scheduling working. I am trying to run it under Qemu as a PowerPC/Prep emulator. From what gdb tells me, pok_boot is executed and then returns into _pok_reset. From there, I have lost the execution path to catch it again (via a breakpoint) in pok_arch_rfi. When the rfi execution at the end of it is executed, nothing happens, the Qemu process eats up 100% of the CPU core time. Ctrl-C'ing leaves me executing reserved_2F00 (which seems to explain Qemu becoming CPU-hungry).

Would you have any clues ?

My environment is the following:
- Windows XP 32Bit
- cygwin 1.5.25
	+ GNU make 2.80
	+ perl 5.8.8
- Ocarina 2.0w (r7317)
- Adacore toolchain for PowerPC
	+ GCC 4.5.2
	+ Binutils 2.20
	+ Qemu 0.14.0

To make the example compile, I had to patch the build system in the following way. Note that the removal of the ``(dist)clean'' target here and there is just meant to avoid complete recompilation each time I adjusted a quote.

diff -u -r src_vanilla/misc/conf-env.pl src/misc/conf-env.pl
--- src_vanilla/misc/conf-env.pl	2011-02-02 16:54:05.000000000 +0100
+++ src/misc/conf-env.pl	2011-05-16 16:08:50.302858300 +0200
@@ -433,11 +433,11 @@

    if ($sys_kind =~ /CYGWIN/ )
    {
-      my $tmp_path = `cygpath.exe -d $ENV{PWD}/misc/grub-boot-only.img`;
+      my $tmp_path = `cygpath.exe -d "$ENV{PWD}/misc/grub-boot-only.img"`;
       chomp ($tmp_path);
       $tmp_path =~ s/\\/\\\\/g;

-      my $tmp_path2 = `cygpath.exe -d $ENV{PWD}/toolchain/qemu`;
+      my $tmp_path2 = `cygpath.exe -d "$ENV{PWD}/toolchain/qemu"`;
       chomp ($tmp_path2);
       $tmp_path2 =~ s/\\/\\\\/g;

diff -u -r src_vanilla/misc/mk/examples.mk src/misc/mk/examples.mk
--- src_vanilla/misc/mk/examples.mk	2011-02-02 16:54:05.000000000 +0100
+++ src/misc/mk/examples.mk	2011-05-17 14:02:38.688391500 +0200
@@ -4,7 +4,7 @@
 all: build

 build:
-	$(POK_PATH)/misc/pok-toolchain.pl $(BUILD)
+	'$(POK_PATH)/misc/pok-toolchain.pl' $(BUILD)

 clean:
 	$(RM) *.o *.ali
diff -u -r src_vanilla/misc/mk/ppc-mkrom.mk src/misc/mk/ppc-mkrom.mk
--- src_vanilla/misc/mk/ppc-mkrom.mk	2011-02-02 16:54:05.000000000 +0100
+++ src/misc/mk/ppc-mkrom.mk	2011-05-17 15:44:47.229127100 +0200
@@ -1,10 +1,10 @@
 install: rom.bin

-rom.bin: $(TARGET)
-	$(OBJCOPY) -O binary $< $@
+rom.bin:
+	$(OBJCOPY) -O binary pok.elf $@

 install-clean:
 	$(RM) rom.bin

-run: rom.bin
-	$(QEMU) -L . -bios rom.bin rom.bin -M prep -serial /dev/stdout
+run:
+	$(QEMU) -L . -bios rom.bin rom.bin -M prep -nographic -s -S
diff -u -r src_vanilla/misc/mk/rules-kernel.mk src/misc/mk/rules-kernel.mk
--- src_vanilla/misc/mk/rules-kernel.mk	2011-02-02 16:54:05.000000000 +0100
+++ src/misc/mk/rules-kernel.mk	2011-05-17 14:04:36.295696500 +0200
@@ -1,7 +1,7 @@
 ifeq ($(TOPDIR),)
-CFLAGS += -I$(POK_PATH)/kernel/include -Werror
+CFLAGS += -I'$(POK_PATH)/kernel/include' -Werror
 else
-CFLAGS += -I$(TOPDIR)/kernel/include -Werror
+CFLAGS += -I'$(TOPDIR)/kernel/include' -Werror
 endif

 ifeq ($(INSTRUMENTATION),1)
@@ -9,14 +9,14 @@
 endif

 ifneq ($(DEPLOYMENT_HEADER),)
-COPTS += -include $(DEPLOYMENT_HEADER)
+COPTS += -include "$(shell cygpath -w "$(DEPLOYMENT_HEADER)")"
 endif

 kernel:
-	$(CD) $(POK_PATH)/kernel && $(MAKE) distclean all
+	$(CD) '$(POK_PATH)/kernel' && $(MAKE) all

 copy-kernel:
-	$(CP) $(POK_PATH)/kernel/pok.lo $(shell pwd)/
+	$(CP) $(POK_PATH)/kernel/pok.lo $(shell cygpath -d '$(shell pwd)')

 kernel-clean:
 	$(CD) $(POK_PATH)/kernel && $(MAKE) clean
diff -u -r src_vanilla/misc/mk/rules-main.mk src/misc/mk/rules-main.mk
--- src_vanilla/misc/mk/rules-main.mk	2011-02-02 16:54:05.000000000 +0100
+++ src/misc/mk/rules-main.mk	2011-05-17 15:11:58.755757100 +0200
@@ -30,7 +30,7 @@
$(CC) $(CONFIG_CFLAGS) -I $(POK_PATH)/kernel/include -c sizes.c -o sizes.o
 	$(OBJCOPY) --add-section .archive2=partitions.bin sizes.o
 	$(ECHO) $(ECHO_FLAGS) $(ECHO_FLAGS_ONELINE) "[LD] $@"
- $(LD) $(LDFLAGS) -T $(POK_PATH)/misc/ldscripts/$(ARCH)/$(BSP)/kernel.lds -o $@ $(KERNEL) $(OBJS) sizes.o -Map $@.map + $(LD) $(LDFLAGS) -T '$(POK_PATH)/misc/ldscripts/$(ARCH)/$(BSP)/kernel.lds' -o $@ $(KERNEL) $(OBJS) sizes.o -Map $@.map if test $$? -eq 0; then $(ECHO) $(ECHO_FLAGS) $(ECHO_GREEN) " OK "; else $(ECHO) $(ECHO_FLAGS) $(ECHO_RED) " KO"; fi

 plop: assemble-partitions
diff -u -r src_vanilla/misc/mk/rules-partition.mk src/misc/mk/rules-partition.mk --- src_vanilla/misc/mk/rules-partition.mk 2011-02-02 16:54:05.000000000 +0100
+++ src/misc/mk/rules-partition.mk	2011-05-17 15:23:59.798974700 +0200
@@ -1,5 +1,5 @@
 ifeq ($(TOPDIR),)
-CFLAGS += -I$(POK_PATH)/libpok/include -I.
+CFLAGS += -I'$(POK_PATH)/libpok/include' -I.
 else
 CFLAGS += -I$(TOPDIR)/libpok/include -I.
 endif
@@ -9,11 +9,11 @@
 endif

 ifneq ($(DEPLOYMENT_HEADER),)
-COPTS += -include $(DEPLOYMENT_HEADER)
+COPTS += -include "$(shell cygpath -w "$(DEPLOYMENT_HEADER)")"
 endif

 libpok:
-	$(CD) $(POK_PATH)/libpok && $(MAKE) distclean all
+	$(CD) '$(POK_PATH)/libpok' && $(MAKE) all

 $(TARGET): $(OBJS)
 	$(ECHO) $(ECHO_FLAGS) $(ECHO_FLAGS_ONELINE) "[Assemble partition $@ "
diff -u -r src_vanilla/misc/pok-toolchain.pl src/misc/pok-toolchain.pl
--- src_vanilla/misc/pok-toolchain.pl	2011-02-02 16:54:05.000000000 +0100
+++ src/misc/pok-toolchain.pl	2011-05-17 15:17:31.955861100 +0200
@@ -151,7 +151,7 @@
    {
       $str .= "$m ";
    }
-   return $str . "\$POK_PATH/misc/aadl-library.aadl ";
+   return $str . "'$ENV{POK_PATH}/misc/aadl-library.aadl' ";
 }

 sub get_infos
@@ -420,6 +420,8 @@

    return 0 if ($ret != 0);

+ $ret = system ('sed -i \'s/^TARGET=.*$/TARGET=pok.elf/\' generated-code/cpu/Makefile');
+
    if ($arinc653 != 0)
    {
       foreach $v (@nodes)
@@ -448,11 +450,11 @@

       if ($norun)
       {
-         $ret=system ("$make  clean all >/dev/null");
+         $ret=system ("$make all");
       }
       else
       {
-         $ret=system ("$make clean all run >/dev/null");
+         $ret=system ("$make all run >/dev/null");
       }
       return 0 if ($ret != 0);
       chdir ("../..");

--
Alexis Fouilhe




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/