r/osdev • u/xtof_of_crg • Dec 10 '23
Why does this sub even exist?
Deepest apologies for the phrasing but how are there so many people actively engaged in writing their own OS? What is y’all’s interest?
How does one even approach writing an OS from scratch? I’ve heard it can be done with Rust? I’m thinking about building one myself, where would a competent software engineer with little low level experience even start?
2
u/miki-44512 Dec 11 '23 edited Dec 11 '23
How does one even approach writing an OS from scratch?
The best answer is in osdev
I’ve heard it can be done with Rust?
It is, But I don't recommend it.
I’m thinking about building one myself, where would a competent software engineer with little low level experience even start?
Osdev
What is y’all’s interest?
Personally i think i could make a company and a business, that's my main dream and my goal. Hope it work.
1
u/xtof_of_crg Dec 11 '23
That’s pretty interesting. What kind of OS you trying to bring to market?
1
u/miki-44512 Dec 11 '23
If you looked at the market you will notice something, linux and mac os are somehow by a different degree based on unix, if you look also on a hackintosh and a linux on the same system the are very close to each other in terms of performance the only difference is that linux lack support of a lot of softwar like Microsoft office and the list goes on, but mac supports it but also mac has it's own downside, like not supporting most newer version of opengl, you would need a layer of moltenvk to run vulkan on mac and other support issues, if we had an OS that has the support of mac os does and does provide a lot more freedom for the developers, it will support more games and will widely popular, that's what's i am thinking of to be honest.
1
u/rorschach200 Dec 12 '23
> I’ve heard it can be done with Rust?
It is, But I don't recommend it.
Could you please elaborate on why you don't recommend it?
1
u/mdp_cs BDFL of CharlotteOS | https://github.com/charlotte-os Dec 13 '23
I wrote a whole post on this recently. Here's the relevant part.
1
u/miki-44512 Dec 13 '23
Could you please elaborate on why you don't recommend it?
Because if you take it seriously in order to be able to load any future applications you will need a c library so at the end of the day you could write a whole os in c and cpp but at a certain part you will need c in your rust os, i am not a rust programmer so maybe there are other causes to take in consideration.
45
u/computerarchitect CPU Architect Dec 10 '23
where would a competent software engineer with little low level experience even start?
How's your C knowledge? How's your concurrency knowledge? How's your knowledge of virtual memory?
(Oh, and I'm here to see interesting posts and comment on computer architecture, particularly CPUs and memory systems. I'm not actively developing my own OS.)
28
u/FlyingCashewDog Dec 10 '23
> how are there so many people actively engaged in writing their own OS? What is y’all’s interest?
It's one of the hardest projects I've done, but also one of the most rewarding. I haven't got very far with mine yet, but I remember one night where I spent about 10 hours straight trying to get my OS mapped into the higher half of the memory space, which involved reading a lot of the x86 Software Developer's Manual. It was an incredible feeling when it finally worked.
I also just love understanding how everything works. So much of our software is built on such a big stack of other software. I find that actually implementing the lower levels is the best way to understand what they are doing.
11
u/Historyofspaceflight Dec 10 '23
I’m not developing an OS (yet), but all my favorite projects involve “reinventing the wheel”. If you really want to understand something, build it from scratch.
10
u/outofsand Dec 10 '23
People do crazy things for all sorts of reasons, but my impression is that largely people like me are making their own hobby OSes for fun and personal interest in learning and doing, but the skills learned tend to make one a much better programmer so you could also consider it professional development.
19
u/Future-Nerve-6247 Dec 10 '23
It's pretty useful to know what your software is doing under the hood if you have to build the parts it's interacting with.
7
7
Dec 10 '23
I’ve been a computing professor for over 25 years and in the industry for 40. I’m in the process of writing my own primitive OS for the experience. It’s a wild ride.
I’ve written some primitive languages and worked with current and old assembly languages (6502 up to RISC-V), emulators (vice, etc) and find a love of the low level nature of it all.
I just want to know as much as possible. So I’m here and on osdev.org, I watch Ben Eater videos for the electronics part, and spend a lot of time honing my C chops and working with qemu and cross compilers. It’s mind-bending fun. (At least my kind of fun!)
Good luck to you!
3
Dec 11 '23
Because writing OS is hard and exciting, and addictive.
I learned a lot during osdev. Linux, shell, gcc, makefile, x86 assembly,elf file format, dynamic linking, etc. I learned more from osdev than from collage.
osdev.org is everything you need.
3
u/Yamoyek Dec 11 '23
OS dev is fun because it's the (probably) most comprehensive project a programmer can work on. To build an OS, you've got to touch on hardware, graphics, data structures, optimization, and desktop applications. You can spend your entire life tinkering on an OS if you really want to.
2
u/Amjad500 Dec 11 '23
Same as what everyone said.
I really want to understand low level stuff and how a computer works under the hood. I have been interested in this and general low level stuff for a long time. Been following several people talking about OS and making their own OSes as well (like Andreas Kling)
Then about 3~ years ago I started working on emulators to understand how hardware in general works. So I started working on several emulator projects, GB, PSX, etc...
And starting an OS (1~month ago) was the next step for me to understand how software can use the hardware. So here we are XD.
It's quite a hard and massive topic, inside an OS there is huge amount of stuff to work on, ranging from low level hardware drivers to making your own GUI Manager and Browsers.
But it really helps reading about it and understanding that each component can be implemented fairly easily alone, and then you components can be grouped together to achieve greater functionalities (at least this is how I have been doing it )
You can start by implementing basic stuff related to hardware and low level and it doesn't have to be an OS from scratch at the beginning.
Good luck
2
u/Previous-Rub-104 Dec 11 '23
Honestly, I was just interested in how computer boots programs, how to program low level programs etc. I have watched a tutorial on how to code a simple bootable Assembly code, then I made it print "hello world". That amazed me enough to get me into OS dev, so I just went with the flow and started learning C, Assembly and x86. Beginnings were rough since I didn't know Assembly, neither C, I had never heard about virtual memory, CPU registers and stuff before I started, so I learned everything on the go. That was almost 2 years ago. I still don't know much, but I have a working scheduler (the algorithm is working, context switching is not 😅), virtual memory manager, physical memory manager, so the project is going pretty well and it's still active.
1
u/Dracux Dec 11 '23
It is interesting, I am starting to create an OS for hobby, and as it is being done in the "hard way", I am learning assembler from scratch, learning all the principles of OS, and a huge ammount of other things. In a week I learn like a lot of new things and I am documenting all in youtube, so I think that this sub is a great idea, I am learning a lot from reading this.
1
1
u/Ikkepop Dec 11 '23 edited Dec 11 '23
Deepest apologies for the phrasing but how are there so many people actively engaged in writing their own OS?
This hobby has been around since the very first computers appeared. There's something very liberating about the feeling of being in complete control of the machine and letting your fantasy run loose.
When I started it was a really natural thing to do, I used to spend most of my time in MS-DOS and that was hardly an OS, programming it was almost the same as implementing your own OS in every program you wrote.
Now it's alot more obscure as a hobby, but still the primal curiosity remains in many developers' hearts ;)
What is y’all’s interest?
Too many to count...
How does one even approach writing an OS from scratch?
One usually starts with the osdev wiki
I’ve heard it can be done with Rust?
It can be done with any sufficiently low level language, popular picks are C, C++, Rust, Assembly. But I'v seen other languages as well, like Ada, Pascal, C# etc.
I’m thinking about building one myself, where would a competent software engineer with little low level experience even start?
Start by getting low level experience.
1
u/funbike Dec 12 '23
IMO, every student that plans on getting into systems or embedded work should take a class where they have to write an OS. It would be useful to any CS student, really.
Few things give you a deeper understanding of all things software.
Of course, after the class, those same students likely want to tinker with their little toy OS. I don't know percentage, but I'm sure there are many in here with that history.
1
1
u/mdp_cs BDFL of CharlotteOS | https://github.com/charlotte-os Dec 13 '23
Because OSes aren't a solved problem and all of the mainstream ones suck badly compared to what research has shown is possible.
My personal goal is to create a project that is a proof of concept for a far better system design and OS API than the Unix-likes and their crufty old POSIX APIs and whatever the hell Windows even is anymore.
3
u/xtof_of_crg Dec 11 '23
Yeah, the title probably came off the wrong way, it was more supposed to be an expression of amazement and interest than anything else. I appreciate everyone’s responses, clearly I’m being over ambitious even stating “out loud” that I’m think about OS dev at all. If I had questions about hypothetical OS dev, would this be an appropriate sub ?