
Ask HN: Systems programming – where should I start? - gchp
I want to get involved in systems programming, but don&#x27;t know where to start.<p>My background is in developing web applications, and have used PHP, Ruby, Python and JavaScript heavily over the years. I don&#x27;t have a formal education in computer science.<p>I&#x27;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&#x27;ve found that I&#x27;ve been spoiled by dynamic languages over the years in not having to think&#x2F;worry about any of that.<p>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?<p>What computer science concepts do you find most valuable when it comes to systems programming?<p>Thanks for the help in advance!<p>1. Rust - http:&#x2F;&#x2F;rust-lang.org
======
Alupis
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/](http://www.linuxfromscratch.org/lfs/)

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

[3]
[http://download.savannah.gnu.org/releases/pgubook/Programmin...](http://download.savannah.gnu.org/releases/pgubook/ProgrammingGroundUp-1-0-booksize.pdf)

~~~
pconner
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.

~~~
gchp
Ok, what would you consider a nontrivial project?

~~~
caw
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.

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

------
tjr
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.

[http://www.amazon.com/Expert-Programming-Peter-van-
Linden/dp...](http://www.amazon.com/Expert-Programming-Peter-van-
Linden/dp/0131774298)

------
tuhdo
You can start with learning embedded system from Edx:
[https://www.edx.org/course/utaustinx/utaustinx-
ut-6-01x-embe...](https://www.edx.org/course/utaustinx/utaustinx-
ut-6-01x-embedded-systems-1172)

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

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

[http://csapp.cs.cmu.edu/public/samples.html](http://csapp.cs.cmu.edu/public/samples.html)

