Is anyone aware of a FORTH Language distro in the works for RPi ?
GFHumiston@Hotmail.com
FORTH Language for RPi ?
10 posts
- Posts: 1
- Joined: Tue Dec 27, 2011 4:21 am
Not aware of anything specifically for RasPi yet, but I don't see any problem with porting one of the many freely-available versions. Also, there are some Java and JavaScript based Forths which (AFAIK) would not require porting at all. See:
http://www.forth.org/compilers.html
http://www.forth.org/compilers.html
http://pygmy.utoh.org/riscy/ might be fun to port.
- Posts: 1207
- Joined: Sun Sep 11, 2011 2:32 pm
Well there's GForth for a start - a standard package in Debian - many others, I'm sure.
And not a Pi, but cheaper
is the Fignition board - amazing. I saw it being demoed by its creator at the weekend - outputs to composite video done entirely in software on an 8-bit Amel microcontroller.
ok - after sudo apt-get install gforth:
So there you are - just remember, its running bog-standard (Debian) Linux, so if there's a package for it, then it's almost certian it'll run on the Raspberry Pi. (Although it's not a dedicated Forth "distro" as such)
Gordon
And not a Pi, but cheaper
ok - after sudo apt-get install gforth:
gordon @ dot: gforth
Gforth 0.7.0, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
1 2 3 * + . 7 ok
: hi ." Hello, world" ; ok
hi Hello, world ok
So there you are - just remember, its running bog-standard (Debian) Linux, so if there's a package for it, then it's almost certian it'll run on the Raspberry Pi. (Although it's not a dedicated Forth "distro" as such)
Gordon
If you wanted an actual distribution -- ie a standalone Forth environment, then the hard part would be writing the USB and SD card drivers. Those will not exist for any existing Forth distribution and you will probably have to use the Linux drivers as the sole documentation. Porting Forth is trivially easy in comparision.
If all you want is the Forth language running under Linux, then see above.
If all you want is the Forth language running under Linux, then see above.
You could roll your own easily, by porting JONESFORTH. Forth is unique of all others due to its simplicity.
Standalone Forth environment isn't far away if you can get one written at all. Find yourself a copy of ARM Architecture Reference Manual, ARM1176ZF-S Technical Reference Manual, and BCM2835 ARM Peripherals.
Have seen the kernel.img in the SD card image? On bootup it'll be loaded into the address 0x00000000. The image starts with an exception vector table (0x00-0x20). Fill the vector table with branches into correct handlers.
You won't necessarily need those for a toy implementation. And I guess it's same problem for writing any standalone running thing for raspberry.
Standalone Forth environment isn't far away if you can get one written at all. Find yourself a copy of ARM Architecture Reference Manual, ARM1176ZF-S Technical Reference Manual, and BCM2835 ARM Peripherals.
Have seen the kernel.img in the SD card image? On bootup it'll be loaded into the address 0x00000000. The image starts with an exception vector table (0x00-0x20). Fill the vector table with branches into correct handlers.
0x00 Reset
0x04 Undefined Instruction
0x08 Hypervisor Call (Software Interrupt)
0x0C Prefetch Abort
0x10 Data Abort
0x14 Hyp Trap? (not sure what this is)
0x18 IRQ interrupt
0x1C FIQ interrupt
...the hard part would be writing the USB and SD card drivers...
You won't necessarily need those for a toy implementation. And I guess it's same problem for writing any standalone running thing for raspberry.
Sorry to resurrect such an old topic. But my Embedded System's students ported this semester Jones Forth to Raspberry PI. Their port is available at https://github.com/M2IHP13-admin/JonesForth-arm and seems pretty stable.
The port uses the linux new EABI for input/output, but it could be a fun project to make a bare-metal standalone version in Raspberry-PI
Pablo.
The port uses the linux new EABI for input/output, but it could be a fun project to make a bare-metal standalone version in Raspberry-PI
Pablo.
- Posts: 1
- Joined: Thu Feb 21, 2013 1:03 pm
I've just had printed the 4tH Forth 'compiler' by J.L Bezemer, better known as The Beez: http://thebeez.home.xs4all.nl/4tH/
Google group: https://groups.google.com/forum/?fromgr ... h-compiler
I do have 4tH running on a 'Pi but as yet I'm still struggling with the installation. 4tH is a COMPILER but it will work interactively.
I'm also interested in the GPIO c-libraries such as http://abyz.co.uk/rpi/pigpio/pigpio-v1.tar but I'm a ways from getting anything talking, if at all. I was quite elated when the 'Pi went online and also found My Book network drive.
Google group: https://groups.google.com/forum/?fromgr ... h-compiler
I do have 4tH running on a 'Pi but as yet I'm still struggling with the installation. 4tH is a COMPILER but it will work interactively.
I'm also interested in the GPIO c-libraries such as http://abyz.co.uk/rpi/pigpio/pigpio-v1.tar but I'm a ways from getting anything talking, if at all. I was quite elated when the 'Pi went online and also found My Book network drive.
- Posts: 8
- Joined: Sat Oct 29, 2011 6:19 pm
Hello,
I'am using Gforth with GPIO libraries which you can find here : https://github.com/harrypower/Rpi_Gforth_GPIO.
It has also a assembler/disassembler for arm.
The only trouble I have with the assembler and the Forth is you can only access the virtual memory, so you need the c-libraries for GPIO-access.
A question I have is is there a way to access the GPIO register direct from Forth?
Bye,
Arie
I'am using Gforth with GPIO libraries which you can find here : https://github.com/harrypower/Rpi_Gforth_GPIO.
It has also a assembler/disassembler for arm.
The only trouble I have with the assembler and the Forth is you can only access the virtual memory, so you need the c-libraries for GPIO-access.
A question I have is is there a way to access the GPIO register direct from Forth?
Bye,
Arie
- Posts: 11
- Joined: Mon Jan 28, 2013 2:40 pm
I think the easiest way to access the GPIO ports from *any* program language is to use the kernels "export", "unexport" interface in the "/sys/class/gpio" directory. It should be accessable by normal file operations also in Forth.
I currently don't have a link, but there is at least one example written in c somewhere - so you can see how it works in detail. And there should be a way to get access to GPIO not only by root. But for very fast GPIO operations (like pwm)
another solution has to be found.
good luck!
I currently don't have a link, but there is at least one example written in c somewhere - so you can see how it works in detail. And there should be a way to get access to GPIO not only by root. But for very fast GPIO operations (like pwm)
another solution has to be found.
good luck!
- Posts: 57
- Joined: Sun Feb 24, 2013 3:53 am
- Location: Bavaria-Germany