hi in order to implement our first qmu emulated PCI device we need to know how to build qmu from source and that's what I'm going to show you in today's video so let's start first let me navigate to the web page or the GitHub repository of qmu because here we need to copy the link to get the source but when I scroll down a little bit I can also find the build instructions and for additional information we can visit U's Wiki web page and in here we see the um yeah the required packets or yeah
the software we need to install to build qmu so we need get we need to install some libraries here and we need the ninja build system so I've already installed these dependencies on my system so I can skip this for now and let's head back to the terminal and let's clone the Repository okay this will take a few seconds so while this is cloning maybe a small hint here so these are the required package but if you want to have a full build with all the features which are available you need to install a little
bit more and here we can find the packages you need to install yeah so that's basically it hopefully our clone is done yet no not yet so let me pause the video for a second so you don't have to wait for the Clone to finish okay cloning is done so now let's navigate into the folder and let's create a build folder and CD into it and now the next thing we have to do we have to run configure and first let's run configure with the help flag so we can see the help so one very
important thing is we have to specify a Target list so for which targets we want to build qmu so in our case I will use Arm Linux users so with this target we can emulate users bace programs with qmu here are other architectures available AR 64 um somewhere we should have risk uh risk five for 32 bit and 64bit and these are all the user simulations but if we want to emulate the whole a whole system we need this soft mmu target so here we have arm soft mmu for arm 7 architecture or R 64
soft mmu for 64bit or arm 8 architecture so I will go with the following Targets target list um is arm oh arm soft mmu and I think I have to use a equal sign here and then also arm Linux user so what else do we have here here we have some features if we want to enable a feature we have to write minus minus enable minus and then the feature name for example if you want to have USB pass through so we can pass through a USB device we need to enable um lip USB for
example or another um cool yeah good Target if you want to have Network support is slurp so with slurp you can add a network back end to qmu and you can use this for example if you want to forward your SSH port or any other Port through your qmu emulated systems but I don't need this for now so I will just use the target list arm soft mmu and arm Linux user so now it will configure everything it will check for the dependencies and then we should be able to build it okay now this is
done so if I type l s you can see here a lot of photos have been created and the most important thing here is this make file over this make file we can build um yeah U so let's do this and as I have 12 threets available here on my CPU I will run make minus J12 so now yeah the building process has started and you can see it has to build about 3,000 targets so I will pause the video for now and I will be back when the build process has finished okay so the
build process has finished and now if I take a look um what has been built here I can see I have have a qmu arm here for emulating user space programs and I also have a qmu system arm here or which I can emulate a virtual Linux system so let me show you how to do this first let's run qmu arm and all I have to do here I have to pass in the compiled program which is compiled for architecture and I will use here my Psy box so if I just on this hey I
can see busy box has been started so yeah or what I could also do busy box Echo hello world and in this case it will print out hello world or another interesting thing would be un name minus a to get the caral and here we can see yeah this is really arm V7 architecture here cool so emulating a user space program seems to work now let's try to emulate a compile Linux system for arm so my machine will be worked or with M help once again I can see all the supported machines here and these
are all the machines supported by my build I will use the word Target here give it 256 megabyte of memory my kernel binary can be found in Linux Arch arm boot set image and my init Rd root FS CPC Kernel's options are root is SL def SL M and I want to use no Graphics here so let's start this and now you can see my kernel is starting now the inner process has run and now busy box is up and running if I type un name minus r you can see it's basically working cool so
that's how to build qmu and in my next video if you take a look into Hardware MK you can see various drivers and you can see a PCI test device here so this is uh example implementation of a PCI test device and in the next video I will show you how you can write your own custom PCI device which will be emulated through qmu so I guess that's for today I hope you've enjoyed the video and learned something in case you want support my work you can buy my coffee on buy my coffee.com for Linux
so that's it for today thanks for watching and goodbye