Raspbery Pi Forth Operating System


32 posts   Page 1 of 2   1, 2
by pilotrhk » Wed Mar 20, 2013 12:59 am
Raspberry Pi Forth Operating System is available on GitHub: https://github.com/aviatorRHK/rpiForth
The rpiForth will grow to include:
1. A file system on the SD card.
2. A text editor to write stored programs to load. ( no more host assembler ).
3. A forth ARM assembler, to write high performance forth words.
4. An Interactive multi-tasking operating system, you can fire up a task and let it run while doing other things or run two or more task at the same time.
5. A Floating point package per ANSI.
6. A I2C driver off board chips. Like the MSP430 micro.
How you all will fine some use for this.
Roland aviatorRHK :mrgreen:
Last edited by pilotrhk on Wed Mar 20, 2013 8:19 am, edited 2 times in total.
Posts: 26
Joined: Fri Mar 08, 2013 1:24 am
by tufty » Wed Mar 20, 2013 6:26 am
Roland.

Firstly, excellent.
Secondly, you need to put your license terms up there. As I understand it (but IANAL), you've effectively just put that version into the public domain. In any case, people need to know the conditions under which they can use it.
Posts: 1454
Joined: Sun Sep 11, 2011 2:32 pm
by DexOS » Wed Mar 20, 2013 7:11 am
You seem to have a ; on the end of the link, which is giving a 404
Batteries not included, Some assembly required.
User avatar
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
by pilotrhk » Wed Mar 20, 2013 8:23 am
Thanks the information. I forgot the license information, it was stored out side my source folder. I will have it in the folder shortly.
Roland :mrgreen:
Posts: 26
Joined: Fri Mar 08, 2013 1:24 am
by jum » Wed Mar 20, 2013 2:32 pm
Nice pilotrk, I love Forth, will try your RPi Forth soonest.

I was considering trying to port a very simple Forth I made for the Playstation 1 to RPi, but was put off because I don't know ARM assembly code (PS1 was MIPS code).
.
Posts: 19
Joined: Wed Mar 20, 2013 12:18 pm
by DexOS » Thu Mar 21, 2013 11:38 am
@pilotrhk, you need to adhere to my license, which is
DexBasic version 0.01
Copyright (c) 2012, Craig Bamford.
All rights reserved.

This program is free for commercial and non-commercial use as long as
the following conditions are adhered to.

Copyright remains Craig Bamford, and as such any Copyright notices
in the code are not to be removed.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The licence and distribution terms for any publically available
version or derivative of this code cannot be changed. i.e. this code
cannot simply be copied and put under another distribution licence
(including the GNU Public Licence).
Batteries not included, Some assembly required.
User avatar
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
by u8nc » Thu Mar 21, 2013 1:57 pm
you may be interested to know what this guy has done
( but I think its on top of linux )
http://thebeez.home.xs4all.nl/4tH/
User avatar
Posts: 45
Joined: Mon Mar 05, 2012 7:55 am
Location: Rural Australia
by pilotrhk » Fri Mar 22, 2013 7:47 am
DexOS wrote:@pilotrhk, you need to adhere to my license, which is
DexBasic version 0.01
Copyright (c) 2012, Craig Bamford.
All rights reserved.

This program is free for commercial and non-commercial use as long as
the following conditions are adhered to.

Copyright remains Craig Bamford, and as such any Copyright notices
in the code are not to be removed.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The licence and distribution terms for any publically available
version or derivative of this code cannot be changed. i.e. this code
cannot simply be copied and put under another distribution licence
(including the GNU Public Licence).


Hi DexOS, I posted your notice on GitHib. I am at wits end. I can not get past first base with your code. I always get error 1 on initialization. Been at it for a week and a half. This is forcing me to learn about what is required to communicate. I am back to the books.

Roland pilotRHK --- aviatorRHK :mrgreen:
Posts: 26
Joined: Fri Mar 08, 2013 1:24 am
by pilotrhk » Fri Mar 22, 2013 8:01 am
u8nc wrote:you may be interested to know what this guy has done
( but I think its on top of linux )
http://thebeez.home.xs4all.nl/4tH/


