Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Cross-compiling 4.4 on ARM

This thread is locked; no one can reply to it. rss feed Print
Cross-compiling 4.4 on ARM
Luiz Cressoni
Member #12,317
October 2010
avatar

Hi all,

I successfully compiled 4.4 n an ARM platform running linux, but I am unable to make it run.

Using the default (empty) allegro.cfg file, allegro_init() returns -1.
Changing the "system=" parameter, it only returns zero when system=NONE. But everything else I try after that returns errors.

The only video driver is fb and it is configured correctly.

Any hint on where shall I start looking for the problem?

Regards,
Luiz

Thomas Fjellstrom
Member #476
June 2000
avatar

Try printing out the allegro_error variable (its a string). It should say what went wrong. Also, compile allegro in debug mode and look for a file called allegro.log.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Luiz Cressoni
Member #12,317
October 2010
avatar

Thomas:

I found out that I built allegro with WANT_LINUX_CONSOLE=no and WANT_MODULES=yes.
After flip both, allegro_init runs OK.

Now, it is set_gfx_mode that is crashing. I followed the code and found that it is unable to open a console.
On init_console() it comes to an "Invalid argument" error here:

/* Get the state of the console -- in particular, the free VT field */
if (ioctl (console_fd, VT_GETSTATE, &vts)) {
uszprintf (allegro_error, ALLEGRO_ERROR_SIZE, uconvert_ascii("VT_GETSTATE: %s", tmp), ustrerror (errno));
close (console_fd);
return 1;

I'm trying to find out why. On the ARM board, I have /dev/tty1 up to /dev/tty63, and /dev/console also.
The graphics driver is fbcon on /dev/fb0. The board runs Qtopia over the framebuffer and I was able to run a small SDL demo also using fbcon (so I guess it is all OK).

Thomas Fjellstrom
Member #476
June 2000
avatar

If you find out, please let us know. The linux console support is not well supported or tested these days.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Luiz Cressoni
Member #12,317
October 2010
avatar

I was able to go a little deeper, and what I found out is that for some reason, /dev/console does not work on this board.

So, forcing the code to seek for a /dev/tty%d apparently worked, but the code is freezing on seteuid().

Commenting the command, if goes crazy while 'fork'ing and detaching the processes.

I'll take a look on the linux kernel to see some details, since the console is not printing on the lcd screen (although I was able to send some graphics to the framebuffer). I guess that it doesn't open a default console or something like that.

I'll post the news when I get any.

Regards,

---------------------------------
Some news:

I had to 'hack' some code, but I now can use graphics. The problem is due to some differences between a regular PC and an embedded board.
I had to bypass init_console() and also wait_for_display.
On the board, I had to call before running my program:

getty 38400 tty1 &
echo 1 > /sys/class/graphics/fb0/state
echo 0 > /sys/class/graphics/fb0/blank

Now, I'm trying to make the mouse works. It's a lcd touchscreen, found on /dev/event0

Calls to "has_event(fd, EV_KEY, BTN_MOUSE)" always returns false. Bypassing the check on open_mouse_device, the pointer works (some calibration neeeded, but ok) but there is no 'mouse click'.

Seems that the events doesn't have the same code. BTN_MOUSE=0x110 and I tested all events and it starts on 0x800 up to 0xfee on this touchpanel.

Connecting an USB mouse, it opens a /dev/event1 and it works perfectly, however.

Go to: