Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of FreeBSD device drivers

    FreeBSD device drivers

    Joseph Kong · 2012

    Systems & OSProgramming
    Open LibraryAmazon
    Stats for nerds
    4recommend
    5mentions
    5people
    2018–2023years
    80% recommend20% neutral

    Mentions per year

    201820192020202120222023

    What Hacker News says

    1. beeburrtSep 2023
      Maybe Joseph Kong's books?

      Designing BSD Rootkits

      https://nostarch.com/rootkits.htm

      FreeBSD Device Drivers

      https://nostarch.com/bsddrivers.htm

      Playing Games With Kernel Memory ... FreeBSD Style

      http://phrack.org/issues/63/7.html#article

      thread
    2. ninjinSep 2022
      “Linux” indeed… I know for a fact that Absolute OpenBSD, The Book of PF, and Designing BSD Rootkits are great. Tempted to pick up the bundle to read FreeBSD Device Drivers, The Book of GIMP, Absolute FreeBSD, and The Book of Inkscape.
      thread
    3. loegJun 2020
      > And started wondering how deep does that go in (Free)BSD? Is all info available in neat strucured format programmatically,

      In short: not exactly, but it's somewhat better than Linux. Sysctls are a commonly used, structured tree of mostly integers. The thing Linux does where procfs/sysfs are a bunch of unstructured text files? FreeBSD mostly doesn't do that.

      Here are some sort of off-hand exceptions or oddball things that might be less desirable:

      1. To get the disk/partition topology, there is a sysctl that spits out an XML graph: kern.geom.confxml. So that's sort of text parsing, but it's got a well-defined grammar that many libraries exist to parse already.

      2. Some sysctls just dump opaque kernel ABI binary structures. These are machine parseable by C programs as long as they were compiled with the same headers as the kernel; parsing in non-C or across ABIs is less good. If these interfaces need to be portable, they are usually exported in a more portable way by libc or another base system C library.

      > or are there other places where you'd need to do Linux-like parsing of special files?

      The only special filesystem you need in FreeBSD is devfs (/dev), and it is populated by devices (or directories containing devices, symlinks to other devices, etc). So if a device exposes an interface that is arbitrary text, sure, you could have something like the Linux situation. But that is atypical. You absolutely do not need /proc or /sys; I don't have either on my desktop FreeBSD workstation.

      The common convention is to use ioctls instead. Ioctls are a pretty lax type system, but the FreeBSD ones do embed the size of the structure in the identity of the ioctl, so you have at least a slight guarantee of noticing ABI changes and being able to provide backwards compatibility.

      > Is there some good reading material of this aspect of the system?

      The canonical book here is FreeBSD: Design and Implementation, 2nd Edition. It's not super recent, but many of the underlying design principles are accurate. Many of the subsystems described function in basically the same way today. I would also plug Joe Kong's FreeBSD Device Drivers if you're interested in writing device drivers specifically (full disclosure: he is a friend).

      thread
    4. ashaferAug 2019
      If you want something more hands on you can try "FreeBSD Device Drivers: A Guide for the Intrepid" by Joseph Kong. It is much easier to read, and my guess is you ran into it while making those BSD patches.

      He also has a short book on building rootkits for BSD, which is a very fun read and demonstrates how things like system calls work.

      If you want a guide to reading actual kernel code, here is a great resource explaining where some of the foundational pieces are. With a tool like cscope, reading the FreeBSD kernel is actually pretty easy.

      http://www.watson.org/~robert/freebsd/reading/

      Hope that helps!

      thread
    5. n_tNov 2018
      Here is my list, which is biased towards Linux. Almost all the books mentioned here are dated and primarily written for 2.6 based kernels. Although many concepts are still applicable and in certain subsystems, the code will be as is with minor changes. So, despite them being old they are still good references.

      * Design and implementation of the FreeBSD operating system: Good and thorough deep dive in FreeBSD OS. Must have.

      * FreeBSD Device Drivers: A Guide for the Intrepid: Didn't quite read it all but looks fine for FreeBSD.

      * Mac OSX internals - a systems approach by Amit Singh: It was good back in days but now outdated.

      * Linux Device Drivers, 3ed : Very dated but still good to grasp Linux device drivers in general. The code examples are bit silly but good enough. There are some GitHub repos which have updated code for latest kernels.

      * Essential Linux Device Drivers by S Venkateswaran: It complements LDD3 book quite nicely. Has some real device examples and very exhaustive. Must have.

      * Linux kernel development by Robert Love: Very good for short/quick intro. Best for preparing before interviews ;)

      * Professional Linux kernel architecture by Wolfgang Mauerer: As other book, its dated but some of the explanations about interrupts, PCI, etc are good. His callgraph approach was very handy in understanding things.

      * The Linux programming interface by Michael Kerrisk: Not really about OS but next thing close to it - system programming (the real system programming). Must have.

      * Understanding Linux virtual memory manager by Mel Gorman: As other books, it's dated but still one of the best available to get a handle on memory management under Linux. Must have.

      * Understanding the Linux kernel: Dated but still my go to book to refresh certain subsystems. Must have.

      * Linux Kernel Programming by Michael Beck: Mentioned for historical reasons, else most out dated book here (2.4 based). Horrible editing and English but heck! I loved it back in the days :)

      * Linux kernel networking by Rami Rosen: Never read it but quite dated.

      * Understanding Linux network internals by Christian Benvenuti: A real bible of Linux networking. If nothing else, your jaw drops at the effort author made to write this book. Dated but unlike more generic Linux kernel things, network stack is still same in its core. Must have.

      * The Linux kernel primer: A top-down approach for x86 and PowerPC Architecture: Very dated book but good to read from PPC perspective. Lot of things have changed since its publication.

      * See MIPS Run by Dominic Sweetman: dated but gives good idea about MIPS internals and how Linux uses it.

      * IA-64 Linux Kernel: Design and Implementation: Its dated not just w.r.t code but also w.r.t. hardware. Nonetheless, it gives a good insight into IA-64 architecture and Linux from non-x86 perspective.

      * Definitive guide to Xen hypervisor: this is the only book on virtual machine which is not just from user perspective. While best way to learn VM is through reading architecture spec and code, this book still satisfied me w.r.t. virtual machine internals.

      Every other book on amazon about Linux kernel is more or less useless. For more academic book, "Operating systems - three easy pieces" is good.

      thread

    Related

    Cover of Designing BSD Rootkits
    2010–2023

    Designing BSD Rootkits

    Joseph Kong
    3 recommend · 6
    Cover of The design and implementation of the FreeBSD operating system
    2008–2026

    The design and implementation of the FreeBSD operating system

    Marshall Kirk McKusick
    36 recommend · 59
    Cover of Absolute OpenBSD
    2014–2026

    Absolute OpenBSD

    Michael W. Lucas
    11 recommend · 21
    Cover of Linux device drivers
    2009–2023

    Linux device drivers

    Alessandro Rubini
    21 recommend · 39
    Cover of Linux Device Drivers Development
    2021–2023

    Linux Device Drivers Development

    John Madieu
    1 recommend · 3
    Cover of Essential Linux Device Drivers
    2018–2019

    Essential Linux Device Drivers

    Sreekrishnan Venkateswaran
    2 recommend · 2
    Cover of Absolute FreeBSD
    2010–2024

    Absolute FreeBSD

    Michael W. Lucas
    8 recommend · 16
    Linux Programming InterfaceMichael Kerrisk
    2011–2026

    Linux Programming Interface

    Michael Kerrisk
    98 recommend · 156