Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


Correspondent

Gabriel Evenfire

Host Image
Host ID: 259

email: evenfire.nospam@nospam.sdf.org
episodes: 6

hpr2027 :: Old Engineers and New Engineers

Released on 2016-05-10 under a CC-BY-SA license.

This is a short episode about a puzzle that I got for my birthday from my in-laws. I gave the puzzle to two of my children to solve after I'd taken a crack at it. It was amusing to see see how and old engineer thought about the problem compared with young ones. Pictures of the puzzle are attached. The object is to get one ball in each notch at the end of the block at the same time.

half moon puzzle from side

top view showing bearings in the centre hollow

bearings are at the far rims of the cresent


hpr1859 :: A Mouse in a Maze on the Raspberry PI

Released on 2015-09-17 under a CC-BY-SA license.

This podcast is about a little programming exercise I learned in my first programming class. The idea is to generate a random text-based maze and make mouse ('@') search the maze systematically to find the cheese ('V'). If it does so before it runs out of energy (moves) it wins ('$' == happy mouse). Otherwise it starves ('%' == dead mouse).

You can find my git repos for the Raspberry PI code including this program at these locations:

The Mouse-in-a-maze program also requires the catlib library as well which is at:

You may note that these directories are different from those in my previous RPI episodes. The repositories used to be on gitorious. However since gitlab acquired gitorious, I have migrated the repositories. They currently live on both github and gitlab and I have pushing updates to both for the time being. So I have been waffling about which one will be the ultimate master for these projects. But since, I am doing most all the work on this code myself, it doesn't much matter for the time being.

If this is your first time playing with bare metal programming in the RPI you can get more info and tips from HPR episodes 1619, 1630 and 1666. Note that the gitorious links in those episodes are outdated as mentioned above. The github links therein should still be fine though.

The mouse code itself is in the apps/mouse0 directory. If you haven't played with this environment before you'll need to do the following:

  • Get a compatible ARM toolchain up and running to build for the RPI. I recommend using: https://github.com/dwelch67/build_gcc/blob/master/build_arm
  • You'll need a USB-to-TTL serial cable to hook up to the RPI. I use: http://www.adafruit.com/products/954
  • You'll also need a small SD card to boot from.
  • Follow the steps in catrpi/README.txt to
    • create an SD-card with a loader on it.
    • build catlib for the RPI locally (a prereq for building mouse0.bin)
    • set up your serial connection to the RPI
    • start up a minicom instance to connect to the RPI

Once those prerequisites are taken care of you can:

  • change directory to /path/to/catrpi/apps/mouse0 type make to build
  • mouse0.bin power on the RPI at the loader prompt, type 'x' in the
  • serial console to start X-modem reception on the RPI
  • use your terminal program to send the mouse0.bin file via X-modem. In minicom you do this by CTRL-A followed by 's'. You then select 'xmodem' as the protocol and navigate to and select the file mouse0.bin to send.
  • when the transfer completes type 's' to start the program

These pages describe VT100 Terminal codes:

Sample traversal:

  ########################################
  #+0****## #+#...###...#..$ ##  #  #    #
  ##+###+## #+++......#...# ##       #   #
  # #.+++++#....#   #      #    #      # #
  #  #+++++#+.+..#  #  #          #      #
  #  #.##.+++#+.### #     #   #   ##     #
  #  ###.+.##++.##     #   ###     #   # #
  ####+.#..#++#.##   #      #####   ##   #
  #++#.#.###+.##    ##       ##    #   # #
  #++++++.##.++.#   #  ##     #  # #  # ##
  #+++++#..##.##      ## #  #### # #    ##
  #+.....#..#.  ##   #      #     ##  ## #
  #+..+.......   # #      #      #  ##   #
  #+...#..###       # #  #          ##  ##
  #.#..#.........# # # # ##### # #    ## #
  #.......##  ##....  #        ###   ##  #
  ##......# ##   ##..#  #####          # #
  #.+.#...###    ###. ##          ##  # ##
  ##.+...#  #      ####      #   ##    # #
  ########################################
  Mouse found the cheese!  :)  Press any key to restart!

