#1 How to Build a Virtual Machine from Scratch

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ต.ค. 2015
  • In this series we'll learn how to build a virtual machine in c++ from scratch. This series is designed to provide insight into how computers work, and therefore is an attempt to be as simple as possible.
    source code: github.com/pbohun/stack-vm-tu...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 68

  • @MrTarakrigia
    @MrTarakrigia 4 ปีที่แล้ว

    Awesome video. Unique stuff!!! Atleast I got the glimpse of how a VM works under the hood. Thanks man!

  • @joshuaorthodox
    @joshuaorthodox ปีที่แล้ว

    Yes! I have been craving to do this myself, but I had no idea where to get started, thank you so much!!

  • @andycouto7688
    @andycouto7688 7 ปีที่แล้ว +4

    This is one of the best videos on how to build a VM I have found thank you for posting this!

  • @AveChristusRex
    @AveChristusRex 8 ปีที่แล้ว +4

    Nice vid! Woking on something similar at the moment.

  • @256k_
    @256k_ ปีที่แล้ว

    i have been looking for a video like this! thank you!

  • @jordilagaresroset8396
    @jordilagaresroset8396 5 ปีที่แล้ว +11

    after watching this, the least i can do is subscribing ;P
    *EDIT*: Wow thank for the heart!

  • @suckinDiesel44
    @suckinDiesel44 4 ปีที่แล้ว +4

    Great video, no nonsense straight into things. Subscribed!

  • @SaifUlIslam-db1nu
    @SaifUlIslam-db1nu 4 ปีที่แล้ว +1

    Hi!
    Where and how did you read about this material? Where did you get this knowledge from?
    Thanks!

  • @memoriasIT
    @memoriasIT 6 ปีที่แล้ว +1

    Good job man! Interested in this, let's see when I manage to do this :P

  • @patricktorgerson5810
    @patricktorgerson5810 7 ปีที่แล้ว

    This is awesome. and surprisingly simple

  • @sirpeanutgaming2749
    @sirpeanutgaming2749 6 ปีที่แล้ว +29

    What resources did you use to help gather information on this subject?

  • @willbou2011
    @willbou2011 8 ปีที่แล้ว +2

    That was just awesome!

  • @betaalpha3062
    @betaalpha3062 5 ปีที่แล้ว

    Amazing! I like this !!!

  • @notsoverflow
    @notsoverflow 6 ปีที่แล้ว +3

    thank you, really awesome tutorial :D

  • @dragonfly3139
    @dragonfly3139 7 ปีที่แล้ว +1

    awesome thank you for putting this up

  • @dmitryponyatov2158
    @dmitryponyatov2158 ปีที่แล้ว

    can you recommend some video or tutorials about writing Python-like object virtual machine?

  • @miquel6572
    @miquel6572 3 ปีที่แล้ว +1

    Does anybody know some book or article where i can learn more abou the theoretical background to this?

  • @pruthvim.g9057
    @pruthvim.g9057 5 ปีที่แล้ว

    I'm getting segmentation fault(core dumped).....while compiling....solution?

  • @easynavigation847
    @easynavigation847 ปีที่แล้ว

    Please which type of hypervisor would we say this machine use.

  • @ahmadabushawar5101
    @ahmadabushawar5101 4 ปีที่แล้ว

    Im getting 0 at the top of the stack and i cant figure out the reason why.

  • @tutacat
    @tutacat 3 หลายเดือนก่อน

    That's not how negative works, the first bit just is an easy way to see if it is negative. negative is inverted bits !(x) then -1 (since you start counting at -128 for example in 8 bit byte
    So 7: 0111 -> 1001

  • @bunmimichael-asalu2069
    @bunmimichael-asalu2069 ปีที่แล้ว

    Hello, Quick Question, Do you know how to do this on mac? Is there an app i can install to do this? Thanks

    • @philipbohun740
      @philipbohun740  ปีที่แล้ว

      You can check to see if you already have gcc installed by opening Terminal and typing: which gcc
      If nothing shows then you'll probably want the homebrew package manager: brew.sh/
      Then you can install gcc like so: brew install gcc
      That will give you the c compiler and then you can use whatever text editor you want.

  • @AlphaEtOmega43
    @AlphaEtOmega43 7 ปีที่แล้ว +2

    Why you didn't use a std::stack rather than a std::vector for your stack ^^ ?

    • @philipbohun740
      @philipbohun740  7 ปีที่แล้ว +6

      std::stack would've been better for this simple example. Though I think if one was serious about performance std::vector is probably the better choice, since it guarantees contiguous allocation of memory which encourages speed. I think in future tutorials I will try to consider simplicity over speed.

  • @NIKHIL-yl1ws
    @NIKHIL-yl1ws 2 ปีที่แล้ว

    Which OS are you using in this video??

  • @meegz149
    @meegz149 7 ปีที่แล้ว

    I use the exact same code but visual studio is telling me that the vector subscript is out of range. Anyone know why that is?

    • @philipbohun740
      @philipbohun740  7 ปีที่แล้ว

      If you run the program in debug mode you can use break statements around where you access any vectors that you have and see what the values are.
      Otherwise you can use print statements printing out the index before you access any elements of a vector. That should help narrow down the exact line where something is going wrong.
      Good luck!

    • @seanmccain1450
      @seanmccain1450 5 ปีที่แล้ว

      Likely because your program counter (pc) doesn’t start at 100.

    • @seanmccain1450
      @seanmccain1450 5 ปีที่แล้ว

      But that just means you are trying to get something that isn’t in the vector.

    • @lincolnsand5127
      @lincolnsand5127 3 ปีที่แล้ว

      @@philipbohun740 it's because you used reserve instead of resize

  • @zerol3971
    @zerol3971 4 ปีที่แล้ว

    Can I get the download site to the new Microsoft terminal?

    • @hexagonist23
      @hexagonist23 2 ปีที่แล้ว

      Why would you want that?

    • @rtzgf67games7
      @rtzgf67games7 ปีที่แล้ว

      @aperturechromakey72 There's a high chance the person asking for "the new windows terminal" thinks that the terminal they see in the video is in fact windows terminal.

  • @dariusfitzpatrick5129
    @dariusfitzpatrick5129 3 ปีที่แล้ว

    what kind of script is that

  • @VS-lq4rj
    @VS-lq4rj 2 ปีที่แล้ว +1

    Can I set the GPU cpu and ram of my choice

    • @rtzgf67games7
      @rtzgf67games7 ปีที่แล้ว +2

      If you implement it lmao

  • @r50142
    @r50142 4 ปีที่แล้ว

    Im using this for opencomputers.

  • @jeanrodrigues6249
    @jeanrodrigues6249 7 หลายเดือนก่อน

    o garoto e bom

  • @marete100
    @marete100 6 ปีที่แล้ว

    aren`t typedefs C style C++?

    • @philipbohun740
      @philipbohun740  6 ปีที่แล้ว +1

      Typedefs are a part of the C language. Modern C++ has both more ways and fancier ways to do typedef-like things.

    • @lincolnsand5127
      @lincolnsand5127 3 ปีที่แล้ว

      Yeah. C++ now uses `using` instead. It fixes some edge cases with certain types (mostly templates)

  • @ziad_vfx
    @ziad_vfx 2 ปีที่แล้ว

    Is it c++ or c?
    Plz answer

    • @TheOriginalDuckley
      @TheOriginalDuckley หลายเดือนก่อน

      Read the description.
      Also C doesn’t have classes. C++ does.

  • @lincolnsand5127
    @lincolnsand5127 3 ปีที่แล้ว

    Fyi, you misused vector and invoked UB. You want to use `resize` or the constructor, not `reserve`

    • @SR-er6hx
      @SR-er6hx 3 ปีที่แล้ว

      No. Reserve is best here since it allocate memory ahead.

    • @lincolnsand5127
      @lincolnsand5127 3 ปีที่แล้ว

      @@SR-er6hx You can't index after doing reserve. Reserve is not guaranteed and often doesn't allocate extra memory. They meant to type resize.

  • @GarrettKingdom
    @GarrettKingdom 6 ปีที่แล้ว +4

    *that moment when he starts typing and you realize this is c++ and not c#*

    • @GarrettKingdom
      @GarrettKingdom 6 ปีที่แล้ว +2

      Also, I wrote that comment from inside a VM :3

    • @pendergastj
      @pendergastj 6 ปีที่แล้ว +3

      who gives a fuck

    • @KaiDuquet
      @KaiDuquet 6 ปีที่แล้ว +7

      Well I'm glad he is not using C# for a VM, for many reasons. For one, just... no

    • @haykg
      @haykg 5 ปีที่แล้ว

      Jamie Pendergast lmao

    • @volcanobeard8668
      @volcanobeard8668 2 ปีที่แล้ว

      But c sharp :(

  • @ProTest-ow1vs
    @ProTest-ow1vs 7 หลายเดือนก่อน

    اصبر يا عسل

  • @jeanrodrigues6249
    @jeanrodrigues6249 7 หลายเดือนก่อน

    apt

  • @aritrajana3211
    @aritrajana3211 6 ปีที่แล้ว

    64 bit

  • @somewhatBoring
    @somewhatBoring 3 ปีที่แล้ว

    python