This is an automated email from the ASF dual-hosted git repository. acassis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 1b358af82f05eb674fd496f0c53f936fde1809e5 Author: raiden00pl <[email protected]> AuthorDate: Thu Dec 18 11:50:14 2025 +0100 Documentation: add notes about TAP configuration for qemu add notes how to configure QEMU network with TAP. Signed-off-by: raiden00pl <[email protected]> --- Documentation/guides/index.rst | 1 + Documentation/guides/qemu_tips.rst | 44 ++++++++++++++++++++++ .../x86_64/intel64/boards/qemu-intel64/index.rst | 9 ++++- 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/Documentation/guides/index.rst b/Documentation/guides/index.rst index 9b617d8d9fc..677529b6f3e 100644 --- a/Documentation/guides/index.rst +++ b/Documentation/guides/index.rst @@ -60,4 +60,5 @@ Guides remove_device_drivers_nsh.rst rust.rst optee.rst + qemu_tips.rst diff --git a/Documentation/guides/qemu_tips.rst b/Documentation/guides/qemu_tips.rst new file mode 100644 index 00000000000..66ec210d5f6 --- /dev/null +++ b/Documentation/guides/qemu_tips.rst @@ -0,0 +1,44 @@ +========= +QEMU Tips +========= + +Netowrking with TAP device +========================== + +Step 1: Configure NuttX network with ``NETUTILS_NETINIT``:: + + CONFIG_NETUTILS_NETINIT=y + CONFIG_NETINIT_IPADDR=0xc0a80868 # Target: 192.168.8.104 + CONFIG_NETINIT_DRIPADDR=0xc0a80801 # Router: 192.168.8.1 + CONFIG_NETINIT_NETMASK=0xffffff00 # Mask: 255.255.255.0 + +Step 2: Create and configure a TAP device on the host:: + + # Create the bridge + sudo ip link add name br0 type bridge + sudo ip link set br0 up + + # Create the tap interface + sudo ip tuntap add dev tap0 mode tap + sudo ip link set tap0 master br0 + sudo ip link set tap0 up + + # (optional) also attach your real NIC if you want LAN access + # sudo ip link set enp3s0 master br0 + + # Assign IP to the *bridge* + sudo ip addr add 192.168.8.1/24 dev br0 + +Step 3: Launch QEMU using the TAP interface:: + + qemu-system-x86_64 -m 2G -smp 4 -cpu host -enable-kvm \ + -kernel nuttx -nographic -serial mon:stdio \ + -device e1000,netdev=mynet0 \ + -netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no + +Step 4: Clean up:: + + sudo ip link set tap0 down + sudo ip link set br0 down + sudo ip tuntap del dev tap0 mode tap + sudo ip link del br0 diff --git a/Documentation/platforms/x86_64/intel64/boards/qemu-intel64/index.rst b/Documentation/platforms/x86_64/intel64/boards/qemu-intel64/index.rst index c2e90041599..013d96179b3 100644 --- a/Documentation/platforms/x86_64/intel64/boards/qemu-intel64/index.rst +++ b/Documentation/platforms/x86_64/intel64/boards/qemu-intel64/index.rst @@ -5,8 +5,6 @@ qemu-intel64 This page file describes the contents of the build configurations available for the NuttX QEMU x86_64 port. - - QEMU/KVM ======== @@ -187,6 +185,13 @@ Command to run the image with some xHCI devices attached:: -kernel nuttx -serial mon:stdio -chardev pty,id=ch1 \ -device qemu-xhci -device usb-mouse -device usb-kbd +Command to run the image with e1000 NIC device with TAP:: + + qemu-system-x86_64 -m 2G -smp 4 -cpu host -enable-kvm \ + -kernel nuttx -nographic -serial mon:stdio \ + -device e1000,netdev=mynet0 \ + -netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no + knsh_romfs ----------
