PROGRAMMING ON THE RASPBERRY PI: THE RETURN OF CAMBRIDGE STYLE COMPUTING   2 comments

PROGRAMMING ON THE RASPBERRY PI: THE RETURN OF CAMBRIDGE STYLE COMPUTING

RaspberryPi_Logo
The Raspberry Pi logo

This blog is about programming in general, specifically how the Commodore 64 prevented me and millions of other would be programmers from creating any programs which used colour, graphics, or sound, apart from coloured text. These would be programmers either gave up and just played games, bought a package to produce very restricted or limited games, such as “Game Maker” by Activision, “Shoot ’em Up Construction Kit” by Sensible Software/Outlaw, or sold the C64 and bought another computer. Here’s a post which is about how to do programming, but not on the C64.

Finally, in 2012, a computer called the Raspberry Pi was released. This is a computer produced not for profit, linked to Cambridge, with a large range of free open source software. The Commodore C64 culprit Jack Tramiel (the one who laid down the specs, but reused Commodore BASIC V2 for it) must be turning in his grave by now!

Technology has now moved far beyond the situation in 1984, when there was a clear division between home computers and business computers, where owners of “home computers” were usually stuck with whatever dialect of BASIC the manufacturer of their computer built in on ROM or Machine Code/Assembly Language, apart from other Copyrighted languages such as the extended BASICs Turbo BASIC and UltraBASIC on the C64, which couldn’t produce stand alone programs. Also, there seemed to be no books written about most extended BASICs, apart from their accompanying manuals. The vast majority of books written about programming the Commodore 64 were in Commodore BASIC V2 with lots of PEEKs and POKEs, AND 32 OR 8, etc, etc. Business computer users had a choice of languages they could load from disk on their systems running CP/M or MS-DOS, while home computers, largely cassette based, had no such choice. The filthy, lying “The A-Z of Personal Computers” described this as “Cassette OS” but actually it was a ROM based OS and different on each manufacturer’s computers, while “business computers” often just had a “bootstrap program” on ROM which told them to start up by trying to load whatever software was on the disk in their drive if any disk was present and if it was bootable.

SVI-738triThe portable Spectravideo SVI-738 X’Press MSX

Things started to change in 1985, when the Amstrad CPC664, as well as the portable Spectravideo SVI-738 X’Press MSX were released, each aimed at “home users” and equipped with a built in disk drive! Unfortunately, neither of these computers sold many units, because the Amstrad CPC664 was replaced by the CPC6128 after 4 months, while the Spectravideo SVI-738 X’Press suffered from distribution problems. Even so, the CPC664 was the predecessor of the CPC6128, while the Spectravideo SVI-738 X’Press was an MSX1 computer dubbed by some journalists as “MSX 1.5”, due to its built in disk drive, and Yamaha V9938 VDP video chip, enabling an 80 column display. This type of design in the same shaped case as the CPC664 had been used before by the Pied Piper computer, as advertised in the disgusting “The A-Z of Personal Computers”, but the Pied Piper computer was aimed at business users. Amstrad supplied the CPC664 with the ROM based Locomotive BASIC V1.1 and AMSDOS, as well as CP/M 2.2 complete with the language Digital Research LOGO on disk, although sadly CP/M 2.2 usually didn’t support graphics and DR LOGO is the only exception to this which I’ve seen. Spectravideo supplied the SVI-738 X’Press with both MSX BASIC 1.0 and MSX Disk BASIC on ROM, as well as MSX-DOS and CP/M 2.2 on disks. MSX-DOS could run CP/M software, but used MS-DOS type commands and MS-DOS formatted floppy disks. Also in 1985, the Atari ST and Amiga computers were released, with built in disk drives, but these were initially too expensive for “home users” and didn’t have much software available, although they could emulate the IBM PC up to a point.

raspberry_pi_model_b_rev2_13The basic Raspberry Pi Model B computer, which allows users to choose their own case, keyboard, and mouse

