FreeBasic 0.90.1 for ARM 6 / 7 devices.

Linux specific questions.
D.J.Peters
Posts: 6958
Joined: May 28, 2005 3:28
Location: Germany

FreeBasic 0.90.1 for ARM 6 / 7 devices.

Postby D.J.Peters » Jul 28, 2013 5:37

note: I tested many things but not all.
Of course I compiled fbc many times with fbc
I compiled wxFBE and some of my own stuff (C64, fbRaytracer, 3D software renderer ...)
some user projects e.g. JASC_soccer ...

Report any problems with this version please.

source code (primary for the dev team)
download: fbc-0.91.0-src-minimal.tar.gz
(all source code changes marked with !!!ARM!!!)

ARM7 FreeBASIC tested on Beaglebone Black (BBB)
download: fbc-0.91.0-bbb-ubuntu.tar.gz (precise 12.04)
download: fbc-0.91.0-bbb-debian.tar.gz (wheezy 7.0)
download: fbc-0.91.0-bbb-arch.tar.gz (archlinux ARM)
download: fbc-0.91.0-bbb-angstrom.tar.gz (shipped with the device)

ARM6 FreeBASIC tested on Raspberry Pi (RPI)
download: fbc-0.91.0-pi-raspbian.tar.gz (most used on the PI)
download: fbc-0.91.0-pi-arch.tar.gz (archlinux ARM)
download: fbc-0.91.0-pi-debian.tar.gz (wheezy 7.0)

install it like:

cd $HOME
tar xfj fbc-0.91.0-xxx-yyy.tar.gz
cd fbc-0.91.0-xxx-yyy
sudo ./install.sh -i

In the case your favorite distro has no sudo or the user is disallowed from sudo use the 'su' command instead.
su -c "./install.sh -i"

I self use the '/usr' prefix ./install.sh -i /usr
many distros for small devices don't have a /usr/local folder at all
or /usr/local/bin isn't in the PATH and you have to add /usr/local/lib/freebasic/linux to the linker path also.

For short prefix /usr is safe on all distros I tested in the past.

usage is simple no extra option needed:

fbc yourprog.bas

Of course fbc -o max yourprog.bas is a usefull optimation option.

note: only fbc on angstrom has no oop at the moment !
Sorry but it's a build without the 'supc++' library (no classes nor new / delete ...)

It would be a good idea if some of you could create linux packages for FreeBASIC.
I have no time and the knowledge of the package manager primary apt-get, opkg and pacman.

Joshy


Some test screens for new FreeBASIC ARM visitors :-)

FreeBASIC on the PI with ARM6.
Raspbian
Image
Archlinux
Image

FreeBASIC on Beaglebone Black with ARM7.
Debian wheezy 7.0
Image
Angstrom Linux:
Image
Ubuntu precise 12.04
Image
Last edited by D.J.Peters on May 10, 2015 22:48, edited 5 times in total.
D.J.Peters
Posts: 6958
Joined: May 28, 2005 3:28
Location: Germany

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby D.J.Peters » Jul 28, 2013 20:53

Tip: using GNU ARM assembler with FreeBASIC

Special ARM GNU as directives

file: "function.s"

Code: Select all

.arm                       @ 32 bit mode
.global fb_add             @ make 'fb_add' visible for FreeBASIC
.type   fb_add, %function  @ it's a function

.text                      @ begin of the code segment
.align 2                   @ word boundary

fb_add:                    @ function fb_add(r0, r1) as integer
  add   r0, r0, r1         @ r0 = r0 + r1
  bx    lr                 @ return from function with result in r0

.end                       @ end of assembler listing

file: "test.bas"

Code: Select all

declare function fb_add cdecl alias "fb_add" (byval r0 as integer,byval r1 as integer) as integer

print " 3 + 7 = " & fb_add(3,7)

sleep
#> fbc test.bas -Wa function.s

Happy debugging :-)

Joshy
Last edited by D.J.Peters on Aug 21, 2014 18:23, edited 2 times in total.
onewarmslime
Posts: 6
Joined: Aug 08, 2013 19:44

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby onewarmslime » Aug 08, 2013 19:45

Thanks a lot for this. being able to program my raspberry pi with BASIC really rocks
peck
Posts: 24
Joined: Aug 04, 2005 1:12
Location: Sweden

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby peck » Sep 01, 2013 11:42

I can nothing but agree. This is fantastic. Will this mean that I'll soon be able to compile for MIPS as well? If so, then I guess all my other compilers might as well retire. It would, however, be a nice addition with some examples on how to use the kernel gate with direct inline assembler to access standard functions (such as getuid, sockets etc) without needing to link with libc. :)
TeeEmCee
Posts: 110
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby TeeEmCee » Sep 10, 2013 21:51