Does it run on Raspberry Pi??

Over the past 40 years I have created 5 to 7 Forths. I developed Forth on target instruments that had an MC68HC11 where all the heads were maintained on the host system and execution code on the target. I was able to to interactively communicate with the target through the host. Those were the days.
Recently, I completed forth on my Linux machine 386 code and MSP430 micro. After I finish this Forth on Bare Metal, I will load it into Raspberry Linux--ARM code. Hey this is fun.
Roland aviatorRHK :mrgreen:
Posts: 26
Joined: Fri Mar 08, 2013 1:24 am
by DexOS » Fri Mar 22, 2013 8:31 am
pilotrhk wrote:
DexOS wrote:@pilotrhk, you need to adhere to my license, which is
DexBasic version 0.01
Copyright (c) 2012, Craig Bamford.
All rights reserved.

This program is free for commercial and non-commercial use as long as
the following conditions are adhered to.

Copyright remains Craig Bamford, and as such any Copyright notices
in the code are not to be removed.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The licence and distribution terms for any publically available
version or derivative of this code cannot be changed. i.e. this code
cannot simply be copied and put under another distribution licence
(including the GNU Public Licence).


Hi DexOS, I posted your notice on GitHib. I am at wits end. I can not get past first base with your code. I always get error 1 on initialization. Been at it for a week and a half. This is forcing me to learn about what is required to communicate. I am back to the books.

Roland pilotRHK --- aviatorRHK :mrgreen:

Thanks, have your run the kernel.img thats in the "Read SD card demo" folder to see if it works with your sd card ?.
You should see
LOAD END
AA550000
If it works and what assembler are you using ?.
Batteries not included, Some assembly required.
User avatar
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
by arieverbeek » Fri Mar 22, 2013 4:11 pm
pilotrhk wrote:
u8nc wrote:you may be interested to know what this guy has done
( but I think its on top of linux )
http://thebeez.home.xs4all.nl/4tH/


Does it run on Raspberry Pi??

Roland aviatorRHK :mrgreen:


Yes 4tH runs on Raspberry Pi, but you cannot access GPIO registers directly.
The nice thing on your Forth is (for me) that you can access GPIO registers direct without the use of C.

I have a problem with your Forth. The function MARKER causes a crash.


Bye Arie
Posts: 12
Joined: Mon Jan 28, 2013 2:40 pm
by arieverbeek » Sat Mar 23, 2013 1:46 pm
Hi Roland,

I compiled your code from git and everything runs fine i saw you repair the marker function.
The only thing I changed was the framebuffer file on Raspberry rev 2.

Thanks,
Arie
Posts: 12
Joined: Mon Jan 28, 2013 2:40 pm
by tgritchie » Sat Mar 23, 2013 2:36 pm
Hello Roland - I have been watching this thread for a while and recently downloaded your current source from github. I have been a Forth enthusiast for 30 years and have also used it professionally on occasion. Nowadays I am considering experimenting with bare metal Forths on the RPi and am very interesting in using your code and/or assisting you if possible. I am particularly interested in the barest of bare metal approaches that one sees from the inventor of Forth Chuck Moore e.g. ColorFORTH. One immediate question springs to mind - How are you building the code? You mention Eclipse and make but I don't see a Makefile in the repository.

Regards
Trevor
Posts: 18
Joined: Fri Jun 01, 2012 4:07 pm
Location: United Kingdom
by pilotrhk » Tue Mar 26, 2013 7:18 pm
tgritchie wrote:Hello Roland - I have been watching this thread for a while and recently downloaded your current source from github. I have been a Forth enthusiast for 30 years and have also used it professionally on occasion. Nowadays I am considering experimenting with bare metal Forths on the RPi and am very interesting in using your code and/or assisting you if possible. I am particularly interested in the barest of bare metal approaches that one sees from the inventor of Forth Chuck Moore e.g. ColorFORTH. One immediate question springs to mind - How are you building the code? You mention Eclipse and make but I don't see a Makefile in the repository.