I’m proud to tell you that, apart from several classic computers, I also own a Raspberry Pi computer! I was fascinated to see the first news about the planned release of the Raspberry Pi in an edition of the TV series BBC Click in 2011 or 2012, before its release in 2012. The people behind the project include Dave “Elite” Braben, who learnt to program in BASIC and 6502 Assembler on an upgraded Acorn Atom, creating 3D vector graphics, before moving on to a BBC Micro. This experience enabled him to learn to program in 6502/6510 Assembler on the C64, but if he’d started out on a C64 I think he’d probably have given up. I don’t know if he ever used the crappy Commodore BASIC V2 on the C64 at all, apart from LOAD “filename”,8 , SAVE “filename”,8 , RUN and the totally insane LOAD”$”,8 followed by LIST instead of CAT, DIR, or FILES. The Raspberry Pi project is about encouraging people to study programming again. Dave Braben mentioned in an interview about the Raspberry Pi project a lot of the same attitude as that behind the original BBC Micro and Sinclair ZX Spectrum computers. The whole project has links to Cambridge and the attitude surrounding that area where lots of groups in the early 1980’s were struggling to make the best BASIC possible, incorporating features from Pascal, instead of reusing a 1977 BASIC like Jack Tramiel did with the Commodore 64. The situation immediately before the Raspberry Pi launched was that most people had forgotten about or never even done any programming, thanks to the lack of any programming language being supplied with PCs or Macs, the lack of any real alternative to PCs or Macs, although Linux was an alternative OS, and the emphasis on the Internet, telecommunications, “comms”, or “telecomputing” as it used to be called, to the virtual exclusion of any other activities on a computer. To compute means to work things out, not to communicate! Computer or IT classes ended up just teaching people how to use popular Microsoft Windows software such as Excel, Word, and Powerpoint. Technology has moved on, so the Raspberry Pi seems to only have a bootstrap program on ROM, which loads the file kernal.img from SD card, so users certainly aren’t stuck with just one or two built in or Copyrighted programming languages. Due to the influence of the prototype Xerox Star, the short lived Apple Lisa in 1983-1984, the original amazing Apple MacIntosh released in 1984, as well as the magnificent, multitasking Amiga released in 1985 (all user interfaces which were copied by Digital Research GEM, Microsoft Windows, and Linux), computers nowadays are expected to use a WIMP or GUI interface where users point and click with a mouse, so that’s the normal setup for an OS on the Raspberry Pi, although there are image files that have been created to boot straight into an emulation of the amazing Atari 8 bit or the marvellous MSX2 and MSX2+ computers, greeting the user with an Atari BASIC “READY” or MSX BASIC “Ok” prompt. Of course, I’m looking forward to a Star Trek: The Next Generation style voice control and something like the touch sensitive LCARS Menu interface.

