samples/posix/uname/README.html · samples/posix/uname/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · POSIX

POSIX uname()

utsname 구조체와 uname shell option으로 OS·node·release·version·machine 정보를 확인합니다.

Official pathsamples/posix/uname/README.html
Source filesamples/posix/uname/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Zephyr QEMU와 POSIX host build 방법, uname -a와 uname -smi 출력을 보존합니다.

Function

uname()

Structure

utsname

Shell

uname -a · -smi

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 E004D442CBAA2738B40A333C0217C4C3D76E8D5FB36F288A17D787E4DAC8A821
.. _posix-uname-sample:

POSIX uname()
#############

Overview
********

In this sample application, the POSIX `uname()`_ function is used to acquire system information and
it is output to the console. Additionally, uname is added as a shell command and system information
is displayed according to the option(s) provided for the command.

Building and Running
********************

This project outputs to the console. It can be built and executed on QEMU as follows:

.. zephyr-app-commands::
   :zephyr-app: samples/posix/uname
   :host-os: unix
   :board: qemu_x86
   :goals: run
   :compact:

For comparison, to build directly for your host OS if it is POSIX compliant (for ex. Linux):

.. code-block:: console

   cd samples/posix/uname
   make -f Makefile.host

The make output file will be located in samples/posix/uname/build.

Sample Output
=============

.. code-block:: console

    Printing everything in utsname...
    sysname[7]: Zephyr
    nodename[7]: zephyr
    release[13]: 3.5.99
    version[61]: zephyr-v3.5.0-3515-g10156f5f1d9c Jan  9 2024 22:23:04
    machine[4]: x86


    uart:~$ uname -a
    Zephyr zephyr 3.5.99 zephyr-v3.5.0-3515-g10156f5f1d9c Jan  9 2024 22:23:04 x86 qemu_x86
    uart:~$ uname -smi
    Zephyr x86 qemu_x86

.. _uname(): https://pubs.opengroup.org/onlinepubs/9699919799/functions/uname.html

Part 3

한국어 전문 번역

개요

이 sample application은 POSIX uname() 함수로 system information을 얻어 console에 출력합니다. 또한 uname을 shell command로 추가하고, command에 전달한 option에 따라 system information을 표시합니다.

빌드 및 실행

이 project는 console에 결과를 출력합니다. QEMU에서 다음과 같이 build하고 실행할 수 있습니다.

west build -b qemu_x86 samples/posix/uname
west build -t run

비교를 위해 host OS가 Linux 같은 POSIX 호환 system이면 host에서 직접 build할 수도 있습니다.

cd samples/posix/uname
make -f Makefile.host

Make가 만든 output file은 samples/posix/uname/build에 저장됩니다.

출력 예

Printing everything in utsname...
sysname[7]: Zephyr
nodename[7]: zephyr
release[13]: 3.5.99
version[61]: zephyr-v3.5.0-3515-g10156f5f1d9c Jan  9 2024 22:23:04
machine[4]: x86


uart:~$ uname -a
Zephyr zephyr 3.5.99 zephyr-v3.5.0-3515-g10156f5f1d9c Jan  9 2024 22:23:04 x86 qemu_x86
uart:~$ uname -smi
Zephyr x86 qemu_x86

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.