nemmi69
Posts: 46
Joined: Tue Jan 10, 2012 11:49 am

Re: Gambas

Wed Apr 18, 2012 7:48 am

I can tell I am a newbie. I have downloaded Gambas 3 but now I have 2 issues.

1- How do I get it to work in QEMU

2- How do I get it on to the Raspberry itself

PS It's arrived so ready to play with it!

nemmi69
Posts: 46
Joined: Tue Jan 10, 2012 11:49 am

Re: Gambas

Mon Apr 23, 2012 2:27 pm

Hmmmm not getting a lot of help here...

User avatar
[email protected]
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Gambas

Mon Apr 23, 2012 2:38 pm

nemmi69 said:


Hmmmm not getting a lot of help here...



I did have a quick look at GAMBAS2, but it wanted to pull in dozens of packages just to install and I ws running out of time at the time, so I gave it a miss.

Do you have a particular interest in GAMBAS or just BASIC in general? (if the latter, want to try my BASIC?)

Gordon
--
Gordons projects: https://projects.drogon.net/

tech_monkey
Posts: 130
Joined: Fri Mar 09, 2012 6:12 pm

Re: Gambas

Mon Apr 23, 2012 5:56 pm

I think a segmentation fault might be something to do with memory. Or a program it is dependent on isn't there.

Can't remember exactly.

Try the lld command.

This will list all the dependencies for a program. If you type Gambas to run Gambas then the syntax for the command is

lld Gambas

Hope this helps
http://www.casatech.eu

User avatar
[email protected]
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Gambas

Mon Apr 23, 2012 6:08 pm

tech_monkey said:


I think a segmentation fault might be something to do with memory. Or a program it is dependent on isn't there.


It's (almost always) due to a program that has tried to access memory that doesn't belong to it.


Can't remember exactly.

Try the lld command.


ldd - it will list a programs library dependancies. However a program will not start to run unless all the dependancies are met.


This will list all the dependencies for a program. If you type Gambas to run Gambas then the syntax for the command is

lld Gambas

Hope this helps


I suspect there is a bug in Gambas thats not showing up in the x86 version, but is apprent in the ARM version - so it will probably take the original developer of it to look and work out what's wrong with it and fix it.

Gordon
--
Gordons projects: https://projects.drogon.net/

tomtor
Posts: 44
Joined: Sun Apr 08, 2012 2:19 am
Contact: Website

Re: Gambas

Mon Apr 23, 2012 6:26 pm

I looked at gambas2 both on my Ubuntu i386 and my N800 arm computer.

gambas2 is not a standard executable. It symlinks to gambas2.gambas:

#! /usr/bin/env gbr2

~^Qħ^B^@^@^@8^@^@^@<88>Ù"^@Áô"^@Ó^A^@^@# Gambas Project File 2.0
# Compiled with Gambas 2.21.0 (r3065)
Title=Gambas 2
Startup=Project

….etc…

So it will start the gbr2 executable with the gambas2.gambas as project file.

I tried copying and editing the gambas2.gambas to get a standalone

project file (so I could use gdb to trace the gbr2 program), but running

gbr2 complained about an invalid or missing project file.

When you execute on the arm computer:

strace gambas2

then you can see that it loads lots of libraries and the trace ends with:

lstat64("/usr/lib/gambas2/gb.qt.gambas", {st_mode=S_IFREG|0755, st_size=14477, …}) = 0
open("/usr/lib/gambas2/gb.qt.gambas", O_RDONLY) = 6
fstat64(6, {st_mode=S_IFREG|0755, st_size=14477, …}) = 0
mmap2(NULL, 14477, PROT_READ, MAP_PRIVATE, 6, 0) = 0x40028000
lstat64("/usr/lib/gambas2/gb.form.gambas", {st_mode=S_IFREG|0755, st_size=1044038, …}) = 0
open("/usr/lib/gambas2/gb.form.gambas", O_RDONLY) = 7
fstat64(7, {st_mode=S_IFREG|0755, st_size=1044038, …}) = 0
mmap2(NULL, 1044038, PROT_READ, MAP_PRIVATE, 7, 0) = 0x41124000
brk(0xb1000)                            = 0xb1000
— SIGSEGV (Segmentation fault) @ 0 (0) —
+++ killed by SIGSEGV +++

So the program starts and runs a while. On the Intel Ubuntu box it runs just fine. It looks like a (minor) bug in gamba itself, but is hard to debug unless

I get some hints how to run a small and trivial gamba program instead

of the full gamba2 IDE.

tomtor
Posts: 44
Joined: Sun Apr 08, 2012 2:19 am
Contact: Website

