Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Systems programming – where should I start?
8 points by gchp on July 25, 2014 | hide | past | favorite | 12 comments
I want to get involved in systems programming, but don't know where to start.

My background is in developing web applications, and have used PHP, Ruby, Python and JavaScript heavily over the years. I don't have a formal education in computer science.

I've recently started looking at Rust[1], and have found myself having to learn about things like memory, pointers, lifetimes, ownership, (de)referencing and so on. I've found that I've been spoiled by dynamic languages over the years in not having to think/worry about any of that.

Where did you start in learning all of this? Can you show me any resources which would help me in learning this sort of thing?

What computer science concepts do you find most valuable when it comes to systems programming?

Thanks for the help in advance!

1. Rust - http://rust-lang.org

I would highly recommend starting out by building your own linux distro by following the linux-from-scratch book or similar.[1]

You will learn a lot about what goes into making a distro actually boot, how the different pieces of software are interacting with each other, and how to solve and debug typical issues and kernel panics.

From there, I think many would recommend attempting to make some sort of Kernel Module, even if it's a very basic one that isn't of much use. The experience alone will teach you a lot of valuable skills and knowledge.[2]

Learning some assembler will help as well. There is a great free ebook from the gnu assembler (GAS) project [3]. Assembler will help teach you how the computer is really doing what it does. This is important if you are going to be working closer to the kernel and most of the critical subsystems, be in Linux or the BSD's (even Windows actually). There are many different Assembler languages, but learning some basics in one will help you understand how others work.

[1] http://www.linuxfromscratch.org/lfs/

[2] http://www.linuxchix.org/content/courses/kernel_hacking/less...

[3] http://download.savannah.gnu.org/releases/pgubook/Programmin...

I think this answer is pretty bad. You don't need to do all that CJ stuff of building a Linux just to learn systems programming. That's all domain-specific knowledge that would be irrelevant to the vast majority of people doing systems programming on Linux, and all of the people doing systems programming on other operating systems.

Assembler is also a low priority to learn. The details of x86 assembly are not important until you happen to need them for some reason -- in which case, learn it when you need it. The same goes for Linux and OS details. Most systems programming does not require the use of assembly language. If you do want to get a feel for "what assembly is", do some of the challenges at https://microcorruption.com/ . It's a lot of fun in its own right and avoids x86 minutia, and you'll get a good picture of how what a stack would look like and what function calling can look like.

What you need to do to learn "systems programming" is crack open C and C++ and get yourself pretty good at them. And get good at dealing with multithreading and the like. That's what the original poster is asking for.

I think it's worth spending a while with user-level C (maybe complete 1 or 2 nontrivial projects) before attempting to write kernel modules.

Ok, what would you consider a nontrivial project?

My first C class had Gameboy programming. There were no libraries to include, and most of the data manipulation was around scores and drawing pixels.

My second C class went into mutexes and things (producers & consumers of some data)

My third class that used C had kernel modules. Our kernel module project was to write a model of a parking lot. There was some user code that called our module saying whether it was a normal vehicle, a handicap vehicle, or an emergency vehicle. The parking lot also had 2 states, emergency or normal. In an emergency, only emergency vehicles could come in, everything else was rejected. The code ran with M floors and N parking spaces per floor, and returned the lowest floor in which you could park.

We also wrote an identical piece of userspace code, and compared how fast each performed.

My C education followed the exact same pattern (Georgia Tech). I'm really happy with it. The whole progression felt very organic.

He may possibly be referring to just getting familiar with C, since there is a lot of stuff you must worry about with C that you may not be used to with higher level languages (such as having to manually manage your memory allocates, etc).

I interpret gchp as asking for suggestions as to projects of the appropriate scope.

This is great, thank you! LFS looks good.

C would be worth studying, as would some books around and about C. (Peter van der Linden's Expert C Programming comes to mind.) Even if you don't actually use C much, it's been a standard for a long time, with lots of interesting heritage.


You can start with learning embedded system from Edx: https://www.edx.org/course/utaustinx/utaustinx-ut-6-01x-embe...

Then, learn Hardware Software Interface from Coursera: https://www.coursera.org/course/hwswinterface

I like this book: Computer Systems: A Programmer's Perspective


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact