Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm pretty comfortable with high-level languages and application development. However, although I have learned about low level topics such as the ones listed below, I have never done anything with that knowledge outside of school.

Some examples:

  • bit twiddling
  • dealing with little vs big endian
  • memory management (stuff relating to the stack/heap/malloc, etc)
  • multi-threading with mutexes and semaphores

What are some ways that I can practice these in my spare time, while working at a company that writes managed code?

share|improve this question

closed as too broad by gnat, MichaelT, GlenH7, thorsten müller, Dan Pichelman Sep 30 '13 at 20:19

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

    
If you're working in C#, you can use unsafe to do these things. –  Robert Harvey Jul 20 '11 at 17:22
    
Oh, I don't mind writing in languages such as C or C++. Using unsafe in C# or Java seems like working around one of the features of the language, while all I want to do is get closer to the metal. –  Steve Jul 20 '11 at 17:30
    
You might find this of interest: graphics.stanford.edu/~seander/bithacks.html –  Robert Harvey Jul 20 '11 at 17:33
    
@Robert: Thanks, the link you mentioned reminded me of the book "Hacker's Delight" –  Steve Jul 20 '11 at 18:00
add comment

4 Answers 4

up vote 4 down vote accepted

I'll try and describe a few exercises that you could actually experiment with, and have verifiable results, in a few different domains.

  • For bit-twiddling, you might try implementing a CRC algorithm. You can easily find test-vectors for a particular CRC polynomial, and the implementation isn't nearly as tricky as I used to think it was (before I implemented one). (If you want example code, look for a bitwise CRC generator, rather than a table-based one - much easier to understand.)
  • For big-vs.-little endian issues, there exist file-formats that can be stored in either - e.g. Wave Audio (though, technically, the little-endian might be called RIFF, while the big-endian variant might be called RIFX). It wouldn't be too hard to write a converter from one endianness to the other, and you ought to be able to playback both the big- and little- endian variants.
  • For mutexes and semaphores, try implementing a higher-layer structure, like a queue, with locking provided by mutexes and semaphores.

HTH

share|improve this answer
add comment

For item #1, get an inexpensive programmable micro-controller development kit or two, Arduino, et.al., and play with blinking LEDs, making things go "beep" and such.

For items #2 and #3, find a used PalmOS device and try to write a small bit-twiddling (blink some pixels) app for that memory constrained Big-endian environment. If you don't want to play with handheld devices, you might be able to find programming tools for an Amiga or 68000 Mac emulator.

Another low-level coding exercise might be to write some x86 assembly language for an early version DOS emulator. If you have an iPhone or Android device and SDK, you can play with some in-line ARM assembly language (using the NDK under Android).

share|improve this answer
add comment

Might be a bit "complicated", but I think writing a simple Bootloader/Kernel would be a great learning experience. Check out: http://wiki.osdev.org/Main_Page and/or Tanenbaum's books.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.