<div dir="ltr">Hi Robert,<br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 25, 2015 at 12:05 PM, Robert Withers <span dir="ltr"><<a href="mailto:robert.w.withers@gmail.com" target="_blank">robert.w.withers@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br>
<div bgcolor="#FFFFFF" text="#000000">
Eliot, thank you for that orientation. I looked at your mac but had
to go one more step. I realized I probably couldn't build both
BochsIA32Plugin and BochsX64Plugin at the same time while sharing
the processors/IA32 support code - it is compiled separately for
IA32 and X64. So I added a processors/X64 directory, with a
seaparate copy of Bochs for 64-bit emulation, built the libs with
your conf.COG from mac, and built both Bochs plugins. I am attaching
the link to BochsX64Plugin for 32-bit linux:
<a href="https://www.dropbox.com/s/g73feosuzlx45le/BochsX64Plugin.11-25-2015.tgz?dl=0" target="_blank">https://www.dropbox.com/s/g73feosuzlx45le/BochsX64Plugin.11-25-2015.tgz?dl=0</a></div></blockquote><div><br></div><div>You definitely /don't/ need a separate copy and /can/ use the IA32 Bochs sources. It works fine. That's what I've been doing. Look at the conf.COG files. They differ only in configure options. They build all objects locally, taking only source from processors/IA32/bochs</div><div><br></div><div><div>oscogvm$ diff build.macos32x86/bochsx*/conf.COG</div><div>3,4c3,4</div><div>< # Bochs x64 simulator for the BochsX64Alien plugin.</div><div>< # this sets up the x64 compile for Cog on Mac OS X. Disable as much inessential</div><div>---</div><div>> # Bochs x86 simulator for the BochsIA32Alien plugin.</div><div>> # this sets up the x86 compile for Cog on Mac OS X. Disable as much inessential</div><div>32,33c32,35</div><div>< <span class="" style="white-space:pre">                </span>--enable-x86-64 \</div><div>< <span class="" style="white-space:pre">                </span>--enable-global-pages \</div><div>---</div><div>> <span class="" style="white-space:pre">                </span>--disable-x86-64 \</div><div>> <span class="" style="white-space:pre">                </span>--disable-pae \</div><div>> <span class="" style="white-space:pre">                </span>--disable-large-pages \</div><div>> <span class="" style="white-space:pre">                </span>--disable-global-pages \</div></div><div><div>oscogvm$ cat build.macos32x86/bochsx64/conf.COG</div><div>#!/bin/sh</div><div><br></div><div># Bochs x64 simulator for the BochsX64Alien plugin.</div><div># this sets up the x64 compile for Cog on Mac OS X. Disable as much inessential</div><div># stuff as possible leaving only the cpu/fpu & memory interface</div><div><br></div><div># build cpu/libcpu.a disasm/libdisasm.a fpu/libfpu.a using</div><div># $ ./conf.COG</div><div># $ ../../processors/IA32/bochs/makeem</div><div><br></div><div>set echo</div><div># CFLAGS="-pipe -O3 -fomit-frame-pointer -finline-functions -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-labels=16 -falign-loops-max-skip=15 -falign-jumps-max-skip=15 -fprefetch-loop-arrays $CFLAGS"</div><div>CFLAGS="-m32 $CFLAGS"</div><div>CFLAGS="-Dlongjmp=_longjmp -Dsetjmp=_setjmp $CFLAGS"</div><div>CFLAGS="-pipe -O3 -fomit-frame-pointer -finline-functions $CFLAGS"</div><div>CFLAGS="-g $CFLAGS"</div><div>CPPFLAGS=""</div><div>CXXFLAGS="$CFLAGS"</div><div><br></div><div>export CFLAGS</div><div>export CPATH</div><div>export CPPFLAGS</div><div>export CXXFLAGS</div><div>export LDFLAGS</div><div><br></div><div>../../processors/IA32/bochs/configure \</div><div><span class="" style="white-space:pre">        </span>--enable-Cog \</div><div><span class="" style="white-space:pre">        </span>--enable-cpu-level=6 \</div><div><span class="" style="white-space:pre">        </span>--enable-sse=2 \</div><div><span class="" style="white-space:pre">        </span>--enable-assert-checks \</div><div><span class="" style="white-space:pre">        </span>--with-nogui \</div><div><span class="" style="white-space:pre">                </span>--enable-x86-64 \</div><div><span class="" style="white-space:pre">                </span>--enable-global-pages \</div><div><span class="" style="white-space:pre">                </span>--disable-mtrr \</div><div><span class="" style="white-space:pre">                </span>--disable-sb16 \</div><div><span class="" style="white-space:pre">                </span>--disable-ne2000 \</div><div><span class="" style="white-space:pre">                </span>--disable-pci \</div><div><span class="" style="white-space:pre">                </span>--disable-acpi \</div><div><span class="" style="white-space:pre">                </span>--disable-apic \</div><div><span class="" style="white-space:pre">                </span>--disable-clgd54xx \</div><div><span class="" style="white-space:pre">                </span>--disable-usb \</div><div><span class="" style="white-space:pre">                </span>--disable-plugins \</div><div><span class="" style="white-space:pre">        </span>${CONFIGURE_ARGS}</div><div><br></div><div># apic == Advanced programmable Interrupt Controller</div><div># acpi == Advanced Configuration and Power Interface</div><div># pci == Peripheral Component Interconnect local bus</div><div># clgd54xx == Cirrus Logic GD54xx video card</div><div><br></div><div># avoid conflict with squeak unix build's config.h</div><div>echo cp config.h bochsconfig.h</div><div>cp config.h bochsconfig.h</div><div><br></div><div>echo "and don't forget to run ../../processors/IA32/bochs/makeem"</div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><br>
<br>
Best,<br>
Robert <br>
<br>
... ^^<br>
<br>
<div>On 10/24/2015 11:54 PM, Eliot Miranda
wrote:<br>
</div>
<blockquote type="cite">
<pre> </pre>
<br>
<fieldset></fieldset>
<br>
<div>Hi Rob,</div>
<div><br>
</div>
<div> I've only tried to build it in
Mac OS X. I've also changed the build structure so one /can/
build it either in 32 or 64 bits. So look at the structure for
building the support libraries under build.macos32x86 and
replicate it under <span style="background-color:rgba(255,255,255,0)">build.linux32x86, write or change
platforms/unix/plugins/</span>BochsX64Plugin/Makefile to pick
up the libraries from (IIRC) <span style="background-color:rgba(255,255,255,0)">build.linux32x86/bochsx64/{cpu/libcpu.a,disasm/libdisasm.a,fpu/libfpu.a}
and you should be fine. You'll need to
run build.linux32x86/bochsx64/conf.COG which you'll copy
from build.macos32x86/bochsx64/conf.COG</span><br>
<br>
<span style="background-color:rgba(255,255,255,0)">_,,,^..^,,,_
(phone)</span></div>
<div><br>
On Oct 24, 2015, at 5:59 PM, Robert Withers <<a href="mailto:robert.w.withers@gmail.com" target="_blank"></a><a href="mailto:robert.w.withers@gmail.com" target="_blank">robert.w.withers@gmail.com</a>>
wrote:<br>
<br>
</div>
<blockquote type="cite">
<div><span></span></div>
</blockquote>
<blockquote type="cite">
<div>
Is it possible I need 64-bit headers/libraries on the 32-bit
Ubuntu when compiling BochsX64Plugin? Here a line I am
receiving an error for and it is for 64-bits:<br>
<br>
from sqBochsX64Plugin.cpp, line 68:<br>
bx_cpu.sregs[BX_SEG_REG_CS].cache.u.segment.l = 1; //
64-bit seg<br>
<br>
resulting in error, below.<br>
<br>
<br>
<div>On 10/23/2015 01:49 PM, Eliot
Miranda wrote:<br>
</div>
<blockquote type="cite">
<pre> </pre>
<br>
<fieldset></fieldset>
<br>
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Oct 21, 2015 at 7:26
PM, Robert Withers <span dir="ltr"><<a href="mailto:robert.w.withers@gmail.com" target="_blank"></a><a href="mailto:robert.w.withers@gmail.com" target="_blank">robert.w.withers@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
I am not sure it is possible, even. Can this plugin
be build 32-bit; does it make any sense to do so?<br>
</blockquote>
<div><br>
</div>
<div>yes. How on earth can the 64-bit Cogit be
created if this plugin can't be built in 32-bits?
I'm using it on Mac OS X in 32-bits using a 32-bit
VM.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br>
Here is the make portion of this attempt for this
plugin. I am unsure how to deal with this C++ issue
in the
Cross/plugins/BochsX64Plugin/sqUnixBochsX64Plugin.cpp
file.<br>
<br>
<br>
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:
In function 'int resetCPU(void*)':<br>
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:68:47:
error: 'struct bx_descriptor_t::<anonymous
union>::<anonymous>' has no member named
'l'<br>
bx_cpu.sregs[BX_SEG_REG_CS].cache.u.segment.l
= 1; // 64-bit seg<br>
<br>
<br>
Thank you,<br>
Robert<br>
<br>
<br>
/bin/bash
/home/rabbit/warren/oscogvm/build.linux32x86/squeak.cog.spur/build/libtool
--mode=compile gcc -m32 -g -O2 -DNDEBUG -DDEBUGVM=0
-msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-DCOGMTVM=0 -DLSB_FIRST=1 -m32 -DHAVE_CONFIG_H
-I/home/rabbit/warren/oscogvm/build.linux32x86/squeak.cog.spur/build
-I/home/rabbit/warren/oscogvm/build.linux32x86/squeak.cog.spur/build
-I/home/rabbit/warren/oscogvm/platforms/unix/vm
-I/home/rabbit/warren/oscogvm/platforms/Cross/vm
-I/home/rabbit/warren/oscogvm/spursrc/vm
-I/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin
-m32 -DUSE_BOCHS_CONFIG_H=1
-I/home/rabbit/warren/oscogvm/processors/IA32/linuxbochs
-I/home/rabbit/warren/oscogvm/processors/IA32/bochs
-I/home/rabbit/warren/oscogvm/processors/IA32/bochs/instrument/stubs
-c -o BochsX64Plugin.lo
/home/rabbit/warren/oscogvm/src/plugins/BochsX64Plugin/BochsX64Plugin.c<br>
gcc -m32 -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DCOGMTVM=0
-DLSB_FIRST=1 -m32 -DHAVE_CONFIG_H
-I/home/rabbit/warren/oscogvm/build.linux32x86/squeak.cog.spur/build
-I/home/rabbit/warren/oscogvm/build.linux32x86/squeak.cog.spur/build
-I/home/rabbit/warren/oscogvm/platforms/unix/vm
-I/home/rabbit/warren/oscogvm/platforms/Cross/vm
-I/home/rabbit/warren/oscogvm/spursrc/vm
-I/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin
-m32 -DUSE_BOCHS_CONFIG_H=1
-I/home/rabbit/warren/oscogvm/processors/IA32/linuxbochs
-I/home/rabbit/warren/oscogvm/processors/IA32/bochs
-I/home/rabbit/warren/oscogvm/processors/IA32/bochs/instrument/stubs
-c
/home/rabbit/warren/oscogvm/src/plugins/BochsX64Plugin/BochsX64Plugin.c
-fPIC -DPIC -DPIC -o BochsX64Plugin.o<br>
mv -f BochsX64Plugin.o BochsX64Plugin.lo<br>
/bin/bash
/home/rabbit/warren/oscogvm/build.linux32x86/squeak.cog.spur/build/libtool
--mode=compile g++ -g -O2 -DNDEBUG -DDEBUGVM=0
-msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-DCOGMTVM=0 -DLSB_FIRST=1 -m32 -DHAVE_CONFIG_H
-I/home/rabbit/warren/oscogvm/build.linux32x86/squeak.cog.spur/build
-I/home/rabbit/warren/oscogvm/build.linux32x86/squeak.cog.spur/build
-I/home/rabbit/warren/oscogvm/platforms/unix/vm
-I/home/rabbit/warren/oscogvm/platforms/Cross/vm
-I/home/rabbit/warren/oscogvm/spursrc/vm
-I/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin
-m32 -DUSE_BOCHS_CONFIG_H=1
-I/home/rabbit/warren/oscogvm/processors/IA32/linuxbochs
-I/home/rabbit/warren/oscogvm/processors/IA32/bochs
-I/home/rabbit/warren/oscogvm/processors/IA32/bochs/instrument/stubs
-c -o sqBochsX64Plugin.lo
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp<br>
g++ -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2 -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -DCOGMTVM=0 -DLSB_FIRST=1
-m32 -DHAVE_CONFIG_H
-I/home/rabbit/warren/oscogvm/build.linux32x86/squeak.cog.spur/build
-I/home/rabbit/warren/oscogvm/build.linux32x86/squeak.cog.spur/build
-I/home/rabbit/warren/oscogvm/platforms/unix/vm
-I/home/rabbit/warren/oscogvm/platforms/Cross/vm
-I/home/rabbit/warren/oscogvm/spursrc/vm
-I/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin
-m32 -DUSE_BOCHS_CONFIG_H=1
-I/home/rabbit/warren/oscogvm/processors/IA32/linuxbochs
-I/home/rabbit/warren/oscogvm/processors/IA32/bochs
-I/home/rabbit/warren/oscogvm/processors/IA32/bochs/instrument/stubs
-c
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp
-fPIC -DPIC -DPIC -o sqBochsX64Plugin.o<br>
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:17:0:
warning: "setjmp" redefined [enabled by default]<br>
# define setjmp(jb) _setjmp(jb)<br>
^<br>
In file included from
/home/rabbit/warren/oscogvm/processors/IA32/bochs/gui/siminterface.h:1069:0,<br>
from
/home/rabbit/warren/oscogvm/processors/IA32/bochs/bochs.h:117,<br>
from
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:7:<br>
/usr/include/setjmp.h:67:0: note: this is the
location of the previous definition<br>
#define setjmp(env) _setjmp (env)<br>
^<br>
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:
In function 'int resetCPU(void*)':<br>
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:68:47:
error: 'struct bx_descriptor_t::<anonymous
union>::<anonymous>' has no member named
'l'<br>
bx_cpu.sregs[BX_SEG_REG_CS].cache.u.segment.l
= 1; // 64-bit seg<br>
^<br>
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:74:47:
error: 'struct bx_descriptor_t::<anonymous
union>::<anonymous>' has no member named
'l'<br>
bx_cpu.sregs[BX_SEG_REG_DS].cache.u.segment.l
= 1; // 64-bit seg<br>
^<br>
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:80:47:
error: 'struct bx_descriptor_t::<anonymous
union>::<anonymous>' has no member named
'l'<br>
bx_cpu.sregs[BX_SEG_REG_SS].cache.u.segment.l
= 1; // 64-bit seg<br>
^<br>
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:101:10:
error: 'class bx_cpu_c' has no member named 'efer'<br>
bx_cpu.efer.set_LMA(1); /* Hack. The old version
we use have doesn't support set_EFER */<br>
^<br>
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:
In function 'int disassembleForAtInSize(void*,
ulong, void*, ulong)':<br>
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:213:52:
error: 'struct bx_descriptor_t::<anonymous
union>::<anonymous>' has no member named
'l'<br>
anx64->sregs[BX_SEG_REG_CS].cache.u.segment.l,<br>
^<br>
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:
At global scope:<br>
/home/rabbit/warren/oscogvm/platforms/Cross/plugins/BochsX64Plugin/sqBochsX64Plugin.cpp:324:39:
error: no 'void bx_cpu_c::TLB_flushNonGlobal()'
member function declared in class 'bx_cpu_c'<br>
void BX_CPU_C::TLB_flushNonGlobal(void)<br>
^<br>
make[1]: *** [sqBochsX64Plugin.lo] Error 1<br>
make: *** [BochsX64Plugin.la] Error 2<br>
<a href="mailto:rabbit@rabbithole:%7E/warren/oscogvm/build.linux32x86/squeak.cog.spur/build$" target="_blank">rabbit@rabbithole:~/warren/oscogvm/build.linux32x86/squeak.cog.spur/build$</a>
mv -f BochsX64Plugin.o BochsX64Plugin.lo<br>
mv: cannot stat ‘BochsX64Plugin.o’: No such file or
directory<br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div>
<div dir="ltr">
<div><span style="font-size:small;border-collapse:separate">
<div>_,,,^..^,,,_<br>
</div>
<div>best, Eliot</div>
</span></div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</div>
</blockquote>
</blockquote>
<br>
</div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>