Archive for the ‘Raspberry Pi’ Category

Which OS, Which Book?

04 Mar

 

Assembly Language RISC OS Beginners is a perfect place for novices to start learning fow to program ARM machine code on the Raspberry Pi.

Assembly Language RISC OS Beginners is a perfect place for novices to start learning how to program ARM machine code on the Raspberry Pi.

The ability of the Raspberry Pi to run different operating systems is very appealing. It means you can choose a working environment that best meets your computing needs. But it can also lead to issues when it comes to choosing an operating system when you do not necessarily have a lot of experience with any of them. This can be especially galling if the Raspberry Pi is your first foray into the use of computers.

I had a similar problem when I opted to write an introduction to assembly language – which OS? I selected RISC OS because I thought the benefits of using the assembler that is part of BBC BASIC made it an overwhelming choice. Simple, easy, tried, proven.

Although RISC OS has a great support base it doesn’t have the numbers that a more main stream OS such as Linux and Debian has, and in particular the Raspbian version of the OS that is available for the Raspberry Pi. As I was getting numerous enquires about a Raspbian version of the book I took the plunge and published Assembly Language Raspbian Beginners and then subsequently revised and updated the original Beginners tome and renamed it Assembly Language RISC OS Beginners.

The question I get asked now by those wishing to learn assembly language on the Raspberry Pi is ‘which book should I use?’ I would suggest in the first instance that anyone in this position should spend a few hours looking at both of the operating systems. They are available free and are readily downloaded. Dedicating an SD Card for each one will enable you to try both simply by changing the SD Card. On Amazon the first few chapters of each book of the books are available to view free of charge (more if you ‘join’ and sign-in). Thus you can read the beginning of each book book, try a few examples and start to analyse which one you prefer working with. After all this is going to be your experience.

Here are the appropriate links for the book previews:  RASPBIAN       RISC OS

Both books contain similar information but it is presented differently by necessity of the OS. Thus by the end of either book you will have covered largely the same information and have similar skills. The Raspbian book uses the GCC Compiler (supplied with the SD Card image) to run through all the examples. The RISC OS book starts by using the BBC BASIC Assembler (supplied with the SD card image) and then goes on to show the use of the GCC Compiler (a simple free download from the Desktop). The BBC BASIC Assembler has been around for several decades and is tried and tested. Personally I believe it is the best tool available on the Raspberry Pi to learn assembler. I stress the term ‘learn’. The BBC BASIC Assembler (currently) cannot do everything that the GCC Compiler can do, which is why I cover it later in the book by which stage you will be comfortable with using ARM assembler.

Programming using the GCC Compiler is coverd in both books.

Programming using the GCC Compiler is covered in both books.

Operating system access is also a key consideration. When you are writing assembly language you will want to access routines that will allow you to undertake tasks such as reading input from the keyboard and writing output to the screen. These basic tasks are available in both OS however the level of support for other tasks is infinitely superior in RISC OS.