Re: Gambas

Tue Apr 24, 2012 4:35 am

I made a small Hello program and it works on armel Debian Squeeze.

What I did:

Create a small program in gamba2 on Ubuntu 11.10 (Amd64 bit)

Create a gamba2 executable from it (IDE button)

transfer the "hello.gambas" file to the Arm device

=====

[email protected]:~$ ./hello.gambas
Hello
[email protected]:~$ cat hello.gambas
#! /usr/bin/env gbr2

~?8??# Gambas Project File 2.0
# Compiled with Gambas 2.22.0
Title=hello
Startup=MMain
Version=0.0.1

====

So a simple program runs just fine

Next step, a gtk program. This segfaults with a null pointer just like gamba2:

open("/usr/lib/gambas2/gb.form.gambas", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0755, st_size=1044038, …}) = 0
mmap2(NULL, 1044038, PROT_READ, MAP_PRIVATE, 5, 0) = 0x40fc0000
brk(0xb0000)                            = 0xb0000
— SIGSEGV (Segmentation fault) @ 0 (0) —

So, something goes wrong in the Form module. I filed a bug report for the

developer:

http://code.google.com/p/gamba.....ail?id=242

nemmi69
Posts: 46
Joined: Tue Jan 10, 2012 11:49 am

Re: Gambas

Tue Apr 24, 2012 6:52 am

Still no idea as to how to get Gambas across to the Raspberry if I download it in windows. I have a Raspberry sitting idle as I have no clue how to get things started apart from booting it up on the SD card with the process I followed for Debian.

Chris.Rowland
Posts: 239
Joined: Thu Jan 12, 2012 5:45 pm

Re: Gambas

Tue Apr 24, 2012 8:26 am

tomtor's analysis is that there's a bug in the ARM version of Gambas. He's reported it to the developer and from what I can see that's all that can be done unless somebody else is up to debugging the code.

So the answer is to use something else until it's been fixed.

YoungJules
Posts: 14
Joined: Thu Jan 26, 2012 12:13 pm

Re: Gambas

Tue Apr 24, 2012 8:42 am

Oh nemmi69 I'm sure you're not alone!

I think there will be a lot of people rushing to buy the Pi, then realising it's a bit more technical than they thought.  As a general rule, if you're running Windows, the Pi is probably not for you

Of course if you're already fed up with it and want to find a good home for it... just let me know

User avatar
[email protected]
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Gambas

Tue Apr 24, 2012 8:51 am

nemmi69 said:


Still no idea as to how to get Gambas across to the Raspberry if I download it in windows. I have a Raspberry sitting idle as I have no clue how to get things started apart from booting it up on the SD card with the process I followed for Debian.



Maybe you need to start with something else. ie. Forget programming and start "using". Login to the Pi, startx then see what you can find.

So you have a windows machine and a Linux machine - there is a huge world of resources out there about learning Linux (and unix in-general).

If you want to program on the Pi in BASIC, login to it and type 'brandy' if it's not installed, then sudo apt-get install brandy and off you go.

I'm going to package up my own BASIC by this weekend once I've ironed out some issues to do with running it in composite video mode.

Gordon
--
Gordons projects: https://projects.drogon.net/

tomtor
Posts: 44
Joined: Sun Apr 08, 2012 2:19 am
Contact: Website

Re: Gambas

Wed Apr 25, 2012 5:13 am

A small update. Although I'm not interested in programming gambas basic myself, I'm currently building gambas3 to see if it runs on the Pi.

If not I'll try to debug it and give the feedback to the developer....

nemmi69
Posts: 46
Joined: Tue Jan 10, 2012 11:49 am

Re: Gambas

Wed Apr 25, 2012 5:57 am

Well the problem with something else is I still dont know how to move a program from the pc to the Rasberry

tomtor
Posts: 44
Joined: Sun Apr 08, 2012 2:19 am
Contact: Website

Re: Gambas

Wed Apr 25, 2012 7:01 am

nemmi69 said:


Well the problem with something else is I still dont know how to move a program from the pc to the Rasberry


If you mean how to move files between a Windows-PC and the Pi then this question should be posted in the beginners forum section, but I'll give you my suggestions.

You don't provide much info but I assume your Pi and Windows-PC are connected to the same local ethernet and you know your username and password to log into the Pi when you connect a keyboard and a screen.

I don't have a Pi myself, but I believe that if you are running the Debian image than the ssh server program is running on the Pi by default (if not someone will correct me).

Let's assume that you are sitting behind your Windows-PC and that you have no screen/keyboard attached to the Pi. (You are running it headless as a server).