There's no reason to think that FB won't work on 32 bit MIPS or any other 32 bit platform (I haven't tried the 64 bit branch). Why don't you try it?
tinram
Posts: 86
Joined: Nov 30, 2006 13:35
Location: UK

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby tinram » Sep 19, 2013 11:36

Amazing Joshy.
Thank you for your effort in this conversion.

On Raspbian, the installer worked perfectly.
Then, to compile with fbc, ld needed its dependencies (ld: cannot find -lncurses):

sudo apt-get install libncurses-dev

(apt swaps to libncurses5-dev, but works)
D.J.Peters
Posts: 6958
Joined: May 28, 2005 3:28
Location: Germany

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby D.J.Peters » Sep 20, 2013 1:44

Hello onewarmslime, peck and tinram thank you for testing.

Looks as if the ARM version pretty stable and should be an official part of FreeBasic.

Joshy
peck
Posts: 24
Joined: Aug 04, 2005 1:12
Location: Sweden

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby peck » Sep 27, 2013 12:50

Support for generating GCC this way will give FB a new boost as well as beat the crap out of competitive compilers as well as it could support other platforms as well. Mindblowing, putting it mildly.

A great help for many people would probably be a live iso with everything needed already since many people lack a native ARM device to run this from. At least a native device with everything needed. Just a thought to boost popularity.
gkaizer
Posts: 1
Joined: Oct 25, 2013 14:37

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby gkaizer » Oct 25, 2013 14:45

hi, is there any future fbc for arm5 (like olinuxino or chumby)? or will it be for arm6/7 only? thanks
mistofeles
Posts: 6
Joined: Sep 26, 2012 21:14

FB 0.91

Postby mistofeles » Nov 08, 2013 19:46

Problem

root@raspi:/home/pasi/FB# fbc -o max eka.bas
Segmentation fault (core dumped)

Built it from fbc-0.91.0-bbb-arch.tar.gz
Raspberry Pi B, 256MB RAM
Arch Linux

Ideas ?
D.J.Peters
Posts: 6958
Joined: May 28, 2005 3:28
Location: Germany

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby D.J.Peters » Nov 09, 2013 19:04

Hello mistofelees,
i'm not at home so i can't test anything on the PI.
But i compiled many things on Arch Linux successful in the past.
Image
By the way fbc compiled fbc self on Arch Linux successful too.

Joshy
leodescal
Posts: 165
Joined: Oct 16, 2009 14:44
Location: Jodhpur, Rajputana, Empire of Aryavart
Contact:

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby leodescal » Jan 27, 2014 18:55

Very nice :). I just tested it on Raspbian running over Qemu. I'll try to port FreeBASIC to powerpc 32 bit, again QEMU would help :D
D.J.Peters
Posts: 6958
Joined: May 28, 2005 3:28
Location: Germany

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby D.J.Peters » Jan 27, 2014 22:23

Hello leodescal, do you mean LinuxPPC or embedded PPC system and is it Big- or Litle- Endian ?
In case of embedded system does it support double and single floating point in hardware also ?

Joshy
leodescal
Posts: 165
Joined: Oct 16, 2009 14:44
Location: Jodhpur, Rajputana, Empire of Aryavart
Contact:

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby leodescal » Jan 29, 2014 17:59

D.J.Peters wrote:Hello leodescal, do you mean LinuxPPC or embedded PPC system and is it Big- or Litle- Endian ?
In case of embedded system does it support double and single floating point in hardware also ?

Joshy

Hi, I am using mac99 as target machine to emulate on QEMU, I think it is Big Endian. I meant LinuxPPC, GNU/Linux Debian for PowerPC to be specific. I currently have working virtual machine for it currently.
There is FreeBSD version for ppc too but I never got success to get it run on QEMU. But I do plan to get a Powerbook G4 in near future, then probably I might get PPC FreeBSD run over it.
marcov
Posts: 2296
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: FreeBasic 0.91.0 for ARM 6 / 7 devices.

Postby marcov » Jan 30, 2014 10:45

leodescal wrote:There is FreeBSD version for ppc too but I never got success to get it run on QEMU. But I do plan to get a Powerbook G4 in near future, then probably I might get PPC FreeBSD run over it.


I installed it on a first gen Mac Mini, and that works. Keep in mind that it is also a matter of drivers, and before you buy, make sure that the components in your Mac are supported.

Return to “Linux”

Who is online

Users browsing this forum: No registered users and 3 guests