General TC > General TC Talk

Simulate system with less resources??

<< < (2/2)

Rich:
Hi mb0
To simulate 64Meg of RAM,  max_addr=64M
If extlinux is the boot loader you are using, add it to the  APPEND  line in extlinux.conf.

I see curaga got here ahead of me, so his suggestion is,   mem=64M

maro:

--- Quote from: mb0 on March 15, 2012, 08:00:04 AM ---...
Would qemu allow me to get a rough idea of how my software would run on arm/mips systems without changing the (x86) software? Or would i just be able to scale to a slower x86 processor, unless i recompiled?? (ie, not quite sure how qemu works)
...
--- End quote ---
A particular strength of QEMU is that it has two operating modes:

* Full system emulation. In this mode, QEMU emulates a full system (for example a PC), including one or several processors and various peripherals. [...]
* User mode emulation. In this mode, QEMU can launch processes compiled for one CPU on another CPU. [...] (abbreviated quote from the QEMU man page) So yes, you could use your PC (i.e. a x86 system) to see how your piece of software would work on a different CPU (e.g. MIPS); provided you've either cross-compiled it on the host or compiled it from source either inside the VM or on a different "native" system.

Using user mode emulation will probably only make sense if you've got a simple stand-alone executable (e.g. statically linked) and very little other dependencies. I've got to admit that I've used this mode maybe once or twice (essentially "just for fun") in the several years I've been using QEMU now on a virtual daily basis. So I'm not really sure about its limitations.

OTOH the full system emulation can work indeed "as advertised". I'm saying this with a bit of hesitation as non-x86 systems can be a bit more tricky: For example a few days ago I wanted to check out the behaviour of a certain Perl module on a big-endian CPU, and I picked for no particular reason the PowerPC CPU for this exercise. So the idea was to find a PPC Linux distribution that could be operated in a Live system manor, as this is what I've come to appreciate in my work with TC. In the end I had to give several different (small) distributions a try, and I've stumbled over a few bugs (or limitations) in those when run in an QEMU VM. Some of the issues encountered might be a problem in QEMU itself, others I'd say are clearly distribution related (e.g. certain necessary kernel modules that were not included in the initrd). So all up I'd say it can work quite well, but it pays to be able to understand and troubleshoot all the problems one might uncover. IMHO the problems can be due to limited testing done by the smaller group of QEMU developers for the non-x86 systems, and the smaller group of people supporting those non-x86 Linux systems.

OTOH when running QEMU on a PC to emulate a PC we are rather talking of a Virtualizer. In this case you are better off to add the KVM extension (provided your host CPU supports it) to gain near native speed for the emulated system. But as you were rather asking to slow things down this might not be your primary concern right now.

curaga:
If you merely need to see the effect of a slower cpu, you can run it on the host and limit with cpulimit.

Navigation

[0] Message Index

[*] Previous page

Go to full version