Hi guys,
I've compiled arm-linux-gcj (gcc 4.3.0) with GTK+ AWT peers and now I would like to test a simple graphical application on my embedded box (PXA270, 128MB Ram, with LCD monitor).
Here is the code:
import javax.swing.*;
public class SimpleFrame {
public static void main(String args[]) {
JFrame f = new JFrame("Simple Frame");
f.setSize(200,100);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
}
I moved libgtkpeer.so library to the filesystem of embedded box and all the libraries required by libgtkpeer.so. I've taken these libraries from arm fedora rpms (
http://ftp.linux.org.uk/pub/linux/arm/fedora/pub/fedora/linux/releases/8/Everything/arm/os/Packages/).
Here are the needed libraries:
libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0x00000000)
libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0x00000000)
libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x00000000)
libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x00000000)
libcairo.so.2 => /usr/lib/libcairo.so.2 (0x00000000)
libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x00000000)
librt.so.1 => /lib/librt.so.1 (0x00000000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x00000000)
libm.so.6 => /lib/libm.so.6 (0x00000000)
libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x00000000)
libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x00000000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00000000)
libz.so.1 => /usr/lib/libz.so.1 (0x00000000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00000000)
libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00000000)
libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00000000)
libdl.so.2 => /lib/libdl.so.2 (0x00000000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00000000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x00000000)
libXtst.so.6 => /usr/lib/libXtst.so.6 (0x00000000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00000000)
libc.so.6 => /lib/libc.so.6 (0x00000000)
libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x00000000)
libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00000000)
libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00000000)
libXext.so.6 => /usr/lib/libXext.so.6 (0x00000000)
libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00000000)
libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00000000)
libXi.so.6 => /usr/lib/libXi.so.6 (0x00000000)
libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00000000)
libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00000000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0x00000000)
libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x00000000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00000000)
libgcc_s.so.1 => libgcc_s.so.1 (0x00000000)
libselinux.so.1 => /lib/libselinux.so.1 (0x00000000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00000000)
libpcre.so.3 => /usr/lib/libpcre.so.3 (0x00000000)
libxcb-xlib.so.0 => /usr/lib/libxcb-xlib.so.0 (0x00000000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00000000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x00000000)
ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00000000)
I see that libgtkpeer is using libX11, is this the best choice for an embedded system? Would DirectFB be an alternative? Is there any way to build GTK+ AWT peer for DirectFB?
However I'm getting the following error when I try to run on my embedded box SimpleFrame compiled with gcj:
Warning: Out of Memory! Returning NIL!
I have like 120 MB of free ram when I try to do this.
Using "top" I see that SimpleFrame eats all the ram after loading all the needed libraries (I can see that from strace log).
Do I need to start the X11 server before running the application or do I need any other libraries to run a graphical application from a box without any windowing system?
Can anyone test which is the RAM footprint of SimpleFrame compiled with gcj and GTK+ AWT peers running on an arm box?
I feel like I'm missing something between gtk/glib layer and framebuffer, would anyone clarify this please?
Thank you,
Francesco