I originally heard on the weekly technology series BBC Click that the Raspberry Pi was going to be supplied with the programming languages BBC BASIC, Python, and Ruby installed on SD card. I had never even heard of Python or Ruby before this. Later on, I was pleased to hear that some versions of classic BASIC interpreters, or emulators such as Sinclair Spectrum BASIC were being produced, as well as emulator packages including Atari, Oric, the Apple ][, and MSX BASIC. This makes the Raspberry Pi an ideal platform for programming!

To recap, the Raspberry Pi looks on whichever SD card has been inserted into its slot for a file called kernel.img. It considers this file to be its operating system, no matter what instructions are contained in it. This gets round criticisms of other computers such as it not being possible to bypass their operating systems and “take control” of them. Even Linux OS “gets in the way”. The Raspberry Pi usually runs one or another distro of Linux, but it can just as easily run a very simple program whenever necessary, such as to flash some LED lights, written in ARM Assembler or “hit the metal” for whatever reason, instead of going through an OS. The Raspberry Pi has fairly standard hardware, although four models (A,B, A+, and B+) have now been produced, so programmers don’t have to guess which graphics or sound cards may have been fitted, which would each require their own drivers under MS Windows, Mac OSX, or even Linux. The differences between these models are just the amount of RAM (256K or 512K), whether or not they have an Ethernet port, which size SD card they take, and how many GPIO expansion pins they have.

The Raspberry Pi is marketed mainly for teaching programming, so that’s what most users should be doing with it. It seems that nearly all the software used on it was already available under Linux, but it’s been organised into a syllabus of software that people may never have heard of before. The approved distro is Raspbian with languages such as the pre installed Python, which seems like a simplified interpreted C mixed with BASIC, Scratch, which is a package that can easily create animations and games using built in sprites under mouse and keyboard control using a set of program blocks that can be put together, Wolfram/Mathematica, which seems to be a mixture of yet another object orientated C type language, as well as having access to a database of general knowledge about the World we live in and powerful single commands. For example, I bet Wolfram knows without being told that when Tony Blair was in the House of Commons his left foot was also there, but with most other programming languages the programmer would have to tell them that Tony Blair was a person, who Tony Blair is, and that wherever people in general go, their left feet are sure to follow, unless it was told specifically that Tony Blair’s left foot had been amputated. http://blog.stephenwolfram.com/2014/02/starting-to-demo-the-wolfram-language/ There’s also the software Sonic Pi for inputting and playing “little tunes” like I was desperate to do on my C64. Users can also install Brandy BASIC, a BBC BASIC clone, which may be capable of running all the classic BBC BASIC programs from the BBC Micro, as well as later BBC BASIC V programs from the Acorn Archimedes. The Raspberry Pi even has its own version of RISC-OS which made its début on the classic Acorn Archimedes computer, including BBC BASIC V. Another freely available language is FUZE BASIC, which is part of an electronics project kit, but can be used without buying the kit, based on BBC BASIC and Sinclair Spectrum BASIC, with some extended commands added. http://www.fuze.co.uk/

The Raspberry Pi, with an ARM processor running at 700-900Mhz is far more powerful than 8 bit “home computers” such as the Sinclair Spectrum, BBC Micro, Amstrad CPC, or Atari, while even the Acorn Archimedes computers used ARM processors which only ran at about 8-25Mhz. It can also be used to view Internet websites and HD video, but not Flash because there’s no version of Flash for the ARM processor.

Years ago, I started to learn C on my Amstrad CPC664. It was touted as an amazing language capable of producing programs which would run on any computer that had a C compiler available for it, including the IBM PC and clones, Apple MacIntosh, Amiga, and Atari ST. Unfortunately, I soon found out that the programming techniques I was learning lacked any use of colour, graphics, or sound, which would only be introduced in header files of extended routines, after a considerable amount of time studying C, so it seemed as bad as trying to program on the Commodore 64, plus the complication of correctly placing lots of curly brackets and semicolons, as well as passing parameters to pointers, so I eventually gave up trying to learn C. Python has a widely used library of commands in the popular free extension pygame (which is written about so much it’s more or less standard), which soon enables users to program colour, graphics and sound, unlike in Commodore BASIC V2 on the C64 or C and so far I haven’t seen any curly brackets, or semicolons!

Scratch1The Scratch programming language interface

It seems that Scratch is the easiest programming language available for the Raspberry Pi. It’s by MIT and shows similarities to LOGO, such as the graphics origin in the middle of the screen, a pen down option, and turtle graphics, but including multiple sprites (as in Terrapin LOGO for the Atari 8 bit and C64), a collection of sound effects, as well as backgrounds, controlled by LEGO type building blocks of commands split into several categories for building simple animations and even games, so I’ll be telling you more about Scratch, as well as Python soon!

That’s all for now!

Advertisements

Posted November 25, 2014 by C64hater in Uncategorized

2 responses to “PROGRAMMING ON THE RASPBERRY PI: THE RETURN OF CAMBRIDGE STYLE COMPUTING

Subscribe to comments with RSS.

  1. You couldn’t manage colour on a C64? Did you have a colour monitor?

  2. I didn’t have a colour monitor. I often used a large B&W TV, but that’s not my point. Sometimes I was able to plug into our main rented colour TV, but a few months later, my evil penny pinching Dad sent the colour TV back, then we only had one TV, so I had to wait until no one was watching TV just to use my computer. This was hell during the 1984 Olympics! After that, he had my broken B&W portable TV repaired, so I could use that. These TVs both displayed the C64 colours as different shades of grey, although some colours were difficult to tell apart. The problem with actually programming colour on the C64 was that it had NO COMMANDS for displaying colour. This is the whole point of this blog! To program colour, users had to PEEK and POKE themselves to death! This nightmare started with the two POKEs 53280 and 53281, for border and screen colours.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: