How to make a custom BSD-based OS reddit / freebsd ---------------------------------------------------------------------- Oxey405 路 2022-09-12 10:16 Hey 馃憢! So I'm a bit interested in operating system but idoing it from scratch seems overly complicated and is not optimum. Do I was thinking about using freebsd to make one. One small problem, I don't know how to build it and how to modify it. Can someone here help me understand how FreeBSD works or give me resources please ? [EDIT] I've seen a lot of people discouraging me from doing such a thing because it too hard. Thanks for the advice I'm sure you are right, I'm not a "good" programmer but : This is for fun and learning purposes so please don't tell me that it's too complicated I know it is but experiments is what I like in dev! Thank you anyway for your guidance! ---------------------------------------------------------------------- RemoteBroccoli 路 2022-09-12 10:44 [https://youtu.be/L1m7O49RSYU](https://youtu.be/L1m7O49RSYU) Take a look at this excellent howto by /u/robonuggie It's a perfect example of "How to when you need one". ---------------------------------------------------------------------- celestrion 路 2022-09-12 12:04 > doing it from scratch seems overly complicated Rather than overly complicated, it's as complicated as it needs to be, given the state of hardware, firmware, and protocols right now. Operating systems are big, and the concerns they manage are tiny and fast-moving. > I don't know how to build it and how to modify it. [https://www.freebsd.org/cgi/man.cgi?build](https://www.freebsd.org/cg i/man.cgi?build) > give me resources please ? [https://docs.freebsd.org/en/books/developers- handbook/](https://docs.freebsd.org/en/books/developers-handbook/) ---------------------------------------------------------------------- VastAd1765 路 2022-09-12 12:29 FreeBSD is a complete operating system unto itself. You don't base an OS on something that is already an operating system. Unlike Linux, FreeBSD is not a kernel. ---------------------------------------------------------------------- laffer1 路 2022-09-12 13:25 Strong disagree. Dragonfly and MidnightBSD are both freebsd based originally and the latter tracks major changes still. As for a base on freebsd and doing a distribution there are many examples of that including ghostbsd, pfsense, truenas core, etc. I run the MidnightBSD project. If there are specific questions, feel free to ask me. ---------------------------------------------------------------------- laffer1 路 2022-09-12 13:34 First you need to decide what level of customization you are planning. Do you plan to use the same package manager? Are you going to build your own packages? Will you support freebsd update or package based upgrades? Are you going to support portsnap? Will you have your own ports free? There鈥檚 is a lot to build if you go down that route. You could also consider netbsd pkgsrc for instance. You will need to write scripts to customize for your goals. Learn how to build release ISO鈥檚. ---------------------------------------------------------------------- Oxey405 路 2022-09-12 13:48 I think what I want is basically making custom ISOs yeah but also creating a Nintendo switch-like UI and learning a bit on how an operating system works in the first place. I'm not yet in ingeneering class but you know... I want to try... For fun ! ---------------------------------------------------------------------- daemonpenguin 路 2022-09-12 14:01 Lots of platforms are based on FreeBSD. GhostBSD, DragonFly BSD, Midnight BSD, the PlayStation 5 OS. ---------------------------------------------------------------------- Oxey405 路 2022-09-12 14:09 Isn't the Nintendo switch OS based upon FreeBSD ? ---------------------------------------------------------------------- Oxey405 路 2022-09-12 14:10 I'll look that up thank you ! ---------------------------------------------------------------------- laffer1 路 2022-09-12 14:10 I don't think so. They did use some BSD code. The PS4 os is based on FreeBSD 9 and I think they did something similar with PS5. ---------------------------------------------------------------------- Oxey405 路 2022-09-12 14:10 Thanks 馃憤 ! ---------------------------------------------------------------------- laffer1 路 2022-09-12 14:30 I started MidnightBSD in college. It's been a great learning experience even if I haven't hit all my goals. Some projects make their own build system for releases. Others piggyback off freebsd. The short version with freebsd: Do a buildworld/installworld/mergemaster as normal. Ideally install this, reboot and do a fresh make buildworld buildkernel Then go into /usr/src/release; make release; env DESTDIR=/usr/rel make install This should put release ISOs in /usr/rel. If you have to build another set, make sure you run make clean in the /usr/src/release directory first. DragonFly had a "nrelease" folder that builds a live cd. I copied this years ago in MidnightBSD's repo and was able to add to it to make a live cd. Not sure if dragonfly still does this or not. I think GhostBSD has their own release setup and you can check their repository for details on that. With MidnightBSD, I use the FreeBSD approach right now with /usr/src/release and then have an additional script in etc/rc.d/firstboot that does an install of GUI components from packages. I've wanted to replace the install process for awhile, but I need to work out some issues with our package manager first. I'd like to install via packages which requires adding a system package type and making a static version of the package manager. You could probably work on the UI bits first and get that working some and then work out the details of the rest. I made the mistake of trying to get the base os, ports tree first and I've basically been doing 70% ports/package manager work ever since. If you have a unique thing to pull people in, it's easier to get users and other devs helping you. I was able to get a lot of help while in college between students and hitting IRC during the day. It's been harder to get folks to help with a full time job. I'm not online enough for some people. ---------------------------------------------------------------------- VastAd1765 路 2022-09-12 14:37 Platforms are not operating systems. All those above are FreeBSD with custom configurations and software. They are still FreeBSD with add- ons. he wants to make an operating system with FreeBSD but FreeBSD is already an operating system. ---------------------------------------------------------------------- [deleted] 路 2022-09-12 14:38 [deleted] ---------------------------------------------------------------------- loziomario 路 2022-09-12 14:39 Giving man and handbook to someone means to give a very special suggestion ? Do you think that he didn't know about those primary resources ? Don't you think that he may have already gave a look at man and handbook and maybe he is asking for a more specific resource,I mean something more focused,updated and practical... ---------------------------------------------------------------------- laffer1 路 2022-09-12 14:39 DragonFly is a completely different operating system. It forked off FreeBSD 4.x and has diverged a lot. By your logic, all BSD operating systems are 386BSD. They can never change or evolve. MidnightBSD is harder to describe because it's more than what GhostBSD does, but it is still mostly FreeBSD under the hood with changes to the kernel and userland, additions, subtractions, etc. ---------------------------------------------------------------------- VastAd1765 路 2022-09-12 14:43 Those are forks of FreeBSD where they took FreeBSD and changed the insides, presumably the kernel and other things, and turned it into something different. Similar to taking BSD4.2 and creating FreeBSD. But this is not what the OP wants to do. The OP says he wants to create an operating system but FreeBSD is already an operating system. If he wants to make a fork, that's something different. ---------------------------------------------------------------------- laffer1 路 2022-09-12 14:44 This is covered in my post. I mentioned distributions like ghostbsd, pfsense, truenas core. They are still FreeBSD. uname is still going to print FreeBSD. This is what the op wants to do. I think some of you are trying to get at the definition of operating system. Some folks feel it's only the kernel. Other definitions include the tools required to manage the OS. This distinction allows people to commonly include purpose-built distributions as an operating system in everyday speech. It's fair to argue that pfsense is a distribution of FreeBSD purpose-built as a firewall or that it's an operating system depending on your hot take on the definition of OS. The distinction doesn't really matter to answer the OP's question. ---------------------------------------------------------------------- celestrion 路 2022-09-12 14:48 > very special Was not listed as a requirement. > Do you think that he didn't know about those primary resources Quoth OP: "I don't know how to build it." The `build` manual page gives exactly that information and the "updating FreeBSD from source" section of the handbook does, too, so I'm guessing, "no." > maybe he is asking for a more specific resource More-specific answers require more-specific questions. > something more focused,updated and practical Something more focused than the exact manual page which answers the question, more up-to-date than something maintained *alongside the source tree*, and more practical than the "examples" section at the end? Please post it! ---------------------------------------------------------------------- loziomario 路 2022-09-12 14:53 For example the youtube video given as a suggestion is something more pratical,focused and fresh than the man and the handbook. Personally I would have jumped on that video before to read from the man and the handbook. A video tutorial is even more funny to learn. And the robonuggie videos are high quality videos. But on the end I think it's a subjective matter. The point here is that I think that to give as a suggestion to read man and handbook is a pretty useless suggestion for many. It is given for grant that everyone should read there. But some people don't do that. So,it's a better idea to ask ourself why and what benefit there is to give a foregone advice like that. ---------------------------------------------------------------------- JuanSmittjr 路 2022-09-12 15:09 what's your definition of an OS? ---------------------------------------------------------------------- celestrion 路 2022-09-12 15:35 > Personally I would have jumped on that video before to read from the man and the handbook. And personally I never watch videos when trying to learn anything in- depth about software development. Jumping back and forth between different timestamps in a video seems an awful way to understand, for example, the various targets exposed by `sys.mk`, which is absolutely something a person will need to refer to when rebuilding the operating system. That's probably why the Lions' Commentary was never turned into a book-on-tape. Watching someone talk into a microphone and type into an editor turns out to be a really inefficient way of obtaining in-depth information when you're not trying to do the exact thing the presenter is doing. > read man and handbook If that was my response, you'd have a point. Instead, I pointed to *the exact manual page giving the build instructions* and the link to the current developer's handbook, which will likely answer whatever OP's *next* question is. These are the canonical resources for the questions asked in that **it is valid to file a bug report against them when they are inaccurate**, which cannot be said of a fan-made video. > It is given for grant that everyone should read there. But some people don't do that. If three decades of writing software has taught me anything, it's that people do not read documentation by default. Saying, "read the damn manual," is not helpful because it's a huge and intimidating wall of jargon. Saying, "here is the exact place to start your journey," *is* helpful because it narrows the focus of the problem, and because the answer found there is more correct and authoritative than is likely to be found elsewhere. Honestly, if the manual is too difficult for a reader, they should first look to gain that necessary technical familiarity before attempting to build an operating system. OS development is truly difficult, and there really is a lower bound to how simply things can be presented while still being useful and complete. But you are, of course, always welcome to post a better resource. ---------------------------------------------------------------------- setwindowtext 路 2022-09-12 16:40 I agree with you, reading handbooks is boring and inefficient. At the same time, I believe that watching videos is a waste of time. I think a better idea is to enroll into a 5-year computer science program at MIT, graduate with distinction, and then start writing your own OS. ---------------------------------------------------------------------- [deleted] 路 2022-09-12 16:40 [removed] ---------------------------------------------------------------------- loziomario 路 2022-09-12 17:35 I suspect that to "enroll into a 5-year computer science program at MIT, graduate with distinction" is not even enough to write an OS. To write an OS there is the needing to create a whole team of programmers,each one with a specific expertise. I would add also a good attitude with relationships,otherwise even a good programmer could enter in conflict with the other ones and he may be expelled. Do you have an idea about how much money do we need to spend to enroll a 5-year computer science program at MIT ? I'm curious to know that. I live in italy,I have no idea. ---------------------------------------------------------------------- theRealNilz02 路 2022-09-12 18:08 Easy answer: Don't. What you can do is to Setup a minimal FreeBSD and then add the Software you want/need to it. ---------------------------------------------------------------------- setwindowtext 路 2022-09-12 19:02 You would need to google it yourself. I would expect anywhere between $50K and $100K per year, plus excellent results on the intake exams. ---------------------------------------------------------------------- [deleted] 路 2022-09-12 20:27 Hi OP, if I were you I would use the FreeBSD handbook to install FreeBSD. I would then install xorg and a desktop environment like xfce. All of this is easy to do if you walk through the handbook, use the man pages, and search the forums and this subreddit for questions. Then I'd install something a window manager like fluxbox or openbox. I would heavily customise that window manager. This is going to take some time, but these window managers are heavily customisable. ---------------------------------------------------------------------- nohearth 路 2022-09-12 21:37 I would honest not base a os on FreeBSD as it completely os. I would start off with making your own Linux distribution or just trying to make your own operating system. As it would be fair hard to try and base a os on FreeBSD it doable but I think you would be better off just making you own os. And think very carefully about what programming language you are going to use for your os ---------------------------------------------------------------------- 12Darius21 路 2022-09-13 03:54 Building a release is fairly easy, check the man page: https://www.freebsd.org/cgi/man.cgi?release(7) At work I make a custom install image which is the vanilla release (I finally got rid of all the patches we needed) plus a custom package set (and nearly all of those are vanilla, just a few special drivers etc). It's quite easy to unpack the ISO, add what you want and reassemble it. ---------------------------------------------------------------------- Xzenor 路 2022-09-13 05:42 And where did you say your answer to OP's question was? ---------------------------------------------------------------------- Oxey405 路 2022-09-13 05:47 Thanks ! ---------------------------------------------------------------------- Oxey405 路 2022-09-13 05:49 Thanks but what I want to do in the most part is making my own xfce desktop environment in a custom FreeBSD-based OS... ---------------------------------------------------------------------- [deleted] 路 2022-09-13 05:50 [deleted] ---------------------------------------------------------------------- theRealNilz02 路 2022-09-13 05:55 FreeBSD, being a mostly minimal OS, can be as custom as you want it to be. ---------------------------------------------------------------------- theRealNilz02 路 2022-09-13 05:56 Even making a Linux distribution is not a good Thing to do. They don't need more fragmentation. ---------------------------------------------------------------------- VastAd1765 路 2022-09-13 09:06 A graphical UI has little to nothing to do with FreeBSD. You would need your xfce-like program, which you would create, and xorg or wayland which are also non-FreeBSD software. ---------------------------------------------------------------------- PreviousWay 路 2022-09-13 09:35 You can take a look at NanoBSD. I've never used it but from my understanding it serves that purpose you are trying to do. Seems it needs some work to setup, but might help you understand the process. https://docs.freebsd.org/en/articles/nanobsd/#howto ---------------------------------------------------------------------- Oxey405 路 2022-09-13 09:55 I know but it needs to run on a lightweight OS such as FreeBSD ---------------------------------------------------------------------- hgshepherd 路 2022-09-13 10:18 Using Google is too hard... can't you point him to a fun YouTube video that answers his question? ---------------------------------------------------------------------- grahamperrin 路 2022-09-13 15:57 > I run the MidnightBSD project. Hey! Does the edit at look OK to you? Subject to review; it's part of an intended update to . ---------------------------------------------------------------------- laffer1 路 2022-09-13 16:05 Yes that is fine. ---------------------------------------------------------------------- Oxey405 路 2022-09-13 17:15 I'm asking here because this is a dedicated subreddit with people knowing several things about FreeBSD and already having experience. Don't worry, I know how to use Google. I simply didn't searched in Google because : 1) I didn't have time to search before I wrote this post. 2) I think that the individuals on this subreddit are more experienced than Google which isn't human and can point to two opposite ways of doing something. 3) Human explaining to humans has worked for thousands of years and asking for human help seems rational. 4) Yes I'm lazy, I know about that. 5) Asking to other individuals can help filter out the good stuff from the bad stuff. I trust the internet collective mind not a random guide on the internet. With so much people in here, bad choices are filtered out. And I think staying cordial and not sarcastic is in the rules. ---------------------------------------------------------------------- Oxey405 路 2022-09-13 17:34 Ok ! Thanks for the info ! I mean PS4 OS is an gaming system OS which is close to what I wanna build. ---------------------------------------------------------------------- grahamperrin 路 2022-09-13 18:33 > I think staying cordial and not sarcastic is in the rules. Those things are certainly a good fit with *Reddiquette*. ---------------------------------------------------------------------- nohearth 路 2022-09-16 02:11 I hope your os work out I鈥檓 planing of making my main od someday as well just got learn a lot of coding