Regards
Trevor



Hi Trevor,
I used gedit (linux) for most my editing, but I have also used Eclipse. I recently went back to Eclipses, as an Editor, I like it. I have posted my Makefile on GitHub. I it is basicly the save as Alex Chadwick gave it to us except that I have changed the 'Source' to 'git'. This directory is my git repository. Read my README.md file in the repository. I am keeping log on changes I make to the repository.

I like ARM for a FORTH Engine. It is the best processor to run the Forth indirect threaded code I have ran across. This system is fast and when I finally get a multitasking system installed, It will make the Ardino a pain in the ass.

Hope you dig in and make it work for you.
Roland :mrgreen:
Posts: 26
Joined: Fri Mar 08, 2013 1:24 am
by pilotrhk » Tue Mar 26, 2013 7:21 pm
arieverbeek wrote:Hi Roland,

I compiled your code from git and everything runs fine i saw you repair the marker function.
The only thing I changed was the framebuffer file on Raspberry rev 2.

Thanks,
Arie


Arie,
I am glad that your are using rpiForth. I think there is a lot of super things we can do once we get all the tools in place.
Roland :mrgreen:
Posts: 26
Joined: Fri Mar 08, 2013 1:24 am
by tgritchie » Wed Mar 27, 2013 7:38 pm
pilotrhk wrote:
Hi Trevor,
I used gedit (linux) for most my editing, but I have also used Eclipse. I recently went back to Eclipses, as an Editor, I like it. I have posted my Makefile on GitHub. ....
Roland :mrgreen:


Thanks for that. I note however that the makefile calls up a linker script called linker.ld - I think you need to commit this to github as well for completeness. Also I see a reference to a library which I don't recognise (csud). What is this for?

Cheers
Trevor
Posts: 18
Joined: Fri Jun 01, 2012 4:07 pm
Location: United Kingdom
by jum » Thu Mar 28, 2013 9:51 am
Nice work Roland. (I copied some/most of your rpiBoot files to one of my Raspbian SD cards to test it).

tgritchie wrote:... Nowadays I am considering experimenting with bare metal Forths on the RPi and am very interesting in using your code and/or assisting you if possible. I am particularly interested in the barest of bare metal approaches that one sees from the inventor of Forth Chuck Moore e.g. ColorFORTH. ...Trevor


This is also what I was hoping for, a "minimal" forth. (+ an editor). As an (interactive and easier) alternative to assembler for bare metal stuff.
Posts: 19
Joined: Wed Mar 20, 2013 12:18 pm
by tgritchie » Thu Mar 28, 2013 3:00 pm
tgritchie wrote:
pilotrhk wrote:
Hi Trevor,
I used gedit (linux) for most my editing, but I have also used Eclipse. I recently went back to Eclipses, as an Editor, I like it. I have posted my Makefile on GitHub. ....
Roland :mrgreen:


Thanks for that. I note however that the makefile calls up a linker script called linker.ld - I think you need to commit this to github as well for completeness. Also I see a reference to a library which I don't recognise (csud). What is this for?

Cheers
Trevor


A little googling reveals that the csud library is Alex Chadwick's USB code. Nonetheless I think it would be a good idea to commit this as a relocatable binary so that the Forth system can build *out of the box* as it were

Trevor
Posts: 18
Joined: Fri Jun 01, 2012 4:07 pm
Location: United Kingdom
by pilotrhk » Tue Apr 02, 2013 5:52 am
tgritchie wrote:
tgritchie wrote:
pilotrhk wrote:Hi Trevor,
I used gedit (linux) for most my editing, but I have also used Eclipse. I recently went back to Eclipses, as an Editor, I like it. I have posted my Makefile on GitHub. ....
Roland :mrgreen:


