Received: from eggs.gnu.org ([140.186.70.92]:37337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9pEe-0007ey-6D for qemu-devel@nongnu.org; Tue, 12 Apr 2011 21:51:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9kmZ-0004RD-9C for qemu-devel@nongnu.org; Tue, 12 Apr 2011 17:05:56 -0400 Received: from higgs.elka.pw.edu.pl ([194.29.160.5]:45663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9kmZ-0004Hm-3e for qemu-devel@nongnu.org; Tue, 12 Apr 2011 17:05:55 -0400 Received: from [194.29.160.202] ([194.29.160.202]:45906 "EHLO localhost") by higgs.elka.pw.edu.pl with ESMTP id S25875Ab1DLVE5 (ORCPT ); Tue, 12 Apr 2011 23:04:57 +0200 Received: from elektron.elka.pw.edu.pl ([194.29.160.2]) by localhost (hadron2.elka.pw.edu.pl [192.168.27.246]) (amavisd-new, port 2510) with ESMTP id A4k5NHRYpDzc for ; Tue, 12 Apr 2011 23:04:55 +0200 (CEST) Received: from 159-moc-4.acn.waw.pl ([212.76.43.159]:38325 "EHLO [172.19.1.1]" ident: "TIMEDOUT" smtp-auth: "wzabolot" TLS-CIPHER: "AES256-SHA keybits 256/256 version TLSv1/SSLv3" TLS-PEER-CN1: rhost-flags-OK-OK-OK-FAIL) by elektron.elka.pw.edu.pl with ESMTPSA id S4620380Ab1DLVEr (ORCPT ); Tue, 12 Apr 2011 23:04:47 +0200 Message-ID: <4DA4BE68.7040900@ise.pw.edu.pl> Date: Tue, 12 Apr 2011 23:04:40 +0200 From: wzab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Model of simple Bus Mastering ADC for QEMU Reply-To: wzab@ise.pw.edu.pl List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi All, I'm interested in using of QEMU as a simple environment providing virtual hardware for my students, learning how to write device drivers for different devices. Unfortunately the QEMU's API seems to be not very strictly documented :-(. I've tried to implement a simple Analog to Digital Converter model, connected directly to the PC system bus (at 0x41000000 physical address) and using the IRQ 5 line via standard ISA PIC. The ADC is able to take control over the system bus and write the data into the system RAM, after the physical address of allocated RAM is written by the driver to proper registers (one register per page). I'd appreciate any remarks regarding my implementation. The model is working, but I don't know if I have correctly used functionalities of QEMU. Next step should be to extend the model with the PCI interface... BTW. Is it possible to write similar models for devices connected via SPI interface to the embedded system? If you are interested, you can find my sources (model, Linux driver anmd sample program using it) in the alt.sources usenet group, as a message with subject: "Model of Bus Mastering ADC implemented in QEMU" or message or simply in the Google archive: http://groups.google.com/group/alt.sources/msg/4592a94e584b85a6 -- Best Regards, Wojtek Zabolotny