Part 1
요약·해설
qemu_x86·Cortex-M3·MPS2·Cortex-A53의 driver mapping과 net-tools 기반 TAP 절차입니다.
Linux · tuntap
e1000 · stellaris · smsc911x
QEMU echo server
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
75DE3C63E5EFC125EC7FA24F42CDBFC0A76DD21C34A0ACD3488DECF38FCE0308
.. _networking_with_eth_qemu:
Networking with QEMU Ethernet
#############################
.. contents::
:local:
:depth: 2
This page describes how to set up a virtual network between a (Linux) host
and a Zephyr application running in QEMU.
In this example, the :zephyr:code-sample:`sockets-echo-server` sample application from
the Zephyr source distribution is run in QEMU. The Zephyr instance is
connected to a Linux host using a tuntap device which is modeled in Linux as
an Ethernet network interface.
Prerequisites
*************
On the Linux Host, fetch the Zephyr ``net-tools`` project, which is located
in a separate Git repository:
.. code-block:: console
git clone https://github.com/zephyrproject-rtos/net-tools
Basic Setup
***********
For the steps below, you will need two terminal windows:
* Terminal #1 is terminal window with net-tools being the current
directory (``cd net-tools``)
* Terminal #2 is your usual Zephyr development terminal,
with the Zephyr environment initialized.
When configuring the Zephyr instance, you must select the correct Ethernet
driver for QEMU connectivity:
* For ``qemu_x86``, select ``Intel(R) PRO/1000 Gigabit Ethernet driver``
Ethernet driver. Driver is called ``e1000`` in Zephyr source tree.
* For ``qemu_cortex_m3``, select ``TI Stellaris MCU family ethernet driver``
Ethernet driver. Driver is called ``stellaris`` in Zephyr source tree.
* For ``mps2_an385``, select ``SMSC911x/9220 Ethernet driver`` Ethernet driver.
Driver is called ``smsc911x`` in Zephyr source tree.
* For ``qemu_cortex_a53``, ``Intel(R) PRO/1000 Gigabit Ethernet driver``
Ethernet driver is selected by default.
Step 1 - Create Ethernet interface
==================================
Before starting QEMU with network connectivity, a network interface
should be created in the host system.
In terminal #1, type:
.. code-block:: console
./net-setup.sh
You can tweak the behavior of the ``net-setup.sh`` script. See various options
by running ``net-setup.sh`` like this:
.. code-block:: console
./net-setup.sh --help
Step 2 - Start app in QEMU board
================================
Build and start the :zephyr:code-sample:`sockets-echo-server` sample application.
In this example, the qemu_x86 board is used.
In terminal #2, type:
.. zephyr-app-commands::
:zephyr-app: samples/net/sockets/echo_server
:host-os: unix
:board: qemu_x86
:gen-args: -DEXTRA_CONF_FILE=overlay-e1000.conf
:goals: run
:compact:
Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`.
Part 3
한국어 전문 번역
QEMU Ethernet Networking
이 문서는 Linux host와 QEMU에서 실행하는 Zephyr application 사이에 virtual network를 설정하는 방법을 설명합니다.
Zephyr source distribution의 sockets echo server sample을 QEMU에서 실행하며, Linux에서 Ethernet network interface로 모델링되는 tuntap device로 Zephyr instance와 host를 연결합니다.
사전 준비
Linux host에서 별도 Git repository의 Zephyr net-tools project를 내려받습니다.
git clone https://github.com/zephyrproject-rtos/net-tools기본 설정
Terminal window 두 개가 필요합니다.
Terminal #1: net-tools를 현재 directory로 둡니다(cd net-tools).Terminal #2: Zephyr environment를 초기화한 development terminal입니다.
Zephyr instance를 구성할 때 QEMU connectivity에 맞는 Ethernet driver를 선택해야 합니다.
qemu_x86: Intel PRO/1000 Gigabit Ethernet, Zephyr driver 이름e1000qemu_cortex_m3: TI Stellaris MCU family Ethernet, driver 이름stellarismps2_an385: SMSC911x/9220 Ethernet, driver 이름smsc911xqemu_cortex_a53: Intel PRO/1000 Gigabit Ethernet driver가 기본 선택됨
1단계: Ethernet interface 생성
Network connectivity를 사용하는 QEMU를 시작하기 전에 host system에 network interface를 만듭니다.
Terminal #1에서 다음 명령을 실행합니다.
./net-setup.shScript option은 다음 명령으로 확인하고 조정할 수 있습니다.
./net-setup.sh --help2단계: QEMU board에서 application 시작
예제는 qemu_x86에서 sockets echo server sample을 build하고 실행합니다. Terminal #2에서 west build -b qemu_x86 samples/net/sockets/echo_server -- -DEXTRA_CONF_FILE=overlay-e1000.conf로 build한 뒤 run target을 실행합니다.
CTRL+A를 누른 뒤 x를 눌러 QEMU를 종료합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.