A Bare Metal Raspberry Pi Course
Written by Harry Fairhead   
Saturday, 27 October 2012

Although this short course is billed as "Baking Pi - Operating System Development" it is more realistically about bare metal programming in ARM assembly language. That is, programming without the help of an OS.

This is a course designed to explain the real basics of computing - there is nothing between you and the hardware. You write an ARM assembly language program and a basic loader gets it running on the Raspberry Pi.

raspberrypilogo

What you do is generate a machine code file and copy this onto an SD card that has a bootable OS on it. That is, you replace kernel.img with the file that contains your own program. This is one sense in which you are writing an OS - your program runs in place of the OS.

Initially the program simply flashes an LED - but not by calling provided subroutines. Instead you program the hardware chip, the GPIO controller, directly.  From here there are a few more lessons using the LED and then the built-in timer is described. Fun with the LED culminates in a Morse code flasher.

From here we move on to programming direct to the screen. This is more than just working with a memory-mapped graphics facility. The graphics chip is as powerful as the CPU and so working with it is a little more complicated.  Several lessons work up from random dots to text.

The final two lessons deal with working with input devices. The first of them starts off with an admission that programming this sort of input from scratch is tough and so some libraries are used to make it easier. I can understand the student being slightly let down at this point, but it is how things are done in the real world. You don't write a USB library if one is available, even if you are building an OS. At the end of the two lessons you have a keyboard and screen program that can be used as a dumb terminal.

The tools used are the YAGARTO ARM assembler hosted by Eclipse on Windows, Mac or Linux. The instructions on how to set up the tools are not particularly detailed and, if you have any problems with the course, it will be getting the assembler up and running.

Overall this looks like a good way to get back to basics, and a Raspberry Pi is cheap enough to buy one to just play with ARM assembler.

Great fun.

raspberrypilogo

More Information

Baking Pi - Operating Systems Development

Related Articles

MagPi - A Raspberry Pi Magazine

Raspberry Pi Stampede

Raspberry Pi or Programming - What shall we teach the children?

Learn 6502 Assembler The Easy Way

Inside the Computer - Addressing

Learn assembler for free

 

blog comments powered by Disqus

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.

 

Banner


New Version of OpenCV in Alpha
02/09/2014

The OpenCV team has announced OpenCV 3.x. Changes include a move to core plus plugins architecture, a lot of new functionality and optimizations that deliver a substantial speedup.



Intel RealSense - What Can YOU Do With It?
08/09/2014

There is still time to come up with an idea that could win you big bucks in the Intel RealSense App. If you want inspiration there is now plenty on offer and you can also reserve a RealSense developer [ ... ]


More News

Last Updated ( Saturday, 27 October 2012 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.