Support several edu devices in QEMU - linux-kernel

I am studying kernel writing by using the edu device in the QEMU. I saw how to add a new device and saw the kernel how to add new device in qemu. Now I want to add several device instances by running -device edu several time when running qemu (qemu-system-x86_64 ... -device edu -device edu -device edu ...). Now, when running the kernel above, I get the command line in endless loop. I wondering , how should the kernel be writing in order to support several instances ?

Related

Can I use my GPU from a docker container on a MacBook Pro ? (AMD Radeon GPU)

I would like to run a GPU enabled app (Gazebo) inside a docker container on my MacBook Pro.
I seemed to me, through my research, that about a year ago, Docker released a native Docker app for MacOS.
Before that, Docker used to spawn an entire Linux VM and run the container on top of it.
Now, it apparently uses some native hypervisor framework, making it more optimized and closer to the hardware, changing entirely Docker's approach to containerization on a Mac.
All this is not very clear to me and I am not sure of everything I stated.
Is it now possible to use my macbook pro's GPU from a docker container, and, if yes, how ?
The command line I'm using right now, which works for regular X11 apps but not GPU-enabled apps like Gazebo is:
xhost +
docker run -it -e DISPLAY=$ip:0 -v /tmp/.X11-unix:/tmp/.X11-unix image_name bash
There's still a virtual machine involved.
Docker for Mac uses a virtualization layer called XHyve. It's a lot thinner and more lightweight than VirtualBox or such (emulates fewer peripherals), but it's still virtualization.
PCI passthrough is (theoretically) possible, but you can't pass through your laptop's main GPU and still use it.
Hardware with an IOMMU (and yes, your MacBook Pro has an Intel chipset with such support) can allow a virtualized environment direct access to PCI hardware.
However, you can't cede control of a piece of hardware to a VM and still use that hardware from the host. (Some high-end server network cards work around this by having multiple PCI endpoints, so the host and each guest gets a different endpoint to talk to).
So -- you could get an external Thunderbolt-attached GPU, and it might work... in the future.
The underlying support in Xhyve isn't there yet (as of this mid-2017 writing), and even on KVM (used by a lot of folks doing pioneering work here), there are only limited reports of success (with a specific video card -- the Radeon HD 5850).

Load Options ROM using Windows driver?

Why on earth? What? Well, I have some SCSI hardware that won't run with Windows 10 and a UEFI boot. My PC also doesn't seem to load the Options ROM if I run in insecure UEFI mode. So I wondered if technically I could write a Windows 10 driver that could do what the BIOS doesn't.
Clearly, I can't 'load before OS' to allow a 'boot from SCSI' but I might at least be able to make SCSI disks and hardware active after Windows boots.
So before I head off on a wild goose chase, is this technically possible? Can I, for example, run code to hook interrupts from a Windows driver running in the kernel?

Qemu Booting on a Windows image disk keeps crashing on startup

I have dumped a SSD to a raw image file with dd. It is mountable and seems to be working fine. The OS installed is a Windows 7 32bits.
I tried to start a vm on qemu with this image disk as "hda" :
qemu-system-i386 -enable-kvm -hda my_image.001 -m 1024 -vga std &
I tried it with qemu-system-x86_64 too.
When the vm starts, the windows logo appears and a BSOD occurs. I do not have time to read the error message.
When it restarts it says that due to a recent hardware change windows has failed and starts on a windows repair tool.
The windows repair tool fails to fix the problem
Since Windows seems to start booting before crashing, I am guessing this is due to some driver being missing from the disk for windows to load. Is there a way to get the actual error or missing driver?
Thanks for your help.
EDIT :
According to the following link, I need to retrieve the drivers for the qemu emulated hardware and put it on the disk I want to use. I will try copying the drivers from a working VM to the one I want to fix.
http://www.dowdandassociates.com/blog/content/howto-repair-windows-7-install-after-replacing-motherboard/
It was due to drivers being loaded automatically at startup. Disabling the corresponding registry keys of the OS forces Windows to reload new drivers on next boot.
It worked properly.
in "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services"
Set the "Start" value to 0 for Amdide iaStorV and pciide.

Can you make a program run from usb without logging in to windows?

Like the question says: can you put some files on a usb, that run when you plug it in to your computer? maybe make a mini OS that you launch from bios? I have to be able to run an exe program from it, so it would need to basicly be able to run windows, just without logging in, kinda like how you can with ubuntu on a usb with wine configured.
Yes, but BIOS needs to support this:
BIOS must be UEFI
BIOS boot manager should try to load from USB before HDD/SSD.
Such applications are called UEFI (shell) applications and can be created via EDK II.
These apllications run at ring 0 on Intel architecture.

Qemu emulator arm for tegra2

I have Toradex Colibri t20 embedded board Linux image (U boot,kernel,roofs). Colibri t20 is based on tegra2 arm-cortex-a9 processor. I want to run this Linux kernel in Qemu emulator.How can i boot with qemu?
qemu-system-arm can run u-boot and kernel SW, only when it has support for the board that those SW were configured/built for.
ARM's versatilepb and vexpress-a9 are supported. There are good tutorials out there for using those boards, Balau on kernel, also Kumar
Bare metal simulation is less ambitious. There, roughly speaking, QEMU only has to emulate the processor. Check out Balau on bare metal. Quick search shows maybe there is support in progress for Tegra2.
I'd suggest installing current packages on your host, see what machines and cpus are supported. Not sure of the following syntax detail, but something like
qemu-system-arm -M ?
is the way to get the list of supported machines.

Resources