I made an entire OS that only runs Tetris

Поделиться
HTML-код
  • Опубликовано: 17 апр 2021
  • it's tetris time
    NOTES:
    * yes, I know it's more of a kernel than an operating system. but "ring 0 bare metal OS/tiny kernel" just doesn't have the same ring to it.
    * not sure how to pronounce BIOS
    * i'll get a pop filter soon i promise
    * pls don't copyright strike me for the music EA 🥺
    CODE: github.com/jdah/tetris-os
    TWITTER: / jdah__
    PATREON: / jdah
    EDITOR: NeoVim
    THEME: palenight
    EMULATOR: QEMU
    RESOURCES:
    osdev.org: wiki.osdev.org/Main_Page
    Sortix: sortix.org/
    ToaruOS: toaruos.org/
    James Molloy's Kernel Development Tutorials: www.jamesmolloy.co.uk/tutorial...
    EXTRAS:
    zment with working music on the PC speaker: • TETRIS OS on real hard...
    Parker Reed running this on real hardware: • Tetris-OS
  • НаукаНаука

Комментарии • 4,4 тыс.

  • @SimonClarkstone
    @SimonClarkstone 3 года назад +6462

    Fun fact: GIMP can export images as C code for situations like these.

    • @A1rPun
      @A1rPun 3 года назад +883

      Wasn't expecting to learn anything from YT comment, thanks for this.

    • @maddiepilz5711
      @maddiepilz5711 3 года назад +735

      > situations like these
      lol

    • @resampling9129
      @resampling9129 3 года назад +299

      Holy FUCK I needed to know this. Cheers mate!!

    • @blazi_0
      @blazi_0 3 года назад +39

      Wow that's cool !

    • @DorperSystems
      @DorperSystems 3 года назад +302

      you wouldn't believe how many times I have had to use GIMP export to C

  • @IsmaelVazquezJr
    @IsmaelVazquezJr 3 года назад +6093

    I’m genuinely impressed. This has to be the most exciting “building an OS” video I’ve ever seen since Terry Davis.

  • @tejing2001
    @tejing2001 2 года назад +167

    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
      @gavinthecrafter Год назад +31

      So you basically made a full featured game engine entirely out of C *IN 7TH GRADE?!?!* That's impressive

    • @tejing2001
      @tejing2001 Год назад +8

      @@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 :-(

    • @pigsweat7763
      @pigsweat7763 Год назад +41

      @@tejing2001 where the hell do you have a c class in 7th grade

    • @tejing2001
      @tejing2001 Год назад +18

      @@pigsweat7763 The silicon valley area in California. It was an elective, of course.

    • @ME0WMERE
      @ME0WMERE 11 месяцев назад +15

      C at 11 years old? lucky dude

  • @chrisknestrick374
    @chrisknestrick374 2 года назад +238

    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
      @lexihadrovic Год назад +7

      You done with the OS?

    • @nibbletrinnal2289
      @nibbletrinnal2289 Год назад +33

      @@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

    • @lexihadrovic
      @lexihadrovic Год назад +2

      @@nibbletrinnal2289 Thanks for informing me on that!

    • @Ollie12418
      @Ollie12418 Год назад +2

      How did you write your own OS? I wanna do it too!

    • @nibbletrinnal2289
      @nibbletrinnal2289 Год назад +6

      @@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

  • @CrownCatX
    @CrownCatX 3 года назад +1775

    Next: "I went mining in a cave and collected resources to make my own hardware"

    • @InnerEagle
      @InnerEagle 3 года назад +29

      I made my own hardware and then proceeded to create a way to mine cryptocurrencies without collateral issues

    • @TerraKnight27
      @TerraKnight27 3 года назад +18

      computercraft in real life

    • @X-Ter
      @X-Ter 3 года назад +38

      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"

    • @papiangelus
      @papiangelus 3 года назад +1

      Iron man type beat

    • @janno288
      @janno288 3 года назад +5

      "Just like the simulations"

  • @Majima_Nowhere
    @Majima_Nowhere 3 года назад +3025

    "Bro, your computer is so slow, what OS is it using? Vista?"
    "Tetris."
    "...Huh?"
    "My computer is running on Tetris."

    • @jrgenbull5334
      @jrgenbull5334 3 года назад +91

      «Bro, your computer is so slow, what OS is it using? Windows 10?»

    • @cobbcoding
      @cobbcoding 3 года назад +90

      @@jrgenbull5334 wow, how could you insult TetrisOS so much, that you would say it's as slow as Windows 10...

    • @YOEL_44
      @YOEL_44 3 года назад +27

      @@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

    • @YOEL_44
      @YOEL_44 3 года назад +14

      @@yeppiidev That's not the point, the point is that, as a current, modern, feature filled OS, is not that hard to run

    • @YOEL_44
      @YOEL_44 3 года назад +7

      @@yeppiidev I watched my first YT video on a W98 machine, I know

  • @Arcoz
    @Arcoz Год назад +136

    Me:
    - Let me check the code.
    Github:
    - Repository unavailable due to DMCA takedown.

    • @leg1187
      @leg1187 Год назад +4

      I know right. I wonder why?

    • @SomeRandomPiggo
      @SomeRandomPiggo Год назад +1

      @@leg1187 The Tetris Company hates their fans like Nintendo does, aggressively monetizing everything even if it hurts their brand

    • @HallwayMusic91
      @HallwayMusic91 Год назад +7

      @@leg1187 Tetris Company took it down due to violation of copyright infringement.

    • @leg1187
      @leg1187 Год назад +7

      @@HallwayMusic91 Oh of course it did :/ What did he expect?

    • @HallwayMusic91
      @HallwayMusic91 Год назад +6

      @@leg1187 It would have been nice to try out this OS. I mean after all, it is "the perfect game".

  • @LauraLowe
    @LauraLowe 11 месяцев назад +116

    Idea: You _can_ run applications, but to launch them you have to clear lines that correspond to positions on the taskbar

  • @fknight
    @fknight 3 года назад +6999

    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.

    • @I_Am_Kosh
      @I_Am_Kosh 3 года назад +33

      Lol

    • @I_Am_Kosh
      @I_Am_Kosh 3 года назад +349

      Shouldn't he be curing cancer or something

    • @akkico
      @akkico 3 года назад +15

      @@RedstoneNinja99 saw that the other day. i forgot that i subscribe to him.

    • @recklessroges
      @recklessroges 3 года назад +33

      Ben Eater [eaterbc] collaboration when?

    • @pyfun4196
      @pyfun4196 3 года назад +23

      here comes the Coding Jesus.

  • @chalupagrande
    @chalupagrande 3 года назад +2898

    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....

    • @user-cd4bx6uq1y
      @user-cd4bx6uq1y 3 года назад +15

      Scratch, but same.

    • @ashwinbelbase
      @ashwinbelbase 2 года назад +42

      Not just you, every developer felt that XD

    • @NicVigil
      @NicVigil 2 года назад +9

      Comments are useful lol

    • @burlingk
      @burlingk 2 года назад +22

      I think anyone who has done anything that took more than a few hours to complete felt that.

    • @AsmodeusMictian
      @AsmodeusMictian 2 года назад +12

      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.

  • @retrojon_
    @retrojon_ Год назад +17

    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!

  • @renofumi28
    @renofumi28 2 года назад +4

    20:49 "It was at this moment that he knew
    He fucked up"
    Seriously that's a huge pain for tetris enthusiast 😂

  • @polraudiozion1156
    @polraudiozion1156 3 года назад +3460

    Just imagine the Tetris bootloader where you have to beat level 100 levels of Tetris to boot into your main OS.

    • @peterbelanger4094
      @peterbelanger4094 2 года назад +322

      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.

    • @sonicfon
      @sonicfon 2 года назад +283

      @@peterbelanger4094 Nice virus.

    • @andjohn
      @andjohn 2 года назад +61

      I need this to be a grub option. Chainload only after 100 levels.

    • @charliesenn4517
      @charliesenn4517 2 года назад +25

      Or do that to decrypt your data #CryptoLockerVirus

    • @coffin7904
      @coffin7904 2 года назад +3

      @Suicide Kyd what's the name?

  • @jedits2256
    @jedits2256 3 года назад +1590

    "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

    • @georgefloydgaming4772
      @georgefloydgaming4772 3 года назад +27

      “HEY WHAT DO I DO “

    • @nathangamble125
      @nathangamble125 3 года назад +21

      @@georgefloydgaming4772 YOU PLAY TETRIS!!!

    • @marlo8850
      @marlo8850 3 года назад +1

      @@georgefloydgaming4772 Can you do a playthrough of rainbow six vegas with Derek Chauvin lets plays?

    • @georgefloydgaming4772
      @georgefloydgaming4772 3 года назад +1

      @@marlo8850 I own rainbow six siege only

    • @-na-nomad6247
      @-na-nomad6247 3 года назад +6

      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.

  • @theulfhednar2655
    @theulfhednar2655 11 месяцев назад +5

    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)

  • @MShahbazKharal
    @MShahbazKharal 2 года назад +3

    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.

  • @aarghrai2697
    @aarghrai2697 3 года назад +798

    Code Bullet : Makes the game and then makes the AI
    jdh : Makes the OS and then makes the Game

    • @vodam6970
      @vodam6970 3 года назад +52

      these 2 combined would be unstoppable

    • @mimisgtaman
      @mimisgtaman 3 года назад +33

      @@vodam6970 Sounds more like something stoppable and highly cashable ...Perfect content

    • @foxy6670gaming
      @foxy6670gaming 3 года назад +51

      Now just implement CB's Tetris AI and you've got a computer that you don't have to use.

    • @aarghrai2697
      @aarghrai2697 3 года назад +3

      @@foxy6670gaming LMAO

    • @brandontechnerd
      @brandontechnerd 3 года назад

      @@vodam6970 true lol

  • @palegrass6168
    @palegrass6168 3 года назад +1418

    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."

    • @Henrix1998
      @Henrix1998 3 года назад +118

      Collab with Ben Eater?

    • @TheCustomFHD
      @TheCustomFHD 3 года назад +13

      @@Henrix1998 omg yes! XD

    • @alexstone691
      @alexstone691 3 года назад +1

      James Sharman anyone?

    • @VioletJewel1729
      @VioletJewel1729 3 года назад +94

      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."

    • @thev01d85
      @thev01d85 3 года назад +17

      @@VioletJewel1729 You have too much free time, don't you?

  • @JordanSugarman
    @JordanSugarman 2 года назад +6

    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.

  • @potassiumdev3501
    @potassiumdev3501 11 месяцев назад +7

    It's sad the source code got copyrighted ;-;

  • @JokerFey
    @JokerFey 3 года назад +1612

    OS: "what is my purpose?"
    jdh: "you load Tetris"
    OS: "Oh my god!"
    jdh: "Yes!"

    • @zvpunry1971
      @zvpunry1971 3 года назад +15

      s/load/are/

    • @stasyandr563
      @stasyandr563 3 года назад +11

      is it Rick and Morty reference? :D

    • @lowqualityvideos8091
      @lowqualityvideos8091 3 года назад +2

      @@stasyandr563 ies tthaht ah reick ahand mhorteey wrehfherrehnce

    • @otesunki
      @otesunki 3 года назад

      @@zvpunry1971 haha slashes program

    • @TheChasedanger
      @TheChasedanger 3 года назад +2

      Welcome to the computer pal

  • @subpixell
    @subpixell 3 года назад +443

    I'm sad that you didn't take the genius opportunity to name it "TetrOS"

    • @Jono997
      @Jono997 3 года назад +16

      Should've known someone else would think of this joke.

    • @z-beeblebrox
      @z-beeblebrox 3 года назад +15

      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

    • @MrCrackbear
      @MrCrackbear 3 года назад +15

      a tetris operating system called tetros actually already exists and it fits within the 512 bytes of the boot sector

    • @gregdabrat
      @gregdabrat 3 года назад +1

      Amazing

    • @devhonk1722
      @devhonk1722 3 года назад +4

      @@MrCrackbear Yeah but still, does it support the glorious Sound Blaster Audio:tm:?

  • @fugoogle_was_already_taken
    @fugoogle_was_already_taken Год назад +3

    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

  • @viktorhonchar
    @viktorhonchar 2 года назад +1

    Holly man...
    Outstanding skills!
    Respect for the effort and also result!!!

  • @nikhilmwarrier7948
    @nikhilmwarrier7948 3 года назад +1438

    jdh: _Builds an entire OS from scratch just to play tetris_
    Me: _opens Stackoverflow:_ *How to center a div in CSS*

    • @MisterRousseaux
      @MisterRousseaux 3 года назад +205

      I mean we laugh, but I swear it changes every time...

    • @eness379
      @eness379 3 года назад +51

      its easy to center but hard to do it vertically i wasted multiple hours on that thing
      edit: vertically i meant

    • @tedi7103
      @tedi7103 3 года назад +18

      @@eness379 vertical centering will always be hell man

    • @eness379
      @eness379 3 года назад +1

      @@tedi7103 ye i meant vertically i am not a native english speaker sorry

    • @tedi7103
      @tedi7103 3 года назад +9

      @@eness379 that's chill man don't worry. And remember flexboxes are your friend :^)

  • @lorenzoiannuzzi3937
    @lorenzoiannuzzi3937 3 года назад +344

    "yeah i was bored so I made tetris"
    "oh that's nice"
    "yeah, but writing the filesystem was a pain in the ass"

    • @efhiii
      @efhiii 3 года назад +22

      Who needs a file system

    • @DamienPup
      @DamienPup 3 года назад +18

      "wait, the *what* ?"

    • @diamondminer81
      @diamondminer81 3 года назад +10

      There was no file system smh

    • @pseudonymity0000
      @pseudonymity0000 2 года назад

      @@diamondminer81 There was. It handled one file, of one fixed size, located in a few fixed sector locations.

    • @namenotappropriate8756
      @namenotappropriate8756 Год назад +2

      @@pseudonymity0000 That's not file system, that's just accessing the disk and reading bits from it

  • @fntthesmth423
    @fntthesmth423 2 года назад +1

    I really appreciate the way you kept spacing the code when it was a bunch of variables

  • @rr42
    @rr42 2 года назад +5

    After all this the repo gets a DMCA takedown : (
    Was really hoping to take a stroll through the code

  • @cat47
    @cat47 3 года назад +320

    “Some people use cheats like a prebuilt universe but I don’t need any of that stuff”-Jdh 40567

  • @ovencake523
    @ovencake523 3 года назад +532

    I like how he figures out the music to tetris by playing and listening instead of just looking it up

    • @Ruinah
      @Ruinah 3 года назад +66

      Agreed, my literal first thought was "why didn't he just look at any of the million MIDI versions of Tetris and transcribe that".

    • @textnumbers22
      @textnumbers22 3 года назад +37

      Gotta practice learning by ear somehow

    • @Johnny31323
      @Johnny31323 2 года назад +2

      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.

    • @TheRojo387
      @TheRojo387 Год назад

      Sounds very Russian. Long live Пажитнов!

    • @Xvladin
      @Xvladin Год назад

      I feel like the tetris theme is like the first thing you learn to play by ear

  • @khoapham1821
    @khoapham1821 2 года назад +9

    The world needs more of this guy, who still can write assembly

  • @ThePooper_
    @ThePooper_ 2 года назад

    I binge you’re youtube videos while coding, i love you’re content man keep up the good work 👍

  • @sayhey2972
    @sayhey2972 2 года назад +1436

    Well, can we just appreciate, that you did such a good job that Tetris Holding, LLC issued a DMCA takedown, good job

    • @superzova
      @superzova 2 года назад +90

      That made me sad

    • @tissuepaper9962
      @tissuepaper9962 2 года назад +176

      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.

    • @hilal_younus
      @hilal_younus 2 года назад +17

      Wait, this video got striked?

    • @sayhey2972
      @sayhey2972 2 года назад +35

      @@hilal_younus Yeah i checked it 3 months ago from multiple countries „Not available due to DMCA violations“

    • @hilal_younus
      @hilal_younus 2 года назад +50

      @@sayhey2972 well, ironically it popped up in my recommendations lol… it just sucks that he got striked for his hard work. Shows how much RUclips really cares about their creators.

  • @thescroncho8945
    @thescroncho8945 3 года назад +297

    i didn't understand a word he said in this entire 20 minutes but i loved every second of it

    • @js7539
      @js7539 3 года назад +2

      Did you understand when he said tetris?

    • @thescroncho8945
      @thescroncho8945 3 года назад +3

      @@js7539 what tetris?

    • @timg2727
      @timg2727 3 года назад +1

      @@js7539 what's a tetris?

    • @backdoorgate
      @backdoorgate 3 года назад +1

      this happens when a coding video is recommended by youtube

  • @hippyhoppo
    @hippyhoppo Год назад +2

    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

  • @01Chris02
    @01Chris02 2 года назад +1

    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.

  • @sorryvol
    @sorryvol 3 года назад +436

    your channel is so underappreciated, I have been watching since your first video and don't understand why your channel hasn't blown up yet. great video production quality, informative and just the right amount of humour. wait until the algorithm gods decide it's your time and your channel will blow up in no time.

    • @jdh
      @jdh  3 года назад +68

      thanks! but tbh I feel like 22k subscribers is "blown up" for me haha it's still a little unreal for me to think about at that number

    • @puppergump4117
      @puppergump4117 3 года назад +5

      It was probably the minecraft videos

    • @dsi-films1264
      @dsi-films1264 3 года назад +3

      @@jdh haha I’m happy for you :) Amazing things you do!

    • @henrylang699
      @henrylang699 3 года назад +2

      @@jdh great work with everything still

    • @jnnx
      @jnnx 3 года назад

      That’s not how it works, that’s not how any of this works!

  • @eric-jt4ij
    @eric-jt4ij 3 года назад +375

    As a hobby OSdev I can say this is highly based, good job.

  • @henrikr8183
    @henrikr8183 2 года назад +2

    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.

  • @noxfortes
    @noxfortes 2 года назад +7

    I just can't believe the fact that the repo got DMCA'd 😑😑

  • @2k7u
    @2k7u 2 года назад +560

    Dammn man, your github repository got actually DMCA'ed, this is insane

    • @sevrjukov
      @sevrjukov 2 года назад +41

      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.

    • @InsideBSIProd
      @InsideBSIProd 2 года назад +7

      lmaoooo that's fucking crazy smh my head

    • @legoboy7107
      @legoboy7107 2 года назад +87

      @@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.

    • @imaginarystranger1974
      @imaginarystranger1974 2 года назад +82

      @@legoboy7107 Who in their right mind would buy tetris?

    • @traida111
      @traida111 2 года назад +88

      @@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.

  • @redumptious2544
    @redumptious2544 3 года назад +567

    Next up: A collaboration with Ben Eater, because you two are basically going the same path just in opposite directions.

    • @Templarfreak
      @Templarfreak 3 года назад +52

      more like going in the same directions but on opposite sides of the same fence

    • @andrewliu6592
      @andrewliu6592 2 года назад +21

      and then there’s that guy making integrated circuits in his garage

    • @DVankeuren
      @DVankeuren 2 года назад +3

      Opposite directions would be making tetris for an os.

    • @crusaderanimation6967
      @crusaderanimation6967 2 года назад +4

      @@andrewliu6592 Oh my imagine colab between all 3.

    • @daniellewilson8527
      @daniellewilson8527 2 года назад +2

      Haven’t seen Ben Eater, what videos does he make?

  • @DorjnamjimCSB-CSD
    @DorjnamjimCSB-CSD Год назад

    Thank you for the video, This actually gave me lot of an Inspiration to make my old laptop old game machine ! Love u dude !!! ...

  • @XinhuiZENG
    @XinhuiZENG 4 месяца назад +6

    "Repository unavailable due to DMCA takedown."

  • @spookyturbo1618
    @spookyturbo1618 3 года назад +269

    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

    • @inqmusician2
      @inqmusician2 3 года назад +1

      It's actually easier to do the MIDI routine.

    • @chrispham6599
      @chrispham6599 3 года назад +1

      @@inqmusician2 no it's not! It's not as simply as just putting the MIDI INTO the code

    • @d0nnyr0n
      @d0nnyr0n 3 года назад +2

      @@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.

    • @inqmusician2
      @inqmusician2 3 года назад

      @@d0nnyr0n Yeah, but many games and consoles did this way. Nintendo DS, for instance.

  • @deathscape47
    @deathscape47 3 года назад +165

    This is the most satisfying programming/game dev/vim/neovim video on youtube, i could watch this all day

  • @paulwratt
    @paulwratt 2 года назад

    Its a good thing you did not release this 18 days earlier :) - thanks for making the source available

  • @FreeSpeechWarrior
    @FreeSpeechWarrior 9 месяцев назад

    That is totally sick you're a good programmer man I really like your videos. 👏👏👍👍

  • @cannac6995
    @cannac6995 3 года назад +311

    This man is the kind of person who can flex on us but using the entertaining way

  • @norb3695
    @norb3695 3 года назад +169

    "Look ma, no errors!" That is literally me showing my code to anyone

    • @norb3695
      @norb3695 Год назад

      @enrique amaya the fuck?

  • @ricardovega1407
    @ricardovega1407 2 года назад

    I wish I had your knowledge, so many ideas in my head!

  • @cppxaxa
    @cppxaxa 2 года назад +2

    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"

  • @pedrogonzalez5590
    @pedrogonzalez5590 2 года назад +116

    The Github repository got a DMCA takedown

    • @shepardpower
      @shepardpower 2 года назад +7

      Sucks

    • @daviddgtnt
      @daviddgtnt 2 года назад +17

      I WANNA SEE THE FLIPPING CODE

    • @menderelcapbig1876
      @menderelcapbig1876 2 года назад +8

      he should have considered that tetris is copyrighted...

    • @BartoszDotryw
      @BartoszDotryw 2 года назад +1

      YT description:
      > pls don't copyright strike me for the music EA
      Get's DMCA'ed instead.

  • @henningerhenningstone691
    @henningerhenningstone691 3 года назад +206

    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
      @atemoc 3 года назад +6

      Well at least for the drivers it shouldn't have been TOO hard, because it was run onto a virtual machine

    • @RobinCernyMitSuffix
      @RobinCernyMitSuffix 3 года назад +5

      @@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

    • @atemoc
      @atemoc 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

    • @atemoc
      @atemoc 3 года назад +1

      @@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!

    • @Toopa88
      @Toopa88 3 года назад +9

      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.

  • @nikhuge6580
    @nikhuge6580 2 года назад +3

    This is the most inspiring video I have ever watch in RUclips…….thnks for the effort…

  • @AirforcLuckyThirteen
    @AirforcLuckyThirteen 2 года назад

    I wish I was this capable! Impressive work!

  • @Bladavia
    @Bladavia 3 года назад +376

    Can't believe there's someone out there who's still paying for a domain hosting niche documentation on 90's hardware.

    • @timgels2918
      @timgels2918 3 года назад +101

      And i am glad they exist

    • @YitzharVered
      @YitzharVered 2 года назад +34

      Domains were free back in the day

    • @gfasterOS
      @gfasterOS 2 года назад +13

      @killmoo all 7 pennies per year for a site like that

    • @Darkest_matter
      @Darkest_matter 2 года назад

      @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

    • @nickwilson3499
      @nickwilson3499 2 года назад +2

      @@Darkest_matter to host a single page?

  • @ForbiddenPizza
    @ForbiddenPizza 3 года назад +226

    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

    • @frenzygamer907
      @frenzygamer907 2 года назад +32

      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 :)

    • @Taylor_5724
      @Taylor_5724 2 года назад +12

      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

    • @callmeishmael5742
      @callmeishmael5742 2 года назад +44

      @@frenzygamer907 only people who program in assembly aren't cheating

    • @aiocafea
      @aiocafea 2 года назад +57

      assembly is cheating, you use mnemonics
      real gs use machine code

    • @callmeishmael5742
      @callmeishmael5742 2 года назад +52

      @@aiocafea *real* programmers build their own computers. I don't mean with graphics cards and pre-built circuits, I mean with transistors and stuff

  • @combardus9309
    @combardus9309 2 года назад

    This is such an insane thing to do. Youre an inspiration

  • @0ia
    @0ia 8 месяцев назад

    I don’t deserve a video this good, thanks. Great job.

  • @PeterfoxUwU
    @PeterfoxUwU 3 года назад +88

    This is literally everything I've ever wanted! 😍

  • @centenarium
    @centenarium 3 года назад +57

    i only understand Java and C# but this was still extremely interesting, seeing a genius create an operating system

  • @Dayrider10
    @Dayrider10 4 месяца назад

    Damn, this man just says my thoughts out loud and I appreciate it

  • @waterinferno2071
    @waterinferno2071 4 месяца назад +1

    You fixing the rotation table made me actually happy to see

  • @hexandcube
    @hexandcube 2 года назад +61

    "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

    • @belstar1128
      @belstar1128 2 года назад +4

      Nintendo is insane with copyright.

    • @altpersonas
      @altpersonas 2 года назад +1

      The Tetris Company notoriously defends its copyright and its also illegal to make a copy of Tetris

    • @kantraa
      @kantraa 2 года назад +1

      @@altpersonas then why are there so many clones of it on the play store

    • @BryanLu0
      @BryanLu0 2 года назад +4

      @@altpersonas It is not illegal to make clones. It is illegal to use their company name

    • @U20E0
      @U20E0 2 года назад

      @@BryanLu0 note that “clone” and “copy” mean slightly different things

  • @vaclaurus3545
    @vaclaurus3545 3 года назад +327

    I completely forgot I even subscribed, what a surprise.

    • @user-cb8pj2eb1g
      @user-cb8pj2eb1g 3 года назад +1

      But a welcome one!

    • @vaclaurus3545
      @vaclaurus3545 3 года назад

      @@user-cb8pj2eb1g yes!

    • @JinskuKripta
      @JinskuKripta 3 года назад +1

      @@vaclaurus3545 I can't read your comment because the name of @___... is too long and RUclips don't let me press Read More due to that fact.

    • @vaclaurus3545
      @vaclaurus3545 3 года назад

      @@JinskuKripta lol I said "yes" I can click the button just fine. 🤷

    • @sql64
      @sql64 3 года назад

      @@user-cb8pj2eb1g wish i had such a good name

  • @user-rh2xc4eq7d
    @user-rh2xc4eq7d 4 месяца назад +1

    You can use group theory to rotate the tetraminos. A rotation is a combination of orthogonal and diagonal reflections.

  • @benjaminkindle1841
    @benjaminkindle1841 2 года назад

    You seem way too smart to be spending your time making this...
    Good job!

  • @sneeznoodle
    @sneeznoodle 3 года назад +95

    As someone with no assembly knowledge, this whole video was a bizarre combination of surreal, confusing and inspiring. I kinda wanna learn assembly now.

    • @alexanderl4995
      @alexanderl4995 3 года назад +61

      No you don’t.

    • @sneeznoodle
      @sneeznoodle 3 года назад +20

      @Trevor B yknow what fair enough

    • @chillsgaming1900
      @chillsgaming1900 3 года назад +1

      Do it then. What's stopping you?

    • @sneeznoodle
      @sneeznoodle 3 года назад +7

      @@chillsgaming1900 caveman brain

    • @Templarfreak
      @Templarfreak 3 года назад

      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

  • @wafflespawn
    @wafflespawn 3 года назад +239

    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.

    • @Kitulous
      @Kitulous 3 года назад +14

      I can't even make myself continue to learn asp net lol

    • @jdh
      @jdh  3 года назад +208

      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!

    • @sorryvol
      @sorryvol 3 года назад +1

      @@jdh computer science?

    • @thev01d85
      @thev01d85 3 года назад +12

      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

    • @thev01d85
      @thev01d85 3 года назад +7

      @@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

  • @user-ij2hk6mf8z
    @user-ij2hk6mf8z Год назад

    That is so cool, I love it!

  • @m.furkaner7418
    @m.furkaner7418 2 года назад

    This is the pinnacle of RUclips right there! Aspiring to say the least

  • @LiEnby
    @LiEnby 3 года назад +189

    next: "I reprogramed the BIOS of my computer to only run tetris"

    • @breaktrace
      @breaktrace 3 года назад +1

      yes

    • @-Tris-
      @-Tris- 3 года назад +26

      funny way to brick someone's PC

    • @gladiusso
      @gladiusso 3 года назад +18

      @@-Tris-literally

    • @NextLevelCode
      @NextLevelCode 3 года назад +5

      It already exists. CoreBoot Bios with Tetris payload.

    • @vertihippo1274
      @vertihippo1274 3 года назад +4

      @@-Tris- What more use does a PC need than to play Tetris? I'd say it's fully functional. lol

  • @knownas2017
    @knownas2017 3 года назад +57

    This is the person who's going to make those computers you see in Fallout.

  • @semilife
    @semilife 2 года назад

    Wow, in awe. Watching and listening to a genius at work.

  • @metalpunk
    @metalpunk 2 года назад

    While I am, like everyone else, astounded by the effort that went into this project, I have to say I'm impressed by the playthrough demo, especially ca. 21:50-22:15. Well played

  • @EebstertheGreat
    @EebstertheGreat 3 года назад +14

    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.

  • @junsulee1854
    @junsulee1854 3 года назад +28

    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

    • @cynoglav9665
      @cynoglav9665 2 года назад +1

      This is only a thing in more recent versions of Tetris. OG Tetris did none of that!

  • @hammarhank
    @hammarhank 2 года назад

    This is so cool! dream to have this knowledge

  • @itzlilluke
    @itzlilluke Год назад +1

    I love how he spends more time on building the OS than Tetris. I’m honestly impressed!
    Keep up the work JDH!

  • @alexismandelias
    @alexismandelias 3 года назад +8

    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.

  • @sauldickson4079
    @sauldickson4079 3 года назад +90

    “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.”

    • @Mr_Yeah
      @Mr_Yeah 3 года назад +9

      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.

    • @jdh
      @jdh  3 года назад +42

      Oh no don't worry, I know it's possible, I just don't want to void my warranty or anything lmao

    • @BocuD
      @BocuD 3 года назад +9

      @@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

    • @bobweiram6321
      @bobweiram6321 3 года назад +4

      @@BocuD Sarcasm.

    • @paulstelian97
      @paulstelian97 3 года назад

      Modern Macs can actually only run UEFI OSes I think? And Boot Camp runs Windows 10 in UEFI mode?

  • @MrBreadoflife
    @MrBreadoflife Год назад

    I did a few assembly based graphic demos back in the day on the SoundBlaster and vga, but i wasn't that big of a mosaicist to create a basic OS to go with it!

  • @sirfluffdev
    @sirfluffdev Год назад +3

    This sounds like it could be a fun project for learning the basics of bare metal programming. Time to do this in Rust!

  • @thedeagle1007
    @thedeagle1007 3 года назад +41

    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.

    • @lycorisdev
      @lycorisdev 3 года назад +11

      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?

    • @thedeagle1007
      @thedeagle1007 3 года назад +5

      @@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.

    • @lycorisdev
      @lycorisdev 3 года назад +4

      @@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?

    • @richarddurkee4617
      @richarddurkee4617 3 года назад

      C++ is tough. Keep going!

  • @it-vb6sr
    @it-vb6sr 3 года назад +19

    As someone who has only really used high level languages this is incredibly fascinating, all your videos are great and I hope the RUclips algorithm would favour your channel more. Awesome content

  • @KetraXPL
    @KetraXPL 2 года назад +3

    17:54 nice music i love it

  • @nkusters
    @nkusters Год назад

    Love it; very impressive

  • @sheep_supreme6790
    @sheep_supreme6790 3 года назад +9

    really impresive. I feel like I only saw a fraction of the hard work, that went into this. great job

  • @zackmandude6764
    @zackmandude6764 2 года назад +3

    18:53 As soon as the drumroll started, an ad popped up

  • @funwithalbi2425
    @funwithalbi2425 2 года назад

    damn, your learning so much!

  • @davidschwaiger7563
    @davidschwaiger7563 2 года назад

    I am really impressed but you destroyed my eyes ! I was watching your video at 00:26 and while i was watching i came up to the minute 8:30 in the video and the white bright screen blinded me 😂

  • @raymonddevries9928
    @raymonddevries9928 3 года назад +15

    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.

  • @JosephTatumPage
    @JosephTatumPage 2 года назад +5

    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.

  • @KevFrost
    @KevFrost 2 года назад

    I am so impressed that you used all manner of wikis, pdfs and wayback machine to build your OS, then worked out the music freehand, rather than ripping midi file/looking up the sheet music of Korobeiniki

  • @sherlock_221
    @sherlock_221 Год назад

    Please tell us about your education your educational back.. You are one of the greatest computer master i have seen on youtube. Bow down to the king.

  • @brick4353
    @brick4353 3 года назад +66

    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.

    • @Jesse78
      @Jesse78 3 года назад +6

      That's a big rip

    • @casey6259
      @casey6259 3 года назад +1

      big oof

    • @havens1515
      @havens1515 3 года назад +1

      Now make THIS run on a pi

    • @OrdosKoala
      @OrdosKoala 3 года назад +1

      This is the saddest thing I have read today

    • @OxygenOS
      @OxygenOS 3 года назад

      big rip

  • @AndrewWilsonStooshie
    @AndrewWilsonStooshie 2 года назад +6

    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.

  • @shantanukulkarni8883
    @shantanukulkarni8883 2 года назад +1

    Sir, I haven't seen such patience in my life. Your work will be appreciated for generations.

  • @AlexeyDubkov
    @AlexeyDubkov 8 месяцев назад +1

    Awesome nostalgic video! It reminded me what I build in my ~13-15, my own OS just not with Tetris but simple shell.