[vbox-dev] Using Sockets in Device emulation

Arpit Patel arpit_patel at yahoo.com
Tue Sep 20 16:23:02 GMT 2011


Thanks for your reply. I need to talk to some socket level application/server(which can possibly be running on another system) that is simulating SATA behavior and I need to generate those SATA commands via socket comm from within AHCI emulation code.  Since this is done for some new AHCI hardware development as well as some new storage hw protocol emulation, I am using the AHCI emulation to test my drivers and on the back end would like to generate SATA commands via socket comm to the simulation app. running on other end. That's why I want to initiate this socket comm from  AHCI emulation code. Is there any other better approach to this problem you can suggest in virtualbox?
Thanks.
Arpit.

From: Klaus Espenlaub <klaus.espenlaub at oracle.com>
To: vbox-dev at virtualbox.org
Sent: Monday, September 19, 2011 10:34 AM
Subject: Re: [vbox-dev] Using Sockets in Device emulation

On 16.09.2011 22:20, Arpit Patel wrote:
> Hi,
> I wanted to use tcp sockets from Device Emulation (eg. DevAHCI.cpp) and
> connect to a socket server running on one of the Guest OS or to another
> system on the network. I have following questions -

DevAHCI is a rather complex device... which means it's not the ideal starting point.

What do you actually want to achieve? Accessing remote storage? It would help a lot of you'd say a few words about your general idea before setting out to implement it.

> 1. Would this kind of socket comm possible from Device Emulation code?
> 2. As device emulation code runs in Ring0 mode, if I try to even include
> iprt/sockets.h file, it complains that RTSocket APIs are not available
> in Ring-0 context. If that is so, what sockets can I use from within
> Device Emulation code?
> 3. How do I know which code of Virtualbox is running in Ring0 and which
> is running in Ring3? I was under the impression that the vbox host
> drivers that are built and installed on the host OS is the only code
> that runs in Ring0 and everything else should be Ring3.
> 4. Is there any sample code of this socket comm that can be used from
> device emulation in virtualbox, that you can point me to?.

In general you need to make sure that the socket code is ONLY used by Ring3 code, then it would compile. However this all may be unnecessary if you actually want a new storage "format".

Klaus


> Thanks.
> Arpit.
> 
> 
> 
> 
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> http://vbox.innotek.de/mailman/listinfo/vbox-dev


-- Oracle <http://www.oracle.com>
Dr. Klaus Espenlaub | Snr. Manager Software Development Desktop
Virtualization
Phone: +49 7151 60405 205 <tel:+49715160405205>
Oracle VM VirtualBox

ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | 71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Jürgen Kunz, Marcel van de Molen, Alexander van der Ven

Green Oracle <http://www.oracle.com/commitment>     Oracle is committed to
developing practices and products that help protect the environment


_______________________________________________
vbox-dev mailing list
vbox-dev at virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20110920/1be78b23/attachment.html>


More information about the vbox-dev mailing list