You can install the winscp program (http://en.wikipedia.org/wiki/WinSCP) to copy files from/to the Pi.

Another handy program to install on Windows is putty (http://the.earth.li/~sgtatham/...../putty.exe) so that you can login into your Pi from your Windows PC.

nemmi69
Posts: 46
Joined: Tue Jan 10, 2012 11:49 am

Re: Gambas

Wed Apr 25, 2012 9:24 am

Thanks that sounds promising. Can the link be via USB between the pc and Raspberry?

tomtor
Posts: 44
Joined: Sun Apr 08, 2012 2:19 am
Contact: Website

Re: Gambas

Wed Apr 25, 2012 11:12 am

nemmi69 said:


Thanks that sounds promising. Can the link be via USB between the pc and Raspberry?


No, not in an easy standard way. You'll need ethernet. If you don't have that then I suggest using a USB-memory stick to transfer the files, just as you would do between two window PCs.

nemmi69
Posts: 46
Joined: Tue Jan 10, 2012 11:49 am

Re: Gambas

Wed Apr 25, 2012 2:39 pm

Thanks for that, I will go for the USB stick

tomtor
Posts: 44
Joined: Sun Apr 08, 2012 2:19 am
Contact: Website

Re: Gambas

Thu Apr 26, 2012 4:19 am

I did locate the bug which caused the gamba segfault problem.

Those who are interested can find the cause and solution in the problem report

http://code.google.com/p/gamba.....ail?id=242

If there is interest then I'll try to create a .deb package. That will take some time because I've no experience with that.

For those in a hurry I suggest compiling from source, that's a nice exercise for your new Pi

charlesg
Posts: 2
Joined: Fri Apr 27, 2012 10:46 am

Re: Gambas

Fri Apr 27, 2012 12:00 pm

Hi

I would recommend you put your efforts into running Gambas3. Gambas2 will not be developed any further. Benoit Minisini, the creator of Gambas, has done some work and (as of yesterday) has got Gambas3 running on QEMU ARM.

He is very keen to have somebody with a Pi to carry this forward.

http://old.nabble.com/Gambas-3-runs-on- ... 54003.html rgds

tomtor
Posts: 44
Joined: Sun Apr 08, 2012 2:19 am
Contact: Website

Re: Gambas

Fri Apr 27, 2012 12:12 pm

charlesg said:


I would recommend you put your efforts into running Gambas3.



Yes, I suggested Benoit to use QEMU in the problem report:

http://code.google.com/p/gamba.....ail?id=242

and I compiled/fixed Gambas3 (not Gambas2).

Speed is quite decent on a 400Mhz ARM, so it will work ok on the 700Mhz Pi.

charlesg
Posts: 2
Joined: Fri Apr 27, 2012 10:46 am

Re: Gambas

Fri Apr 27, 2012 12:24 pm

Sorry Tomtor, did not mean to tread on toes!

If somebody has a screen image of Gambas3 running on Pi it would be very cool.

tomtor
Posts: 44
Joined: Sun Apr 08, 2012 2:19 am
Contact: Website

Re: Gambas

Fri Apr 27, 2012 1:04 pm

I'm currently building and packaging Gamba3 for the Pi but Gamba2 looked like this on my N800:


tomtor
Posts: 44
Joined: Sun Apr 08, 2012 2:19 am
Contact: Website

Re: Gambas

Fri Apr 27, 2012 6:54 pm

I made an initial Debian package for Gambas3 for those who want to test it on their Pi:

http://tomv.home.xs4all.nl/ras....._armel.deb

Chris.Rowland
Posts: 239
Joined: Thu Jan 12, 2012 5:45 pm

Re: Gambas

Fri Apr 27, 2012 8:25 pm

Sorry if this appears a silly question but how do you install it?

I know about using synaptic/aptitude to install packages from the official distribution but not installing from a stand alone program.

User avatar
SN
Posts: 1014
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
Contact: Website

Re: Gambas

Fri Apr 27, 2012 9:20 pm

tomtor said:


I did locate the bug which caused the gamba segfault problem.

Those who are interested can find the cause and solution in the problem report

http://code.google.com/p/gamba.....ail?id=242

If there is interest then I'll try to create a .deb package. That will take some time because I've no experience with that.

For those in a hurry I suggest compiling from source, that's a nice exercise for your new Pi


thanks for that - I will revisit this, I assume its the redefinition of those two functions in config.h that fixes it - for me I prefer gamabas2 over gambas3 because its closer to VB5/6
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?

Return to “Other projects”