7 ms·
Show HN: I made my own OS from scratch because I was bored
I've wanted to make my own OS since I started programming. Now, 5 years later, I did it (kind of).
Sure, it is really basic, has very little functionality, but I made it and I'm proud of that. Oh, and I'm just 16 btw.
- ranger_danger 2y agoHow can we download only the source code?
- Jotalea 2y agoThe source code comes in a bundle that includes a compiler, an emulator, and some extra tools. While I don't see an advantage on downloading the source code alone, I won't deny it. Just note that there are three different "branches": - stable: This is the one being distributed in the website - neofetch: This one exists because I couldn't get the ASCII art to fit within 512 bytes along with the rest of features - multistage (untested): Here I'm trying to work with jumps in memory to handle different commands and features (and include them all in one release). I read online that I can compile them separately and then merge the binaries to get jumps to work. But I haven't finished it, and it probably won't compile as it is right now. That said, here is the source code for all of them: https://quickshare.samsungcloud.com/wB9kfq1umxW2 https://quickshare.samsungcloud.com/wB9kfq1umxW2 edit: fixed missing newlines
- codecraze 2y agoCongratulations on your project! Out of curiosity why don’t you put the source code on github?
- Jotalea 2y agoI want to clean up the environment I used before uploading it to GitHub; that has taken me like 4 days and still going. Yes, I've spent more time configuring the environment and documenting than actually programming. And the worst part? It's not even finished!
- mysterydip 2y ago> I made it and I'm proud of that And that's all that matters for a hobby project. Congrats!
- gtirloni 2y agoNice accomplishment. I usually do things because I'm excited about something :)
- ktbwrestler 2y agoGreat job, something like this is also a really great way to get your foot in the door with a job when the time comes. I like that you have the site in both Spanish and English!
- Jotalea 2y agoYeah, I'm a native Spanish speaker, and since I'm planning to share this project in Hispanic communities too, it would be bad to not have my own language in it. Though following that logic, I should also make my OS in Spanish too... I guess I could add some kind of translation dictionary, I'm not sure. I guess I'll do it in the future.
- thereticent 2y agoI'm impressed with your dedication and also amazed that I ran into this on HN. My 9-year-old just showed me your Geometry Dash remake in Scratch. You're like a legend to him and his friends!
- Jotalea 2y agoWhoa really?? I wonder where did he find it.. it's been a while since I've last worked on it. I think it was in 2023.. and I've never showed it too much, maybe less than 50 views? > You're like a legend to him and his friends! :D
- teruakohatu 2y agoThere has perviously been a nice guide posted on HN on getting code to run on bare metal: https://johv.dk/blog/bare-metal-assembly-tutorial.html https://johv.dk/blog/bare-metal-assembly-tutorial.html
- kitd 2y agoTIL about UefiShell.iso.
- iwontberude 2y agoCongratulations are in store but of course you are a special kind of person to escape boredom this way. It’s a gift and a curse. Good luck!
- Jotalea 2y agoThanks ;)
- caspper69 2y agoThe page isn't in English, but Google helpfully translated it for me. Without source, and only those commands available, it's kind of difficult to see what you've implemented and how far you progressed. Did you do anything with the MMU yet? Any hardware detection? Do you ever jump to a user space context? Do you have any specific design goals you want to explore, or was this just a learning exercise? Like Groundhog Day, I have been doing this over and over and over for the last 25 years. So many toy kernels, so many ideas and tests and watching A's and B's and C's and D's flash on the screen. Memory dumps. Writing executable loaders. Poring over the Intel/AMD manuals (and later AARCH64). ACPI (ugh). Trying to implement the techniques from the latest papers (usually in an effort to maximize the performance of a microkernel-ish design). It's all great fun of course, so I'm not lamenting that, but when you start to get to the userspace infrastructure, unless you're YOLO'ing it with libc and POSIX compatibility, everything is so opinionated, and there's SO MUCH TO BUILD, I just kind of peter out. It's been about 18 months or so since I last had the itch, but it's inevitable that I'll do it all over again. Best of luck!
- gazook89 2y agoImmediately after the opening header there is a button to switch to English, fyi.
- Jotalea 2y agoThere actually is a Switch to English button at the top of the screen, which of course translates the whole website to English, and adds more details that I know English-speaking people would be interested on (for example, the source code), while Spanish-speakers won't. And even if they are, they have a note saying "for more details, check the English version of the site"; and I'm sure that if they can understand those details, they can also understand English. > Did you do anything with the MMU yet? Any hardware detection? No, not yet. I still have to learn that > Do you ever jump to a user space context? I mean, I haven't put any restrictions, just as I haven't put many features that I would consider user space. > Do you have any specific design goals you want to explore, or was this just a learning exercise? I saw a video about TempleOS, and got motivated to make my own OS from scratch. Of course, TOS is a ~15 years-in-work project, while mine has been just a couple days/weeks, these are very far from each other. I guess my final goal with it would be to get Minecraft running? I don't know, getting a Java program (or Java itself) to run on an OS from scratch sounds too complicated for me. My current goal is to get Bad Apple on ASCII to show up on this, but to do that I need to save a lot of variables, one for each frame, and there being ~6000 frames, it would take a huge lot more than 512 bytes, so I would need to get jumps in memory to work so I can have these many variables set, which is what I would be working on now, if I hadn't other stuff to do. > Best of luck! Thanks :)
- krylon 2y agoRespect! This is really cool!
- colesantiago 2y agoNice job, keep it up!
- Jotalea 2y agoThanks :)
- asdf0987 2y agodespite saying it's open source, there's no link to read source code e.g github.
- ranger_danger 2y agowhy do you think that is a requirement to being called open source?
- martzy13 2y agoI don’t know that GitHub per se would be a requirement, But when I think open source - I usually think about being able to browse the code in some type of repository, in a human readable format. I like to browse a codebase in some way that I don’t have to download and unzip an unknown set of files.
- seanw444 2y agoOpen source != provided source control repository
- Karellen 2y agoI think that's debatable. Many open source licenses have a definition of accessible source code that is similar to: > The "source code" for a work means the preferred form of the work for making modifications to it. Certainly, in the past "a tarball of the source for whatever version you have" was absolutely considered sufficient for that. But these days the features provided by source control systems, such as "annotate"(/"blame"), "bisect", etc... could very well be argued to have raised the baseline for what "the preferred form of the work for making modifications to it" should mean.
- ranger_danger 2y agoI understand you prefer to be able to browse the code online, and that does seem to be largely the norm with most projects, but from a technical/legal perspective, my understanding is that the only actual requirement is that source code is provided if requested, they don't even have to post it anywhere on the Internet in advance. It could just have been emailed to you or something. But people usually put a link up somewhere just to make it easier.
- layer8 2y agoWe need more bored people.
- notfed 2y agoI desperately wish to be bored. (Context: I have a job)
- amelius 2y agoWe need new ideas in OS/kernel development, not reiterations of the same old (boring) ideas ... (imho)
- swiftcoder 2y agoQuick, someone light the UBI signal
- jart 2y agoThat's called living off interest, dividends, and stock growth.
- zeroq 2y agoanyone remembers Argante (https://argante.sourceforge.net/concept.html https://argante.sourceforge.net/concept.html)?
- changexd 2y agoGreat work! I'm usually bored too, sometimes I find something to study or try to implement known tech, but only give up when I feel like it's too hard for me or it's too much work haha, this motivates me a bit.
- pshirshov 2y agoIt's not actually an OS, it's more like a simple stub from osdev, a simple program running on bare metal.
- veltas 2y agoGot to agree, not to knock OP for sharing this because this is a fun hobby project, but to most people this doesn't meet even loose definitions of OS. I'd say this is a bootable environment or something. To be an OS it would have to have some way to run programs as well.
- Jotalea 2y agoTo me, an OS is a piece of software that can boot in a computer without requiring anything from another OS as host, and allows running programs bundled with the OS (like Paint on windows 1.1), and if supported, 3rd party programs.
- veltas 2y agoYes, and a lot of people feel that way, but that's 'booting', or 'bootstrap'. A program like that is what I might call a bootable application. It's just not what an OS is. "Operating System" has quite a clear meaning, being software that assists the general operation of the computer. If it's not capable of running general programs then it's not an Operating System.
- noone_youknow 2y agoEveryone has to start somewhere, and many who try don’t even get this far (I’m not sure I would have at OP’s age either).
- Karellen 2y agoWell, the earliest version of the code that would morph first into a terminal emulator, and eventually become Linux "was written to use one thread to write the letter A to the screen. The other thread wrote the letter B."¹ Who knows what direction this OS will evolve along? ¹ Linus Torvalds, Just for Fun, pp.63
- lolinder 2y agoTo anyone else who read the Spanish version first, note that the English version is longer and has the link to download the source code!
- deleted 2y ago[deleted]
- KTibow 2y agofyi, you can automatically detect the user's language and switch to English when applicable by using `navigator.language`... ...or even better, don't use JS (which doesn't work on older browsers and prevents some optimizations), and read the Accept-Language header instead
- account42 2y agoAnd please do NOT do what gogle does and pretend that certain values in the Accept-Language header don't indicate a user preference and you should guess based on the IP address instead.
- nikolay 2y ago[flagged]
- osrec 2y agoWhy?
- fjjjrjj 2y agoFeelings come and go. They aren't who you are, just a part of you. You are welcome for 3 years of therapy in two sentences. OP, way to funnel your energy into your project. Nice work!
- k1kingy 2y agoI have 2 young kids, some of the best advice I've been given is that it's a good thing if your kids are occasionally bored. Why? Because it forces them to problem solve and on most occasions they get pretty creative. I'll often get home from work and there will be a massive blanket fort through the living room, or some kind of obstacle course in the front yard. Being bored is not a bad thing! I know kids who have lived on iPads/TV/other devices from a young age, and they don't understand the concept of being bored and watching them try to grasp the concept of 'make believe' is downright painful. And don't get me started on not being allowed to feel proud! Who hurt you?
- miningape 2y agoAs long as it doesn't push into apathy and arrogance I don't see an issue with feeling proud or being motivated by boredom
- jmkni 2y agolol well done :)
- Jotalea 2y agothx
- anastyabd 2y ago[dead]
- heyyfurqan 2y agoAwesome!
- TZubiri 2y agoCopado, cuales son sus dependencias?
- imcritic 2y ago[flagged]
- Jotalea 2y agoPara compilar teniendo un host windows (lo odio pero no tengo otra opción) están todas las dependencias incluidas en el Dev Kit. Ahora, si estás en Linux me imagino que nomás necesitas nasm (el compilador) y build tools. Igual no estoy seguro..
- TZubiri 2y agoAh pero eso para compilar, osea que no hay dependencias de runtime tipo otro linux. Es todo assembly.
- qingcharles 2y agoThis is a really good step-by-step reference to writing your own OS: https://www.amazon.com/Developing-32-Bit-Operating-System-Cd-Rom/dp/0672306557 https://www.amazon.com/Developing-32-Bit-Operating-System-Cd... Find a copy on your favorite shadow library.
- anandnair 2y agoWebsite is not working?
- Jotalea 2y agoUhh, it is? The server I use apparently blocks specific devices or ISPs, it has happened to me a couple times and I haven't found a solution other than using a VPN or a different device on a different network. The tools they give me don't cover this device blocking, so I guess that either they manage it or it is managed automatically. I will switch to self hosting once I get an actual server.
- p0w3n3d 2y agoLe agradezco a Duolingo, no necesité cambiar el idioma a inglés cuando entré a tu sitio web.
- not_your_mentat 2y agoIsn't disclosing your age a HR violation? ;)
- mrbluecoat 2y agoReminds me somewhat of https://github.com/ReturnInfinity/BareMetal-OS https://github.com/ReturnInfinity/BareMetal-OS
- tomhee 2y agoNice job! Just started my own too.
- revskill 2y agoAnother medium blog so i could not access.
- Jotalea 2y agoUhh, it is not medium, it is my own website.