sharpapotheosis
Posts: 58
Joined: Thu May 24, 2012 6:47 pm

Vintage Basic

Tue May 29, 2012 9:19 pm

Now that Haskell is up and running on the Pi, I was hoping (once I receive mine) to get vintage basic compiled and running. Used in conjunction with a python script I found but is on my other computer (I'll get back to you on that one) one could get the Pi running with a basic prompt much like the BBC micro (so I'm told: I'm a college student and have only ever seen a Micro from a distance!)

My eventual dreams are to make an operating system that on boot allows you to choose between a booting to a text only basic interpreter and a python interpreter (and maybe a couple of others). This may be completely beyond me but I have the summer holidays approaching so will need something to do :P

What do people think? Potential pitfalls? Any inspiring suggestions?

User avatar
bigsi111
Posts: 66
Joined: Thu Apr 19, 2012 8:50 am

Re: Vintage Basic

Wed May 30, 2012 12:30 pm

That's a great idea. I do think that Basic is a much under valued language.

Also, any ideas what's happening with the BBC BASIC port?

sharpapotheosis
Posts: 58
Joined: Thu May 24, 2012 6:47 pm

Re: Vintage Basic

Wed May 30, 2012 6:29 pm

I didn't know there was one, though from what I could see when I briefly Googled it, it was an "I wonder if someone will..." rather than any actual progress. If you know otherwise please do tell me, I would be interested to see what they are doing with it.

Got my Pi through today so it shouldn't take me too long unless I run into loads of problems. Just writing Debian to an SD card now :D

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

Re: Vintage Basic

Sat Jun 02, 2012 6:19 pm

The BBC Basic port is called Brandy and is a standard pacakge under Linux (Certianly, it's there under Debian), however it's not been maintained for some time AIUI.

Altererntatively, I have a modern BASIC of my own design which I wrote early this year and is currently very workable and usable for lots of things, in a BASIC sort of manner...

It supports low and high resolution graphics (reminiscent of the Apple II), it also has turtle graphics and sprite handling (although its early days for the the sprite handling). There are high-level looping constructs, named procedures and functions, as well as file handling and other "stuff". I've found it not too hard to hand-translate Apple II or BBC B, or other BASIC programs into it - if you can get them in text format.

Sound is on the agenda - possibly a simple version of the BBC envelope and sound commands.

And although you use line numbers when typing a program into it in interactive mode, if you want to use an external editor, then you don't need line numbers (unless you want to goto or gusub, or restore data to a line number)

I'm in the process of packaging it up - compile from tar.gz is fine for some, but not all, however I'll probably only be able to produce Debian packages, so other distros might need some help - unless you go down the unpack/compile route... (it's all GPL)

I did it as a bit of a personal project last year and the Pi wasn't originally on the agenda, but when I got intersted in the PI, I got it running under Qemu quickly, and it just worked on a real one. I've had some issues making it run on the console directly (no X needed), but I think I've solved all that.

I can also control remote Arduinos and the local GPIO pins from a BASIC program too..

I've also done a proof-of-concept to get a Pi to boot directly into BASIC - about 5 seconds from turn-on, but it'll depend on just how much other "stuff" you want going - e.g. network, usb, etc.!

Will see if I can get a package ready by the end of the bank holiday weekend!

(Although for the very keen, http://unicorn.drogon.net/rtb/ has both x86 Linux and ARM binarys and some rough examples)


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

User avatar
bigsi111
Posts: 66
Joined: Thu Apr 19, 2012 8:50 am

Re: Vintage Basic

Sat Jun 02, 2012 7:07 pm

Gordon, that's great to hear, I'll take a look - thanks so much

sharpapotheosis
Posts: 58
Joined: Thu May 24, 2012 6:47 pm

Re: Vintage Basic

Sat Jun 02, 2012 10:38 pm

Oh wow! Ok, it sounds like I needn't bother :P that 5-second boot into a basic prompt sounds exactly like what I had in mind eventually, no networking or fancy stuff, just a prompt. Is there any way of sharing the OS you've made?
Is there a tool to turn your SD card into a .img file that other people can use?

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

Re: Vintage Basic

Sun Jun 03, 2012 8:05 am

sharpapotheosis wrote:Oh wow! Ok, it sounds like I needn't bother :P that 5-second boot into a basic prompt sounds exactly like what I had in mind eventually, no networking or fancy stuff, just a prompt. Is there any way of sharing the OS you've made?
Is there a tool to turn your SD card into a .img file that other people can use?
It's not hard to make a bootable SD card with just my BASCI on it - the image would be under 3MB. (Not quite the 16KB of old though!) However issues to solve... Keyboard mapping - there needs to be enough Linux in there to know which keymap to use. Storage - One idea is just to have a single fat32 partition - and store to the local SD card, rather than network, however being on the 'net might be handy and providing something like load from a web server to get demos is on the cards (load http://server/test1 sort of thing) So a bit of networking, but that can be optional. Network also for time of day (NTP). Also a way to edit config.txt - some displays will need overscan, some not, etc. although that can be done on any PC that can readwrite SD cards if needed.

I've somehow managed to get myself involved in some little street party today, so might not have much time to work on it today, but we'll see.

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

DavidMS
Posts: 139
Joined: Fri May 25, 2012 8:48 pm
Contact: Website

Re: Vintage Basic

Sun Jun 03, 2012 9:06 am

If the weather with you is anything like it is in Bucks at the moment I would stick inside with a hot coffee and a Rbpi
http://meanderingpi.wordpress.com/
11 Raspberry Pi's and counting....

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: Vintage Basic

Sun Jun 03, 2012 2:24 pm

[email protected] wrote:It's not hard to make a bootable SD card with just my BASCI on it - the image would be under 3MB. (Not quite the 16KB of old though!)
First, it sounds like a great project and if you have gotten it and linux down to 3mb, i will take my hat off to you.
Can you give any info has to how you tripped it so small (linux kernel that is).
Thanks.
Batteries not included, Some assembly required.

sharpapotheosis
Posts: 58
Joined: Thu May 24, 2012 6:47 pm

Re: Vintage Basic

Sun Jun 03, 2012 5:43 pm

It's now sort of unrelated, but I've managed to install yabasic on my Pi (running Debian). It was fairly simple and I've written an interpreter script in python. I'll release a tutorial tomorrow (once I've written it) for those who want to get an easy and basic basic interpreter running on their Pi now.

Why yabasic instead of vintage basic as originally planned? Because it has fewer dependencies and a less complex installation. Also, I think it offers some graphical capabilities over vintage basic, but I'm not sure.

Hats off indeed to you gordon, I wouldn't even know where to begin on compiling my own linux...

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

Re: Vintage Basic

Sun Jun 03, 2012 6:09 pm

sharpapotheosis wrote:
Hats off indeed to you gordon, I wouldn't even know where to begin on compiling my own linux...
I guess you mean building a distro - well before I went out and got rained on this afternoon, I did some more experiments. I can boot a Pi into BASIC in 4 seconds, and that includes recognising a keyboard, however only a default layout. The difficulties then are what happens when you power down - there's the potential of file system corruption and so on. Also no networking, so no time, nor the possibility of remote file access.
My 2nd go was to edit /etc/rc.local to run BASIC - that works well, and I have it halt the CPU automatically if you 'exit' BASIC - however we're up to 40 seconds boot time as Linux goes through all its usual /etc/init.d scripts.
Plan C is to strip Debian down to the barest minimal distribution possible. Currently down to 600MB, but I know I can get it much less than that...

So essentially I'm taking standard Debian (actually, I started with Raspbian, but that's not important) and just started to apt-get purge stuff and I'm not finished yet :)

Watch this space, as they say!
-Gordon
--
Gordons projects: https://projects.drogon.net/

sharpapotheosis
Posts: 58
Joined: Thu May 24, 2012 6:47 pm

Re: Vintage Basic

Mon Jun 04, 2012 3:57 pm

Installing yabasic on the raspberry pi:

Firstly, we need to install the dependencies. This tutorial is assuming you're using the standard debian version. If you're not, there may be some other dependencies you need to install. The first thing we need to do is update our repository listings. Into a terminal, type:

Code: Select all

sudo apt-get update
We then need the xorg and n-curses development. The command:

Code: Select all

sudo apt-get install ncurses-dev xorg-dev
We then need to download the yabasic source from http://www.yabasic.de/. Direct link.

Then navigate to the directory where the download is saved, using the "cd" command. For example, if the file is saved in /home/pi/Downloads, the command would be:

Code: Select all

cd /home/pi/Downloads
We then need to unpack the source, configure and compile it. These are the commands:

Code: Select all

tar xf yabasic-2.763.tar.gz
cd yabasic-2.763
./configure
sudo make install
Note: if yabasic gets updated, you shall need to change the version number.

To check that this has worked, try the command "yabasic" and if it starts, it's working. (You can now press ctrl+C to quit)

Now you've got it installed, I've written a (currently probably not very good) python script that acts as a line interpreter. Download it here.

When you exectue this it presents you with a prompt. You can either begin typing your program (using line numbers) or use these specific commands. "save [filename]" for example "save test.bas" will save the current program buffer in the file "test.bas".

"read [filename]" imports the program in the file into the buffer.

"list" displays the current program buffer, "run" runs the current program buffer, and "quit" exits the prompt altogether.

Also, to write over a line with a mistake in, simply type the corrected line, using the same line number. For example:

Code: Select all

> 10 PRONT "HELLO WORLD"
> RUN
---Error in .temp_file_for_yabasic.bas, line1: syntax error at ""HELLO WORLD""
---Error: Program not executed
> 10 PRINT "HELLO WORLD"
> RUN
HELLO WORLD
>

simplesimon
Posts: 20
Joined: Thu Jun 28, 2012 1:11 pm

Re: Vintage Basic

Wed May 01, 2013 11:10 am

cbmbasic works too. the early version compiles without modification. in the later version just delete the arch lines in the makefile, the raspi's default will be used.

NigelJK
Posts: 65
Joined: Wed Sep 05, 2012 1:44 pm

Re: Vintage Basic

Wed May 22, 2013 7:30 am

Head over to the RiscOS forum (in the Distro's section). RiscOS supports the latest version of (true) BBCBasic, boots to what you want (including to a Basic command line) and is 'simple' in the way of Micros of old.

Squeebles
Posts: 2
Joined: Wed May 29, 2013 6:43 pm

Re: Vintage Basic

Thu May 30, 2013 8:30 pm

i just ran QBasic in rpix86 on my pi. the only downside, and hopefully it's just something that i did, is that rpix86 runs with full cpu usage. :?

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Vintage Basic

Tue Sep 17, 2013 3:29 am

bigsi111 wrote:That's a great idea. I do think that Basic is a much under valued language.

Also, any ideas what's happening with the BBC BASIC port?
As no one else seems to answer your question:

The RISC OS port is actually quite stable at this point. And BBC BASIC has been extended, now the BBC BASIC Assembler has full support for the ARMv6 instruction set, including VFP.

So if you are still interested in this download the current RISC OS SD-Card image from the RPi downloads, flash a new SD and have fun :-) .
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Vintage Basic

Tue Sep 17, 2013 3:33 am

Almost forgot:

There are a couple of different Modules available to add GPIO support to BBC BASIC if you do any HW stuff.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

Return to “Other programming languages”