When he said: "So the cool thing is that it works for now and will only break when I’m about 20 more hours into this project and have completely forgotten about this code." I felt that....
Apple TurboPascal back in the 90's, then C# around 2013 or so. Both times ran into a situation where I SWEAR EVERYTHING WAS F**$@@ RIGHT, and yet somehow it didn't want to work. I tell people that it takes a special kind of masochist to do computer code. They laugh. I'm serious.
My C programming class in 7th grade had me doing something a lot like the second half of this for our final group project. We just had a pointer to the start of video memory and a few very basic support structures like that, and the rest was up to us. I ended up writing most of the core layer, while the rest of the team implemented game features and made sprites and all that other stuff. I walked out of that class really knowing what programming was about, even if it took me a few more years to get a practical coding environment going for myself. Looking back, that teacher was one of the best I've ever had, in any subject. He was a huge follower of the socratic method, never handing us answers, but getting us to come up with them ourselves, or find them in documentation, while never letting us get mired in a dead end.
@@gavinthecrafter Full-featured for the scale of game we were going for, anyway, yeah. Kinda sounds more impressive than it felt like to me at the time. It was maybe 6-7k lines of code iirc. The game was roughly a mix between space invaders and asteroids. Unfortunately, I no longer have the code :-(
After that: "I invented the universe to make my own Earth which allows me to gather resources to create my own hardware, then I make an operating system, which I use to play PONG"
@@magictoffee7066 The Tetris Company is a company that works HEAVILY with Nintendo, to the point of basically being fully associated with Nintendo in the public eye if you were to pull a random person off the street and asked where they best knew Tetris from.
@@eliascregard396im laughing so hard at this comment not just because it's not nintendo but also because nintendo dmcas so many things that people assume it's them
@@jrgenbull5334 To be fair, Windows these days is quite efficient, I've used it on a single core Intel Atom with only 1GB DDR2, it wasn't a gaming computer for sure, but it was actually usable, I could even watch YT videos on Firefox
Or how about the only way to save or load a file is to clear Tetris lines. Each square resenting one bit. If you fail to clear that level, you lose all that data.
This video never gets old! 2 days ago I finally got my bootloader to load and run my 32-bit C kernel and today, I got it printing to the screen properly. I have a long way to go and hopefully, I'll have my own version of Tetris running as well in the future!
I did something similar when I was just starting at engineering school, added a custom made bootloader to my laptop wich required a code to be pressed (pressed not entered, like keep holding 3 letters when it checks) to boot, otherways it shows "Disconnecting" and shuts off, people tend to leave the pc alone after that.
This video inspired me to start writing my own OS. As I’ve been writing I’ve been rewatching this and understanding more and more. I *just* started having this weird behavior and was like, “I bet I didn’t read enough sectors in.” Yup, that was it! Thank you for saving me a LOT of pain!!! 😁
@@lexihadrovic they almost certainly are not, depending on their goals. most hobby operating systems take multiple years to get to a point even remotely as useable as something like windows or linux. jdh only managed to do his project in a reasonable timeframe due to the fact that its not even really an OS, but a kernel that does a single highly specific task, which was a good decision on his part imo
@@Ollie12418 not sure why i got notified for your message even though you didn't @ me specifically, but if you're really willing to dedicate the time to such a process, the osdev wiki is *the* de facto starting point for anyone looking to get into osdev. a link to it should be in the description of this video, iirc i wish you luck on your osdev journey my friend
Next Video: "I realized that using an operating system to make tetris is sort of cheating, so I made my own computer without buying any of those cheaty parts and hardcoded tetris into it."
next next video: "using resources on Earth is actually cheating. In fact, using the physics of this universe is cheating. So, I created a worm tunnel by manipulating space-time with quantum mechanics derived from our already partial understanding of the universe to arrive in a new universe with no energy or mass or predefined laws of physics and got to work making my own rules for quantum mechanics before making my own computer to hardcode tetris on. 'But wait!', I thought. I could just make the entire universe one big game of tetris. So, that's exactly what I did: A universe that only runs tetris."
It's ridiculous how many false claims big IP holdings companies get away with making. Not only is the original piece a folk song long in the public domain, this would clearly be fair use even if they did have any rights to the music. Infuriating, truly.
@@sayhey2972 well, ironically it popped up in my recommendations lol… it just sucks that he got striked for his hard work. Shows how much UA-cam really cares about their creators.
@@chrispham6599 I think they meant that the MIDI would make it so he didn't have to make it from scratch. Anyway, Musescore isn't the best way to find sheet music. Sure, some of it is good, but there is a lot of poor transcriptions.
@@sevrjukov I mean...Tetris is still a copyrighted retail game that is sold for money, it hasn't become freeware or whatever. So this is technically distributing an unlicensed version of a paid game for free. But yeah, it still really sucks and is pretty dumb.
@@legoboy7107 I don't see how they can copyright against this because its built from scratch and open source. Even their music wasn't original, it was from Korobeiniki. Maybe they could TM against the name Tetris, also the types of blocks and the colours, but still its open source, I don't get how they can do that.. Nobody who wants to play tetris will use this code, only developers who want to read how the code works.
This is similar to what we did for my 400-level computer architecture class. Only the system we were writing it for was based on a Motorola 68K chip. We had to write all the low-level hardware drivers and a simple OS kernel that tied it all together. The final involved booting it up and loading a program from a floppy disc that the professor gave us (yeah, we implemented a floppy controller driver). The program utilized every feature we had implemented to date to run a very simple (ascii) version of Tetris.
You are a brilliant and consistent man, I thought of creating a simple OS myself back in days when I was obsessed with writing things from scratch but couldn't do it because it is so much work and requires you to understand a whole lot than a normal programmer understands about computers. Your video gives the gist of what it needs to even write a very simple bootable software. Love your work man and thanks for sharing the Github code as it may help someone who is as cool as you.
I struggle to wrap my mind around how this is even humanly possible, man I'd spend months trying to create Tetris in Unity and this guy casually writes it in ANSI C while casually making a working bootloader, graphics driver, sound driver and all the rest of it
@@atemoc naa, it also works on my Thinkpad x230, sadly I'm in the process of moving, and my Thinkpad 240x (yes the x is on the end, it's a Thinkpad from 2001 with a Pentium III) is already at my new home, but I'll try to run it on there too. Backwards compatibility is a nice thing :3
@@RobinCernyMitSuffix Damn, it doesn't work on my ThinkPad SL510, but, that probably is because of some IdeaPad firmware and other weird things on it, other OSes have issues with it too
@@RobinCernyMitSuffix @@RobinCernyMitSuffix Of course, I know that, otherwise how else could I know that other OSes on this PC struggle too? I run Arch Linux and Debian as a daily driver, I got one PC with Haiku OS and other PCs with random obscure OSes because I love playing with them!
I think it's not as hard as it sounds. What you really need to be good at is reading (the correct) documentations, there's a lot of information out there. It's not like he reinvented the wheel.
When I started coding I thought using libaries was some sort of cheating, as I basically just ran someone else's program which I couldn't write myself. This guy took that thought to a whole nother level
even the people who wrote the libraries were cheating ... since they used a high level programming language ... only the people who wrote C didnt cheat :)
As someone with no assembly knowledge, this whole video was a bizarre combination of surreal, confusing and inspiring. I kinda wanna learn assembly now.
as far as my understanding goes there isnt really any practical purpose to use it in this day and age, the only real reason to use it is for hobbyist things
I am truly impressed by this. I'm currently learning more and more code as the days go by (at least it feels that way). And seeing something like this really does make me motivated to keep pushing. I guess I gotta start doing some leetcode first though, to at least get those concepts in. (Mainly been doing webdev until now, so backend is kind of a new field for me)
"This repository is currently disabled due to a DMCA takedown notice. We have disabled public access to the repository. The notice has been publicly posted. " WHY
One more thing you can add is the Tetris bag randomizer where the seven unique pieces are shuffled and outputted as a group repeatedly. Three T pieces coming out of the first four was surprising. awesome video
This project is so needlessly hard and complicated but at the same time so beautiful to watch. Must have felt _so_ satisfying to see through this project after all the pain that went into making it. This I aspire to become as a junior dev.
The Next box isn't just for "fancy new versions." It was literally present in the original Electronika 60 version in 1984. That's before the game had sound, color, or even a price tag.
From my very limited experience from writing memory manager for Nova (had to do it for uni) and some assembly (also for.uni) I admire how persistent you had to be to one man this. Had to take so much effort. Very cool
To be fair C++ is pretty hard to use, don't feel bad. And you too can build anything from the ground up. Computer science is like playing legos. You learn easy stuff and build them on top of one another to make something complex. Over time you can do some impressive stuff as well! What matters is being too angry to give up. What are you working on if I may ask?
@@lycorisdev a basic text based game that justs prints to the command window. I would do a 2D game but implementing graphics through SDL and other libraries is still a little above my head lol. I've only been coding since about November 2020.
As someone who has only really used high level languages this is incredibly fascinating, all your videos are great and I hope the UA-cam algorithm would favour your channel more. Awesome content
Beautiful. I wrote an OS for fun too (back in the early 2000s). It had a bootloader, never left Real Mode, and could display a command prompt, and that was it! I was incredibly happy when I put the image onto a 3.5" floppy and it actually booted on my machine (modern machines with UEFI instead of a BIOS would have been much harder). Then I proceeded to never look at it again and question my life choices.
I am so mind blown by your videos. I have been watching them all day at work. How did you even manage to get to this point? I am about a year into my programming career and this just feels beyond my lifetime
This got you a subscribe from me. I've never seen anyone just write assembly like other people write "normal" code. I used to write assembly on my old BBC and I was constantly having to look everything up all the time.
Dude this guy made an operating system in a month and I can't even figure out data-orineted design in that time. Where did you learn to program? I'm mega jelly about your skills at all things programming.
thanks 😌 but tbh learned almost everything from info on the internet and going through tons of side projects. Technically been to university too but this isn't the sort of stuff you learn there and generally university courses aren't what are going to make you a good programmer, experience and time will (I know, hot take). Progress feels slow but soon enough you'll be looking back on where you were a few years ago and realize you've come really far!
I think he just has a lot of free time on his hands. You see it's not overly difficult to develop an os, it's mainly very time consuming and it's easy to write bugs. The theory is rather easy. That being said there are tons of support groups, the biggest one being the osdev discord server which you can find over at osdev.wiki
@@sorryvol I don't think CS Is the right course to take for operating system development. I've been told that you don't really learn this in college. I however really like embedded systems, and if you do too then you should look into computer engineering which is a mix of EE and CS and it sounds pretty good
Github code repo is gone, just checked and thanks for the video. I can't draw with a pencil, let alone with the code. Your dedication and passion can't be matched. I never ever thought that I'd see an OS, from scratch, running an enterprise workload called "Tetris"
Was able to boot it via PXE in virtualbox and a real notebook and a kvm server :) Nice work. That goes in my boot menu until i forget about it and wonder why everything is booting tetris.
I can’t even make a simple hello world program in assembly, and this guy here creates a whole loader on it like it was nothing. I want to one day have the abilities that this guy possesses.
@@OrbitalCookie I can see why many people hate that. But I find it better than going to school from 10-2. Then working from 4-11 PM, then studying from 11:30 until like 2AM. Rinse and repeat.
This is my second video I've watched from you in as many days. I'm still floored and my mouth is still gaping at your skill lvl. Shows the amazing work one can do when you hack a system. Great job dude.
how does this guy can manage to do such a cool project in such a short time? this dude's amazing! love your video btw, keep up with the excellent work!
you will need some knowledge of computer architecture, core concepts of operating systems and some skill in assembly. A few books that can help you with that: - Programming From The Ground Up by Jonathan Bartlett: teaches you x86 assembly, a bit of computer architecture and other things - Operating System Concepts by Avi Silberschatz, Greg Gagne, and Peter Baer Galvin: it's a great introduction to operating systems, it teaches you how the operating system interfaces with hardware, how the operating system gives support to the user space programs etc. It will teach you much more than it's needed to built what's on the video tho. - manuals on the hardware you're trying to write software to - for writing drivers there are a lot of books about drivers on linux, they might give you a good idea how to do it
You know, usually I can follow what you are doing. Even if I could never write all that myself, I at least understand what's happening. Not this time, oh boy.
When i implemented a bare-metal Tetris for an ARMv7 i used a list of coordinate offsets from the center of the tetris block instead of a matrix containing bits - that makes rotation much easier because you can just use rotation matrices
Next video after that: Making several kilograms of silicon, aluminum, antimony, arsenic, barium, beryllium, cadmium, chromium, cobalt, copper, gallium, gold, iron, lead, manganese, mercury, palladium, platinum, selenium, silver, and zinc using my own fusion reactor to build into hardware
I learnt Java at uni last year as part of a softdev conversion course but have never looked at C before. I'm amazed how much I understand without ever having written or studied lower level languages. Thanks jdh.
“I don’t think Tim Apple would like me booting this on his hardware.” That’s code for, “I have no idea how to get a Mac to boot something other than MacOS.”
Back in the PowerPC days, running anything besides Mac OS is complicated. Now with Intel, it's way easier if you want to run a recent Windows version with Boot Camp. Anything besides that might become challenging, too. But soon, with Apple Silicon, I think it'll be straight impossible to run anything else than macOS.
My jaw is on the floor. Your skills are scary. I'm not even sure about what I *didn't* understand, but the misspelled 0x0020 was something I could relate to even without a coding knowledge this deep. Long story short: subscribed.
ah yes, building an OS. i did this for my raspberry pi, wrote a custom OS so that I could make a robot run easier with it, forgot to backup the ISO, and the sd card broke causing me to lose 4 months of work. good times.
On the topic of bugs, I was awake 21 HOURS yesterday working on a 'small' side project (AKA I was cheating and using a game engine), and spent about 18 hours programming, 14-16 hours of which were fixing this ONE STUPID BUG.
Mind if I ask what you are working on. I have been obsessed with Arbitrary code execution on retro videogames. And I am currently working on a sort of cheating library of my own. In similar vein to cheat engine.
If I can give you advice: try sleeping sometimes. It can dramatically improve the quality of your written code, which reduces the amount of bugs you accidentally introduce.
@@tentative_flora2690 Yeah, I wasn't doing anything like that, I muddled up some ROTATION CODE. Basically, when calculating the rotation of an object based off of the normal of a face, I had accidentally set a mess of trigonometric functions that caused the rotation to get confused. NGL ACE, especially in older games, is super cool :)
It's very well done and I know this is a little old now but you forgot one of the core mechanics of Tetris, tera groups the game generates a group of all possible pieces and then pushes them in the random order then generates a new one you never get more than 2 of the same tetra in a row and I saw multiple times of you getting the same piece 3+ times in a row.
I enjoyed watching every second of this video. The kind of things you are building shows how much time you might have spent on studying. Respect. I can only dream to build stuff like this.
it's a bummer the company behind tetris actually dmca-ed the fuck out of the github repository. i mean they were in their right to do so, but it's also a bit sad that such a big company strikes an educational piece of code like yours.
Yeah, like an actual x64 native compiler - not a transpiler for another language, or not a bytecode interpreter, or LLVM (because cheating!) but an actual, honest-to-God, good ol'fashion' compiler. There are barely any of those around anymore. (Like what the hell happened. Computers got at least 1000 times faster - and still, every modern compiler is somehow slower than Turbo Pascal was on my 486.)
Okay, I'll admit it. I clicked into this video going "an operating system? Psh, yeah right. I bet you're just gonna make tetris in javascript or something." You coherently made an outstanding product with quality code design. My applause to you
This brought me sweet memories of developing DOS game for my course work in university. Basically the same experience: lots of ASM, interrupt handlers, double buffering, tons of manually edited hex data for fonts and sprites. And of course a lot of hours debugging without an actual debugger. But damn, it was so much fun xD
I’m genuinely impressed. This has to be the most exciting “building an OS” video I’ve ever seen since Terry Davis.
rest in peace terry a davis, gone too soon.
ye
Yeah but this os is not 2 fucking mega bytes and does not include a flight simulator ...
@@frenchwizardclientman919 or chess vs god himself
@@sorryvol And an integrated 3D sprite creator
Fun fact: GIMP can export images as C code for situations like these.
Wasn't expecting to learn anything from YT comment, thanks for this.
> situations like these
lol
Holy FUCK I needed to know this. Cheers mate!!
Wow that's cool !
you wouldn't believe how many times I have had to use GIMP export to C
When he said:
"So the cool thing is that it works for now and will only break when I’m about 20 more hours into this project and have completely forgotten about this code."
I felt that....
Not just you, every developer felt that XD
Comments are useful lol
I think anyone who has done anything that took more than a few hours to complete felt that.
Apple TurboPascal back in the 90's, then C# around 2013 or so. Both times ran into a situation where I SWEAR EVERYTHING WAS F**$@@ RIGHT, and yet somehow it didn't want to work. I tell people that it takes a special kind of masochist to do computer code. They laugh.
I'm serious.
@@AsmodeusMictian They laugh, then they ask "so, how do I get a high paying job in programming too bro?". 🤦♂️
My C programming class in 7th grade had me doing something a lot like the second half of this for our final group project. We just had a pointer to the start of video memory and a few very basic support structures like that, and the rest was up to us. I ended up writing most of the core layer, while the rest of the team implemented game features and made sprites and all that other stuff. I walked out of that class really knowing what programming was about, even if it took me a few more years to get a practical coding environment going for myself. Looking back, that teacher was one of the best I've ever had, in any subject. He was a huge follower of the socratic method, never handing us answers, but getting us to come up with them ourselves, or find them in documentation, while never letting us get mired in a dead end.
So you basically made a full featured game engine entirely out of C *IN 7TH GRADE?!?!* That's impressive
@@gavinthecrafter Full-featured for the scale of game we were going for, anyway, yeah. Kinda sounds more impressive than it felt like to me at the time. It was maybe 6-7k lines of code iirc. The game was roughly a mix between space invaders and asteroids. Unfortunately, I no longer have the code :-(
@@tejing2001 where the hell do you have a c class in 7th grade
@@pigsweat7763 The silicon valley area in California. It was an elective, of course.
C at 11 years old? lucky dude
Teach me your ways. You built everything from scratch, even the Tetris soundtrack lol. Next you'll be writing your own BIOS on custom made hardware.
Lol
Shouldn't he be curing cancer or something
@@RedstoneNinja99 saw that the other day. i forgot that i subscribe to him.
Ben Eater [eaterbc] collaboration when?
here comes the Coding Jesus.
Code Bullet : Makes the game and then makes the AI
jdh : Makes the OS and then makes the Game
these 2 combined would be unstoppable
@@vodam6970 Sounds more like something stoppable and highly cashable ...Perfect content
@Foxy 6670 LMAO
@@vodam6970 true lol
Introduce them to NileRed and they'd be extracting silicon from sand to make computer chips.
Next: "I went mining in a cave and collected resources to make my own hardware"
I made my own hardware and then proceeded to create a way to mine cryptocurrencies without collateral issues
computercraft in real life
After that: "I invented the universe to make my own Earth which allows me to gather resources to create my own hardware, then I make an operating system, which I use to play PONG"
Iron man type beat
"Just like the simulations"
"Repository unavailable due to DMCA takedown."
Fucking Nintendo despises fun!
@@eliascregard396 It's not Nintendo, they don't have the rights to tetris anymore, it was the Tetris Company.
@@magictoffee7066 The Tetris Company is a company that works HEAVILY with Nintendo, to the point of basically being fully associated with Nintendo in the public eye if you were to pull a random person off the street and asked where they best knew Tetris from.
@@eliascregard396im laughing so hard at this comment not just because it's not nintendo but also because nintendo dmcas so many things that people assume it's them
"Bro, your computer is so slow, what OS is it using? Vista?"
"Tetris."
"...Huh?"
"My computer is running on Tetris."
«Bro, your computer is so slow, what OS is it using? Windows 10?»
@@jrgenbull5334 wow, how could you insult TetrisOS so much, that you would say it's as slow as Windows 10...
@@jrgenbull5334 To be fair, Windows these days is quite efficient, I've used it on a single core Intel Atom with only 1GB DDR2, it wasn't a gaming computer for sure, but it was actually usable, I could even watch YT videos on Firefox
@@yeppiidev That's not the point, the point is that, as a current, modern, feature filled OS, is not that hard to run
@@yeppiidev I watched my first YT video on a W98 machine, I know
Just imagine the Tetris bootloader where you have to beat level 100 levels of Tetris to boot into your main OS.
Or how about the only way to save or load a file is to clear Tetris lines. Each square resenting one bit.
If you fail to clear that level, you lose all that data.
@@peterbelanger4094 Nice virus.
I need this to be a grub option. Chainload only after 100 levels.
Or do that to decrypt your data #CryptoLockerVirus
@Suicide Kyd what's the name?
jdh: _Builds an entire OS from scratch just to play tetris_
Me: _opens Stackoverflow:_ *How to center a div in CSS*
I mean we laugh, but I swear it changes every time...
@@eness379 vertical centering will always be hell man
@@eness379 that's chill man don't worry. And remember flexboxes are your friend :^)
@@eness379 katılıyorum :D
.vertical-center {
margin: 0;
position: absolute;
top: 50%;
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
This video never gets old! 2 days ago I finally got my bootloader to load and run my 32-bit C kernel and today, I got it printing to the screen properly. I have a long way to go and hopefully, I'll have my own version of Tetris running as well in the future!
I'm sad that you didn't take the genius opportunity to name it "TetrOS"
Should've known someone else would think of this joke.
From the second the video started I was like "please call it TetrOS please call it TetrOS" and...I'm not mad, I'm just disappointed
a tetris operating system called tetros actually already exists and it fits within the 512 bytes of the boot sector
Amazing
@@MrCrackbear Yeah but still, does it support the glorious Sound Blaster Audio:tm:?
"Hey bro can I borrow your laptop really quick?"
"Yeah sure it's on the couch"
"Thanks"
tetris theme starts playing from the living room
“HEY WHAT DO I DO “
@@georgefloydgaming4772 YOU PLAY TETRIS!!!
@@georgefloydgaming4772 Can you do a playthrough of rainbow six vegas with Derek Chauvin lets plays?
@@marlo8850 I own rainbow six siege only
I did something similar when I was just starting at engineering school, added a custom made bootloader to my laptop wich required a code to be pressed (pressed not entered, like keep holding 3 letters when it checks) to boot, otherways it shows "Disconnecting" and shuts off, people tend to leave the pc alone after that.
OS: "what is my purpose?"
jdh: "you load Tetris"
OS: "Oh my god!"
jdh: "Yes!"
s/load/are/
is it Rick and Morty reference? :D
@@stasyandr563 ies tthaht ah reick ahand mhorteey wrehfherrehnce
@@zvpunry1971 haha slashes program
Welcome to the computer pal
This video inspired me to start writing my own OS. As I’ve been writing I’ve been rewatching this and understanding more and more. I *just* started having this weird behavior and was like, “I bet I didn’t read enough sectors in.” Yup, that was it! Thank you for saving me a LOT of pain!!! 😁
You done with the OS?
@@lexihadrovic they almost certainly are not, depending on their goals. most hobby operating systems take multiple years to get to a point even remotely as useable as something like windows or linux.
jdh only managed to do his project in a reasonable timeframe due to the fact that its not even really an OS, but a kernel that does a single highly specific task, which was a good decision on his part imo
@@nibbletrinnal2289 Thanks for informing me on that!
How did you write your own OS? I wanna do it too!
@@Ollie12418 not sure why i got notified for your message even though you didn't @ me specifically, but if you're really willing to dedicate the time to such a process, the osdev wiki is *the* de facto starting point for anyone looking to get into osdev. a link to it should be in the description of this video, iirc
i wish you luck on your osdev journey my friend
Next Video: "I realized that using an operating system to make tetris is sort of cheating, so I made my own computer without buying any of those cheaty parts and hardcoded tetris into it."
Collab with Ben Eater?
@@Henrix1998 omg yes! XD
James Sharman anyone?
next next video: "using resources on Earth is actually cheating. In fact, using the physics of this universe is cheating. So, I created a worm tunnel by manipulating space-time with quantum mechanics derived from our already partial understanding of the universe to arrive in a new universe with no energy or mass or predefined laws of physics and got to work making my own rules for quantum mechanics before making my own computer to hardcode tetris on. 'But wait!', I thought. I could just make the entire universe one big game of tetris. So, that's exactly what I did: A universe that only runs tetris."
@@VioletJewel1729 You have too much free time, don't you?
I like how he figures out the music to tetris by playing and listening instead of just looking it up
Agreed, my literal first thought was "why didn't he just look at any of the million MIDI versions of Tetris and transcribe that".
Gotta practice learning by ear somehow
Tbh i do this too, in my opinion, it's easier to do it yourself than listening to the music, maybe that's just me, but its 100% easier for me.
Sounds very Russian. Long live Пажитнов!
I feel like the tetris theme is like the first thing you learn to play by ear
i didn't understand a word he said in this entire 20 minutes but i loved every second of it
Did you understand when he said tetris?
@@js7539 what tetris?
@@js7539 what's a tetris?
Idea: You _can_ run applications, but to launch them you have to clear lines that correspond to positions on the taskbar
“Some people use cheats like a prebuilt universe but I don’t need any of that stuff”-Jdh 40567
"yeah i was bored so I made tetris"
"oh that's nice"
"yeah, but writing the filesystem was a pain in the ass"
Who needs a file system
"wait, the *what* ?"
There was no file system smh
@@diamondminer81 There was. It handled one file, of one fixed size, located in a few fixed sector locations.
@@pseudonymity0000 That's not file system, that's just accessing the disk and reading bits from it
Well, can we just appreciate, that you did such a good job that Tetris Holding, LLC issued a DMCA takedown, good job
That made me sad
It's ridiculous how many false claims big IP holdings companies get away with making. Not only is the original piece a folk song long in the public domain, this would clearly be fair use even if they did have any rights to the music. Infuriating, truly.
Wait, this video got striked?
@@hilal_younus Yeah i checked it 3 months ago from multiple countries „Not available due to DMCA violations“
@@sayhey2972 well, ironically it popped up in my recommendations lol… it just sucks that he got striked for his hard work. Shows how much UA-cam really cares about their creators.
Me:
- Let me check the code.
Github:
- Repository unavailable due to DMCA takedown.
I know right. I wonder why?
@@leg1187 The Tetris Company hates their fans like Nintendo does, aggressively monetizing everything even if it hurts their brand
@@leg1187 Tetris Company took it down due to violation of copyright infringement.
@@HallwayMusic91 Oh of course it did :/ What did he expect?
@@leg1187 It would have been nice to try out this OS. I mean after all, it is "the perfect game".
Not only did he make the os and tetris, but he busted out the keyboard and figured out the harmony and melody instead of just checking musescore
It's actually easier to do the MIDI routine.
@@inqmusician2 no it's not! It's not as simply as just putting the MIDI INTO the code
@@chrispham6599 I think they meant that the MIDI would make it so he didn't have to make it from scratch. Anyway, Musescore isn't the best way to find sheet music. Sure, some of it is good, but there is a lot of poor transcriptions.
@@d0nnyr0n Yeah, but many games and consoles did this way. Nintendo DS, for instance.
As a hobby OSdev I can say this is highly based, good job.
Hobby...?
@@sparklyspartan1833 yes
@@sparklyspartan1833 yes
@@sparklyspartan1833 yes
@@sparklyspartan1833 yes
Dammn man, your github repository got actually DMCA'ed, this is insane
i wonder just how colossally stupid tetris folks must be to take the repo down. Sometimes it just blows my mind how dumb people can be.
lmaoooo that's fucking crazy smh my head
@@sevrjukov I mean...Tetris is still a copyrighted retail game that is sold for money, it hasn't become freeware or whatever. So this is technically distributing an unlicensed version of a paid game for free. But yeah, it still really sucks and is pretty dumb.
@@legoboy7107 Who in their right mind would buy tetris?
@@legoboy7107 I don't see how they can copyright against this because its built from scratch and open source. Even their music wasn't original, it was from Korobeiniki. Maybe they could TM against the name Tetris, also the types of blocks and the colours, but still its open source, I don't get how they can do that.. Nobody who wants to play tetris will use this code, only developers who want to read how the code works.
This is similar to what we did for my 400-level computer architecture class. Only the system we were writing it for was based on a Motorola 68K chip. We had to write all the low-level hardware drivers and a simple OS kernel that tied it all together. The final involved booting it up and loading a program from a floppy disc that the professor gave us (yeah, we implemented a floppy controller driver). The program utilized every feature we had implemented to date to run a very simple (ascii) version of Tetris.
This is the most satisfying programming/game dev/vim/neovim video on youtube, i could watch this all day
Next up: A collaboration with Ben Eater, because you two are basically going the same path just in opposite directions.
more like going in the same directions but on opposite sides of the same fence
and then there’s that guy making integrated circuits in his garage
Opposite directions would be making tetris for an os.
@@andrewliu6592 Oh my imagine colab between all 3.
Haven’t seen Ben Eater, what videos does he make?
This man is the kind of person who can flex on us but using the entertaining way
He is literally the master of full stack developers.
You are a brilliant and consistent man, I thought of creating a simple OS myself back in days when I was obsessed with writing things from scratch but couldn't do it because it is so much work and requires you to understand a whole lot than a normal programmer understands about computers. Your video gives the gist of what it needs to even write a very simple bootable software. Love your work man and thanks for sharing the Github code as it may help someone who is as cool as you.
I struggle to wrap my mind around how this is even humanly possible, man I'd spend months trying to create Tetris in Unity and this guy casually writes it in ANSI C while casually making a working bootloader, graphics driver, sound driver and all the rest of it
Well at least for the drivers it shouldn't have been TOO hard, because it was run onto a virtual machine
@@atemoc naa, it also works on my Thinkpad x230, sadly I'm in the process of moving, and my Thinkpad 240x (yes the x is on the end, it's a Thinkpad from 2001 with a Pentium III) is already at my new home, but I'll try to run it on there too. Backwards compatibility is a nice thing :3
@@RobinCernyMitSuffix Damn, it doesn't work on my ThinkPad SL510, but, that probably is because of some IdeaPad firmware and other weird things on it, other OSes have issues with it too
@@RobinCernyMitSuffix @@RobinCernyMitSuffix Of course, I know that, otherwise how else could I know that other OSes on this PC struggle too? I run Arch Linux and Debian as a daily driver, I got one PC with Haiku OS and other PCs with random obscure OSes because I love playing with them!
I think it's not as hard as it sounds. What you really need to be good at is reading (the correct) documentations, there's a lot of information out there. It's not like he reinvented the wheel.
i only understand Java and C# but this was still extremely interesting, seeing a genius create an operating system
This is literally everything I've ever wanted! 😍
The world needs more of this guy, who still can write assembly
When I started coding I thought using libaries was some sort of cheating, as I basically just ran someone else's program which I couldn't write myself. This guy took that thought to a whole nother level
even the people who wrote the libraries were cheating ... since they used a high level programming language ... only the people who wrote C didnt cheat :)
Honestly I hate using libraries because I don't understand how they are supposed to work a lot of the time and they are often very slow
@@frenzygamer907 only people who program in assembly aren't cheating
assembly is cheating, you use mnemonics
real gs use machine code
@@aiocafea *real* programmers build their own computers. I don't mean with graphics cards and pre-built circuits, I mean with transistors and stuff
"Look ma, no errors!" That is literally me showing my code to anyone
@enrique amaya the fuck?
As someone with no assembly knowledge, this whole video was a bizarre combination of surreal, confusing and inspiring. I kinda wanna learn assembly now.
No you don’t.
@Trevor B yknow what fair enough
Do it then. What's stopping you?
@@chillsgaming1900 caveman brain
as far as my understanding goes there isnt really any practical purpose to use it in this day and age, the only real reason to use it is for hobbyist things
I am truly impressed by this.
I'm currently learning more and more code as the days go by (at least it feels that way). And seeing something like this really does make me motivated to keep pushing.
I guess I gotta start doing some leetcode first though, to at least get those concepts in.
(Mainly been doing webdev until now, so backend is kind of a new field for me)
Can't believe there's someone out there who's still paying for a domain hosting niche documentation on 90's hardware.
And i am glad they exist
Domains were free back in the day
@killmoo all 7 pennies per year for a site like that
@Suicide Kyd now it's like £10 a month. Only way to survive is get people to click the adverts so you make slightly more than £10 a month
@@Darkest_matter to host a single page?
"This repository is currently disabled due to a DMCA takedown notice. We have disabled public access to the repository. The notice has been publicly posted. "
WHY
Nintendo is insane with copyright.
The Tetris Company notoriously defends its copyright and its also illegal to make a copy of Tetris
@@altpersonas then why are there so many clones of it on the play store
@@altpersonas It is not illegal to make clones. It is illegal to use their company name
@@BryanLu0 note that “clone” and “copy” mean slightly different things
One more thing you can add is the Tetris bag randomizer where the seven unique pieces are shuffled and outputted as a group repeatedly. Three T pieces coming out of the first four was surprising. awesome video
This is only a thing in more recent versions of Tetris. OG Tetris did none of that!
I really appreciate the way you kept spacing the code when it was a bunch of variables
This project is so needlessly hard and complicated but at the same time so beautiful to watch. Must have felt _so_ satisfying to see through this project after all the pain that went into making it. This I aspire to become as a junior dev.
The Next box isn't just for "fancy new versions." It was literally present in the original Electronika 60 version in 1984. That's before the game had sound, color, or even a price tag.
The Github repository got a DMCA takedown
Sucks
I WANNA SEE THE FLIPPING CODE
he should have considered that tetris is copyrighted...
YT description:
> pls don't copyright strike me for the music EA
Get's DMCA'ed instead.
From my very limited experience from writing memory manager for Nova (had to do it for uni) and some assembly (also for.uni) I admire how persistent you had to be to one man this. Had to take so much effort. Very cool
Bro. I'm over here with a case of depression caused by c++ and a project that's taken about 8 hours so far. I could never do what this man just did.
To be fair C++ is pretty hard to use, don't feel bad. And you too can build anything from the ground up. Computer science is like playing legos. You learn easy stuff and build them on top of one another to make something complex. Over time you can do some impressive stuff as well! What matters is being too angry to give up. What are you working on if I may ask?
@@lycorisdev a basic text based game that justs prints to the command window. I would do a 2D game but implementing graphics through SDL and other libraries is still a little above my head lol. I've only been coding since about November 2020.
@@thedeagle1007 I see, I'm also making a text-based game. I don't know C++ but I program in C and I used to use C# in the past, what's troubling you?
C++ is tough. Keep going!
As someone who has only really used high level languages this is incredibly fascinating, all your videos are great and I hope the UA-cam algorithm would favour your channel more. Awesome content
I completely forgot I even subscribed, what a surprise.
But a welcome one!
@@user-cb8pj2eb1g yes!
@@vaclaurus3545 I can't read your comment because the name of @___... is too long and UA-cam don't let me press Read More due to that fact.
@@JinskuKripta lol I said "yes" I can click the button just fine. 🤷
@@user-cb8pj2eb1g wish i had such a good name
Beautiful. I wrote an OS for fun too (back in the early 2000s). It had a bootloader, never left Real Mode, and could display a command prompt, and that was it! I was incredibly happy when I put the image onto a 3.5" floppy and it actually booted on my machine (modern machines with UEFI instead of a BIOS would have been much harder). Then I proceeded to never look at it again and question my life choices.
This is the person who's going to make those computers you see in Fallout.
Yeees
I felt that *_sigh_* on a spiritual level. One character bugs are the bane of programming. This video is actually insane, keep up the good work.
really impresive. I feel like I only saw a fraction of the hard work, that went into this. great job
I am so mind blown by your videos. I have been watching them all day at work. How did you even manage to get to this point? I am about a year into my programming career and this just feels beyond my lifetime
how do you feel now?
This is honestly the best video I have watched in months!
A perfect combination of coding, sarcasm and editing perfection!
This got you a subscribe from me. I've never seen anyone just write assembly like other people write "normal" code. I used to write assembly on my old BBC and I was constantly having to look everything up all the time.
Dude this guy made an operating system in a month and I can't even figure out data-orineted design in that time. Where did you learn to program? I'm mega jelly about your skills at all things programming.
I can't even make myself continue to learn asp net lol
thanks 😌 but tbh learned almost everything from info on the internet and going through tons of side projects. Technically been to university too but this isn't the sort of stuff you learn there and generally university courses aren't what are going to make you a good programmer, experience and time will (I know, hot take). Progress feels slow but soon enough you'll be looking back on where you were a few years ago and realize you've come really far!
@@jdh computer science?
I think he just has a lot of free time on his hands.
You see it's not overly difficult to develop an os, it's mainly very time consuming and it's easy to write bugs.
The theory is rather easy.
That being said there are tons of support groups, the biggest one being the osdev discord server which you can find over at osdev.wiki
@@sorryvol I don't think CS Is the right course to take for operating system development.
I've been told that you don't really learn this in college.
I however really like embedded systems, and if you do too then you should look into computer engineering which is a mix of EE and CS and it sounds pretty good
Github code repo is gone, just checked and thanks for the video.
I can't draw with a pencil, let alone with the code. Your dedication and passion can't be matched.
I never ever thought that I'd see an OS, from scratch, running an enterprise workload called "Tetris"
The amount of dedication is UNREAL!!! Truly amazing work.
next: "I reprogramed the BIOS of my computer to only run tetris"
yes
funny way to brick someone's PC
@@-Tris-literally
It already exists. CoreBoot Bios with Tetris payload.
@@-Tris- What more use does a PC need than to play Tetris? I'd say it's fully functional. lol
Was able to boot it via PXE in virtualbox and a real notebook and a kvm server :)
Nice work. That goes in my boot menu until i forget about it and wonder why everything is booting tetris.
Hey, do you happen to still have the source code? The repo was taken down and it's a shame for such a thing to be gone.
Of COURSE the GitHub repo was DMCA'd...
Fuck Nintendo and The Tetris Company.
I can’t even make a simple hello world program in assembly, and this guy here creates a whole loader on it like it was nothing. I want to one day have the abilities that this guy possesses.
time and willpower
@@OrbitalCookie True. It just feels like I never have enough time in school. School really sucks the fun out of everything.
@@d3vilscry666 LOL imagine day job from 8 to 5
@@OrbitalCookie I can see why many people hate that. But I find it better than going to school from 10-2. Then working from 4-11 PM, then studying from 11:30 until like 2AM. Rinse and repeat.
That ability called learning ability.
This is my second video I've watched from you in as many days. I'm still floored and my mouth is still gaping at your skill lvl. Shows the amazing work one can do when you hack a system. Great job dude.
how does this guy can manage to do such a cool project in such a short time? this dude's amazing!
love your video btw, keep up with the excellent work!
I just can't believe the fact that the repo got DMCA'd 😑😑
Where do you even start learning how to do this, this is incredibly impressive.
Googling. A lot of googling and 30 year old documentations. No one can teach you these things, you have to learn it all yourself
@@Henrix1998 and doing
you will need some knowledge of computer architecture, core concepts of operating systems and some skill in assembly. A few books that can help you with that:
- Programming From The Ground Up by Jonathan Bartlett: teaches you x86 assembly, a bit of computer architecture and other things
- Operating System Concepts by Avi Silberschatz, Greg Gagne, and Peter Baer Galvin: it's a great introduction to operating systems, it teaches you how the operating system interfaces with hardware, how the operating system gives support to the user space programs etc. It will teach you much more than it's needed to built what's on the video tho.
- manuals on the hardware you're trying to write software to
- for writing drivers there are a lot of books about drivers on linux, they might give you a good idea how to do it
I've added some resources in the description that I used when I started learning this stuff a few years back :)
@@jdh Thank you very much!
The level of dedication is insane, I love it
You know, usually I can follow what you are doing. Even if I could never write all that myself, I at least understand what's happening. Not this time, oh boy.
Holly man...
Outstanding skills!
Respect for the effort and also result!!!
When i implemented a bare-metal Tetris for an ARMv7 i used a list of coordinate offsets from the center of the tetris block instead of a matrix containing bits - that makes rotation much easier because you can just use rotation matrices
Ok, so, given the way this goes, the next video he's gonna say "I'm just too good for computers, so I made my own computer and OS, just to run pong"
If you're interested in that sort of thing, check out Ben Eater's 6502 computer + videocard builds ;)
@@figboot Ahhh yes, is that the guy that made a video card entirely out of breadboard?
@@Einhamer Yeah, that's him
Next video after that:
Making several kilograms of silicon, aluminum, antimony, arsenic, barium, beryllium, cadmium, chromium, cobalt, copper, gallium, gold, iron, lead, manganese, mercury, palladium, platinum, selenium, silver, and zinc using my own fusion reactor to build into hardware
once Ben Eater finish building his bread board computer, you'll need to port this over =D
He is already a full stack developer. If ever a nuclear war takes place, those two will rebuild the entire computer architecture.
I learnt Java at uni last year as part of a softdev conversion course but have never looked at C before. I'm amazed how much I understand without ever having written or studied lower level languages. Thanks jdh.
“I don’t think Tim Apple would like me booting this on his hardware.”
That’s code for, “I have no idea how to get a Mac to boot something other than MacOS.”
Back in the PowerPC days, running anything besides Mac OS is complicated.
Now with Intel, it's way easier if you want to run a recent Windows version with Boot Camp. Anything besides that might become challenging, too.
But soon, with Apple Silicon, I think it'll be straight impossible to run anything else than macOS.
Oh no don't worry, I know it's possible, I just don't want to void my warranty or anything lmao
@@jdh If booting a different OS would void your warranty i don't think apple would be allowed to make computers.. Its really easy lol, just try it
@@BocuD Sarcasm.
Modern Macs can actually only run UEFI OSes I think? And Boot Camp runs Windows 10 in UEFI mode?
I'm convinced he just found an excuse to show us his masterful Tetris skills.
eh, he is only okay.
That's a good excuse for hacking your brain outside the confort zone
please people this is literaly thebest joke you can ever make about this vid
He isn't using a 7bag system, or using right wells 0/10 would not play
@@duckmeat4674 I saw earlier someone invented a new faster method to play tetris
"I finally find this one character, change it to be correct and keep going" is the most accurate coding statement I've ever heard
You fixing the rotation table made me actually happy to see
My jaw is on the floor. Your skills are scary. I'm not even sure about what I *didn't* understand, but the misspelled 0x0020 was something I could relate to even without a coding knowledge this deep. Long story short: subscribed.
ah yes, building an OS. i did this for my raspberry pi, wrote a custom OS so that I could make a robot run easier with it, forgot to backup the ISO, and the sd card broke causing me to lose 4 months of work. good times.
That's a big rip
big oof
Now make THIS run on a pi
This is the saddest thing I have read today
big rip
On the topic of bugs, I was awake 21 HOURS yesterday working on a 'small' side project (AKA I was cheating and using a game engine), and spent about 18 hours programming, 14-16 hours of which were fixing this ONE STUPID BUG.
Mind if I ask what you are working on. I have been obsessed with Arbitrary code execution on retro videogames. And I am currently working on a sort of cheating library of my own. In similar vein to cheat engine.
Those 18 hours weren’t wasted though. Each tangent you went on that wasn’t the root cause made you a better engineer
If I can give you advice: try sleeping sometimes. It can dramatically improve the quality of your written code, which reduces the amount of bugs you accidentally introduce.
@@tentative_flora2690 Yeah, I wasn't doing anything like that, I muddled up some ROTATION CODE. Basically, when calculating the rotation of an object based off of the normal of a face, I had accidentally set a mess of trigonometric functions that caused the rotation to get confused.
NGL ACE, especially in older games, is super cool :)
@@timhold2016 Yeah, a quite literal tangent,
20:49 "It was at this moment that he knew
He fucked up"
Seriously that's a huge pain for tetris enthusiast 😂
Real
great project, unfortunately "Repository unavailable due to DMCA takedown." :(
who would do such a horrible thing?
"who would do such a horrible thing?" - Tetris LLC, of course ;-)
EA
Sad but they have every right to do so as it is copyright violation.
@@bakane6030 True
It's just if they are VERY strict with rules - people wouldn't want to engage with them in any way. That kills creativity.
@@bakane6030 lmao as if tetris hasn't been copied to death already.
"im sure not going to right this whole thing in assembly" believe me you shouldnt. writing games in assembly takes weeks and sometimes months
It's very well done and I know this is a little old now but you forgot one of the core mechanics of Tetris, tera groups the game generates a group of all possible pieces and then pushes them in the random order then generates a new one you never get more than 2 of the same tetra in a row and I saw multiple times of you getting the same piece 3+ times in a row.
That’s a modern Tetris thing, older versions of Tetris are totally random like this.
not totally random; NES and most older ones have “seeds” that correspond to the order of the tetriminos
I love how he spends more time on building the OS than Tetris. I’m honestly impressed!
Keep up the work JDH!
This is now my favourite human achievement. Previously it was ethics and before that Primus. But now it's this. Simply astonishing.
thank you mr. pope
@@jdh thou art welcome
I enjoyed watching every second of this video. The kind of things you are building shows how much time you might have spent on studying. Respect. I can only dream to build stuff like this.
Me as a newborn programmer:
mom come pick me up I'm scared
After all this the repo gets a DMCA takedown : (
Was really hoping to take a stroll through the code
It's sad the source code got copyrighted ;-;
This is the most inspiring video I have ever watch in UA-cam…….thnks for the effort…
it's a bummer the company behind tetris actually dmca-ed the fuck out of the github repository. i mean they were in their right to do so, but it's also a bit sad that such a big company strikes an educational piece of code like yours.
Its a good thing you did not release this 18 days earlier :) - thanks for making the source available
VIDEO IDEA: Make your own programming language. Been trying myself, but would like to see how you would do it
Have you looked into the esolang community? They've made countless programming languages.
Yeah, like an actual x64 native compiler - not a transpiler for another language, or not a bytecode interpreter, or LLVM (because cheating!) but an actual, honest-to-God, good ol'fashion' compiler. There are barely any of those around anymore. (Like what the hell happened. Computers got at least 1000 times faster - and still, every modern compiler is somehow slower than Turbo Pascal was on my 486.)
i've actually been making one that inherits characteristics from BASIC, although it's SUPER limited at the moment lol
Okay, I'll admit it. I clicked into this video going "an operating system? Psh, yeah right. I bet you're just gonna make tetris in javascript or something." You coherently made an outstanding product with quality code design. My applause to you
This brought me sweet memories of developing DOS game for my course work in university. Basically the same experience: lots of ASM, interrupt handlers, double buffering, tons of manually edited hex data for fonts and sprites. And of course a lot of hours debugging without an actual debugger. But damn, it was so much fun xD
"Please don't copyright strike me for the music EA"
*Repository unavailable due to DMCA takedown.*
:'(
it's not from EA, it's from TTC