hpr1666 :: Bare Metal Programming on the Raspberry Pi (Part 3)

Released on 2014-12-22 under a CC-BY-SA license.

This is the third episode in a series on bare metal programming on the Raspberry Pi. This episode rounds out my initial stab at doing a series on RPI embedded programming based on my summer vacation project. This episode discusses how to write code with an eye towards using it in an embedded environment. It continues with a discussion of how coprocessors fit into the ARM architecture. It also describes how to manage coprocessors programatically in a very hackerish way using self-modifying code. Finally, the episode describes how to enable the virtual memory subsystem in the ARM as well as the cache. It includes some performance measurements of my code both with and without the cache enabled.

Here is some of the source material that I reference in this episode. See the previous episode show notes for information on how to get your own bare metal Raspberry Pi setup up and running.

CATRPI

  • Homepage: https://gitorious.org/catrpi
  • Git repo: git://gitorious.org/catrpi/catrpi.git
  • My own repository of code that I wrote during this little project.

Hacker's Delight by Henry S. Warren Jr.

  • http://www.hackersdelight.org/
  • A fantastic book on low level computer mathematics. I find it a joy to read. I cannot recommend it highly enough. It belongs on anyone's shelf next to Knuth and other "programming bibles".

ARM ARM

ARM TRM

dwelch67's bare metal repository


hpr1630 :: Bare Metal Programming on the Raspberry Pi (Part 2)

Released on 2014-10-31 under a CC-BY-SA license.

The second episode in a series on bare metal programming on the Raspberry Pi. This episode builds on part 1 by showing how interrupts work on the RPIs ARM chip and the framework I created to manage them. It then goes on to describe how an interrupt-enabled serial driver works. From there, the episode shows how we can use the serial cable in conjunction with a loader program to enable us to load bare-metal programs onto the RPI without having to copy them to the SD card each time. In the process, the episode describes the XMODEM protocol that the loader users for the file transfer process.

Here is some of the source material that I used while working on this little learning experience.

Links


hpr1619 :: Bare Metal Programming on the Raspberry Pi (Part 1)

Released on 2014-10-16 under a CC-BY-SA license.

This show is about programming on a Raspberry Pi with on operating system or libraries. In this programming environment, the only software that the CPU executes is the software that you write. This episode introduces how to configure the build environment and get a basic application up and running. From here one can leverage these techniques to build more sophisticated applications and deepen ones knowledge of systems programming.

Here is some of the source material that I used while working on this little learning experience.

dwelch67's bare metal repository

CATRPI

  • Homepage: https://gitorious.org/catrpi
  • Git repo: git://gitorious.org/catrpi/catrpi.git
  • My own repository of code that I wrote during this little project.

Adafruit USB to TTL cable

Script to build the ARM toolchain

ARM ARM

ARM TRM

RPI Schematics

RPI Peripherals


hpr1350 :: The Origin of ONICS (My Intro)

Released on 2013-10-04 under a CC-BY-SA license.

This show is about the Open Network Inspection Command Suite (ONICS). It is a project I have been working on at home for a couple of years now. The idea is to create a set of command line tools that work like cat, sed, awk, grep, etc but for network packets instead of lines of text. This podcast is actually less about the tools and more about the process that I went through to build it. So its more a tale of the project that was never done than an explanation of how to use the tools.

Contact info:

Quick Start Guide for Building ONICS

  • git clone git://gitorious.org/catlib/catlib.git catlib
  • git clone git://gitorious.org/onics/onics.git onics
  • cd catlib/src
  • make
  • cd ../../onics
  • make
  • sudo make install # (optional)

The microphone I ended up jury rigging to record this:

back of mic
http://hackerpublicradio.org/eps/hpr1350/0_Evenfire-00-mic-back1.jpg

back of mic2
http://hackerpublicradio.org/eps/hpr1350/0_Evenfire-00-mic-back2.jpg

front of mic
http://hackerpublicradio.org/eps/hpr1350/0_Evenfire-00-mic-front.jpg


Become a Correspondent