Which is the best BSD system to learn how operating systems work? reddit / BSD ---------------------------------------------------------------------- aScottishBoat · 2020-08-22 21:39 Hello, For many years, I've been fascinated with Unix-like operating systems. I find the design very appealing and robust, and the vast Unix-like ecosystem has led to amazing advances in technology. I love operating systems, and I've always wanted to learn _more_, about how they are built, and how the code works. Which would be the _best_* BSD system to learn: * how kernels works * how Unix utilities function alone, and work together (signals, std{err,in,out}, etc.) * how libc is coded, and how libc glues everything together * anything else important My ultimate goal is to be able to contribute code, whether in the form of utilities, improving kernel code, fixing bugs, etc. I am a software engineer by trade, and I've experience with high-level languages (plenty of scripting, shipping product, cloud architecture...). I need to improve my C skills, but that can be done. Being able to read quality C code will help with that. I've used Linux for many years, and my daily driver is Arch Linux. Digging into my system is not intimidating for me. I've been exploring the BSD community all week, and I have to say, I am very pleased with the love of computing and community that I've found. Looking forward to continuing my BSD journey. Cheers. \* I Know _best_ is hard to qualify, so your opinion is what matters. Edit: Fix Markdown Edit: I know the Minix 3 project is implementing the kernel below NetBSD, with other neat features ([here](https://www.youtube.com/watch?v=jMkR9VF2GNY) is a wonderful talk by Andrew Tanenbaum). If the (outdated) Minix 3 textbook is a good place to start, this also works for me. I know the BSDs and Minix have different beginnings, but with Minix 3 now working with NetBSD, this may be a viable solution. Edit: \* UPDATE \* So I've chosen FreeBSD to move forward with starting my journey. To be honest, I've been _most_ interested in OpenBSD for a couple years now, and in the last week I've had a tremendous desire to try NetBSD. But I have chosen FreeBSD because it was the system I managed to install and understand. Last night I first attempted OpenBSD, and had some issues installing on my laptop. I then fired up a NetBSD live installer, and once installed, I felt... lost. Documentation could help this, but I felt unprepared at this point to proceed. I proceeded to install FreeBSD 12.1, and it installed w/o any issue. This is not to say FreeBSD hasn't already thrown something at me, but I believe I can work my way through it. FreeBSD has rich documentation, a lively community, and plenty of high-quality source code for review. In fact, _all_ BSDs have these things, but FreeBSD is the first system that I've installed where I feel like I have a hang of things without having read much documentation. I _will_ be honest, FreeBSD is the system that I desired to learn _last_ (I am a security nut first, and the _small_ish nature of NetBSD seems welcoming for my mission), but FreeBSD is arguably the most straight-forward, and has all the high qualities of the other systems. I'm not sure how my journey will go, but I know what my endgame is, and FreeBSD will help me get there. Thanks to everyone who offered comments. Please continue the discussion, as any new posts will offer insight into BSD. Thanks again. ---------------------------------------------------------------------- [deleted] · 2020-08-22 21:48 I'm not going to claim that OpenBSD is *best* in any way - in the same way that Emacs vs Vi is kind of a futile discussion. But I *will* say that their technical docs are outstanding and would argue that if you want to wrap your head around an OS, picking an OS with fewer SLOC would make sense. ---------------------------------------------------------------------- dsifriend · 2020-08-22 21:54 As far as quality of _educational_ documentation goes, I think FreeBSD is hard to beat. You may want to compare with OpenBSD once you’ve wrapped your head around things. For looking at code to learn from, I’d have to recommend OpenBSD. They’re very meticulous about what they commit to, focusing largely on security and clarity. Look at the other main branches to learn about cool concepts you wouldn’t otherwise (like what happens when you optimize for portability [NetBSD] or for parallelism [Dragonfly]). ---------------------------------------------------------------------- rhabarba · 2020-08-22 21:58 If you want to know how *operating systems* work, the [old Unix code](https://www.tuhs.org/cgi-bin/utree.pl) would be a good starting point. The newer a system is, the more *abstract* are its underlying concepts, making it harder to understand them. ---------------------------------------------------------------------- desnudopenguino · 2020-08-22 22:43 I'd say OpenBSD. Along with the clean, succinct code, there is a freenode irc channel devoted to daily code review of openbsd's base. So you can jump in and suggest a file or function to check out and they'll walk through it with you. ---------------------------------------------------------------------- gumnos · 2020-08-22 23:54 I'm surprised I haven't yet seen bias toward NetBSD here. FreeBSD has a reputation for focusing more on speed, meaning you might find places where they make a clarity-vs-speed tradeoff; similarly OpenBSD has a reputation for focusing more on security, meaning you might find places where it catches obscure security-corner-cases, obscuring the intent of the actual code. Meanwhile, NetBSD's focus on portability means that I would expect the clarity of the code to be foremost, abstracting out platform-specific bits, even if it lacked performance or security code glommed on. That said, Minix was **designed** for academic learning (started typing up a reply and came back to this after you had edited with your Minix/NetBSD edit), so armed with AST's textbook, the Minix3 source, and the NetBSD userland, you're pretty well-equipped to understand the concepts before diving into the FreeBSD or OpenBSD source code. ---------------------------------------------------------------------- gumnos · 2020-08-22 23:58 That said, given their lineage, it's hard to go *wrong* with any of them. They all value clean code. Just that I expect Minix or NetBSD to be a spot easier. ---------------------------------------------------------------------- ScratchinCommander · 2020-08-23 00:31 Which channel ? ---------------------------------------------------------------------- aScottishBoat · 2020-08-23 01:04 > picking an OS with fewer SLOC would make sense Yeah, their mindset of '_less surface area, increased security_' is a great realisation. Thanks for the feedback. ---------------------------------------------------------------------- aScottishBoat · 2020-08-23 01:05 A true treasure trove. Thanks. ---------------------------------------------------------------------- aScottishBoat · 2020-08-23 01:05 All good feedback. Ty. ---------------------------------------------------------------------- aScottishBoat · 2020-08-23 01:06 > jump in and suggest a file or function to check out and they'll walk through it with you. Exceptional. I'll have to do this. Thank you! ---------------------------------------------------------------------- aScottishBoat · 2020-08-23 01:08 Thank you for clarifying on the point of reviewing Minix 3 + relevant documentation as a _good idea_. I may, just _may_, begin with this route. I'd like to see how outdated the textbook is (which version it uses vs. Minix 3 stable). Thanks again. ---------------------------------------------------------------------- aScottishBoat · 2020-08-23 01:13 Thank you all for the feedback. My initial take away is that _there is truly no wrong answer_ (this is probably largely due to having a homogeneous system vs. GNU + Linux + systemd +...). I've been most fascinated with OpenBSD for a _long_ time (I'm a software engineer at a security company - I like privacy-enhancing technologies), but since watching AST's fantastic talk on adding the Minix 3 microkernel below NetBSD, I'm having a _slight_ fascination with NetBSD. I'm not a hardware enthusiast, so I'm not sure if this will lead me down a path that is not meant for me. I know No Starch Press has well-received books on FreeBSD and OpenBSD, and although outdated, the FreeBSD NSP book + the FreeBSD handbook may be a good route. I'm still largely undecided on which system to dive deep down into, so I'm excited to see any new responses/discussion. Thanks again r/BSD. ---------------------------------------------------------------------- tele-caster-blast3r · 2020-08-23 01:25 There is a world of documentation on FreeBSD, and the package manager is great. Be it man pages or their site, you can find detailed instruction throughout. ---------------------------------------------------------------------- nahnah2017 · 2020-08-23 01:26 The FreeBSD No Starch book just came out a year and a half ago and the Handbook is constantly updated so I don't know why you think they're outdated. In addition, if you really want to get into [the bowels of the FreeBSD operating system](https://www.amazon.com/Design-Implementation- FreeBSD-Operating-System/dp/0321968972/ref=sr_1_2?dchild=1&keywords=fr eebsd&qid=1598146070&sr=8-2) ---------------------------------------------------------------------- jaypatelani · 2020-08-23 02:00 NetBSD also you Might like this blog reading code of NetBSD http://www.silas.net.br/codereading/netbsd-code.html ---------------------------------------------------------------------- desnudopenguino · 2020-08-23 03:07 #openbsd-daily I believe. ---------------------------------------------------------------------- desnudopenguino · 2020-08-23 03:10 #openbsd-daily is the channel. They usually have a schedule of what's being reviewed, so they won't review something at the drop of a hat, but you can get in the queue for the next couple reviews. And they are always reviewing code, at least when I hung out there a couple years ago. ---------------------------------------------------------------------- aScottishBoat · 2020-08-23 03:20 I was thinking the NSP book may be out of not (the handbook, presumably, always being updated), but I didn't realize the latest edition was less than 2 years old. That's not bad at all. Thanks! Edit: Thanks for the recommendation. I've opened it to review tomorrow. ---------------------------------------------------------------------- aScottishBoat · 2020-08-23 03:22 Wonderful link. It begins very low-level, but I enjoy this style of learning. Thanks for the share. ---------------------------------------------------------------------- jaypatelani · 2020-08-23 03:48 No Problem :) ---------------------------------------------------------------------- Horyv · 2020-08-23 08:19 I found FreeBSD well documented, balancing technical info with historic reasoning - which often makes it easier to rationalize technically why things came to be done they way they are. Community is also rich with knowledge and forums are active (the one admin/mod who’s always on it is very patient, helpful and knowledgeable). ---------------------------------------------------------------------- Madgemade · 2020-08-23 08:55 As nobody has posted any links to Tannenbaum's books yet; [Modern Operating Systems (2015)](https://books.google.co.uk/books?id= 9gqnngEACAAJ&dq=isbn:013359162X) [Operating Systems: Design and Implementation (2006)](https://books.go ogle.co.uk/books?id=RYU_AQAAIAAJ&q=isbn:978013142938) I've got the second book (2009 Intl. Ed.) and it's pretty good. I've also been thinking about learning more about OSs. I don't think being outdated is an issue for OS in general. The concepts have not changed in a long time. From what I can tell, most changes are new features, drivers, bugfixes and optimizations not changes to core concepts. ---------------------------------------------------------------------- knightjp · 2020-08-23 10:25 For me, I would cut my teeth on FreeBSD, if you want to setup a good daily driver system. In the process of setting up all the various components of the system yourself, you will get to terms and find out what makes a good UNIX system tick. If you are just looking to setup a good system with great code base and you are looking at code, then it has to be OpenBSD. ---------------------------------------------------------------------- losthalo7 · 2020-08-23 12:32 https://www.youtube.com/watch?v=XBSsc2qHP_g ---------------------------------------------------------------------- aScottishBoat · 2020-08-23 15:53 I have an update. Please review the latest edit in the original post. ---------------------------------------------------------------------- desnudopenguino · 2020-08-23 16:17 Yeah, I just realized putting a # on front does that. Lol. I was wondering why my posts were showing up like this... ---------------------------------------------------------------------- glamdivitionen · 2020-08-24 15:01 386BSD is a nice place to start. ---------------------------------------------------------------------- NitroNilz · 2020-08-25 15:27 I find this really helpful: https://pdos.csail.mit.edu/6.828/2012/xv6.html ---------------------------------------------------------------------- MatuuszGames · 2022-04-15 13:59 GNU/Linux.