#1 How to Build a Virtual Machine from Scratch

  Рет қаралды 59,178

Philip Bohun

Philip Bohun

8 жыл бұрын

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!!
@jordilagaresroset8396
@jordilagaresroset8396 5 жыл бұрын
after watching this, the least i can do is subscribing ;P *EDIT*: Wow thank for the heart!
@andycouto7688
@andycouto7688 7 жыл бұрын
This is one of the best videos on how to build a VM I have found thank you for posting this!
@philipbohun740
@philipbohun740 7 жыл бұрын
Thank you!
@AveChristusRex
@AveChristusRex 8 жыл бұрын
Nice vid! Woking on something similar at the moment.
@256k_
@256k_ Жыл бұрын
i have been looking for a video like this! thank you!
@suckinDiesel44
@suckinDiesel44 4 жыл бұрын
Great video, no nonsense straight into things. Subscribed!
@SaifUlIslam-db1nu
@SaifUlIslam-db1nu 4 жыл бұрын
Hi! Where and how did you read about this material? Where did you get this knowledge from? Thanks!
@memoriasIT
@memoriasIT 6 жыл бұрын
Good job man! Interested in this, let's see when I manage to do this :P
@volcanobeard8668
@volcanobeard8668 2 жыл бұрын
3 years later: how it went?
@patricktorgerson5810
@patricktorgerson5810 7 жыл бұрын
This is awesome. and surprisingly simple
@philipbohun740
@philipbohun740 7 жыл бұрын
Thanks!
@willbou2011
@willbou2011 8 жыл бұрын
That was just awesome!
@philipbohun740
@philipbohun740 7 жыл бұрын
Thank you!
@betaalpha3062
@betaalpha3062 5 жыл бұрын
Amazing! I like this !!!
@notsoverflow
@notsoverflow 6 жыл бұрын
thank you, really awesome tutorial :D
@philipbohun740
@philipbohun740 6 жыл бұрын
Thanks!
@dragonfly3139
@dragonfly3139 7 жыл бұрын
awesome thank you for putting this up
@philipbohun740
@philipbohun740 7 жыл бұрын
You're welcome!
@miquel6572
@miquel6572 3 жыл бұрын
Does anybody know some book or article where i can learn more abou the theoretical background to this?
@easynavigation847
@easynavigation847 Жыл бұрын
Please which type of hypervisor would we say this machine use.
@dmitryponyatov2158
@dmitryponyatov2158 Жыл бұрын
can you recommend some video or tutorials about writing Python-like object virtual machine?
@pruthvim.g9057
@pruthvim.g9057 5 жыл бұрын
I'm getting segmentation fault(core dumped).....while compiling....solution?
@sirpeanutgaming2749
@sirpeanutgaming2749 6 жыл бұрын
What resources did you use to help gather information on this subject?
@needlessoptions
@needlessoptions 4 жыл бұрын
Parred lmao
@ahmadabushawar5101
@ahmadabushawar5101 4 жыл бұрын
Im getting 0 at the top of the stack and i cant figure out the reason why.
@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.
@NIKHIL-yl1ws
@NIKHIL-yl1ws 2 жыл бұрын
Which OS are you using in this video??
@rtzgf67games7
@rtzgf67games7 Жыл бұрын
Ubuntu Linux
@AlphaEtOmega43
@AlphaEtOmega43 7 жыл бұрын
Why you didn't use a std::stack rather than a std::vector for your stack ^^ ?
@philipbohun740
@philipbohun740 7 жыл бұрын
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.
@r50142
@r50142 4 жыл бұрын
Im using this for opencomputers.
@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
@jeanrodrigues6249
@jeanrodrigues6249 7 ай бұрын
o garoto e bom
@dariusfitzpatrick5129
@dariusfitzpatrick5129 3 жыл бұрын
what kind of script is that
@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.
@VS-lq4rj
@VS-lq4rj 2 жыл бұрын
Can I set the GPU cpu and ram of my choice
@rtzgf67games7
@rtzgf67games7 Жыл бұрын
If you implement it lmao
@marete100
@marete100 6 жыл бұрын
aren`t typedefs C style C++?
@philipbohun740
@philipbohun740 6 жыл бұрын
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)
@GarrettKingdom
@GarrettKingdom 6 жыл бұрын
*that moment when he starts typing and you realize this is c++ and not c#*
@GarrettKingdom
@GarrettKingdom 6 жыл бұрын
Also, I wrote that comment from inside a VM :3
@pendergastj
@pendergastj 6 жыл бұрын
who gives a fuck
@KaiDuquet
@KaiDuquet 6 жыл бұрын
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 :(
@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.
@ProTest-ow1vs
@ProTest-ow1vs 7 ай бұрын
اصبر يا عسل
@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.
@jeanrodrigues6249
@jeanrodrigues6249 7 ай бұрын
apt
@aritrajana3211
@aritrajana3211 6 жыл бұрын
64 bit
@somewhatBoring
@somewhatBoring 3 жыл бұрын
python
#5 Build Your Own Virtual Machine - Finish Assembler
6:14
Philip Bohun
Рет қаралды 4,7 М.
are stack based vms really slower?
10:48
leddoo
Рет қаралды 17 М.
Cat story: from hate to love! 😻 #cat #cute #kitten
00:40
Stocat
Рет қаралды 15 МЛН
1❤️
00:20
すしらーめん《りく》
Рет қаралды 33 МЛН
Тяжелые будни жены
00:46
К-Media
Рет қаралды 5 МЛН
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 753 М.
Comparing C to machine language
10:02
Ben Eater
Рет қаралды 5 МЛН
x86 Assembly Crash Course
10:45
HackUCF
Рет қаралды 819 М.
Hacker Teaches How to Manage Passwords
4:51
Valuetainment Short Clips
Рет қаралды 120 М.
how Google writes gorgeous C++
7:40
Low Level Learning
Рет қаралды 764 М.
So I Made My Own Programming Language...
11:36
Chadderbox
Рет қаралды 79 М.
Building a Virtual Machine for Programming Language [1/29]: VM pipeline
19:23
Huawei который почти как iPhone
0:53
Romancev768
Рет қаралды 609 М.
Не обзор DJI Osmo Pocket 3 Creator Combo
1:00
superfirsthero
Рет қаралды 1,3 МЛН
Apple watch hidden camera
0:34
_vector_
Рет қаралды 53 МЛН
Обзор игрового компьютера Макса 2в1
23:34
Carregando telefone com carregador cortado
1:01
Andcarli
Рет қаралды 2,1 МЛН