Raspberry PI and Beaglebone Black.
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Raspberry PI and Beaglebone Black.
FreeBASIC for Raspberry PI and Beaglebone Black can be found here
http://www.freebasic.net/forum/viewtopi ... =5&t=21433
I got my Raspberry Pi and the BeagleBone black today.
Paspberry PI:
ARM® 700 MHz 512 MB, OpenGL ES, SDCARD, analog VIDEO + AUDIO, digital HDMI + AUDIO, USB 2.0, GPIO's, Ethernet 10/100
Beaglebone Black:
ARM® 1 GHz 512 MB, OpenGL ES, 2GB memory disk, microSDCARD digital microHDMI + AUDIO, USB 2.0, GPIO's, Ethernet 10/100
I'm off for 2 days now ;-)
Joshy
http://www.freebasic.net/forum/viewtopi ... =5&t=21433
I got my Raspberry Pi and the BeagleBone black today.
Paspberry PI:
ARM® 700 MHz 512 MB, OpenGL ES, SDCARD, analog VIDEO + AUDIO, digital HDMI + AUDIO, USB 2.0, GPIO's, Ethernet 10/100
Beaglebone Black:
ARM® 1 GHz 512 MB, OpenGL ES, 2GB memory disk, microSDCARD digital microHDMI + AUDIO, USB 2.0, GPIO's, Ethernet 10/100
I'm off for 2 days now ;-)
Joshy
Last edited by D.J.Peters on Jan 30, 2014 16:27, edited 6 times in total.
Re: [offtopic] I got my brand new toys.
The Cubieboard or MarsBoard may also be of interest. They each have 1 SATA port on board. The specs of the MarsBoard are pretty impressive, running at 1.2 GHz and 1GB of DDR3 RAM.
Unfortunately, they are probably not as well supported as RPi or Beaglebone.
My dream is to one day program Cortex-M3 microcontrollers with FreeBASIC.
Have fun, Joshy!
Unfortunately, they are probably not as well supported as RPi or Beaglebone.
My dream is to one day program Cortex-M3 microcontrollers with FreeBASIC.
Have fun, Joshy!
Re: [offtopic] I got my brand new toys.
I don't have any of these gadgets myself, just an old box from Ebay.
But if I did buy one, I certainly wouldn't take it to pieces as D.J.Peters has done, on the first day.
But if I did buy one, I certainly wouldn't take it to pieces as D.J.Peters has done, on the first day.
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: [offtopic] I got my brand new toys.
All works fine here. (HDMI, 3D only on Raspberry PI, Audio, NET, USB etc.)
After a "hello_world.c" and some OpenGL ES test's I learn ARM assembler now.
I use code::blocks and geany as IDE (same as on Win32 and x86 Lnux)
Porting the FB runtime for ARM linux devices should be possible all dev packages are the same as on a x86 Linux box.
The problem is the ARM code emitter for fbc.
OpenGL on the PI can't run in a window it's a kind of fullscreen indepent from current window manager
so ScreenRes() will ignore width,height and depth and ScreenInfo() can return the current resolution and depth.
None OpenGL modes are libX11 stuff same as on x86 lnux.
@DKL
Can FB compile it self if you compile it self with -gen gcc ?
Joshy
After a "hello_world.c" and some OpenGL ES test's I learn ARM assembler now.
I use code::blocks and geany as IDE (same as on Win32 and x86 Lnux)
Porting the FB runtime for ARM linux devices should be possible all dev packages are the same as on a x86 Linux box.
The problem is the ARM code emitter for fbc.
OpenGL on the PI can't run in a window it's a kind of fullscreen indepent from current window manager
so ScreenRes() will ignore width,height and depth and ScreenInfo() can return the current resolution and depth.
None OpenGL modes are libX11 stuff same as on x86 lnux.
@DKL
Can FB compile it self if you compile it self with -gen gcc ?
Joshy
Last edited by D.J.Peters on Aug 31, 2014 18:41, edited 2 times in total.
Re: [offtopic] I got my brand new toys.
Yea, -gen gcc can be used to rebuild fbc itself. In fact I consider -gen gcc more stable than the x86 ASM backend now, because of the unsolved bugs in the ASM backend...
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: [offtopic] I got my brand new toys.
Hello dkl
if you compile fbc to c code does we get one large c and h file
or does every bas file creates it`s own c file ?
Does the c version of fbc use only the static fb runtime libs or the libc from host ?
Joshy
if you compile fbc to c code does we get one large c and h file
or does every bas file creates it`s own c file ?
Does the c version of fbc use only the static fb runtime libs or the libc from host ?
Joshy
Re: [offtopic] I got my brand new toys.
fbc source code is split into many *.bas modules, there will be one *.c file generated for each *.bas, just like for the *.asm backend.
-gen gcc output has the same dependencies like -gen gas output. It will depend on libfb/libfbmt/libfbgfx, which in turn depends on libc/libpthreads/etc.
-gen gcc output has the same dependencies like -gen gas output. It will depend on libfb/libfbmt/libfbgfx, which in turn depends on libc/libpthreads/etc.
-
- Posts: 5494
- Joined: Sep 12, 2005 20:06
- Location: California
Re: [offtopic] I got my brand new toys.
dodicat: I believe Raspberry Pi comes like that. It's a computer for hardware hackers/enthusiasts/students. It has a manual and plenty of available support.
Wow. When did this happen? How about the LLVM backend?dkl wrote:Yea, -gen gcc can be used to rebuild fbc itself. In fact I consider -gen gcc more stable than the x86 ASM backend now, because of the unsolved bugs in the ASM backend...
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: [offtopic] I got my brand new toys.
Hello dkl,
can you support porting fbc to other CPUs ?
would be cool to have fbc as a bundle of *.c files
so far i know we need on other cpu architectures:
libfb.a, libfbgfx.a, libfbmt.a
but was it with the linker stuff ?
crt2.o, crtbegin.o, crtend.o, ...
sorry for my noob questions.
Joshy
can you support porting fbc to other CPUs ?
would be cool to have fbc as a bundle of *.c files
so far i know we need on other cpu architectures:
libfb.a, libfbgfx.a, libfbmt.a
but was it with the linker stuff ?
crt2.o, crtbegin.o, crtend.o, ...
sorry for my noob questions.
Joshy
Re: [offtopic] I got my brand new toys.
Do it yourself! Execute (best with fbc-0.9) in folder src/compilerD.J.Peters wrote:would be cool to have fbc as a bundle of *.c files
- fbc -r -gen gcc *.bas
fbgfx is NOT a must-have (AFAIK), you can use SDL, GDK or others.D.J.Peters wrote:so far i know we need on other cpu architectures:
libfb.a, libfbgfx.a, libfbmt.a
But either fb or fbmt are mandatory. They should compile with gcc on any system.
These are parts of the C build system. They should come with the system.D.J.Peters wrote: but was it with the linker stuff ?
crt2.o, crtbegin.o, crtend.o, ...
In the above described way I managed to compile all *.o files (compiler & rtlib) and to build the libfb.a and libfbmt.a native on Angström. But, I couldn't link them yet (The original makefile uses fbc. I'm not familar with alternatives, ld or gcc).
Any help is welcome.
Re: [offtopic] I got my brand new toys.
root@beaglebone:~# ./fbc -version
FreeBASIC Compiler - Version 0.90.0 (06-30-2013) for linux
Copyright (C) 2004-2013 The FreeBASIC development team.
root@beaglebone:~#
Re: [offtopic] I got my brand new toys.
... enough for today.root@beaglebone:~/Projekte/test# cat a.bas
?"My first FreeBasic program on ARM:"
for i as integer = 1 to 9
?i; " line of putput!"
next
?"Voila!!!"
root@beaglebone:~/Projekte/test# ./a
My first FreeBasic program on ARM:
1 line of putput!
2 line of putput!
3 line of putput!
4 line of putput!
5 line of putput!
6 line of putput!
7 line of putput!
8 line of putput!
9 line of putput!
Voila!!!
root@beaglebone:~/Projekte/test#
Re: [offtopic] I got my brand new toys.
hello TJF, would you give a step by step description on how you compiled FB for ARM ?
also give details on any pitfalls and workarounds, I would like compile FB for Mac.
thanks.
also give details on any pitfalls and workarounds, I would like compile FB for Mac.
thanks.
Re: [offtopic] I got my brand new toys.
Well, it happened during September/October after the 0.24.0 release. There were lots of -gen gcc patches coming in at the time, and more until early 2013. Work on the LLVM backend helped the C backend aswell, though after the initial phase of getting excited about it I haven't continued working on it much. But it's still an interesting option, especially to solve the debugging meta data problems with the C backend, and I want to make it work eventually.anonymous1337 wrote:When did this happen? How about the LLVM backend?
Much like TJF said, you can pre-compile the fbc sources (from the src/compiler/ directory) by doing:
and then theoretically copy the .c files over to the target system and compile them with gcc using something like:fbc -target linux *.bas -gen gcc -r -m fbc
That's assuming you have already compiled libfb.a and fbrt0.o on the target system. It will probably need further -l options depending on rtlib dependencies, on Linux for example -lncurses or -ltinfo, and -pthreads.gcc -o fbc -fno-strict-aliasing -frounding-math fbrt0.o *.c -lfb
Just keep in mind that the .c code is not system/architecture/ABI-neutral, so for example .c code generated with -target linux won't work on Win32, and (currently as of FB 0.90) it also contains 32bit assumptions so won't work on 64bit, not to mention that there still is some x86 inline asm used by -gen gcc to implement fast & "properly" rounding (the FB way of rounding) for float <-> integer conversions which won't work on other architectures.
We've started the 64bit port a while ago (i.e. x86_64 Linux/Windows systems, and theoretically other 64bit too), and I'll continue working on it now that the 0.90 release is done. It includes removing the 32bit assumptions from fbc and of course removing any traces of x86 from -gen gcc output. And just overall qualiy improvements of -gen gcc since it will fully rely on it.
While -gen gcc can already be used to port FB to different architectures (only requiring some tiny fixes as of FB 0.90), porting to a different operating system such as MacOSX or Android is more difficult because the rtlib must be ported first (and the gfxlib2 shouldn't be forgotten either) to use the different set of system functions.
Re: [offtopic] I got my brand new toys.
thank you dkl for the information.