EmbeddedRelated.com
Forums

ARM and GNU

Started by Mike_rod January 24, 2009
Hi,
 
I am using an ARM9(AT91SAM9RL64) core and intend to design a GUI for the
Project.
 
I am using Eclipse (along with the yagarto toolchain) for coding. The X
libraries(normally associated with Linux) are a part of this toolchain and
provides various funtions to create objects, etc.
 
I have tried these functions (XDrawlines, XFillPolygon, etc) in
Linux(REDHAT) and got some ideas as to how these functions are to be
used.
 
However, i am a bit lost when i have to implement these functions in the
ARM9. Could you give me a head start as to how to implement these functions
in the ARM9 (note: i don't intend to use the Linux kernel in the ARM, i am
creating a Standalone GUI).
 
I will be using SDRAM (around 8MB) in my application for buffering the
LCD. Oh, btw, i'm using a 240 (RGB) x 320 resoultion LCD in 16 bit mode.
 
Things i know till now:
 
- SDRAM config and use
- LCD config and use
- ARM config and use
- using the Xlib for displaying custom objects.
 
Things i'm confused about:
 
- using the same Xlib in ARM to create to display on the LCD. I have a
confusion over the 'display' data structure that is passed as the first
parameter. What exactly am i supposed to do to set/initialise this
parameter. In the Linux atmosphere, this parameter specifies a connection
to the X-server, and is a pretty hugh data structure containing release,
version, buffer pointers, etc....

Thanks


On Jan 24, 1:36=A0pm, "Mike_rod" <michael_rodrig...@indiatimes.com>
wrote:

> - using the same Xlib in ARM to create to display on the LCD. I have a > confusion over the 'display' data structure that is passed as the first > parameter. What exactly am i supposed to do to set/initialise this > parameter. In the Linux atmosphere, this parameter specifies a connection > to the X-server, and is a pretty hugh data structure containing release,
You sound rather confused. If you are not using an X server, you will not be using Xlib. And if your code is designed around Xlib's APIs, emulating those APIs means rewriting X, which is silly. In fact, as far as the idea of rewriting anything goes: it is a capital mistake to reinvent unnecessary wheels. There are (perhaps literally) millions of different off-the-shelf APIs for implementing a GUI, and the right time to choose which one you're going to use is before you start writing the app. On occasion there are good reasons to use one API for a working demo, then port to a different (generally smaller) system for production, but even in this case, a migration plan should be built into the initial software design to minimize engineering effort and reduce the bug load. In your case, since your application is already written for X, your best option for getting to run on this ARM9 platform is to use a simple framebuffer X server, which requires only that you preinitialize the graphics controller into the appropriate mode. In fact, all the work has most likely been done for you already.
Mike_rod schrieb:
> Hi, > > I am using an ARM9(AT91SAM9RL64) core and intend to design a GUI for the > Project.
...
> However, i am a bit lost when i have to implement these functions in the > ARM9. Could you give me a head start as to how to implement these functions > in the ARM9 (note: i don't intend to use the Linux kernel in the ARM, i am > creating a Standalone GUI).
I have some doubts if X11 for a standalone GUI is the roght choice...
> Things i know till now: > > - SDRAM config and use > - LCD config and use > - ARM config and use > - using the Xlib for displaying custom objects.
X11 is designed to communicate with an X-Server over a network. The X-Server controls the Display (and input-devices...). When you call XFillPolygon(...) the Xlib (X-client) does not much more than asking the X-Server to draw a polygon. Painting the polygon by turning on/off pixels is the server's job.
> Things i'm confused about: > > - using the same Xlib in ARM to create to display on the LCD. I have a > confusion over the 'display' data structure that is passed as the first > parameter. What exactly am i supposed to do to set/initialise this > parameter. In the Linux atmosphere, this parameter specifies a connection > to the X-server, and is a pretty hugh data structure containing release, > version, buffer pointers, etc....
Normaly you don't need to worry about "Display", you can treat it as a handle without looking into it. As far as I remember, Linux-PDAs have GUIs but do not use X11 (Sharp Zaurus, OpenZaurus has(had?) source-codes.). All without warranty, I did not use Xlib for >15 years. Falk
Mike_rod wrote:

> However, i am a bit lost when i have to implement these functions in the > ARM9. Could you give me a head start as to how to implement these functions > in the ARM9 (note: i don't intend to use the Linux kernel in the ARM, i am > creating a Standalone GUI).
I don't think it would be a good idea to use X11. It needs a lot from Linux, e.g. sockets, so you'll have really a lot of work to implement it yourself. If you need a full set of widgets without an OS, you can try this: http://www.wxwidgets.org/about/wxuniv.htm If you need just some graphics output and not many standard widgets, I would use this: http://en.wikipedia.org/wiki/Cairo_(graphics) or this one: http://www.levien.com/libart/ I've tried libart for a playstation portable project some time ago, but was too slow. Both libraries are very easy to port for framebuffer platforms, so you can try it, if it is sufficient fast for your project. If you don't need sophisticated 2D vector oriented drawing functions, you can try one of the many available simple framebuffer libraries: http://www.google.com/search?q=framebuffer+library -- Frank Buss, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de
On 2009-01-24, Falk Willberg <Faweglassenlk@falk-willberg.de> wrote:

> As far as I remember, Linux-PDAs have GUIs but do not use X11 (Sharp > Zaurus, OpenZaurus has(had?) source-codes.).
Both, actually. The Zaurus's factory firmware used Qt embedded which is a Qt port that runs directory on top of a framebuffer. There are other user-developed firware loads that do indeed use X11 on the Zaurus. If you want to use Gtk instead of Qt, there are both X11 and framebuffer backends for that as well. If I were doing an embedded system, I'd avoid X11 if at all possible. -- Grant