Free BSD is one of the longest-running and most influential open-source operating systems in the world. It was born from the Berkeley software distribution in the early 1990s, and it has powered everything from high-performance networking infrastructure to game consoles and content delivery networks. Over three decades, it has evolved through major architectural shifts, from symmetric multi-processing and kernel scalability to modern storage systems and predictable release engineering. John Baldwin has spent more than 25 years working on Free BSD as a developer, contributor, and consultant. In this episode, John joins Gregorvan to discuss the origins of Free BSD, how its governance model differs from other open-source projects, its role in systems like Netflix's CDN and the PlayStation 4, the challenges of maintaining a 30-year-old codebase, and much more.
Gregorvan is a security-focused technologist, having previously been a CTO across cybersecurity, cyber insurance, and general software engineering companies. He has based in Singapore and can be found via his profile at van.hk or on LinkedIn. Hello, and welcome to Software Engineering Daily. My guest today is John Baldwin. Thanks so much for being here with us today, John.
Thanks for having me. So, yeah, today we're going to be talking about all things Free BSD. Some of our listeners will already know exactly what that is, others will perhaps have some inkling or have read that somewhere to do with something they use in the daily life, which we'll get on to. But I think the first part to go through, which is what we like to do on Software Engineering Daily, is just to get on to your background, John, you've had a very interesting technical career. So, yeah, I'd love to just step through that before we get into what is Free BSD.
Sure. I guess I have enjoyed working with computers and working with software and kind of how you build things from kind of a young age. I first started programming when I was around 12 or so, when I called my 64 with basic and high school, I started programming in Pascal and learning some assembly and had interesting and low level details like operating systems. A good friend of mine in high school and I actually wanted to write our own operating system from scratch, which was a bit overly ambitious on our part. But we were already interested in kind of that level and kind of doing system level programming.
When I was an undergrad, I was first exposed to Free BSD. This would be in the mid 1990s when free and open source Unix's were coming onto the scene. And that's the one that I first started using in colleges undergrad. I got really interested in using it both as a user myself, like I'm forced myself to use that as my daily driver during school and for my classes. But I also ended up being assisted in my university and kind of managing our undergraduate lab.
And as part of that, I kept working with Free BSD more and more. And by the end of my undergrad, I actually started contributing to all patches to join a project as a member, even as a senior at university. So then when I graduated from school, I had the opportunity to actually go work for a free BSD company doing this thing that I really enjoyed doing. And that was my first job out of college. And so I've been active in free BSD and working on various parts of the system since around 2000 or so.
And I've gone through various jobs and various employers, but the one comes to know all of it has been that in some way each job I've gone through or now is like, it's a contract to each client that I have that used Free BSD in some form. So I've had the wonderful pleasure and opportunity to work on this project that I really enjoy. And it's that many people only get to work on as a hobby and I get to work on it, pay it in some fashion and get to spend my time working on this project. And even though my employers have changed over the years, I now have this kind of crazy, a 25 year career hacking on and operating system kernel. And various music land and other things that go along with that.
So that's been really neat, a lot of fun, so very privileged and honored that I get the chance to do this. And that's the way I bridge all that work is that it's the way I enjoy to do it. That's awesome. And I think, yeah, we obviously have quite a few listeners at the beginning of their software journeys. And I think it's like a really interesting way to frame it that actually you can get.
So deep into a specific technology that actually employer, not this employer doesn't matter, so to speak, but if you're able to weave that thread of the technology that you just enjoy through it, then that maybe makes life more enjoyable as well. It's fun to work on. I'll say that. One benefit, I guess, is the trade off. In the one case, you would love to have this nice stable job that lasts forever, but it's the same thing all the time in some ways.
But by moving between different employers at different times, I got to work on different types of projects and different workloads and find out different areas of stuff. So one of my jobs is at the Weather Channel working on local TV insertion, where you insert local content that's relative to a geographic region, like the local weather forecast instead of the national weather forecast. And so that was exposure to TV and video. And I can tell my parents, say, that thing when you see on TV, I'll work with that, versus other jobs that involve much more level performance and low latency networking and all sorts of different things. And it's one benefit of that for me is I've kind of done a tour through different parts of the kernel and the handler of different parts of the operating system over time, motivated by the different projects I was working on.
So that's also been neat to have that chance to wander around and figure see sort of street and kind of in parallel to wandering around both the US as a country and the different jobs of that. Yeah, that's awesome. So let's get into free BSD. What is it? Why did it come about?
Let's start there. So for those that aren't fully in the know, what is free BSD? The free BSD is a general purpose Unix-like operating system. It's very similar to Linux or Mac OS, for example. Free BSD started in the mid-90s.
So it's actually descended from the kind of variant you might call it or flavor of Unix that was developed at UC Berkeley in the 80s, where it's like the first kind of widely used version of TCP IP came from. And Berkeley kind of wound down their research stuff in the early 90s, but they released what they had done as open source. And so various communities popped up trying to use those bits. And in particular, there was a gentleman that I think is Bill Jollis, and he wrote a series of articles and Dr. Dodds talking about porting for free BSD, I believe it was version 4.4, to run on x86 PCs, like a 3-6 at the time.
And over using that, and this is before my time, a community developed around collecting patches that would run on top of 3-6 BSD to fix various bugs and issues that came up. And there were some personality issues. And eventually people kind of like, Bill Jollis would vanish for a while, then come back and vanish for a while. People got tired of waiting for the next release of 3-6 BSD to actually come out. So eventually the people that community that collected around 3-6 BSD, they slid off into two groups.
One was NetVSD, they slid off first, and the second was for BSD. And they said, let's take this foundation we have of VSD from UC Berkeley, and the patches that Bill initially developed this 3-6 BSD. And then a whole bunch of patches for various people all over the world are using that and make a release out of it. And then that started them rolling. And that's kind of how the previous project got started.
Yeah, and I think it's helpful to sort of, I guess, slightly compare contrast to very, very high level with Linux, in a sense, like these are two lineages of Unix, is that right? Yeah, so Linux was written from scratch, but influenced by the design of the way Unix works. So it aimed to be positive compatible. So in particular, Gnew already exists as a project, backed by the Free Software Foundation, and was trying to make an alternative to commercial Unix at the time. And one of the things Gnew didn't have, well, they had a kernel called Herd, but I think Herd was perhaps not as well along.
And Linus came along and wrote a kernel that was still on top of the rest of the community system. And Linux worked really well, and it became a community that people could go and work on and get a free Unix-like system, something that was comparable to maybe boxes they had used at work, and it's a binary, but this is one they can install on their home PC and run. And so free to see Linux were both kind of operating in that same kind of space. Yeah, and to kind of, I guess, those, like, try to understand why use one over the other, just at this high level, Linux being this kind of fast-to-change community-driven, like, very, very large community-driven, free BSD, perhaps being sort of more of a workhorse that's more, like, quote, stable for those that need to use something.
Well, I think sometimes things happen by accident in history. And one of the things that happened in the 90s is in addition to, there being people who took BSD from UC Berkeley and tried to make an open-source distribution. There were also a group of folks, some of the people who had been at UC Berkeley perform a company called the SDI, and it was going to sell a commercial version of the SUS. And they decided that one of their marketing strategies would be to pick the telephone number of 1-800 its Unix, even though AT&T only did an extreme mark. And that made the lawyers at AT&T very unhappy, resulted in a pretty big lawsuit between AT&T and UC Berkeley.
And when that happened, that kind of put a bit of a collage around many folks in regards to the BSD community, because there was a lot of uncertainty about what was going to happen to this project, and along with the BSD and free BSD, like in this whole universe, what's going to be the outcome of the lawsuit? Is there a source that's going to exist? Is this, like, a safe platform I could build something on top of? Where's it going to get danked out? Because the judge will decide it's encumbered.
And so I think one side effect of that is that people who worked certain found Linux as an alternative where that uncertainty wasn't happening. And so you've had a shift of mind-share of developers, because they were kind of weighing both options early on. And the BSD world had this obstruction in the way. And by the time I got there, the obstruction had been lifted. I didn't start working with previous detail a couple of years later in the mid-90s when I was in college.
At that time, the lawsuit had been resolved. But in terms of early developer mind-share, like, damage had been done, if it makes sense. So in some ways, it wasn't even a technical. It was just things outside the technical realm that individual developers don't have control over it. And it's just kind of a way that sometimes decides how things go.
Wow. Yeah, it had not picked that up. So that's like really interesting history. And as you call out, it is sometimes something that is completely untetical it has ended up driving a direction for decisions. And just sort of, I guess, we'll get into some of the use cases in more detail later.
But just to get to set the scene before we dive in, things that Free BSD might have touched that you're using as a listener. So at very high level, PS4OS runs on Free BSD, for example. Netflix, their CDN servers, for example. Also a huge use case. And macOS, so most of the listener base, that's incredibly biased with me.
I want to make a lot of our listener base from macOS. And so it's in there as well. But we're going to get into those use cases a little bit later. I think looking at how Free BSD has actually worked as a project, because we've just talked about sort of, well, there is a sort of mind-share split, I guess, as we've just learned between Linux and Free BSD. As projects, they're set up quite differently.
And yeah, I guess it'd be really interesting to understand, like, how does the Free BSD project work? Let's go from there. Sure. So one common model in a lot of open source projects is you have an acronym for it of a net-select dictator for life, for the BDSL. So you have a person who kind of has the vision for what the project should be and how it should go forward.
And that's a model that works quite well with a lot of open source projects. Free BSD has never really had that model. Earlier when I said that Free BSD came out of this community of folks around the 3D6 ESD patch kit, well, there was already a group and there wasn't like a single person. And if anything, the single person they were waiting on proved to be someone who was absent. So from its initial start, Free BSD was already a group of several folks together with no one single architect or no one single kind of benevolent dictator.
And that group over time started expanding. Initially, they had kind of a leadership team. We still have the same name for the core team. But the first group of people that were on the core team were basically the people who had root on the box where the source tree lives. And Free BSD from its inception used source code controls.
So we had CVS in the very early days. And the box it has a CVS repository. If you had root on that, you were part of the core team. And over time, you would add more folks who were either committers. So they were people who could commit access to the SSH or CVS, this SSH and push commits to the repository, as well as folks who were in this core team.
And they were all self-selected or invited. That's still true for committers to Bay kind of, or for the most part. But for core, it was originally kind of a self-selected group. And it kind of slowly grew over time. And wasn't as good about maybe removing people who were no longer active, for example, as it could have been.
And around 2000 or so, there was a bit of friction between the developer community and core. And I think the core was quite responsive to someone with a developer wanted to do. So we had a little mini internal revolution by the developer community and crafted a set of bylaws and instituted elections and started electing our governing board. And we've held regular elections every two years since 2000. And had a different rotating group of folks who were on our core team.
And that's, we have different trade-offs, I guess, compared to the benevolent dictator model. One of the advantages that we've had is that we've, many of our senior developers from that kind of first generation, well, they worked on free GSD at that point. But then some of them found other things to do when they left and went off to other projects. And we were able to have younger folks who had come up through the ranks, grow into leadership positions in the core team, and kind of survive having multiple generations of leadership in the project. So that we can live without, if we don't have a dictator that if they leave suddenly or unfortunately hit by a bus, we can survive that.
We've already kind of survived that multiple times in our history in that. So we have the ability to have a structure that will sustain beyond the last of any one individual. On the other hand, when you have committees and groups, things aren't always as efficient. And also the way that technical direction has historically worked in the project is that developers as individuals work on the phrase we have word as you scratch the itch that you have. Sometimes it's an itch your employer has, just often the case.
Or sometimes it's just something that you have. You went and bought a laptop and it doesn't. Some driver doesn't work or suspend a resume doesn't work quite right. So you want to go get that thing to work on your own time and that's where some of the patches come from. Or if it's employer motivated and employer like, not like it's a use case for something and so they spend their own resources employing somebody to work on fixing bugs or adding features that they need, that they then contribute back up stream.
And so technical direction arises from these individual developers working on different tasks. And that's not always a single unified vision or direction. And sometimes that's not the best. Sometimes we did benefit, I think, from having a bit more direction. That's one of the things internally we've talked about in our leadership is we're kind of evolving and changing over the years.
As Dewey at some point need to have a bit more active direction in trying to have a roadmap as a project of where we're going. And part of that is talking to our corporate consumers who are active in our community and our individual developers and trying to figure out where are things where you guys are aligned. And there's common things that if somebody wants to volunteer and doing something and they would like to know if they don't have a particular itch to scratch, they just want to know where is the best place to spend my time. That's I think the vibe of a roadmap could be is those folks will know how best to contribute through time. So that's currently one thing we're looking at as a community is maybe trying to play with developing a project roadmap that will update over time.
But that's still something to be developed. And it's a lot of non-coding work, which is not always the most fun work to do in open source. Yeah. And just roughly like percentage wise, what would you say in terms of those that contribute, those that are within sort of fairly major companies that rely on the Ph.D. versus the kernel hackers and the person who's at some point picked up a laptop and wants to hack away on it.
So the Phrasing project is kind of a couple of different open source projects, at least two big open source projects within a single open source project, at least as compared to say the Linux landscape. In Phrasing we have a lot of development of source code for our kernel and our base system utilities. And then we have this system called ports that allows us to import third party code or rather build packages of third party code, things like KDE or Noam or Wayland X1, those other, all sorts of stuff like that, like tens of thousands of those packages. And together that allows you to build a distribution. And in the Linux world, these things are kind of split up.
So you have the Linux kernel folks working on just the kernel piece, and you have a different group of people who might work on the C runtime library, like G-Litsi, your muscle. And then you have folks over in Debian or Ubuntu or other places who then have a symbol of different bits from these different sources and glue them together to make a distribution. And in previous D, we do all of that in one place. But it does mean in particular that the work model and a lot of the workflow that happens inside the like develop the kernel and the basis in part is very different from working with third party packages like KDE. And that shows up in various different ways.
So one way it shows up is a lot of our work on the source side seems to be funded. I would say maybe at least 80% or so commits that go in probably had a tag that they're sponsored by somebody or if you look at the Liza's code, at least 80% probably are paid for in some fashion by some kind of employer or a client for a consultant or something to that effect. Whereas on the port side, we're dealing with how we manage patches to third parties, software, and keep it building and working on current versions of free DSD. A lot more of that work is volunteer basis, almost inverted. I would say like 90% of that work is probably volunteer instead of funded.
So you have this different mix depending on what kind of work is going on inside of our project. Got it. And just before we kind of move on to some of these key use cases, if you like that we've seen free VSD end up in, would you say that having this government's model as opposed to called benevolent dictator model, does that create a degree of trust? And that's why VSD can end up in these really critical large projects. Like how is that decision made, do you think when someone's coming along that is like the size of an Netflix and trying to figure out which path to take?
I honestly don't know if our government's model is a factor in anybody's decision. When I'm aware of people who've decided to use previous product, often it comes down to the fact that an engineer who's participating in the design of the architecture of the product is familiar with previously in some fashion. Either they use it before or I have a prior job, I won't name them to protect the other set, but they were trying to pick a platform for a product. And at the time, when it was having some turmoil and like swapping their VM system, it felt like to then every three months, and they looked at that and said, we don't want that. We want to use VSD.
That was the basis of their decision. And it was kind of a gut-the one on the part of their system architect. So I think in many cases, many of these things are a lot more serendipity than they are very well thought out. In terms of deciding what kind of technologies you want to use or what things do I know that the engineers who are picking the system design, what are they familiar with? That's what they'll choose.
You can't always say that it's on a very clear technical basis as much as I'm just comfortable with this. That makes a lot of sense. I'm probably speaking purely from a personal perspective where a lot of my job is basically de-risking projects from a technical perspective. So I'm often looking at these, maybe slightly more macro areas as well, but in the reality is, often, as I know, a developer has picked up a technology and that's why it is. And then you have to come back later and address some things based on the choice, but that's the way time goes.
History goes really. So I'd say that's what happens. So, let's go into some of these examples of where FreeBSD has ended up. I think it'd be interesting to touch very briefly on PlayStation, but I know that we're going to talk more length about Netflix. That's the one that you had a lot more of hand in.
So, yeah, just for example, why do you think PlayStation ended up with FreeBSD and then we can jump into Netflix as well? As a project, we haven't talked a lot with Sony, but earlier on when they were working on the PS4, some of their engineers did talk with us a bit and gave us a few talks at some conferences. And from what I recall from when we were talking with them that before the PS4, when Sony would build a platform for their new PlayStation console, they had to figure out what software they were going to run on it. They would maybe pick bits and pieces of software from different places on the internet, maybe a server, a C library from one open source project and a TCP IP stack from somebody else and various shared libraries and things, and kind of assemble what was effectively a homegrown operating system for each kind of version of the PlayStation.
And this meant that they were in the kind of operating system support and development business, as well as building a gaming development platform and hardware business. And I think with the PS4, they decided we would rather not be in the operating system business anymore than we'd have to be. And we would rather use something that was off the shelf as our starting point. And when they're evaluating alternatives, one of the things that also happened around the time of the film with the PS4 was the FFF released version three of the GPL license, which included some clauses related to granting of patent rights and so forth that for various, not all, but some companies, that gives their lawyers a bit more heartburn than previous versions of the GPL did, for example. I believe that was true for the case for Sony, and that when they were evaluating what platform to use, one of the big reasons they chose previously was the previously was the BSD license, and that they did not have to worry about dealing with the GPL V3 and what possible implications that might have if they were to use the GPLV3 software and the PlayStation Coex.
That's my understanding of how they ended up landing on the previous four. We have gotten some contributions from Sony on the PS that came out of the PlayStation effort, some of that is direct to us, for example, some support for things like AVX and our kernel I think came from Sony originally, but they've also contributed in other ways that have really benefited the project. Another thing that was happening kind of in the, I guess that's the right time frame in 2010s or 2000s was the rise at LVM as another alternative open source compiler suite, and LVM was very attractive to Sony and they spent a lot more contributing to the linker side of the story, which at the time was it really is well developed as playing as a C compiler. So they contributed a lot of effort into the LVM linker, and one of the ways previously has benefited from that is that now we use playing an LOD as our default toolchain for all our applications.
So I think with previous D15, for example, I believe we have one binary left in the basis in this DPL, which is like this three or something, but the rest of our system now is fully DSD licensed. So that's been one big benefit that we've gotten from effort that Sony has done. Nice. So then Netflix is also quite a big story for free BSD and I think for you personally as well, the work that you've done. So let's get into that.
Where does free BSD turn up in Netflix's infrastructure and then what kind of happened there? Sure. So to be clear, I've done some contract work from Netflix, but I'm not an employer in Netflix. Yes, yes, I should have clarified that. Yes, I should have clarified that.
Blameros, there may be bits that I don't know, I'll say it that way. But Netflix uses free BSD and they're CDN. So if you're watching a movie from Netflix and the bits are being streamed to your device, probably this coming from a free BSD box, that's at your ISP. Typically, they're trying to avoid sending lots of bits across the actual internet and only sending the bits locally within your kind of local way and for your ISP or so forth. And they do that with a distributed set of boxes to build a CDN.
And the boxes in the CDN are running free BSD. And that's where they're playing with pushing a lot of bits out of boxes, hundreds of big bits of TLS encrypted traffic to all sorts of customers. And so that workload is a very high performance workload in terms of the role throughput, the individual connections. My understanding is they're not aiming for like a hundred gigabits on a single connection. Instead, you need thousands of clients connected to a box.
Many of them at the end of very slow links with maybe turbo latency and packet loss and drop. So being efficient about pushing out as many bits as you can while tolerating a very mixed quality of the links that you have, that's kind of what they're focused on and working on the things that changes they make in particular to free BSD around a lot of work in the TCP stack and doing those TLS offload and things like that. Yeah. So there was some collaboration with Chelsea O, I believe, and that's who you were contrasting for. So one of the things that Netflix was very interested in early on was the ability to encrypt all the traffic that was going by.
And then a couple of different reasons for doing this that I wanted you to get into, but this presented a bit of a technical problem. Traditionally, when you were just sending web traffic and stuff effectively with certain movies, it's just web requests like that, you know, a couple of megabytes of the time of these back end movie files. Traditionally, OS's both Linux and frequency had an optimization for a website where then if you're sending a chunk of a file over a socket, you can make a single system call, a SIM file, and the kernel would take care of running the state machinery between as interrupts are coming in from the network device and interrupts are coming in from the storage device. When it blocks, you can send it straight out the socket to the neck and never involve user land at all. And the kernel can do this all synchronously and it's very efficient.
Well, the minute that you throw TLS into the equation, all that goes out the window because somebody has to encrypt the traffic. And the old way of doing this was you did all the encryption and user land. So now you have to go get bits from the disk, using a blocking system call, wait for the bits to go from the disk and use the land, copy them out to use the land, and the encryption copy that data back into the kernel into a separate buffer to be sent out on the deck on the socket. And unlike SIM file, where if you're not using TLS and you're sending the same file to like 20 different clients, you only need one copy of that file's data in memory. Inside the kernel, we can share the pages that hold that data among multiple open network connections.
That's really easy to do. You just share the same page and send it down multiple network connections. So TLS is not the same data, but as every different connection has its own session keys, you have to encrypt the data differently for every session. So no longer can you share the data, you use much more memory, you start using more bandwidth on the PCI bus and so forth, and it kind of all cascades down into horribleness. So one of the solutions that Netflix pursued to help address this, let's do move the TLS processing out of user space into the kernel.
It allows you to get back to using SIM file and have the kernel manage all the workflow. And initially the way they did this was to, you still end up with multiple copies of the data, but you're able to do the bulk encryption, like the AES, GCM, what most common it is nowadays, so you actually encrypt the data and send it out on each connection. And then an internal version of that, one of my first projects that I worked on, that's helping to clean it up a bit so that it can be upstreamed into free VST, because they didn't consider this to be their secret sauce, that their secret sauce is making movies, the secret sauce is not TLS encryption. So they were happy to have that be something that we could put into stock free VSTs that other people could use it and also contribute to it. Then as a following project to that, another of my clients is a company called Shellsio, that makes some smart nicks that have more than just kind of ethernet inside their neck, they can do various things like TCP offload and whatnot.
And they have the ability to do the actual encryption of individual TLS packets on the neck. So then I extended the framework that had come initially from Netflix to allow for some network connections, we may not need to do the encryption and software in the kernel, but we can send the raw, unencrypted data all the way down to the neck and it can encrypt it on the wire on the way out. And one of the advantages of that approach is you no longer need separate copies of the data. You're back completely to the original SIM file version where you have one copy of the data for the raw file on disk and what the movie is, and that's the only copy you need inside memory of the host, and only the nick is actually doing the way they put the data on the fly. So that was kind of interesting project because I got to work with, it ended up being effectively the joint project of what does Netflix need as a customer, what can help Shellsio kind of sell their nicks and what's the design that works for both of those and allow us to glue things together?
Yeah, and as you call out, it was a sort of collaboration where Shellsio, they had to open up their hardware specs effectively to make this possible. Netflix kind of funded the whole thing. I mean, just in front of the rest of our work. So I'm a contractor for Shellsio, so I can access their docs under the India that I have as a contractor. So the Shellsio, I wrote as on the Shellsio side, but I already looked at the design of how this is going to help it work.
Okay, yeah. That was very interesting. I think again, for our listeners, understanding how these things come together is helpful as well. Equally, I work on projects that have these kind of same dynamics where it's three parties and party A doesn't necessarily directly talk to party C, but because you've got B in the middle, the whole thing can work basically. So yeah, makes a lot of sense.
And then maybe just touching briefly on macOS, again, like what was maybe the history there for why FreeBSD ended up in macOS. So I think my understanding is after macOS 9, I guess what it would be, Apple started working on macOS 10. They borrowed a bunch from, I believe, next. That's kind of where the Maki bits came from because there's bits of macOS that are very Mocked arrived, but there's also a fair bit that is BSD to run. In particular, I believe the initial network stack in macOS 10.0, which has largely came from FreeBSD or at least in that BSD, but BSD bits in general.
And a lot of their libc, their equivalent of g-libc in user space is largely derived from FreeBSD. So in particular, one of the things that also happened is several of the folks that I originally worked with in my first job out of college went to Apple and kind of taking part of the frequency culture, wasn't like a C-minestay or at least like the mind share a little bit. And working on whether it was user space bits or currently that's an all sorts of Apple products that came down the line. So there's a lot of kind of friendship between the projects in part because there's a lot of friends between the different communities. Yeah, okay, makes sense.
So let's move beyond where FreeBSD has ended up and actually a little bit to maybe a key part of the journey of FreeBSD itself. I guess it's what we call SMB, so Symmetric Multiprocessing. I think this was something that sort of had to evolve over a few years even. But yeah, could you maybe just talk to me like, what was the problem and why did this have to be solved and how was it solved? Problem is physics and it's root.
But S&P is the problem of that. At some point, CPUs, we can no longer scale them individually to get performance. We had to scale horizontally instead of vertically. So we started having to have multiple cores in the systems. And dealing with multi-threading is a complex problem in any environment, much less than OS kernel.
So I started supporting S&P systems like dual Pentium systems or dual Pentium Pro back in that kind of era of very late 90s, a lot of parallelism. And that was kind of the point when I got this first job working on FreeBSD stuff and I was supposed to, fresh out of college, work on a bootloader for itanium. I think some changes to the installer to have a better user interface and installer. It was one of the things I was supposed to work on. But one of the things that happened is right around this time of 2000, the company I was at was called Onek Rig C-ROM that merged with the company who had the 1,800, its Unix telephone number, Deforming a newer company called VSCI, and we had this commercial VSC operating system.
And to help bootstrap FreeBSD's effort at having a more mature, supportable, and processors, they kind of gave us a code up and said, hey, you can borrow stuff from us. Like an initial version of kind of their way of doing lock-in and so forth. And so we had some developers in the community who are working on that. And I started helping out on IRC during the nights and during the days at my new job. And somehow, a couple of months in, I'm actually doing a lot of this work, even though I'm fresh out of school and went behind me years and probably shouldn't be doing this work.
And having to learn a lot of things about the comics and so forth, which is actually the itanium manuals are very useful for me because I worry about things like require release semantics of memories. It's now like how you talk about concurrency and so forth. But I started working on this project, which in trying in FreeBSD, we called it S&P Next Generation. So S&P and G is what we called it. And it's a long-running project.
Initially, FreeBSD, when they were just trying to get this to work on plain x86, like the dual finions, they did the most 90-thing you can do, which is you have one giant spin lock around the entire kernel. And any time a user process would go into the kernel, it would have to wait for this one giant spin lock. There's a wonderful book I read when I got out of college or maybe what I see here are so-called UNIX Systems for Modern Architecture, which modern meant late 90s. And it talked about the way that systems like System 5 release 4 and a few other systems, how they had done S&P, and the model that FreeBSD had is the one that I believe a book describes is not the worst possible thing you could do in terms of it doesn't scale at all, which you start having more numbers of words. So the effort to run S&P and G was how do we not have one giant spin lock and how do we have a system where multiple things can happen, not just in user space, but in the kernel, concurrently on different CPUs.
And FreeBSD shows to go with a design that modeled more of the way that Solaris and perhaps Hirex kind of in other commercial instances did it, where we created dedicated threads in the kernel where inner handlers would run instead of running inner kernels handlers on your kind of borrowed context. Linux still actually does the kind of borrowed context thing. I believe Windows does do it as well, in fact. Although a DPC in Windows is kind of like kicking things off to a thread sort of that we do in free DST. But we had this, that was one of the first things changes was how we knew our inner handlers into threads.
That was actually the first thing I was kind of helping to stabilize the Atlantic in the tree. And then from there, I started working on things like, well, we've got this code dump from these nice generous folks, but it's kind of very x86 specific. And we had some kind of early patches for an alpha port that we had to try to bring up S&P on alpha, and I kind of had them smash those things together and tried to clean up the S&P code to be more portable and not very x86 specific, which meant refactoring the mutex code we inherited and defining extensions to our atomic operations to do with memory barriers and various things that kind of get us to the point where we're a little bit cleaner and kind of can expand over time. In terms of the project itself, though, multi-threaded kernel and like, you might think of it just like performance scaling across multiple cores is a never-ending project.
Like you're constantly just finding new things. Like Netflix continues to push the boundary in certain areas of the system. We have mostly gotten rid of this legacy giant lock that we had as our whole over. And I think it's now effectively around the keyboard driver and a few other things that just kind of aren't more fixing almost at this point. So it's mostly done, even though the variables still exist.
But even so that we have a multi-threaded kernel, like performance scaling continues to be a thing, right? We continue to grow sideways. When we were first doing S&P and G, we were worried about scaling well on 4 core or maybe like 6 core 8 core systems. And now we have to scale on 512 core systems. So it's kind of a never-ending problem because physics, like we just don't get to have 40 gigahertz processes.
So, oh, well. I mean, just briefly going back to how you described the project being set up overall, is that still almost like a certain set of contributors that work on like that scaling side or is that again, it's like a distributed problem across all of the pieces? Yeah. So, as for EBSD has evolved, modernized storage, I believe, has sort of been an interesting area that things have had to develop. I think a lot of our listeners will understand just this evolution of how storage operates going from HEDs to SSDs.
And then now we've got NVMe's, we can probably do a whole episode on that in the future. I think it'd be interesting to just understand how 3DSD has to adapt to this evolution. And then we're also going to just look at how, like a major release came out early just the end of last year, version 15. It'd be very interesting just to hear what leads up to that. And then again, perhaps like, what is 15 as well?
So that's a lot of questions. Let's go back to storage. How is 3DSD in storage sets it evolve? Well, I think in general, storage has evolved in the industry. If you look at old spinning rust and the command sets we had with things like ATA or SCSI, and SCSI in particular, has very complex state machines.
And if you go look at the spec for, I say the spec, there's actually several specs. If you look at the specs for SCSI, it's very, very complicated. And if you go now to look at the spec for NVMe, NVMe is very simple. And part of what's happened is as we moved away from spinning rust and we moved to flash memory, it turns out that a lot of the complexity you needed to do was controller timeouts or seek latency and so forth, those are no longer relevant in a flash storage world. And so NVMe arose a bit out of, well, can we make something that is a lot simpler and cuts away a lot of the complexity?
And that complexity, though, gets mirrored in the software stack too, right? So in previously, we have a mostly unifying kind of storage framework, something that I think was a standard developed outside of previously, but previously adopted called CAM, common accessness, I think is what it stands for, which is how we deal with SCSI and ATA and how we deal with NVMe. But if you look at the bits, like the state machine handling for NVMe inside of CAM is much simpler than the state machine handling for SCSI and ATA and so forth. You'll be able to make that model work fine. But certainly moving forward, life gets a little less complicated.
You don't have to worry about just scheduling in the same way. But now with NVMe or flash storage, you do have to think about things like TRIM, which you didn't have to think about before in the same way on spinning rust. But you don't have to think about the elevator algorithm and trying to sort and minimize the seek head, the amount of time you're moving the head around with the seek time of moving your heads is, that's gone. So, seek latency is basically gone. But you do have to kind of think about when do I trim, how much do I trim, that's kind of my big bottleneck of how much bio-scasional between trims.
And so, there's a different kind of problem, I guess, to think about. And then there's also network attached storage things like ISCSI and NVMe over fabrics, which is you want to present the same command step and over network connection. And there, you don't like definitely seek latency is not quite the same thing at all, because it's all this kind of virtualized notion of a storage device. And then it all kind of looks up in the same way, all of our storage layer in the same way. So, what do the APIs have to modernize as well along the way?
So, it's not necessarily because of storage, but in terms of modernization. Well, I guess one way to look at it is that as a long running source project, gosh, all 30 years old, it's crazy to think I've been around it for 25 of those 30 years, over time you would create a bunch of technical debt and you'd have APIs that looked good in the past. And then, as you've worked with them for several years, suddenly they're not quite as useful maybe or they're a little crafty. And so, one of the things that I also do, this is more my volunteer time, is I will try to find some things that are kind of crafty and clean them up. It is a balance, you don't want to do churn for churning sake, because that doesn't do anybody good.
People who are carrying downstream forks like Neffleks, he calls them undue suffering by making them merge a bunch of conflicting changes. But in particular, in our device driver frameworks, I found a couple of things over the years that annoyed me, where through some legacy reasons, like in every device driver we required you to declare a global variable that was used in a macro that no one ever used, and so I did some work over the past couple of years to transition as to where you could use the macro with without the variable and then once all the treatment converted, then I dropped the compatibility shims. I've done another one this year. The compatibility shims are in 3D50, but I haven't finished the transition. When you're dealing with IOP resources in the device driver, things like memory mapped IO or IO port from a PCI bar, but also other things like PCI bus numbers and so forth that a driver might need to kind of allocate and hold on to or map and then use it to read registers.
The way our API worked is there were various functions you had to call both to allocate the resource when you wanted to use it, maybe to map it and release it when you were done. You had to pass several redundant arguments kind of to every step along the path. So even though like in a true object or to design, the very first thing you called it allocated a resource, it gives you an opaque object back and the opaque object knows things about itself. It should know all the parameters you pass to it. So one of the changes I made was to make it like learn the one missing parameter that it didn't already know about itself so that for all the following calls, like releasing a resource or mapping ones into a CPU address space, you just pass the resource now instead of having to say, is it memory versus IO and what identified that I used?
Like which PCI bar was it? So that it just makes it a little bit simpler and less for the programmer to think about. And those seem like worthy cleanups and they're ones where using either evil or magic between your perspective and the CPU processor, you can allow both forms to work for a while so that you can across multiple versions, you can allow there to be compatibility so that device driver developers don't have to worry about it if they adopt the new one they can still use a file when they merge changes to order branches and that's kind of the strategy to take it in that case. And those are nice cleanups to do. It's healthy, I think, in code bases to clean up things like they get crusty after a while because if you avoid doing the setical, it just gets bigger and it's somewhat because a bigger round to have to shovel through.
Yeah, absolutely. I really like that framing because at the end of the day, this is helping developers use it and I think often other projects, usually just because of time of the maintainers, it's just almost impossible for them to come back to these things, even though they fully admit or agree that something is crafty or just out of date by the standards of how a developer might want to interact with that framework. And also one of the things that especially early on, we would kind of talk about the previous community is that in a corporate environment, you're writing software, you're under a time crunch in a schedule and it's chipped fast and not chipped well. And often you write code that you know is kind of craft or prototype and it's one of the doors and it's like, there's nothing you can do about it as at the engineer level. And one of the things that I think some people really enjoy about working in open source in general and in previous in particular is we have a place where we can do things right.
And you can take time and not, you're not under a time crunch in a schedule the same way to push something out the door and you can sit down and think, well, what is a good design and work with a good design and take your time to do it well and maintain it and keep it clean kind of in this platform. And that's one of the reasons I think people are attracted to doing this kind of work in an open source space is without that time pressure of employer, you get to do it right and kind of do it well. And I like to have peace about what you did instead of knowing that some products shipped and you wrote it and you would rather dis on it. Yeah. Well, talking about shipping version 15 came out at the end of last year.
I believe that was roughly a kind of two year cycle versus when 14 came out is that kind of a normal cycle and like I guess what contributes to the state's the thought around a major version bump on VBSD. So it is now kind of a normal cycle. Historically, we've aimed for that kind of cadence of roughly two and a half years or so between major releases or before that it was a bit more up in the air. One of the changes that's happened in the last couple of years is we had a different person become our lead release engineer and this individual, these are really great guys and it's called, first of all, very smart. He wanted to have a very fixed kind of release schedule, which is what some folks in the community have been calling out for years, but he sat down and done it.
And so he's got us on a pretty fixed schedule where now and 15 was our first major release that was kind of on this new schedule that he proposed. We're doing a major release now in Q4 every other year. So every two years we'll have a new, that's like 16 out of will be two years from last December. And that's already kind of sent and sewn for us. And our minor releases are now once a quarter.
The only difference being we're going to major release, we take a whole half year to focus on that so we don't have the Q3 release on those years. But you know, so now we have I think 14 four is going to be Q1 this year and 15.1 will be Q2. So now we're actually a better cadence that I think is healthy for us as having releases that have fixed interval. And this means they're not getting on a feature. And so developers don't got developed.
That's the sauce that goes into releases. It's just a thrash of things they work on. And so it's a coordination of developers working on stuff. But then being respectful of the timelines too, I think one of the things sometimes we would see in the past, we didn't have a good fixed schedule is when you would announce a release because there was uncertainty about when the next minor release would be, then you get this last minute for like a ton of stuff that would land in the tree all at once. Not only is the most stable of things being merged last minute into the tree, whereas having a fixed schedule means that we can, at least in the experience of power to say no, if he used to say no, or she used to say no.
And developers know, well, if I missed this one, well, there'll be another one on this branch in six months. So it's not the end of the world. I know it's coming. I know my bits will get out and it takes a little bit of stress off. It also allows companies who support drivers in the tree, for example, they wanted to have a schedule to know how to schedule and try to kind of their internal resourcing and now they have that.
So they can figure out when they want to put bits into the same branches in advance enough when it releases a lot. Yeah, that makes a lot of sense. And yeah, that predictable cadence, I think, as you say, so it helps literally everybody who's part of the process and the end consumer, if you like, I either the company's taking which bits they would like to as well. So as we kind of start cruising towards the end of the episode, I do want to touch on Sherry, though that's C-H-E-R-I for those looking this one up. What is Sherry?
So Sherry BSD, I believe, and like, what is that project? And yeah, that's sort of interesting evolution. Sherry is a research project that's kind of been developed at the University of Cambridge in the UK. That's where most of the effort is centered. There are a few of us, like myself, who are contractors who can help the project, who are scattered in the US and other places, but it's mostly a team of folks in the UK at Cambridge.
And Sherry is trying to leverage some ideas from an older set of computer systems called capability systems. And I won't dive too much into that, but folks who are a bit more bragher than I do might be familiar with capability systems, which were a different way of thinking about software. But Sherry aims to take some of the ideas, not exactly the same capability systems from the past, but some of the ideas and see if we can use them to make existing real-worlds C and C++ code more memory safe, because existing C and C++ code is very memory- unsafe today. So if you're familiar with buffer overflows, the reason we have them is that at a core level, at the ISAs of contemporary CPUs, like X86 and ARM and RISC-V, the way we think about regions of memory is we have a pointer that has the address.
We started the address, and it knows nothing else. It doesn't know how big the region is. It doesn't know if you've moved partly into the region or partway out or if you've kind of jumped in front of the region, the pointer has no idea. It's just a number. It's just the address.
And so this means that it is up to software and software engineers to maintain all the metadata correctly about how big it, when I call Malek to get memory, how much did it ask for and keeping track of how much I asked for and making sure I don't get that long. And if history has shown us anything over the past many several decades, it's that we as engineers get that wrong all the time. So one of the big changes Cherry makes is that Cherry proposes a different register type down in the hardware that is something called a capability, and this part is kind of similar to capability systems where you can have a register that has not just an address, kind of in the low 64 bits or 32 bits. But you have another word of data that goes along with that that includes other information about a region of memory. So it can include information like bounds and permissions.
And the bounds are encoded using kind of a floating-point scheme to avoid having really big pointers, only twice as a day, not like four times a day, it's a starting point. But we're able to store this information about pointers down inside the ISA. And in addition to having some metadata, we also have this one bit tag on the side that we use to maintain whether or not pointers are valid. And part of the reason the tag is important is it allows us to constrain the operations you can do on a capability. So you can reduce permissions on a capability by reducing the bounds or ending out some of the permissions you already have, but you can never increase the permissions.
You can't gain broader rights than the capabilities you already have. In particular, if you try to do an operation that might do that, what will happen is maybe we'll actually modify the metadata word of the capability, but also put up a tag to say that the thing you've got to result, you can no longer use. Then the other change you make in the ISA is we make load and store operations, now use these capability registers as your base address register instead of a plain integer. So now all your loads and stores memory access is heavily authorized by a valid capability. And we can verify when your access and memory isn't in bounds, or you do a load against the capability that has a read permission, or you do an instruction fetch against the capability in your program counter that has a CQ permission, and if you break those rules, you can accept it.
Instead of wandering off into undefined magic machine land, where bad things happen. Then on top of that, we modify the ISA to now have this new type, and we modify all the general purpose registers in your CPU to use this new register type. And we have the memory subsystem to allow us to store tags and memory, and make sure it's all coherence. So for example, if you do automics, we'll make sure the comparison swap does the right thing with tags all the way through. Or if you do just write a memory write to something, you'll actually clear tags, but you can only preserve tags if you go out of your way to do the right thing correctly.
Then on top of that, we have extended LLVM to support shared architectures. And when you're compiling for a shared architecture, all the pointers in your scene C++ application now become these minor capabilities of metadata. And that includes both explicit pointers, so things you declare in your source code, but also, there's lots of things that your runtime creates inside your process that you as a developer never see. Things like got tables, which are how we kind of indirect to get to global variables inside other parts of your program, or like in C++, if you have a class with virtual methods, and you have an array of these pointers to all your function pointers of Vtable, and all those things become capabilities in shared C++. And it turns out that for some code, things like operating system kernels, and maybe your C librarian or C runtime that wants mallet, you have to make some changes.
Because for example, in mallet, you need to make sure that if someone asks for 16 bytes, that you get a chunk of memory from the OS, you need to narrow the bounds to make sure that the pointer you return to the caller can only access 16 bytes. So you have to make some changes in places like that. But a lot of application level code turns out you don't have to make so many changes. So for example, we've been able to run most of KDA and QT on top of a system I'll talk about in a second without having to make hardly any changes inside of KDA or QT itself. Because it's pretty clean, well-disciplined, plus-known, and that just compiles for this alternate API out of the box.
In terms of places you can run, Sherry, when I started with Sherry, it was kind of definitely a very, and still is a research system. It's all sorts of research we're still doing. It was focused on MIPS, and so we had extensions on MIPS, which is a lovely little architecture from way to describe it. But other folks have also started to address. So we have a particular ARM, has found Sherry very appealing.
They actually built a custom CPU and SOC called Morello around that implements kind of Sherry extensions on top of the ARM v architecture. And it's like I have one over here, it's like a quad core 2.4 gigahertz processor and that's the thing that like they can run KDE, they can run kind of a full-blown Unix. Sherry vsd is a port that we have a free vsd to run on top of these ecosystems and to support these architectures. And that's so that's my box is running Sherry vsd, run KDE, run kde, run a web browser. We actually even have an early port of Chrome, which is an incredibly amount of work for people to do.
But it is a real thing, it can run real software. There's also been interest in the first five community. There's currently an ongoing effort to standardize into extension called RVY. Hopefully later this year perhaps we'll finally be ratified as an alternate base, I say, to risk five to support Sherry systems. So it's a very interesting bit of work.
And it's kind of compliments other work going on in the memory safety space. So if you look at other things like Rust, other languages like that, Rust still needs bits of itself, and it's run time and so forth that are written in C. And so Sherry gives you the opportunity to enforce the memory model all the way down into even the bits of C that interact. We had an earlier research project that dealt with this in Java and dealing with JNI where you could enforce the memory model from Java down inside the JNI code that was running because it had to use Sherry capabilities to access anything inside of Java. And so all the restrictions in Java were the enforce.
Or things like Unsafe Rust code could still have the same restrictions because it's in the ISA. It's not something that can be bypassed. It's not truly maintained kind of in software. Yeah, I was going to touch on the Rust piece because we do have a lot of Rust listeners I believe in. So probably some of them are saying, but why not just use Rust?
So yeah, and you've given very good explanation of at the end of the day having a much lower level implementation of this memory safety can be very advantageous. Well, I think memory safety is a big issue, right? I think Microsoft did a study that's something like 70% of the critical vulnerabilities that they had a ship of patch for, boiled down to the reseity in some form of passion. And we need different toolkits to address the problem. It doesn't seem to me realistic that we're going to rewrite everything that's currently in seeing some other language.
There's billions, if not trillions of existing C code in the world for better or for worse. And you know, we're kind of stuck with it. And some of the stuff we're going to be running rest, but some of it may not. So it may be very hard to rewrite. So we need different tools for different options.
And so I think Sherry is a good alternative to give us more tools to attack the problem. So we're coming to the end here. You've imparted a lot of knowledge and wisdom today. I think a lot of our listeners will find that they've learned. I'm not going to say something today.
I've learned a lot today. I sometimes ask this question to guests just as a round out really just what is something that you know now that you would maybe like to tell yourself coming out of college or high school, whichever you know now, I mean, really to perhaps software development or career and software development. What would you tell yourself then that you know now? One of the things I've had there earlier during a few years ago was teaching on the Greg Horse for four semesters, or less as you can imagine. And so I'd actually think to talk to my students a few times along these lines.
I guess some of the things I would tell them are like, have fun. That's definitely true. Things like when you're doing a job interview, recognizing interviews at two weeks street, it's not so we use a candidate who are trying to do something. You should be paying attention to the culture of what you're interviewing to decide, do I like these people? Like what were these people?
I think it's a really valid thing you should not purely think about. It's only a view of being service of the company. I always recommend a couple of books. Some books I really I enjoyed when I first got out of college for the Mythical Manmas. It's one of my favorite books.
Sadly far too relevant today. And I think Frederick books said that in the 25th anniversary, which is what I was reading in the 90s, and it was still sadly too relevant. It's very relevant today. Another book I really enjoyed is something called Peopleware, which talked about some of the neither one of these is about like 16 of bug in it. Neither one of these is about like writing four books or anything.
They're about thinking about the art side of software engineering, which you're doing. I guess one of the things I would tell my students is that your job is not to just grab random things off the stack overflow and throw them in because you won't earn your salary if that's all you're doing. Like your job is to like engage your brain and think about solving the unique problems that your employer has. And lots of times that does mean assuming things from other pieces that you find, things you find on the internet, but there's going to be some wrinkle where they just can't be something off the shelf because the off the shelf thing will be a lot cheaper. So like to justify your existence, there's got to be some wrinkle to it.
Like lean into that. Like in this case, that was usually till the beginning to do your homework assignment. It's not because I need copies of your homework assignments because you need to practice and you get your 10,000 hours and they get competent. Yeah. And I think that's more relevant than ever.
We've managed to really not even talk about AI whatsoever on this episode, which is great. I think we seem to touch on it almost in every episode, but I think all the things you've just called out. I was talking to one of the other presenters the other day on more. We have a regular SED news episode where we just talk about kind of more just very current. And we were talking about what does the education landscape look like for people today.
I argued that a CS degree and just claimed right don't have a CS degree, but a CS degree is still very powerful because it's about how you think about solving problems and everything you just said, John, I think holds true. It is just about leaning into solving problems and thinking about how to solve problems and so forth. Someone's going to make the Yamashines work. That's also true. Yeah.
For the record, my son is a first year. He's a freshman in CS. So that's actually a lot of fun because I'm perhaps assisting his teaching and making him learn the painful, will little bits that maybe he's not getting in class. Well, I think you'll have probably a very good career as a result assuming he wants to continue with software development. So for development, John, again, thank you so much for the time.
I've learned a lot. I'm sure the audience has learned a lot and managed to peek into the world of free VSD, which is very interesting. And as we've learned, power is a lot of what we basically use daily without even realizing. So thank you very much. Thank you for having me.