How an Operating System work?

Hello,
I want to learn how an Operating System work and I guess BSD is clear and simpler than other OSes like GNU/Linux and Windows OS. I want to change some parts of source codes and recompile them and see the result in the OS. Which version of BSD is simpler for my goal?

Thank you.
 
Hello,
I want to learn how an Operating System work and I guess BSD is clear and simpler than other OSes like GNU/Linux and Windows OS. I want to change some parts of source codes and recompile them and see the result in the OS. Which version of BSD is simpler for my goal?

Thank you.
Really? How long's a piece of string? What you ask is so vague it's unanswerable without guessing.

What part of the OS? User/kernel/all? If it's the kernel then go read these:

Operating system concepts - silberschatz & galvin
Modern Operating Systems - tanenbaum.

Then download minix - it's got a netbsd userland and microkernel. That's much easier to work with and understand than vast monolithic kernels as used by *bsd & linux.
Note: This is not an argument against *bsd, it's just fact that microkernels are easier to dissect because nearly everything that makes the OS run is in userspace not the kernel. YMMV.
 
What mark_j says. Minix is good for learning certain aspects of OS design.

I’d like to add that the BSD systems are far away from what I would call “simple”. But if you’re still curious to have a look at a BSD system, one option is to get the stuff from ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/1.0-RELEASE (this is actually 1.0.2) and dissect it. You can install it in a VM (my recommendation is to use QEMU because it can emulate an NE2000 ISA network interface which is supported by FreeBSD 1.0). Of course it’s a historic release from 1993, so you won’t find all modern state-of-the-art things in there. But for curiosity and educational purposes it might be useful. For example, the kernel sources are just 7.5 MB, compared to more than 400 MB for a recent version of FreeBSD.
 
Hello,
I want to learn how an Operating System work and I guess BSD is clear and simpler than other OSes like GNU/Linux and Windows OS. I want to change some parts of source codes and recompile them and see the result in the OS. Which version of BSD is simpler for my goal?

Thank you.

There is way to many unknown variables here to give you areal answer. In a general sense i'd agree about it being easier to get an overview of all the nuts and bolts with BSD systems (but then you also list Windows for comparison so i am not sure how much actual research went into this statement). Which one is best for you? I guess it would be most appropriate if you were the judge of that. There isn't that many relevant BSD systems so just grab the sources and see which one makes the most sense to you after spending like an evening playing with it. As long as your C skills are somewhat solid and you have a bit of basic experience with programming for unix-like systems you shouldn't run into any major problem with any of these.
 
Thank you so much for all of your answers. I want to download ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/1.0-RELEASE/ or https://9p.io/sources/plan9/sys/src/ but after download of these codes then how can I compile and boot the OS and see the result?
Consider a developer that want to add some features to current version of BSD or examine it. How he\she could see the result of his\her works after changed some parts of a code? He\She must save the source code changes but how about to compile and make .iso file for boot the OS and see the result?
 
For me simplicity also comes from how easy it is to compile and test code changes quickly and allowing me to tinker with internals.

From my experience, 9front (Plan 9) is possibly the quickest to get started with, followed by OpenBSD and then FreeBSD. That said, FreeBSD has the best documentation so I tend to go with that.

Minix and some of the very old UNIXes can be a little awkward to jump in to.
Linux can be OK. Pretty heavy in some ways, all the kernel config stuff actually gets in my way a little.
 
You are not going to learn how an OS works by downloading, compiling, and using it. You are going to learn how it works by reading about the reasons for things to be designed the way they are. I would start with the books Mark_j recommended above.
 
Thank you so much for all replies.
I want to download and compile FreeBSD version 1 from ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/1.0-RELEASE. Which steps I must do?
What platform are you using now? You would find it hard to locate hardware that suits 1.0-R. Your best bet is a virtual system, but I suspect even that would be a tricky manoeuvre.
Unless you have the hardware to match the software it's a chicken and egg situation if you want to compile it.
I would guess your ONLY option is to install FreeBSD 1 on a virtual machine and then muck around in /src/sys.
 
I downloaded the all the files in that URL and wanting to compile and make that OS. How can I do it?

I don't have the slightest clue. There is probably some instructions on how to build a modified kernel and/or world bundled with the source distribution. Just poke around a bit. Also there is an install.txt in /floppies that seems quite extensive. You might want to read that.

Word of advise: People around here tend to be extremely helpful if you have specific questions but they won't go and solve your problems. If your idea of learning how operating systems work is to download something and hit a "Build + Install" button you won't get far.
 
I downloaded the all the files in that URL and wanting to compile and make that OS. How can I do it?
What do you expect to learn from compiling an existing OS? You will not learn how it works, or how to write one. Before you can learn that, you need to get pretty darn good at programming, and computer architecture. I took an OS class about 40 years ago. The first semester was about computer architecture (Burroughs 5000, PDP-11, IBM 360, CDC 6600), instruction sets, and assembly programming. We learned things like implementing semaphores and mutexes in IBM 360 assembly language, and doing IO using the PP on the CDC. Clearly, that is for hardware that is not relevant any longer. If you really want to learn about how an OS works, start by understanding how to program an x86 processor, how memory and IO works. Then start reading the source code.
I think FreeBSD 1.0 is significantly too complex as a starter project (as is Linux 0.99-13, which is roughly from the same period); I would read the source code to Minix to begin with, along with the book by Tanenbaum.

If you can't even figure out how to compile the sources, you are not making good progress.
 
  • Like
Reactions: a6h
What platform are you using now? You would find it hard to locate hardware that suits 1.0-R. Your best bet is a virtual system, but I suspect even that would be a tricky manoeuvre.
Unless you have the hardware to match the software it's a chicken and egg situation if you want to compile it.
I would guess your ONLY option is to install FreeBSD 1 on a virtual machine and then muck around in /src/sys.
I know that I need an old PC. I want to use Xen or VirtualBox for it, but can I compile this version of FreeBSD using a moden Linux Distro?
 
I want to use Xen or VirtualBox for it

Well, then i guess you should try it? I think the recommendation was to use Qemu but if those also support the mentioned hardware (you checked this, have you?) it shouldn't really make a difference.

but can I compile this version of FreeBSD using a moden Linux Distro?

Look, i hate to be that grumpy guy but what is it with these questions? Did you do any research at all (or even just read this thread...)? Anyways i'll answer your question if you can explain to me why you think going straight for a crossbuild is a good idea.
 
Thank you so much for all replies.
I want to download and compile FreeBSD version 1 from ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/1.0-RELEASE. Which steps I must do?
First you have to install it. Then you can boot it and compile it with itself. You cannot compile FreeBSD under Linux or anything else.

Your best bet is probably to install it inside a VM, because it won’t run on current physical hardware. My recommendation is to use QEMU because it can emulate an NE2000 network card, which is supported by FreeBSD 1.

So, the steps are:
1. Install QEMU.
2. Create a QEMU VM with an emulated NE2000 network card. A single-core CPU and 16 MB RAM (not GB!) should be sufficient.
3. Boot the VM with the installation media of FreeBSD 1, then install FreeBSD, including source code. The files that you downloaded contain documentation about how to do that (“readme” files etc.).
4. Once FreeBSD is installed, boot it and learn how to use it. Configure the network etc. Read the documentation, read the manual pages.
5. Try to compile the system. The sources are installed in /usr/src. There should be instructions, too (at the very least, there should be extensive comments at the beginning of the Makefile).

Good luck.
 
Back
Top