Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Learning Linux from Scratch
34 points by bqc 3 months ago | hide | past | favorite | 15 comments
I'm interested in learning Linux and have minimal knowledge about operating systems and kernels. Can you recommend resources that cover everything from the basics to advanced topics?

Do I need to have knowledge of OS before understanding Linux kernal.




If you're going to go "bottom up": You probably should know about operating systems in general, yes. Linux has been heavily refined and optimized over the years, so having some basic framework to think through will be very worth it.

I recommend Operating Systems: Three Easy Pieces for self study: https://pages.cs.wisc.edu/~remzi/OSTEP/

If you're going to go "top down": Take the plunge and install Linux on your home computer. Put in the time to get it working exactly at you wanted. Then read The Linux Programming Interface, which covers userland in excellent detail. Now you're ready to pierce the veil and finally start understanding the kernel.


Top down - don't try to understand how something works before you understand what it does.


IMHO, the first step would be to learn how to use Linux (if that's not done). For that, just install some Linux distro and use it. Maybe start with Ubuntu, and try to use the command line as much as possible (instead of using the graphical user interface).

When you feel comfortable with Ubuntu, maybe try Arch Linux. You will learn a lot just by installing and configuring Arch (but you will be lost if you have no experience of Linux, hence something like Ubuntu first). Arch Linux has a very good documentation!

When you feel comfortable with Arch, try compiling packages manually. With the Arch AUR you can do that pretty easily (get a PKGBUILD and build the package). Again, that's all documented by Arch Linux!

When you feel comfortable building packages manually, maybe it's time to try Linux from Scratch: https://www.linuxfromscratch.org/. It will go one step further than the way you installed Arch Linux, and this time you will compile all the packages manually!

At this point you will have learned a lot and it will be easier to see how to move more into the kernel.

Note that this is just my opinion: maybe you can get into the Linux kernel without understanding how the Linux OSes work, but... well that's not how I would do it :-).


Best way to learn Linux is by building it. Checkout https://www.linuxfromscratch.org/ Follow it through But before that read through Operating System Principles by Gelvin,Gagne


The Design of the Unix Operating System by Maurice Bach is readable and provides a very good high level overview that overlaps Linux.

https://archive.org/details/DesignUNIXOperatingSystem/page/n...

Operating Systems, Three Easy Pieces is a reasonable book about operating systems in general.

https://pages.cs.wisc.edu/~remzi/OSTEP/

If you are going to run Linux, I recommend Ubuntu as the easy path. There are good arguments for other distros. But you probably don’t need an argument.


You didn’t say why.

How you learn Linux depends heavily on your goals, why you are wanting to learn, what you want to do, what outcomes you’re wanting.


1. Install Linux Mint. 2. Try to do everything (yes, even web browsing) through the terminal. (You can go back to browsing in a non-terminal browser later). 3. Read Kernighan and Pike's "The Unix Programming Environment". 4. Mess around with neovim/emacs. 5. You will now have an understanding of Linux as a user. Where you go from here is up to you!

Cheers.



There's some good lectures from CMU if you search for 15-213 on YouTube. The lectures explain how x86-64 works and enough about operating systems you know how virtual memory and signals work. Then any OS resource listed here or try MITs it has YouTube lectures https://pdos.csail.mit.edu/6.828/2021/schedule.html


In my experience learning something comes from playing with it. So allow me shameless plug: https://archive.is/xDb8o This is a Linux tutorial I wrote quite some time ago but it's still relevant, it tries to give you some hands-on overview of Linux system by having you to execute commands and understand the output.

It goal is to just go through it to familiarize yourself with different parts of the systems. There is verbose table of contents on the first page if you scroll down.


This may be a good starting point: https://linuxupskillchallenge.org/


Compiling a Linux kernel and system from source components onto a Raspberry Pi can be educational. I wrote a quick guide on the topic years ago: https://rickcarlino.com/2021/build-a-raspbery-pi-linux-syste...

There is also a Buildroot guide, but going low level first might be more educational.


My advice is, if your aim is to study, to give FreeBSD a try. It's a complete operating system - the kernel and the userspace are developed by the same team. FreeBSD has fewer moving pieces and is very stable.


Try Debian, read any book you find comfortable, do not forget practicing in terminal. You are not going to have knowledge of OS or understanding the kernel anytime soon because it requires you to know C programming language.


https://www.arcolinux.info/ might be interesting to you




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

Search: