<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <tt>On 15/10/2010 6:29 PM, Corey Osgood wrote:</tt>
    <blockquote
      cite="mid:AANLkTiko0ASxbabuVFT2X2J_CkcWWbLPe03Jfb4r=cR-@mail.gmail.com"
      type="cite"><tt>These patches should really go to the serialice
        mailing list<br>
      </tt>
      <pre wrap=""><tt>(<a class="moz-txt-link-abbreviated" href="mailto:serialice@serialice.com">serialice@serialice.com</a>). That said, hopefully the second half of
that patch fixes the seqfaults I'm seeing when trying to use SerialICE
;)
</tt></pre>
    </blockquote>
    <tt><br>
      My apologies, I had searched the coreboot list and saw several
      posts regarding serialice and (erroneously) jumped to the
      conclusion that this was the right spot.<br>
      <br>
      Re-posting original message to the serialice list:<br>
      <br>
      I tried the instructions for getting serialICE installed, but ran
      into two problems (patch attached solved both problems):
      <br>
      <br>
      1) the configure script failed to detect lua, fixed by adding
      --extra-ldflags="-lm" to the build.sh file.  The output of the lua
      test (with redirect to dev/null removed) is below:
      <br>
      sh build.sh
      <br>
      /usr/local/lib/liblua.a(lvm.o): In function `.L112':
      <br>
      lvm.c:(.text+0xb18): undefined reference to `pow'
      <br>
      /usr/local/lib/liblua.a(lvm.o): In function `.L177':
      <br>
      lvm.c:(.text+0x232d): undefined reference to `pow'
      <br>
      /usr/local/lib/liblua.a(lcode.o): In function `.L211':
      <br>
      lcode.c:(.text+0x1453): undefined reference to `pow'
      <br>
      collect2: ld returned 1 exit status
      <br>
      Package lua was not found in the pkg-config search path.
      <br>
      Perhaps you should add the directory containing `lua.pc'
      <br>
      to the PKG_CONFIG_PATH environment variable
      <br>
      No package 'lua' found
      <br>
      Package lua was not found in the pkg-config search path.
      <br>
      Perhaps you should add the directory containing `lua.pc'
      <br>
      to the PKG_CONFIG_PATH environment variable
      <br>
      No package 'lua' found
      <br>
      <br>
      Error LUA not found, can't build with SerialICE support.
      <br>
      <br>
      <br>
      2) QEMU seg faulted when checking for kqemu enabled (note that I
      am running 0.11.1, but I had same behaviour on the qemu 0.11.0
      which is checked into the SerialICE v1.5 tag).  I'm guessing it is
      something with my Gentoo install that causes the seg fault but if
      kqemu is not needed for serial ice then maybe it is easier to
      remove it.:
      <br>
      <br>
      Starting program:
      /home/dharrison/projects/qemu-0.11.1/i386-softmmu/qemu -serialice
      <i class="moz-txt-slash"><span class="moz-txt-tag">/</span>dev/ttyUSB0
        -hda /dev/zero -L bios<span class="moz-txt-tag">/</span></i>
      -bios bios.rom -k en-us -s -S
      <br>
      [Thread debugging using libthread_db enabled]
      <br>
      SerialICE: Open connection to target hardware...
      <br>
      SerialICE: Waiting for handshake with target... target alife!
      <br>
      SerialICE: LUA init...
      <br>
      SerialICE: Starting LUA script
      <br>
      SerialICE: Registering physical memory areas for Cache-As-Ram:
      <br>
      Registering physical memory at 0xffd80000 (0x00080000 bytes)
      <br>
      <br>
      Program received signal SIGSEGV, Segmentation fault.
      <br>
      cpu_register_physical_memory_offset (start_addr=4292345856,
      size=524288, phys_offset=0, region_offset=0) at
      /home/dharrison/projects/qemu-0.11.1/exec.c:2327
      <br>
      2327        if (env->kqemu_enabled) {
      <br>
      (gdb) bt
      <br>
      #0  cpu_register_physical_memory_offset (start_addr=4292345856,
      size=524288, phys_offset=0, region_offset=0) at
      /home/dharrison/projects/qemu-0.11.1/exec.c:2327
      <br>
      #1  0x080735d8 in cpu_register_physical_memory
      (luastate=0x841e4a8) at ../cpu-common.h:33
      <br>
      #2  serialice_register_physical (luastate=0x841e4a8) at
      /home/dharrison/projects/qemu-0.11.1/serialice.c:93
      <br>
      #3  0x0819a1ba in luaD_precall ()
      <br>
      #4  0x081a3e3a in luaV_execute ()
      <br>
      #5  0x0819a6a0 in luaD_call ()
      <br>
      #6  0x08197621 in f_call ()
      <br>
      #7  0x08199cc3 in luaD_rawrunprotected ()
      <br>
      #8  0x08199d25 in luaD_pcall ()
      <br>
      #9  0x08197448 in lua_pcall ()
      <br>
      #10 0x080733fb in serialice_lua_init () at
      /home/dharrison/projects/qemu-0.11.1/serialice.c:117
      <br>
      #11 serialice_init () at
      /home/dharrison/projects/qemu-0.11.1/serialice.c:911
      <br>
      #12 0x080b2e8b in module_call_init (type=MODULE_INIT_BLOCK) at
      module.c:78
      <br>
      #13 0x0805402f in main (argc=13, argv=0xbffff294, envp=0xbffff2cc)
      at /home/dharrison/projects/qemu-0.11.1/vl.c:5956
      <br>
      (gdb)
      <br>
      <br>
      <br>
      Here is the output from a (working and patched) configure:
      <br>
      Install prefix    /usr/local
      <br>
      BIOS directory    /usr/local/share/qemu
      <br>
      binary directory  /usr/local/bin
      <br>
      Manual directory  /usr/local/share/man
      <br>
      ELF interp prefix /usr/gnemul/qemu-%M
      <br>
      Source path       /home/dharrison/projects/qemu-0.11.1
      <br>
      C compiler        gcc
      <br>
      Host C compiler   gcc
      <br>
      ARCH_CFLAGS       -m32
      <br>
      make              make
      <br>
      install           install
      <br>
      host CPU          i386
      <br>
      host big endian   no
      <br>
      target list       x86_64-softmmu  i386-softmmu
      <br>
      tcg debug enabled no
      <br>
      gprof enabled     no
      <br>
      sparse enabled    no
      <br>
      strip binaries    yes
      <br>
      profiler          no
      <br>
      static build      no
      <br>
      -Werror enabled   no
      <br>
      SDL support       no
      <br>
      curses support    yes
      <br>
      curl support      yes
      <br>
      mingw32 support   no
      <br>
      Audio drivers     oss
      <br>
      Extra audio cards ac97 es1370 sb16
      <br>
      Mixer emulation   no
      <br>
      SerialICE support yes
      <br>
      VNC TLS support   yes
      <br>
          TLS CFLAGS
      <br>
          TLS LIBS      -lgnutls
      <br>
      VNC SASL support  yes
      <br>
          SASL CFLAGS
      <br>
          SASL LIBS      -lsasl2
      <br>
      kqemu support     no
      <br>
      xen support       no
      <br>
      brlapi support    no
      <br>
      Documentation     yes
      <br>
      NPTL support      yes
      <br>
      vde support       no
      <br>
      AIO support       yes
      <br>
      IO thread         no
      <br>
      Install blobs     yes
      <br>
      KVM support       no
      <br>
      fdt support       no
      <br>
      preadv support    yes
      <br>
      <br>
      # uname -a
      <br>
      Linux myhostname 2.6.30-gentoo-r6 #1 SMP Wed Sep 30 12:22:36 PDT
      2009 i686 Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz GenuineIntel
      GNU/Linux
      <br>
      <br>
      The following patch fixed both my problems:
      <br>
      <br>
      Disable kqemu since it caused a seg fault and is not needed.
      <br>
      <br>
      Add libm to the LDFLAGS to make the lua test work.
      <br>
      <br>
      Signed-off-by: Dustin Harrison <a class="moz-txt-link-rfc2396E"
        href="mailto:dustin.harrison@sutus.com"><dustin.harrison@sutus.com></a><br>
      <br>
      Index: patches/serialice-qemu-0.11.0.diff
      <br>
===================================================================
      <br>
      --- patches/serialice-qemu-0.11.0.diff  (revision 107)
      <br>
      +++ patches/serialice-qemu-0.11.0.diff  (working copy)
      <br>
      @@ -1024,7 +1024,7 @@
      <br>
       @@ -0,0 +1,5 @@
      <br>
       +#!/bin/sh
      <br>
       +./configure --disable-kvm --disable-sdl --enable-serialice \
      <br>
      -+          --target-list="x86_64-softmmu, i386-softmmu"
      <br>
      ++          --target-list="x86_64-softmmu, i386-softmmu"
      --extra-ldflags="-lm" --disable-kqemu
      <br>
       +
      <br>
       +make
      <br>
       --- qemu-0.11.0/Makefile.target
      <br>
      <br>
    </tt><tt><br>
      <br>
    </tt>
  </body>
</html>