diff options
| author | Sona Sarmadi <sona.sarmadi@enea.com> | 2017-12-11 14:16:53 +0100 |
|---|---|---|
| committer | Sona Sarmadi <sona.sarmadi@enea.com> | 2017-12-11 14:25:57 +0100 |
| commit | 3468ecb92178d75fe27b91d4b9bbc9af577573d8 (patch) | |
| tree | 55360a76a8f5568728fe0617b505c61e638e47de | |
| parent | 313fc404f55b5fefe1169556c430244a6e3e723c (diff) | |
| download | nfv-access-documentation-3468ecb92178d75fe27b91d4b9bbc9af577573d8.tar.gz | |
Updated ch. 8 Using Enea NFV Access SDKs.
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
| -rw-r--r-- | doc/book-enea-nfv-access-guide/doc/using_nfv_access_sdks.xml | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/doc/book-enea-nfv-access-guide/doc/using_nfv_access_sdks.xml b/doc/book-enea-nfv-access-guide/doc/using_nfv_access_sdks.xml index 13ae3b7..9995594 100644 --- a/doc/book-enea-nfv-access-guide/doc/using_nfv_access_sdks.xml +++ b/doc/book-enea-nfv-access-guide/doc/using_nfv_access_sdks.xml | |||
| @@ -116,7 +116,7 @@ int main(void) { | |||
| 116 | <listitem> | 116 | <listitem> |
| 117 | <para>Deploy the helloworld program to your target and run it:</para> | 117 | <para>Deploy the helloworld program to your target and run it:</para> |
| 118 | 118 | ||
| 119 | <programlisting>root@cn8304:~# ./helloworld | 119 | <programlisting># ./helloworld |
| 120 | hello world</programlisting> | 120 | hello world</programlisting> |
| 121 | </listitem> | 121 | </listitem> |
| 122 | </orderedlist> | 122 | </orderedlist> |
| @@ -183,12 +183,9 @@ MODULE_LICENSE("GPL");</programlisting> | |||
| 183 | <para>Deploy the kernel module <literal>hello.ko</literal> to your | 183 | <para>Deploy the kernel module <literal>hello.ko</literal> to your |
| 184 | target and install/remove it:</para> | 184 | target and install/remove it:</para> |
| 185 | 185 | ||
| 186 | <programlisting>root@cn8304:~# insmod hello.ko | 186 | <programlisting># insmod hello.ko |
| 187 | root@cn8304:~# rmmod hello.ko | 187 | # rmmod hello.ko |
| 188 | root@cn8304:~# dmesg | 188 | </programlisting> |
| 189 | [...] Loading hello module... | ||
| 190 | [...] Hello, world | ||
| 191 | [...] Goodbye, world</programlisting> | ||
| 192 | </listitem> | 189 | </listitem> |
| 193 | </orderedlist> | 190 | </orderedlist> |
| 194 | </section> | 191 | </section> |
| @@ -227,7 +224,7 @@ root@cn8304:~# dmesg | |||
| 227 | <para>On the host, run the <literal>qemu-ifup</literal> script | 224 | <para>On the host, run the <literal>qemu-ifup</literal> script |
| 228 | located in <literal>/etc</literal> directory:</para> | 225 | located in <literal>/etc</literal> directory:</para> |
| 229 | 226 | ||
| 230 | <para><programlisting>root@cn8304:~# /etc/qemu-ifup –t tap0 –a 192.168.122.10 –p 1050 –g 22</programlisting></para> | 227 | <para><programlisting># /etc/qemu-ifup –t tap0 –a 192.168.122.10 –p 1050 –g 22</programlisting></para> |
| 231 | 228 | ||
| 232 | <itemizedlist> | 229 | <itemizedlist> |
| 233 | <listitem> | 230 | <listitem> |
| @@ -268,9 +265,9 @@ root@cn8304:~# dmesg | |||
| 268 | device and set the default gateway as the <literal>virbr0</literal> | 265 | device and set the default gateway as the <literal>virbr0</literal> |
| 269 | ip address:</para> | 266 | ip address:</para> |
| 270 | 267 | ||
| 271 | <para><programlisting>root@qemuarm64:~# ip addr add 192.168.122.10/24 dev enp0s2 | 268 | <para><programlisting># ip addr add 192.168.122.10/24 dev enp0s2 |
| 272 | root@qemuarm64:~# ip link set enp0s2 up | 269 | # ip link set enp0s2 up |
| 273 | root@qemuarm64:~# ip route add default via 192.168.122.1 dev enp0s2</programlisting></para> | 270 | # ip route add default via 192.168.122.1 dev enp0s2</programlisting></para> |
| 274 | </listitem> | 271 | </listitem> |
| 275 | 272 | ||
| 276 | <listitem> | 273 | <listitem> |
| @@ -284,9 +281,9 @@ root@qemuarm64:~# ip route add default via 192.168.122.1 dev enp0s2</programlist | |||
| 284 | stopping the virtual machine, you can use the | 281 | stopping the virtual machine, you can use the |
| 285 | <literal>qemu-ifdown</literal> script to clean up the configuration | 282 | <literal>qemu-ifdown</literal> script to clean up the configuration |
| 286 | on host. The following command will remove the tap interface and all | 283 | on host. The following command will remove the tap interface and all |
| 287 | the iptables rules for the specific ip address: <programlisting>root@qemuarm64:~# /etc/qemu-ifdown –t tap0 –a 192.168.122.10</programlisting>If | 284 | the iptables rules for the specific ip address: <programlisting># /etc/qemu-ifdown –t tap0 –a 192.168.122.10</programlisting>If |
| 288 | we need to remove only a particular port forwarding rule from | 285 | we need to remove only a particular port forwarding rule from |
| 289 | iptables, this should be run: <programlisting>root@qemuarm64:~# /etc/qemu-ifdown –t tap0 –a 192.168.122.10 –p 1050 –g 22</programlisting></para> | 286 | iptables, this should be run: <programlisting># /etc/qemu-ifdown –t tap0 –a 192.168.122.10 –p 1050 –g 22</programlisting></para> |
| 290 | </listitem> | 287 | </listitem> |
| 291 | </orderedlist> | 288 | </orderedlist> |
| 292 | </section> | 289 | </section> |
| @@ -325,7 +322,7 @@ root@qemuarm64:~# ip route add default via 192.168.122.1 dev enp0s2</programlist | |||
| 325 | GDBServer and cross-gdb.</para> | 322 | GDBServer and cross-gdb.</para> |
| 326 | 323 | ||
| 327 | <para>On target, launch the GDBServer, specifying how to communicate | 324 | <para>On target, launch the GDBServer, specifying how to communicate |
| 328 | with GDB and the name of your program:<programlisting>root@cn8304:~# gdbserver :<port_no> /tmp/helloworld</programlisting>The | 325 | with GDB and the name of your program:<programlisting># gdbserver :<port_no> /tmp/helloworld</programlisting>The |
| 329 | target will now be listening on the port given as a parameter to the | 326 | target will now be listening on the port given as a parameter to the |
| 330 | gdbserver. On the development machine, from the | 327 | gdbserver. On the development machine, from the |
| 331 | <literal><sdkdir></literal>, start the cross-gdb:<programlisting>$ enea-linux-gdb <path_to_the_program>/helloworld</programlisting>Connect | 328 | <literal><sdkdir></literal>, start the cross-gdb:<programlisting>$ enea-linux-gdb <path_to_the_program>/helloworld</programlisting>Connect |
| @@ -350,7 +347,7 @@ root@qemuarm64:~# ip route add default via 192.168.122.1 dev enp0s2</programlist | |||
| 350 | <orderedlist> | 347 | <orderedlist> |
| 351 | <listitem> | 348 | <listitem> |
| 352 | <para>On the host, run the script <literal>qemu-ifup</literal> | 349 | <para>On the host, run the script <literal>qemu-ifup</literal> |
| 353 | located in <literal>/etc</literal> directory: <programlisting>root@cn8304:~# /etc/qemu-ifup –t tap0 –a 192.168.122.10 –p 1051 –g 1025</programlisting></para> | 350 | located in <literal>/etc</literal> directory: <programlisting># /etc/qemu-ifup –t tap0 –a 192.168.122.10 –p 1051 –g 1025</programlisting></para> |
| 354 | 351 | ||
| 355 | <itemizedlist> | 352 | <itemizedlist> |
| 356 | <listitem> | 353 | <listitem> |
| @@ -387,16 +384,16 @@ root@qemuarm64:~# ip route add default via 192.168.122.1 dev enp0s2</programlist | |||
| 387 | <listitem> | 384 | <listitem> |
| 388 | <para>On the guest, after logging, configure the virtual network | 385 | <para>On the guest, after logging, configure the virtual network |
| 389 | device and set the default gateway to virbr0 ip | 386 | device and set the default gateway to virbr0 ip |
| 390 | address:<programlisting>root@qemuarm64:~# ip addr add 192.168.122.10/24 dev enp0s2 | 387 | address:<programlisting>ip addr add 192.168.122.10/24 dev enp0s2 |
| 391 | root@qemuarm64:~# ip link set enp0s2 up | 388 | ip link set enp0s2 up |
| 392 | root@qemuarm64:~# ip route add default via 192.168.122.1 dev enp0s2</programlisting></para> | 389 | ip route add default via 192.168.122.1 dev enp0s2</programlisting></para> |
| 393 | </listitem> | 390 | </listitem> |
| 394 | 391 | ||
| 395 | <listitem> | 392 | <listitem> |
| 396 | <para>GDBserver is the program which runs on the guest VM and allows | 393 | <para>GDBserver is the program which runs on the guest VM and allows |
| 397 | you to run GDB on your workstation. On the guest, launch GBDserver | 394 | you to run GDB on your workstation. On the guest, launch GBDserver |
| 398 | specifying how to communicate with GDB and the name of your program: | 395 | specifying how to communicate with GDB and the name of your program: |
| 399 | <programlisting>root@qemuarm64:~# gdbserver :1025 /tmp/helloworld</programlisting>The | 396 | <programlisting># gdbserver :1025 /tmp/helloworld</programlisting>The |
| 400 | guest is now listening on port 1025, given as a parameter to the | 397 | guest is now listening on port 1025, given as a parameter to the |
| 401 | gdbserver.</para> | 398 | gdbserver.</para> |
| 402 | </listitem> | 399 | </listitem> |
| @@ -416,7 +413,7 @@ root@qemuarm64:~# ip route add default via 192.168.122.1 dev enp0s2</programlist | |||
| 416 | <para>On the host, after finishing the cross-debugging session and | 413 | <para>On the host, after finishing the cross-debugging session and |
| 417 | stopping the virtual machine, you can use the | 414 | stopping the virtual machine, you can use the |
| 418 | <filename>qemu-ifdown</filename> script to clean up the | 415 | <filename>qemu-ifdown</filename> script to clean up the |
| 419 | configuration on host:<programlisting>root@cn8304:~# /etc/qemu-ifdown -t tap0 -a 192.168.122.10</programlisting></para> | 416 | configuration on host:<programlisting># /etc/qemu-ifdown -t tap0 -a 192.168.122.10</programlisting></para> |
| 420 | </listitem> | 417 | </listitem> |
| 421 | </orderedlist> | 418 | </orderedlist> |
| 422 | </section> | 419 | </section> |
| @@ -435,12 +432,12 @@ root@qemuarm64:~# ip route add default via 192.168.122.1 dev enp0s2</programlist | |||
| 435 | <itemizedlist> | 432 | <itemizedlist> |
| 436 | <listitem> | 433 | <listitem> |
| 437 | <para>On target, once serial communication is established, configure | 434 | <para>On target, once serial communication is established, configure |
| 438 | <literal>kgdboc</literal> after the kernel boots:<programlisting>root@cn8304:~# echo ttyS0,115200 > /sys/module/kgdboc/parameters/kgdboc</programlisting></para> | 435 | <literal>kgdboc</literal> after the kernel boots:<programlisting># echo ttyS0,115200 > /sys/module/kgdboc/parameters/kgdboc</programlisting></para> |
| 439 | </listitem> | 436 | </listitem> |
| 440 | 437 | ||
| 441 | <listitem> | 438 | <listitem> |
| 442 | <para>In order to connect to gdb via kgdboc, the kernel must first | 439 | <para>In order to connect to gdb via kgdboc, the kernel must first |
| 443 | be stopped:<programlisting>root@cn8304:~# echo g > /proc/sysrq-trigger</programlisting></para> | 440 | be stopped:<programlisting># echo g > /proc/sysrq-trigger</programlisting></para> |
| 444 | </listitem> | 441 | </listitem> |
| 445 | 442 | ||
| 446 | <listitem> | 443 | <listitem> |