Support from external sites should also be considered. RISC OS is managed by a single entity and has an excellent forum and documentation (https://www.riscosopen.org/content/). Raspbian is open source and community developed and so is probably less co-ordinated (http://www.raspbian.org/). That said Raspbian has by far the bigger take-up and usage when compared to RISC OS and there is a wealth of information related to Linux & Debian. A look at the posts on the Raspberry Pi Forums will confirm this.

It may seem like I am beating round the bush here, and I probably am. I am a firm believer that RISC OS should have been the default OS for the Raspberry Pi. It is safe, tried and tested, is small quick and easy to use. If you are totally new to using the Raspberry Pi then I would suggest that the RISC OS is the best place to start in relation to the two books. If you are a regular computer user and are familiar with a DOS style environment then I would probably say opt for the Raspbian version of the book, especially if you are planning to learn assembler for more than just educational purposes.

But for your own sanity I would strongly suggest taking the route outlined above – get both operating systems installed on SD cards and work through the early chapters of each book – and let that be a key factor in making your own mind up.

 

Manuscript Completed – long exhale…

23 Oct

 

ROSP RPiThe final daft of my manuscript for ROSP (81,000 words) surged through cyberspace to my editor and beta reader just a few hours ago. Just in time too as I was seriously wilting from the heat and smoke that has descended on Sydney in the past week. Can’t even begin to imagine what it’s like for the fire-fighters who’ve been working around the clock to ensure the safety of those affected – many are volunteers too. Incredible what they do – everyone of them a Hero.

I’ll get a full and hopefully final contents list up on the website shortly, but its pretty much as per the original spec although I have re-arranged some chapters, especially the ones dealing with sound. Over the next couple of posts I’ll go into a bit more detail about the contents of the book.  As I’ve mentioned sound already let me run you through what’s covered here.

Four of the 25 chapters are given over to sound and programming sound on the RPi. This is an area that has really developed in the past year or two. RISC OS was originally launched using an 8-bit system which was really very clever in the way it worked. By RISC OS 3, 16-bit sound was catered for but it still relied on heavily the original 8-bit software.

At home with Sonos - Raspberry Pi Surround Sound. The RISC OS sound system has got serious.

At home with Sonos – Raspberry Pi Surround Sound. The RISC OS sound system has got serious.

In recent years though this has changed, and the release of new software has by-passed the old 8-bit interface such that it is possible to achieve almost anything, including running and mixing several sound streams together or in parallel. The chapters in the book detail how the sound system is pieced together and includes a look at the various *commands and SWI calls that you can use for programming purposes. There are several demonstration programs listed as well.

The RPi has two audio outputs: HDMI – often through an attached HDMI monitor – and 3.5mm jack. These both work effectively and you may also have additional hardware attached. If you want to ensure that your sound system is working correctly then you could load one of the sound examples found in $.Documents.Music on the RISC OS Pi SD Card into the Mastero application (in the Apps folder) and try playing it. It may take a few seconds to buffer and filter through, but once it’s playing you are assured you have a working sound system. Don’t worry if you are not especially musical – it is amazing what you can do with a little knowledge.

Returning to the ROSP book production: the process now is to wait for my editor to return me his marked-up copy of the manuscript and I’ll merge this with comments from my beta reader to create a final file ready for formatting. Still on schedule for a late November publication.

(Not to early to be thinking about Christmas presents you know!)

 

The final weeks to a new book

11 Oct
The cover for RISC OS System Programming

RISC OS System Programming for the Raspberry Pi will be available from Amazon late November.

 

I don’t know about you but this week has been busy. The clocks changed here in Sydney last weekend –  forward an hour – and that always annoys me. I like to start my day early, and the ‘lost’ hour is causing a bit of havoc.

I’ve officially announced my next book – RISC OS System Programming  – which is due out late November, and it’s important that I meet my deadlines to ensure it happens. The feedback from RISC OS users has been great, with words of encouragement via Twitter and my website.  Thanks to everyone who has re-tweeted details as well. If you haven’t seen the announcement head over to www.brucesmith.info or my Facebook page at www.facebook.com/authorbrucesmith

I have one full chapter and about three half chapters left to write, then I will be at what I call the First Draft stage when all the chapters are written and in place. Come Monday, I’ll start going through each chapter reading and editing as I progress. I’m always looking to shorten the text as this normally makes definitions and explanations clearer and more concise.  As the chapters will now be in their final order, I’ll number figures and programs and make sure they are cross-referenced correctly in the body of the text.

I will find that I’ve left a few notes to myself in the text,  normally to remind me to check something I couldn’t at the time I was writing the item. I’ll do the checks and adapt the text accordingly if needed. With this all done I’m at the Second Draft stage. I plan to be at that point come next Tuesday.

I’ll let you know how it goes.

 

The age of the disposable computer has arrived

04 May

 

Is the Raspberry Pi a disposable computer?

Is the Raspberry Pi a disposable computer?

One million and counting. Sales of the Raspberry Pi continue to escalate.  With the availability of the Model A, I for one wouldn’t be at all surprised if the two million mark was hit before the end of this year. This is fantastic news for the Foundation and should ensure that the product remains strong in a market that looks as if it might become increasingly competitive.

What the market has lacked for a long, long time is an inexpensive – cheap – system that is readily accessible and has access to a wide variety of free software.  It would be unfair to bracket the Raspberry Pi as a disposable product but that is almost what it is, and that makes it affordable to everyday people that are intrigued and what to find out more.

Thirty years ago it was the BBC Micro. Although the Beeb wasn’t cheap, it was affordable. And with its user port and other interfaces it was connectable and extendable.  The likes of Amiga’s came and went but they were not designed for their connectivity. The ‘IBM’ and Mac arrived en masse to the market, but ‘office machines’ were not designed to connect-up and so the day of the ad hoc ‘computer hardware tinkerer’ passed, but not because of a lack on interest.

The dominant market now for the Raspberry Pi is interfacing projects.  When my local user group meet, the focus is on hardware projects of all shapes and sizes. There is plenty of expertise on hand and people can achieve some real results in a few hours on any given Sunday.  I have been approached by several publishers to re-invent my 1984 classic (which I am very proud to say is in the Computer Hall of Fame) “Interfacing projects for the BBC Micro” for the Raspberry Pi. A look on Amazon shows many other book projects in print.

A version of the BBC classic may be forthcoming for the Rasperbbry Pi.

A version of the BBC classic may be forthcoming for the Raspberry Pi.

Of the people I know who have Raspberry Pis’, most have three and many have five or six. That puts a slightly different perspective on the distribution of the one million sold. Penetration is perhaps not quite as good as you might think in terms of actual quantity of users. For those who have just the one Raspberry Pi , most intend to get a second or more in the near future.  For the record, I have four.  I use two for programming/interfacing (one running RISC OS the other Raspian) and the other two as media centres.

The Raspberry Pi has become the go-to-board for hardware projects, and I think we will see the Model A sales being snapped up in this sector of the market as an even-lower low-cost controller. Significantly, at the time of writing, demand is continuing to outstrip supplies.

Casual users of the Raspberry Pi  are turning to user groups or Raspberry Jams to get their own interfacing fix.  Recently the Ozberry Pi group in Sydney staged a three-hour meeting that was sponsored by Element 14 where some 40 enthusiasts gathered and worked step-by-step together to attach an LED to their Pis and use a small section of code to flash them on and off.  This simple project wasn’t without issues during the evening and also exposed the attendees to the hard truth that the most simple computer tasks can be very frustrating for even experienced users!

But the smiles on the faces from the attendees who ranged in age from 7 to 70 showed it was worthwhile. The Raspberry Pi is hitting the mark.