Changes between Version 9 and Version 10 of Developer/VirtualMachines/VirtualBox


Ignore:
Timestamp:
Jun 10, 2010, 5:16:29 PM (10 years ago)
Author:
Cdcs
Comment:

/* Serial Port Access */

Legend:

Unmodified
Added
Removed
Modified
  • Developer/VirtualMachines/VirtualBox

    v9 v10  
    182182
    183183We can use the VirtualBox serial port for remote console or for debugging purposes. If your application is compiled with the RTEMS gdbstub you can remotely debug it from the gdb on your host computer.
    184 To achieve this we will need to activate the serial port in VirtualBox, Go to your virtual machine settings and choose “Serial Ports”. Enable the serial port as “COM1” with the Mode “Host Pipe”. Select create Pipe and select the place where to create the pipe (eg:/tmp/vboxsp)
     184
     185To achieve this we will need to activate the serial port in VirtualBox.'''Go to your virtual machine settings and choose “Serial Ports”. Enable the serial port as “COM1” with the Mode “Host Pipe”. Select create Pipe and select the place where to create the pipe (eg:/tmp/vboxsp)'''
     186
    185187Now we will need to install socat. You can obtain it from [http://www.dest-unreach.org/socat/ here] or install from your disto’s repositories:
     188
    186189{{{
    187190yum install socat
    188191}}}
     192
     193Now lets use socat to create a pseudo terminal. Run the Virtual Machine and open a terminal. Issue the folowing command:
     194
     195{{{
     196socat -d -d /tmp/vboxsp pty
     197}}}
     198
     199You should obtain a output similar to the following one:
     200
     201{{{
     202[root@cdcs testbed]# socat -d -d /tmp/vboxsp pty
     2032010/06/10 15:08:54 socat[3331] N opening connection to AF=1 "/tmp/vboxsp"
     2042010/06/10 15:08:54 socat[3331] N successfully connected from local address AF=1 "\xB@\xAE<\xA9\xB@\xAEA\xA9\xB@\xAEA\xA9\xB@\xAE,\xBA\x06\bB\xA9\xB@\xAE"
     2052010/06/10 15:08:54 socat[3331] N successfully connected via
     2062010/06/10 15:08:54 socat[3331] N PTY is /dev/pts/4
     2072010/06/10 15:08:54 socat[3331] N starting data transfer loop with FDs [3,3] and [4,4]
     208}}}
     209
     210Write down the PTY that outputted by socat; in this case /dev/pts/4.
     211
     212Now if your application has the RTEMS gdb stub you can start i386-rtems4.10-gdb and issue the following commands to start debugging the application remotely:
     213
     214{{{
     215set remotebaud 115200
     216target remote /dev/pts/4
     217}}}
     218
     219You can also use socat to channel the serial port to a network connection(
     220for connecting with telnet or similar):
     221
     222{{{
     223socat UNIX-CONNECT:/tmp/vboxsp TCP-LISTEN:7777
     224telnet localhost 7777
     225}}}