Category Archives: Systems

Playing With and Learning Embedded System Stuff

A Lost-wakeup Race Condition Actual Example:

//The code below should make us wait until displayInterruptCount becomes 0.
//The problem is that it stopped after a short while.
 __disable_interrupt();   //first I added this
 while ( displayInterruptCountdown )
    __low_power_mode_3(); //This halts the cpu.  An interrupt will
                          //restart the cpu.  The irq service routine
                          //determines whether the cpu will halt when
                          //servicing is finished.
    //I found operation went BAD here. It counted a bit and then stopped.
        //I found second I had to protect the tests after the first!!

Ideas for advice to students:

  • You must learn permanently that you must learn temporarily the many precise details corresponding to those in study projects when you do professional projects.
  • A lot of the programming work is to interpret data from an externally defined interface and transmit data to an externally defined interface.

How to read specifications.

How to read the HTML5 and other Specifications…

Early on, Dean Arden declared that one important goal of courses like computer architecture is to enable people to understand specifications.  I’ve tried to weave using specifications, either written by professors like me into assignments, or, more rarely, for required references included in assignments.

The HTML5 spec quote is so cute, I must directly quote it:

1.7.1 How to read this specification

This specification should be read like all other specifications. First, it should be read cover-to-cover, multiple times. Then, it should be read backwards at least once. Then it should be read by picking random sections from the contents list and following all the cross-references.

Lightweight Java Visualizer Tool

Lightweight Java Visualizer Tool

Cool tool for teaching data structures…

Computer Science Learning Bottlenecks

During a workshop I was asked to identify a learning bottleneck.  Here’s my first:

Students have difficulty visualizing that a pointer variable and the variable it points to are (usually) different variables, realizing the values in one can be changed independently of the other, and choosing the correct variable to access or assign when figuring how to program the variety of tasks that they need to learn about.

Added a second added later:

When asked to report or draw conclusions from structures, students confuse static structure (such as structure of code, and relationships between classes or other types) and dynamic structure (such as quantities and references between instantiated objects, contents of an activation stack, and history of activations).

And later:

Juha Sorva’s proposed threshold concepts for programming, beginning with the dynamics of program execution, seem on the mark.  Distinguishing between a variable storing a pointer and a variable storing a  non-pointer makes sense only after the concept of variable and its role in dynamics is understood.

Learning GIT

Spent a few days learning GIT.

Some links I found:

  1. The GIT user manual from  I cloned the git repository for git itself.  Like the description: “Information Manager from Hell”!
  2. The GIT Parable Starts with a good promise, lets see..  It is really clear and easy to read, although I already understood much of it from other sources.  It ends with3 links to good-looking websites with more detail.
  3. Computer scientist’s intro
  4. (update from csi500 web site’s list).

GIT is based on objects located by references. The references are visible as the hashes.

Key concepts: Working tree. Index. Commits. HEAD pointer.

Concepts: Branch (for clarity, named variable pointer to a commit rather than a line of deveopment).

Hackers and Painters


Hackers and Painters

Essay on how “hacking” i.e. building excellent software differs from science in that it is a kind of “making” like painting.

Into Systems

I’m into reading Linux kernel code and discussions (such as IBM Developer Works postings).

Assembly language code often does not document what it calculates with mathematical expressions. The similarity of higher level language code to mathematical expressions is of course designed to be much stronger. I find the need to consciously translate what is calculated to a mathematical expression before I understand it. This step is probably bypassed by more practiced programmers.

Systems have features required so different applications with conflicting properties can be supported by the same system. Example: GNU ld has the PROVIDE(SYMBOL = DEFINITION); operation. The documentation gives an example for its need:

For example, traditional linkers defined the symbol `etext’.
However, ANSI C requires that the user be able to use `etext’ as a function name without encountering an error. The `PROVIDE’ keyword may be used to define a symbol, such as `etext’, only if it is referenced but not defined.

Some interpretive languages have a conditional assignment operator that assigns a given value to a target variable when the the target variable is undefined. This is the same idea as “weakly defined” symbols supplied by input files in a linking.

Seeking generalizations: (a) Defaults in systems. (b) Perhaps closed world assumptions  (what is not specified is assumed to be false) in logic.


How many people who use advanced features of linkers have written an elementary linker for educational purposes?  Our curriculum currently required of BS majors includes that (in a systems programming course.) How can we effectively balance education by using complex systems to practice building systems and the building of simpler systems?