Smbus-device emulation in QEMU - qemu

I want to emulate a SMBus/I2C device in QEMU. I see that there are existing modules in QEMU which have SMBus functionality, but I don't know how to create a new one or the command to use the existing one. Can somebody please help here.

Related

How to create a new system or board to be emulated by QEMU

I am new to QEMU, but to support a system modeling project, I try to figure out how to emulate a new ARM microcontroller(M33 based) SOC which is not on the supported system list. I have checked on the QEMU documentation: https://qemu-project.gitlab.io/qemu/about/index.html but was not able to find directions to construct and add a new system model. I would appreciate very much if someone can point me to the right documentation, or suggest steps I can follow to generate the new model for emulation.
I would highly suggest using Renode rather than Qemu as it's better suited for microcontrollers and it's well documented and actively maintained on GitHub.
There is no documentation for how to write new machine models for QEMU. The best advice is to look at the source code for an existing machine type that seems similar to the one you want to add. Avoid looking at machine types that have been added to QEMU a long time ago -- they are often written in an older style or using older APIs which are no longer recommended for new code.
As a very rough rule of thumb, you should assume that a new machine model is about as much effort as porting an operating system to that new hardware. (Roughly, a device model is about as much code as a device driver.) Depending on how much functionality you need, you may be able to leave some or many devices in your SoC unimplemented -- the absolute minimum is usually something like a UART and a timer. You'll need documentation of the SoC (technical reference manual or similar, with detailed descriptions of the devices down to the register level).
(Out of curiosity, what is the M33-based SoC?)

unable to run exe created in Qt 5.3 on different windows machine

I am facing issues to run .exe files created in Qt 5.3 on different windows system. I have included all the .dll files. The issue is that on the latest system with graphics card support the application runs without any issues but on older systems it just gives blanck screen.
I suspect that this has something to do with openGL support for the system.
Is there a way where I can make sure that the application runs without any glitches on all the systems?
Or is it possible to have an application created without oprnGL support needed ?
Hoping to hear some solution for this.
Thanks in advance.
EDIT:
Following is the error I get when I run the code
getProcAddress: Unable to resolve 'glBindFramebuffer'
getProcAddress: Unable to resolve 'glBindFramebufferOES'
getProcAddress: Unable to resolve 'glBindFramebufferARB'
and here is the screenshot of the way the screen looks
NOTE :
Please note that when I run the .exe on a new system with updated graphics, the screens looks perfect.
Did you include any OpenGL headers in your Qt Project?
Because if you did then there is obviously going to be a dependency on OpenGL for each system and if one of them cannot support this then you either need to decrease the minimum version of GL you are using or remove these headers altogether. It is also worth noting that no matter how hard you try - you will never get the same version of OpenGL to run across every piece of hardware without having to change something.
Did you add the QtOpenGL module?
From what is sounds like, you are not using OpenGL in your application. If this is true then you should remove this module from your .pro file and it should remove the dependency.
I hope this answers your question. If not, could you provide a little more detail because your question was slightly vague.

How to create a PPAPI plugin for Google Chrome in Windows?

I am new to PPAPI development and have downloaded the already examples from here
However, even after coming across the documentation,
I am not able to build the project.
I have Microsoft Visual Studio 2010, Windows OS and Chrome:30.0.1599.65
I understand that once a dll is created, using the regsvr32 command will register the plugin, although getting the dll, even with available code, seems tough for me. Any help for building the dll is appreciated.
You will want to start here to download the and set up the SDK: https://developers.google.com/native-client/sdk/download
This page will take you through how to build and run the examples: https://developer.chrome.com/native-client/sdk/examples
This page goes over how to actually create your own plugin: https://developer.chrome.com/native-client/devguide/tutorial/tutorial-part1
And then you should read this entire section to code and structure your application: https://developer.chrome.com/native-client/devguide/coding/application-structure
If you need any third party libraries be sure to check here: https://chromium.googlesource.com/webports
Edit: Forgot to mention that you will want to use the same version of the pepper api as the version of chrome you're running (in this case pepper_30). Also, you have to use the NaCl toolchain (one of either glibc, newlib, or pnacl); you can't use the Visual C/C++ toolchains. I recommend trying pnacl now that it is available, as that is by far the most cross platform version, but if you run into trouble, you'll probably want to use the newlib toolchain as it has better support.

What I need to read/analyze in order to understand how QEMU emulates supported network devices?

I would like to analyze how QEMU emulates the supported network devices reading the source code. Also I would like to share with me your opinions about what background is needed to understand QEMU's source code. Please suggest to me some good books or online sources for the surrounding topics that one has to learn in order to achieve that(I suppose Device Driver, Processor Specification etc are needed?). Also if you could tell me about the programming level that one should have in C (as the source code is written in C) that would be nice.
I have already looked at the QEMU's web site and what offers mostly refers on how to use QEMU and configure it.
For basic introduction to qemu and its networking functionalities:
What's a good source to learn about QEMU?
To get started with source code
original qemu paper
qemu-internals
http://www.ecs.syr.edu/faculty/yin/Teaching/TC2010/Proj4.pdf
https://wiki.aalto.fi/download/attachments/41747647/qemu.pdf

Easiest way to unit test SWT and Swing apps in a headless environment?

I'm looking to unit test some SWT and Swing code for a project I'm working on and the tests run fine as long as I'm running them from eclipse.
As soon as I run them in my hudson environment it fails since hudson runs the tests in headless mode.
What's the best way of doing this? Open source solutions only please (since the project is open source).
You could run Xvfb (X virtual framebuffer, an X11 server that performs all graphical operations in memory) and this works fine.
But there is another solution with Hudson's plugin for Xvnc. Simply install the plugin and check the checkbox in the job configuration screen:
alt text http://www.justinedelson.com/blog/wp-content/uploads/xvnc_box.jpg
Hudson will then automatically start up a Xvnc session and set the DISPLAY environment variable to the appropriate value and then shut down the session when the build is complete. One advantage this has over the Xvfb method is that if you have multiple Swing/SWT projects building simultaneously, each build has its own X session. This may not be an issue at all but it seems like a good idea.
Before using this plugin, you obviously have to have Xvnc installed. What's less obvious (although sensible) is that you must also set a password. You do this by running:
$ vncpassword
This has to be done as the same user Hudson runs as.
Try the Abbot Java GUI Testing Framework and SWTbot. At least SWTbot should be able to do it.
If neither offers a headless mode, then this blog post might give you some ideas how to get rid of the UI for testing.
Using Swing I tend to organise things so that the component tree can be created without a Window at the top. Doing this allows you to simply create a JPanel in a unit test and use that as your top-level component. There are certain things you cannot test, such as focus and any logic involved in the creation of the Frame for normal operation, but the vast majority can be tested.
You may want to look into the FEST library to make life easier whether you go headless or not, it looks very good: http://fest.easytesting.org/swing/wiki/pmwiki.php
I was sure I posted this here before, not sure what happened to it.
Cacio allows for running Swing app headless.
http://rkennke.wordpress.com/2011/10/17/cacio-for-ui-testing/
I don't know about SWT, but with Swing you can't. Any instantiation of a Window (JFrame, JDialog, etc.) even if it is never set to visible will blow up in headless mode (on JDK 5). What we did was not run in headless mode and install Xvfb to provide the windowing without actually having a real windowing system installed.
You could try RedDeer Testing framework
https://github.com/jboss-reddeer/reddeer
• Support for running tests in a Jenkins CI environment (Hudson like)