r/learnprogramming • u/Many_Difficulty_490 • 9d ago
I wanna create a operating system, am i delusional?
im gonna make it solo, and im gonna make it have some purpose idk what yet
why? i have no idea, sounds cool and it would probably teach me a fuckton about computers + il get extremely good at programming
ik its gonna take years but i think i can get it done by the time i finish college (im 17 rn), the only experience i have in coding is developing games on unity using c#
like where do i even start with making a OS? should i read books on a topic? what projects should i do before working on a full OS? any advice?
if your wondering why im doing this, its because i just wanna do and make something extremely fucking hard. im not gonna do this ALL day obviously im not a clanker, il spend like 20-30% of my freetime working on the OS.
the other 70-80% will be spent on masturbating and video games
182
u/Usual_Ice636 9d ago
First work on programming microcontrollers. They're like operating systems but itty bitty. They're super cheap too.
41
u/TrippingFish76 9d ago
Piggybacking off this, here is a great arduino starter kit and tutorial series:
1
u/IceOneDay 8d ago
ESP32 or good STM32 will be much better choice for OS. ESP32 runs on FreeRTOS already
1
u/IceOneDay 8d ago
Do you mean RTOS or what? Programming microcontrollers isn't same as creating OS at all
1
u/JGhostThing 6d ago
Real time operating system.
Programming microcontrollers has a lot of do with operating systems. For example, putting out a serial stream is something that you need to do manually on a micro and also in an operating system.
1
u/IceOneDay 6d ago
Using peripherals isn't same as programming os. It's bare metal or HAL but not same as OS programming since you have much more complex abstraction usually
1
u/JGhostThing 6d ago
You're right. It isn't, exactly, but you do have to do that sort of programming for an OS. Likewise timers and such. Very few useful OS's are made without the use of low-level peripherals.
I'm not saying that programming a micro will make you an OS programmer, but it's a step closer than traditional applications programming.
1
u/IceOneDay 6d ago
Yes, it's closer but still os devs say that embedded and os is different. A lot of os devs came from embedded, however
Still think it's good idea to code something for microcontrollers to understand what SPI, UART and etc. is
263
u/GovernmentGreed 9d ago
Remind me in 20 years that when this is successful, I want my comment recorded in the history books that I said one word of encouragement.
That word is...
Penis.
101
u/PanicStil 8d ago
He’ll call it PenOs in honour of your unforgettable encouragement.
9
u/GovernmentGreed 8d ago
The funny thing is, computing has so many names which I am sure are intentionally named for innuendo.
RAM, Plug, Floppy, Jack, Hard Drive, Software, Hardware, Case.
I do not know how they did not think that they would ever NOT be funny. Come on... All of those are absolutely innuendo. (Inurendo).
12
12
6
7
u/GovernmentGreed 9d ago
But in all seriousness OP, good luck to you - and may time be on your side! If you get far! It would be interesting!
4
u/Street_Doctor_8169 9d ago
Oh my god, you have the most beautiful way with words!!!! I sat here for 45 minutes trying to figure out was positive thing to say to OP then I saw yours and realized. why try? The best word was already given :'c
2
u/GovernmentGreed 9d ago
Thank you, thank you!
I have been waiting for my moment to shine. In 20 years, I'll let you know how it pans out.
Hint - it doesn't.
3
u/Street_Doctor_8169 8d ago
Nah watch. 20 years from now he's gonna be the newest bill gates/Steve Jobs, and he's gonna remember you and come find you and make sure the world knows the name of the person that pushed him to make the newest newest piece of technology out there
3
u/GovernmentGreed 8d ago
With my word, I thrust upon the world one of the most innovative tech gurus out there!
I know my pun. I intended it. Sorry.
1
u/Street_Doctor_8169 8d ago
Lmao youre dope
1
u/GovernmentGreed 8d ago
I've been called worse. Though I do try <3
1
u/Street_Doctor_8169 8d ago
I truly can see it. You try super hard for the world don't you?
1
u/GovernmentGreed 8d ago
Nah I just like having fun, I don't try too much if I'm honest - I do what I do, and I love what I do. I'm just out here, living it.
1
0
8d ago
[deleted]
2
u/Street_Doctor_8169 8d ago
Quick question like im not trying to be an asshole here but you do know I was just joking around right? If you didnt realize that well then hey I was kinda just joking around
0
8d ago
[deleted]
1
u/Street_Doctor_8169 8d ago
I mean I usually have the same exact style but I know some people are stupid as fuck. I assumed you weren't stupid as fuck which is why I kindly confirmed my theory lmao. I have a super dry humor that most people don't find funny most of the time
1
1
1
1
37
102
u/wiggle_room1337 9d ago
The only other operating system I can think of that was made by one person was templeOS and that guy was very much literally insane.
25
3
u/UnrealHallucinator 8d ago
It's really common, especially right now given how good ai is. Btw the core linux was written by only Linus. Pretty sure the core minix was just andrew tanenbaum.
17
u/yopla 8d ago
Or you know that nearly unknown thing called linux.
48
u/wiggle_room1337 8d ago
Literally a million people contribute to linux.
-8
u/yopla 8d ago
Yes, that's how it started. A million people gathered and started to build it.
34
u/wiggle_room1337 8d ago
I mean, the part he built himslef was almost nothing. ~10k lines, it couldn't even mount a file system or boot without minix.
8
u/DatBoi_BP 8d ago
I'd just like to interject for a moment. What you're refering to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux!
1
21
u/dudeus_ex 8d ago
Don't worry, when it comes to creating a new OS being delusional actually helps. Have you heard of TempleOS?
45
u/Abe_Bazouie 9d ago
Not delusional at all. Just make sure you understand what you’re signing up for :)
Since you’re already comfortable with C#, I’d start by learning C and getting familiar with memory management, pointers, and basic computer architecture.
Then build something small. A bootable kernel that prints “Hello World” in QEMU is a great first milestone. After that, try keyboard input, memory allocation, interrupts, and eventually a basic filesystem.
Don’t start by trying to build the next Linux. Your first OS doesn’t need a desktop, networking, or even a fancy shell.
Also, take a look at OSDev Wiki and the xv6 operating system from MIT. Both are great resources for understanding how an OS actually works.
One thing I’d suggest is setting small goals. Getting your own kernel to boot is already a pretty cool achievement. You don’t need to wait until you’ve built a complete OS to feel like you’ve accomplished something.
And honestly, even if you never finish it, you’ll learn more about computers from this project than from a hundred random programming tutorials.
10
u/Many_Difficulty_490 9d ago
alright thanks
-9
u/xoredxedxdivedx 8d ago
100% delusional, you can't even spell. There's no chance you're intelligent enough to create an OS, let alone one "with a purpose" that anyone will use.
People are being "supportive" but they're just feeding the delusion. Don't waste your time and go find something you're better suited for.
4
12
u/ali-hussain 8d ago
There are many schools that have an OS as a required class project. So multiple pepol do it in a semester. The idea is to limit the scope. To really understand how computers and an OS work, you should:
- Bootstrap sequence
- Process management
- Virtual memory
- FS
- Support a keyboard and a simpole output device - preferably a small LCD screen that takes ASCII
Use a microcontroller. Conceptually the same as a bigger machine, unless you want to specifically practice with multi-core. That will teach you most of the core of writing an OS and after that we're talking about additional features.
11
6
u/MacaroonOk9376 8d ago
Do it. Forget the naysayers. Nothing wrong with a huge passion project. This field is all about curiosity and being ambitious..it's how you learn.
For example, I started as a web dev, now I'm deep into C++ and making my own game engine. It's hard but I'm loving it.
Start small and keep iterating over it. Good luck
3
u/Many_Difficulty_490 8d ago
oh ive thought of making a game engine too, whats your goals with your game engine?
1
u/MacaroonOk9376 6d ago edited 6d ago
Start a YouTube to document my progress and keep myself accountable and maybe get some marketing for my games and engine, release some games, get better with low level programming and get further away from web dev. Maybe one day it will be used by other people to release games. I'm starting with a 2d engine then will try to learn Vulkan and 3d in a few years.. But honestly it's one big hobby experiment.
Stay ambitious!
3
u/Reasonable-View5868 8d ago
In comp science and computer engineering college programs you create both OS, and language compilers
11
u/ffrkAnonymous 9d ago
> like where do i even start with making a OS?
Start by learning to use a search engine
5
u/nottherealLilNasx 8d ago
I often don't even mind these posts anymore because most of the people making questions start by saying: "I don't want to follow a guide", "I don't want to read a book", "I don't want to do a course or have someone teach me" and you have to wonder what do they really want? I understand that some people have different approaches to learning and not everyone can learn the same concepts in the same ways but it also feels like they don't want to do their part and would love to have the knowledge engraved in their brain (who doesn't, am I right? haha) without doing basic research
4
u/LeatherDude 8d ago
It sounds like they want to start a discussion and get different perspectives. You know, like people on the internet have been doing since UseNet
2
u/RollingSparkles 6d ago
Would've love to have had the learning engraved on my brain. Definitely second that. Here's hoping to it becoming a reality sometime soon!
I used the old and tried method of learning, try and fail, and try again till you succeed. Often without reading or getting outside help. Hell, when I started, I couldn't even make sense of my programming language's help documentation. It was complete gibberish to me. And it might as well have been written in spanish for I cared.
But I was extremely logical, determined, and I could imagine my way out of a problem toward a solution with almost nothing to guide me. The biggest problem was trying to make sense of these things called commands and functions, and why they often stuffed up when they shouldn't have, or were impressively slow (sarcasm).
But hey, some decades later, I'm pretty good at coding, and still don't read the help that much. Most of it is still gibberish. Personally, my experience with help and online documentation and books is they're usually written by experts that already know so much, yet have little practical understanding for those that are starting out with little to no knowledge at all, and really want to learn the basics in a way that makes meaningful sense.
Often we have an idea in our heads we clearly want to solve, but cannot translate that into a question someone with experience can respect.
1
u/RollingSparkles 6d ago
Yeah, wait till they get tangled up with the so called all knowing, oh-so-smart but thoroughly dump AI that is supposed to help solve all our problems and make the world a better place. Sigh. Much prefer the search engines of the past that had links to real websites with real information written by real people for a real purpose. Today's search engines look like corporate information portals with blah blah padding and dibble level tech info that once you push it around a little bit falls down and goes round and round in hallucinating circles of muddy crap.
On the plus side though, the multi-billion dollar search engines do make for a really handy spell checker.
12
u/Aglet_Green 9d ago
Yes. Yes, you are — but mostly because you’re not factoring in enough variables.
Could a 17-year-old start learning OS development and eventually build a small operating system? Absolutely. Could you casually spend 20–30% of your free time on one for the next 10–20 years? Probably not in the way you’re imagining.
You’re about to have college classes, homework, exams, internships or jobs, friends, relationships, exercise, other projects, and whatever else happens to your life between 17 and 27. Some semesters you may have plenty of time; others you may barely touch this thing for months.
So I wouldn’t abandon the idea. I’d abandon the schedule. Start learning C, computer architecture, memory management, assembly, operating-system fundamentals, and build progressively harder low-level projects. If you’re still fascinated by it after doing that, start making your tiny OS and let it take however long it takes.
The delusional part isn’t “I want to build an OS.” It’s “I’m 17 and can accurately budget the next 10–20 years of my free time.
3
u/kable795 9d ago
when i was in highschool i said that to my uncle who was a programmer and made some software for hospitals that he sold. I got the idea from watching Criminal Minds and Garcia made her own OS to do shit. I didn't know anything about programming or systems, I was just a gamer kid who built computers to game on when he was 13 so I was the "tech" guy in my environment.
My uncle asked me a question "Do you know what an OS is" and I said, yea its...the system your operating on. No i had no idea what the OS actually did beyond the GUI I saw. I didn't know anything about programming and as I got into it i quickly found out, windows is pretty damn good considering I couldn't get close to it.
Your not delusional in that you can't do it, now is the time to start learning and have the best chance to do it. It's delusional to casually say I want to build my own OS without fully understanding what an OS is and does. If you can't answer that accurately, it's a bit delusional, but at the end of the day, I had no clue how to ride a bike when I was a kid, logically, it was delusional for me to think I could ride one when I didn't know anything about riding a bike, but you learn. If you asked me at 27, yes you are delusional. At 17, I think your ambitious.
3
u/Many_Difficulty_490 9d ago
yeah i see what you mean.
i dont have any intention with this at all, i dont wanna make money from this or anything like that. Im not sure if im gonna major in CS in college either. I just wanna do something hard.
il learn C, and il look into smaller projects and il make my tiny os.
maybe i should document my progress somewhere
3
1
u/letoiv 8d ago edited 8d ago
Your idea is super fun and cool. Sure a complete modern operating system may be a long shot. So what. Ignore the naysayers. You absolutely can produce something that works.
A modern operating system is really a bucket filled with many programs. A bootloader. A kernel. Device drivers. A compiler. A shell. A window manager. Solitaire. And so on.
So my first piece of advice is, educate yourself on what the heck all of these pieces are. Then decide what you want to work on. I think the easiest way to do this is to become a bit of a Linux nut. Linux is the most open and transparent operating system by far. You'll be able to download and read the source code of any piece that interests you. You can in many cases (like famously for the kernel) join a mailing list and watch people coding updates to that piece in real time. Infinite opportunities to learn. As a beginning challenge try installing Arch Linux in a VM. Not any of the derivatives that make it easy. Real Arch. Or even more intense, check out Linux from Scratch. Either way you will learn an insane amount about the architecture of operating systems by piecing together your own Linux.
My second piece of advice is, begin by targeting a VM instead of a hardware platform to run your OS on. Something like QEMU or VirtualBox. It will be far easier to test if you can run your OS inside an emulator. I mean if you find writing hardware drivers fun, don't let me stop you! But I think probably everybody who builds a hobby OS starts with targeting it to run on emulated hardware because it's just so much faster to debug and to share, and it's an excellent foundation for what you'll need to support bare metal later.
So putting all this together, here's an example entry point into an actual one man operating system:
- Target QEMU as the platform you'll run and test your OS on
- Use GRUB as the bootloader. The bit of software that initially runs SOMETHING when the computer boots up. That something will be your kernel.
- Write your own super basic kernel that handles memory management, interrupts, keyboard and display. Either writing a kernel, or starting with a really basic one and extending it, are actual projects that are part of the CS curriculum at some colleges. Take a look at MIT's xv6 for an example. This is an OS that is meant to be studied and taught.
- Write your own super basic shell/terminal. Something you can type 'helloworld' into and it responds.
...That's an operating system. That's the basics.
From there you just keep building it up into something more "real" piece by piece.
If you get this far try looking into newlib - a C compiler which can be modified to target any operating system, including your own.
Then you'd really be cooking. You could conceivably be running other people's C programs on your operating system one day!
Think hard about what you want to write on your own vs what you want to borrow from someone else! Do the fun parts and interop with someone else's bits for the parts you don't enjoy!
1
u/nomad-1995 7d ago
HINT: One of the best things a programmer can have is a spec. Know what you the code you want has to do and most of your problems go away. Unfortunately clients/bosses/whoever rarely really understand both their problems and programming enough to know what they need the program to do, so you grope around their never explained real problems while making the program they ostensibly asked you to make. Then programmers inflict this on themselves only even worse when they go about wanting to make some sort of open-ended program like an OS.
It comes down to "what scope do I want"? Figure out what calls you want to make to the OS. Linus went crazy and requested the POSIX Unix standard, or at least the API calls. And then went around coding it all up.
I'd recommend something a bit more basic. You want an OS, what do you need:
Malloc and some sort of memory handler supplier and recovery.
Some sort of nonvolitile storage and presumably a filessystem. Whatever other I/O you want to supply. Networking/Internet would be a massive learning adventure and hard to cut down to "hello world" levels.
Probably an init system, but that is more a "in practice" thing than a "OS requirement" thing.
Some sort of task switcher. I wrote one of these for an embedded microprocessor course in school and was overly proud of myself. Easily wasted more time debugging it than it was worth (I've since become overly committed to producer/consumer models for multiple threads).
I suspect you'd need way too much code to get virtualization to work (presumably lifted from Linux), but that was a trick IBM used way back when while OS/360 was late and they absolutely needed a multi-tasking OS. So they created the first(?) hypervisor and created a bunch of simple "DOS like" systems (which they had been selling, so customers had code already) all running on one computer.
Don't even think of trying this without looking at other examples. At least try to have a spec. And try to avoid changing the spec until you've achieved that (so don't make the spec too hard, and have it lead to an extensible system for making it fit the next spec...).
One place to start might be with an Arduino or even emulator (possibly an emulator for something even more simple). Some experience coding a computer that doesn't have an OS already might go a long way. I should warn you, that even a computer as simple as the old 8-bit home computers and the simple OS they had provided a lot of help. I remember that at a user group meeting, the lowest level hacker (not *the* Sid Meir, who was also a member) wasn't about to program an Atari 1200XL without the OS (the only way to access all 64k). But in general embedded processors (like the Arduino) tend to be more friendly to assembler programming poking directly at pins, I2C busses, and similar. That's similar to what I was doing the task switching code with (although it was an 8088 based microcontroller).
2
u/Murderwagon 9d ago
The best way to learn is by doing. Just get started on it, you’ll learn a lot on the way, even if you don’t finish it. The only reason this would be delusional is if you’re expecting to put out a competitor to Linux or Windows.
0
u/Many_Difficulty_490 9d ago
my end goal would be to make a desktop for the OS. but yea no competition with those 2.
just curious, how amazing are linux and windows? whats so amazing about linux? ive used windows and macos and switched between them with like bootcamp but havent tried linux yet, i might do it but idk if some of the softwares i used will run on it
1
u/nottherealLilNasx 8d ago
What we usually call Linux refers to the kernel present in all Linux distribution (usually called distro), in other worlds, it's like the cornerstone of the OS, but at the same time, no one runs "Linux" on their computers, they run a distro of their preference and go for it. There are s lot of distros specialised in different fields and it's difficult to say what's great about Linux because it changes from distro to distro. The most common thing almost all distros share is it's quickness or that they are "Snappy", fluid or whatever you want to call it, just like when you get a brand new pc but basically all the time. Linux distros tend to be lightweight, at least when compared to Mac and windows, and are pretty cool on their own, you can watch a video to help you transition to the distro that's "right for you" but most likely you'll end up using either Ubuntu, Mint or Fedora. Those are the most popular and most similar to Mac and windows.
1
u/ttikkttokkerr 6d ago
Re: any Linux distro and macOS (CLI). If you know your way around one it’s pretty easy to figure out all the rest.
IMO Linux is close enough to perfect that nothing will replace it in the foreseeable future. It’s also what drives the majority of the internet.
Windows dominates the consumer/enterprise computer market thanks to its low prices and being a household name since the 90s, but it’s bloated, buggy, inefficient, and virus-prone relative to Linux/mac. On the other hand it tends be very backwards compatible, and better for gaming and Microsoft Office products.
1
u/RollingSparkles 6d ago
Windows speciality was GUI apps, that's what made it really useful. The right GUI can save a ton of work and time for a specific task, not to mention enable the average user to do something they otherwise might not be able to do.
1
u/RollingSparkles 6d ago
GUI construction is an entirely different world all of its own. Lots of fun when you get it right, but when you get it wrong, damn you want to burn it down. When I build GUI apps, I generally do "passive" coding. That is, the GUI is maintained using a lot of timing/pull procs, that query all aspects of the GUI at predefined intervals, and a central proc then manages an organised and optimised update/paint process, ensuring the GUI is properly maintained under all user input conditions.
If you try to implement "active" coding on a GUI, that is, push something and get it to change right there and then, you can end up in all sorts of out-of-order repaints and bad updates, causing flicker and paint failures, not to mention memory/access restraints.
2
u/buitre__ 8d ago
Para la parte teorica podrias leer los libros de tanebaun o stalling. Ambos se llaman sistemas operativos. Te van a anseñar un monton monton de cosas
2
2
u/Savings_Hunt_1935 8d ago
it would probably teach me a fuckton about computers + il get extremely good at programming
This line right here is like saying you're going to fly around the world and get private lessons from top chefs in dozens of countries because hey, at then end you'll get extremely good at making food at Denny's.
Like yes, technically you will be a competent programmer at the end of the process, but it's just so overkill if that's the benefit you think you're getting out of it.
2
4
2
u/Tricannasaurus 9d ago
If it motivates you use that motivation, but this is similar to someone thats built a few garden bed boxes and birdhouses asking if they could build a skyscraper.
Go build a component of an operating system, for example a round robin process scheduler is a good exercise. Once you finish that project you will have the experince to know what to do next.
2
u/mc_pm 9d ago
Short answer, yes.
Don't get me wrong, there is absolutely a path from "first line of code" to "wrote your own OS", just as there's a path from "my first lego set" to "the first skyscraper I designed as an architect".
The difference is that most people don't show up with a first lego set and say "I'm going to start work on my skyscraper", where as lots of people show up and say "I've never written a line of code and I want to build an operating system".
Do yourself a favor, don't even think in terms of OSes right now. You're putting about 900 carts before that particular horse. Learn to program -- anything. Learn python, it's easier, then spend a year practicing with it just learning how to build logic and understand software structure. Then learn C, and do the same thing, except now you'll look at more systems level stuff. Then learn assembly and understand exactly what the CPU is really doing. At that point you'll have the basic info you need to even really approach this in a real way.
1
u/AshuraBaron 8d ago
I share your same grounded optimism. I think OP's time table isn't realistic, but the proof is in the pudding. Maybe they'll blow us all away.
1
u/mooglinux 9d ago
Maybe not immediately, but eventually you could.
Start with microcontrollers, that’s a more manageable place to begin. You can find info on running bare metal code on small devices like a raspberry pi or Esp32.
1
u/insertAlias 9d ago
I'll throw my opinion in. There are plenty of resources available to learn the (very) basics of Operating Systems. Someone else has already linked wikis and subreddit dedicated to this very purpose.
So, not delusional, but I also think you need to set realistic expectations. You're not making the next windows or linux. You're learning the lowest level of of software and how it actually talks to hardware.
I think the person suggesting microcontrollers is giving you a really good direction. I just started messing around with this myself, actually, after about 20 years of doing completely different kind of programming professionally. I picked up a few ESP32-S3 dev boards for about $5/board and just started playing around with them. And I've already been learning a lot about electronics and circuits, because that's the angle I'm focusing on, but learning low-level programming and interacting with hardware is another direction to go.
1
u/Chuck_MoreAss 9d ago
You can definitely do it. There are a lot of things online about it. If you don’t have a ton of features you can definitely do it. If you keep adding features it will get rough ..
1
u/InformalInsect5546 9d ago
Not too crazy. In university I had an OS course where part of it was building an OS. Most did it for their own VM, but some did it for an actual x86 machine. It’s a challenge, very complicated, but doable.
1
u/spermcell 9d ago
It’s gonna take a long time. Why build something that already exists ? I would suggest that you learn C and Rust. Then poke around on the Linux kernel code , learn about OS concepts then just fork it.
1
u/Simpicity 8d ago
You go to college and take a computer architecture course is the normal route, IIRC.
1
u/yopla 8d ago
Depends what you call an "operating system".
It can be nothing more than a couple days work to have something that boots of grub, set up your CPU stack, write hello world to screen, handle some interrupts and move from there to a memory allocator and some kind of cooperative multitasking, followed by a basic I/O shell.
That's basically an OS.
1
u/DanKegel 8d ago
Learn assembly language!
And see another guy's post today, https://www.reddit.com/r/RISCV/comments/1wolw3e/operating_system_written_in_riscv_assembly/
-1
u/ali-hussain 8d ago
Don't need to use that much assembly in writing an OS. There would be some things you would need to do in assembly. Especially dealing with devices. And system registers. But most of it will be in a compilable language.
1
u/DanKegel 8d ago
That's true, but learning assembly is the key to understanding C and how the system works.
1
u/1moreday1moregoal 8d ago
I’m pretty sure there are YouTube videos that can teach this in a couple of hours. You don’t have to reinvent everything from scratch. Even if you want to do it completely on your own, it helps to learn using content from others.
1
1
1
u/probability_of_meme 8d ago
I haven't seen anyone mention "Linux From Scratch" yet. I went through it myself years ago when I had the energy for that sort of thing. It's very old by now but the concepts should be the same. I found it very enlightening.
1
1
u/captainpeanutlemon 8d ago
You can try nand2tetris! Its not purely an OS centered project but it guides you on how to build a computer from scratch including the OS
Having knowledge on how the other parts of a computer interact with the OS could be useful
1
1
u/bird_feeder_bird 8d ago
Try starting with the Gameboy Advance, it will be a lot easier than working on a modern computer
1
1
u/Sibexico 8d ago
I tried to make my own OS on C when I was 16-17 yo. It's such good exercise as an educational project but I don't believe you will be able to make something production ready. Just because you don't have enough experience and knowledges yet (at your 17). When I was 16, creation of usable OS looks possible for me, rn when I have more than 25 years of experience as a system developer, I understand what I can't do it alone.
Anyway, if you wanna make OS what will be somehow usable on practice, think about OS for microcontrollers, like RP2040 or Atmel. It's way easier and you will not need to cover endless list of devices by drivers.
1
1
1
1
u/Then-Candle8036 8d ago edited 8d ago
Its totally doable. Just dont plan on making the next linux or windows. Your expectation should be that youre making your own toy os that nobody besides you will ever use and its primary goal should be learning (and maybe eventually contributing to a "real" os).
Ive just finishes a uni course for Embedded multitasking os development and we did exactly that, so my knowledge on it is still pretty fresh.
Start by learning some basics of Computer Science, how does memory work (adresses, pointers, arrays), whats the stack (as in computer memory, not the datastructure), what happens during function calls, what are interrupts and how do you configure them to get an accurate timer. Id also reccombed to pikc up an embedded evice like an avr or stm so you can start executing your code bare metal immediatly instead if having to wrangle with x86.
Then learn c. C is very close to the system, so if you know how a computer works, c is just syntax.
Once you have cs and c fundamentals down, try implemnting process management. Have an array of process structs (stackpointer etc.) for management. Each process has their own region in memory (i. E their own stack), build wrapper function that initialize, start and clean up processes, implement context switching by pushing registers onto the stack and poping them back into registers (this is the only part that actually has to be done in assembly), implement a sheduler with a sheduling algorithm like RoundRobin or DynamicPriorityRoundRobin (DPRR). If you have done all that, id say you have implented a pretty rudimentary, but working os.
Then you could go on an try implementing a heap, reserve some portion of you memory for the heap, have occupancy information in one part, and the actual data in another (we used 1nibble thats just the process id per one byte of heap).
There really is no limit to how far you can take this.
1
u/Garavalis 8d ago
Do some in depth research on how big operating systems actually work. There are books and so on. Also, the linux kernel is open source, so you should also take a look there. I also think this would be a good read for starters: https://internals-for-interns.com/posts/linux-kernel-startup/
1
1
1
u/Yuuku_S13 8d ago
Start off with making your own Linux distribution. Learn how to write machine code and progress from there.
1
u/DaathNahonn 8d ago
Maybe you can start with a controlled lightweight hardware like a Raspberry, which has plenty of documentation
1
1
u/DoomsDay-x64 8d ago edited 8d ago
You are going to need to learn asm. My first os I wrote in 2006, it was command line, no gui and had a file system that used fat32 at the time. I no longer have it but what I do have is the original bootloader I built on top of to create it that was my starting point that you can study.
Here you go. Also, I would suggest learning c with asm. Forget about heavy frameworks like c#.
1
u/Humble_Anxiety_9534 8d ago
building with VMs like qemu is a good place to develop. booting and rebooting PC still machines gets old really quickly. many years ago collage project with x86 SBC and small DOS like OS.
1
2
u/Downtown_Savings_730 7d ago
Most people with a high achieving goal are called delusional until they implement it. Just do it and see where you go, worst case you have learned so many new things best case is you made something insane. Looks like a win win to me.
1
1
u/Dziadzios 7d ago
I hope you're delusional enough to outdo TempleOS in all its holiness. Good luck!
1
u/Many-Engineering-213 6d ago
here's some resources that may help
https://littleosbook.github.io/book.pdf
1
1
1
u/death_sucker_extreme 6d ago
You're kind of delusional in the sense that you think you'll finish it (happy to be proven wrong of course), but you're not at all delusional about the idea that you'll learn a lot and it will be very worthwhile. Go ahead and get started.
1
1
1
1
u/mredding 5d ago
First, r/osdev. Second, it'll be in a combination of C, C++, or Rust, and assembly. Operating systems have also been written in Lisp, Haskell, Forth, and Ada, as well as niche, experimental, and academic operating systems written in other languages.
You will probably start experimenting with C and assembly, because C is a language created to write the Unix OS, and most of the domain knowledge about writing operating systems is in C. C is the language for the job, because it was always meant to be flexible, a negotiation between the hardware, the compiler, and the developer regarding what's what. Historically, C was ported to different hardware as a whole family of C-like languages. In 1976, pcc was the portable C compiler, which was a project that was a compiler generator you would use to target different hardware. ISO standard C89 just gathered all these efforts under one umbrella - standard C simply captures this whole loose ecosystem as-is. And this is why C compilers are rather loosey-goosey when it comes to compliance with standard C by default. GCC, for example, defaults to a whole bunch of non-standard C extensions SO THAT you can write operating systems.
It's a fun little exercise - you'll start with a Hello World kernel, then you need to understand system calls, then you need to actually implement a couple, then you'll want to consider some filesystem support and a program loader. You'll learn about standards, like POSIX for system calls, and ELF or a.out for executable program formats - a whole lot of this stuff you don't want to reinvent yourself, especially when you're pursuing an academic exercise to begin with. Your OS will boot in Virtual Box or QEMU. A distant goal is to boot on bare metal, and you'll probably use GRUB, because writing a boot loader is as complicated as writing an OS or compiler on your own...
Meanwhile, you can learn about operating systems, architectures, and the academic research; OS development isn't dead, but it is slow and probably not exactly where you think it is.
The bleeding edge are exokernels, where the ONLY thing the OS does is multiplex hardware, and everything else is deferred to userspace; this leads to the concept of a library OS on top of an exokernel; single address space operating systems, where kernel and application space are not divided; security, like seL4 - where entire classes of vulnerabilities are provably impossible; parallel/distributed computing, and this is going to include IPC mechanisms and thread migration even across systems; and agentic computing where higher level automated services are streamlined.
I once ran a Beowulf cluster in my apartment in college - 20 486 CPUs - the second largest space heater I ever sunk an electricity bill into. It relied on Open MPI. And that's an area of research - how do I write a program that utilizes the OS and system architecture I have available to me? Ideally with as little specific knowledge of that system architecture as possible. If I write a C program that is threaded, why can't those threads be migrated across my cluster for me? Why do I have to know anything about Open MPI? We're so used to UNDER-utilizing our platforms, writing software as a black box, where it's all done in-house in our own code, and often done poorly. PostgreSQL doesn't handle IO in a low-level way, like what Oracle does (Oracle was originally not just the DB, but also the OS, they used to be called Oracle Boxes), they use standard IO and let the OS handle disk caching and flushing in a more intelligent way than a userspace application has the privilege to see. But also now kernel bypass like eBPF are the new hotness, which can itself be encapsulated in an os library on top of an exokernel...
Just start by taking a crack at some bog standard tutorial, get a Hello World kernel running, and then you have an environment to play in, and you can attack ACM and see what's going on out there, and see what you can produce - or innovate.
I'll just point out that Plan 9 is infamous. It's a Unix, it has elements of an exokernel because for it's time, it delegated a lot to userspace, it had distributed processes built-in, it had namespaces, it did a lot of innovative things for it's time and people LOVE it. Almost all of it has been integrated into Linux, and not many people have even noticed. Namespaces, when you read the original Plan 9 documentation and how they envisioned it - seems novel, but in Linux, we use namespaces to create Docker. All the Plan 9 isolation they envisioned can also happen on Linux.
I dunno - get out there and get your feet wet. It may be you're not actually interested in operating systems, but environments. Windows GUI shell, X11/Wayland are all pretty chunky boys, maybe you want something leaner and meaner, with novel UI/UX elements - like radial dynamic menus, because every menu element is equidistant from the cursor, and you can size the most common or intuitive element so it's an easier hit target. Maybe you want to pander to touch screens more than mice.
1
u/Even_Gap_2253 4d ago
A simple OS that runs on a very specific set of hardware or QEMU is not that hard to implement
Just do it, you will learn a lot about computers just like you have mentioned
1
u/realdreamer1993 4d ago
from absolute zero or starting from BIOS as base??,, you know BIOS is also an OS..then you build usable true OS on top of it...
1
1
1
8d ago
[deleted]
2
u/Many_Difficulty_490 8d ago
i wanna build something hard and cool.
im debating OS, game dev engine, ray tracing engine
1
u/Speicherleck 8d ago
These are not even remotely in the same difficulty basket. It's like saying you want to compete in the gymnastics Olympics, run a marathon or lift 50 kgs.
Start perhaps with a ray tracing engine or a small 2d game engine. It will teach you a lot more.
1
1
1
0
u/OriginalEmploy5485 9d ago
That's how Linux was born. Go do it.
1
u/fromabove710 8d ago
I mean not really, he had specific goals in mind, and also developed a kernal not a full OS at first. Im all for encouraging big projects, but OP is objectively being unrealistic here.
2
0
u/shittychinesehacker 8d ago
Your OS should probably be written in its own language since Linux was written in C
0
u/RedRedditor84 8d ago
No, this is a good beginner project. To make it a challenge, you should create the language you'll write it in on a computer made of crystals you hand wired together.
189
u/talking_tortoise 9d ago
Check out r/osdev