From 9391f52d14fa80cc1d908dcd21c03b51e9936059 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sun, 17 Mar 2019 10:33:59 +0100 Subject: README.md: Add Qemu and networking section --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 51e844d8..ba93158d 100644 --- a/README.md +++ b/README.md @@ -214,3 +214,58 @@ To enable kernel internal consistency checking use: ``` --freebsd-options=invariants,invariant_support ``` + +Qemu and Networking +------------------- + +You can use the Qemu simulator to run a LibBSD based application and connect it +to a virtual network on your host. You have to create a TAP virtual Ethernet +interface for this: + +``` +sudo tunctl -p -t qtap -u $(whoami) +sudo ip link set dev qtap up +sudo ip addr add 169.254.1.1/16 dev qtap +``` + +You can show the interface state with the following command: + +``` +$ ip addr show qtap +27: qtap: mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000 + link/ether 8e:50:a2:fb:e1:3b brd ff:ff:ff:ff:ff:ff + inet 169.254.1.1/16 scope global qtap + valid_lft forever preferred_lft forever +``` + +You may have to assign the interface to a firewall zone. + +The Qemu command line varies by board support package, here is an example for +the arm/xilinx_zynq_a9_qemu BSP: + +``` +qemu-system-arm -serial null -serial mon:stdio -nographic \ + -M xilinx-zynq-a9 -m 256M \ + -net tap,ifname=qtap,script=no,downscript=no \ + -net nic,model=cadence_gem,macaddr=0e:b0:ba:5e:ba:12 \ + -kernel build/arm-rtems5-xilinx_zynq_a9_qemu-default/media01.exe +``` + +After some seconds it will acquire a IPv4 link-local address, e.g. + +``` +info: cgem0: probing for an IPv4LL address +debug: cgem0: checking for 169.254.159.156 +``` + +You can connect to the target via telnet for example: + +``` +$ telnet 169.254.159.156 +Trying 169.254.159.156... +Connected to 169.254.159.156. +Escape character is '^]'. + +RTEMS Shell on /dev/pty4. Use 'help' to list commands. +TLNT [/] # +``` -- cgit v1.2.3