Thanks for that. I note however that the makefile calls up a linker script called linker.ld - I think you need to commit this to github as well for completeness. Also I see a reference to a library which I don't recognise (csud). What is this for?

Cheers
Trevor


A little googling reveals that the csud library is Alex Chadwick's USB code. Nonetheless I think it would be a good idea to commit this as a relocatable binary so that the Forth system can build *out of the box* as it were

Trevor


Yes csud is Alex Chadwick's USB code to access the keyboard. Alex get into to it petty deep and I am not versed in the Details of USB. I will put linker.ld on GitHub, it is petty much as Alex created it.
Roland :mrgreen:
Posts: 26
Joined: Fri Mar 08, 2013 1:24 am
by tgritchie » Wed Apr 03, 2013 7:32 pm
pilotrhk wrote:
tgritchie wrote:A little googling reveals that the csud library is Alex Chadwick's USB code. Nonetheless I think it would be a good idea to commit this as a relocatable binary so that the Forth system can build *out of the box* as it were

Trevor


Yes csud is Alex Chadwick's USB code to access the keyboard. Alex get into to it petty deep and I am not versed in the Details of USB. I will put linker.ld on GitHub, it is petty much as Alex created it.
Roland :mrgreen:


OK - thanks for that but I think you also need to commit the relocatable binary (libcsud.a) along with your code unless you expect folks to build that separately to the Forth system. This is doable (I've just done it :) ) but AIUI the library code is quite general purpose and therefore needs tailoring to the RPi environment. It would result in fewer potential hiccups if the *correct* library were part of your codebase

Trevor
Posts: 18
Joined: Fri Jun 01, 2012 4:07 pm
Location: United Kingdom
by Zenchess » Fri Apr 05, 2013 5:48 pm
How do you use this rpiForth system?
I tried copying and replacing all the files from /rpiBoot into my sd card boot partition, when I booted up my pi I just got a screen with the full color spectrum. Do I need to compile and use the generated kernel.img or is the one that comes with the git repository sufficient?

It was nice, but I was expecting a forth repl. Is that what this is or is it not there yet?

The rest of my sd card contents are composed of the latest raspbian image.
Posts: 2
Joined: Fri Apr 05, 2013 5:43 pm
by Zenchess » Fri Apr 05, 2013 7:38 pm
After trial and error I got RpiForth to work on my pi by using all the files from the csud project.
I also removed the overclocking line in config.txt, not sure if that helped or not.

Can't wait until we can save our FORTH programs :)
Posts: 2
Joined: Fri Apr 05, 2013 5:43 pm
by JfChiu » Sun Aug 11, 2013 12:14 am
Dear All,

Now, I can start rpiForth, but I do not how to use "EDITOR", "FILES", "ROOT",....
Could you give me an example ?

Thank you very much.
Posts: 1
Joined: Tue Apr 02, 2013 2:26 am
by skywalker » Sun Jan 19, 2014 8:56 pm
I just found this thread and thought I'd give this Forth a try.
However, it seems there may be some fiddling to do to get it to work (I see mention of a "csud" library).

Perhaps someone who has been through this process can quickly enumerate the steps to drop the necessary files onto a blank SD card? Thanks.
Posts: 28
Joined: Tue Nov 06, 2012 4:55 am
Location: Vancouver, Canada
by MEmerton » Tue Jan 21, 2014 12:08 am
Hi,

I am attempting to install this for my Father, but being new to C (or C++) I am completly lost. Are there any step-by-step instructions? (or more preferably an SD card image?)

My Father has used Forth from the BBC micro days, through to the Archimedies (ARM 2), and still swears by the language.

He learnt Forth on the Jupiter Ace.

He stumbled across this thread, and asked me for help, as the idea of a Forth for an Operating System on his Pi (with GPIO Access), has re-insipired him to code again, and access hardware outside the Computer world.

I have coded a little Forth, but by nature I am a BBC BASIC coder. This means that I have no idea where to start.

Cheers
Michael.
Posts: 9
Joined: Thu Dec 05, 2013 2:54 pm