Advance Innovation Centre
  • AIC Knowledge @ EEC for All
  • 😎Logical Thinking
    • Karel Robot
    • Code to Flowchart
    • Play with Docker
    • CNX Software
  • MCU & Interfacing with Infineon PSOCâ„Ē
    • Basic MCU Interfacing
      • Introduction to CY8CKIT-062S2-43012 Pioneer Kit
      • Development Environment Preparation
      • PSoCâ„Ē 6S2 Peripherals Interfacing (GPIO)
        • Hello World and LED Blinking
        • GPIO Principles
        • PSoCâ„Ē 6S2 GPIO-HAL LED Blink Lab
        • PSoCâ„Ē 6S2 GPIO-PDL LED Blink Lab
        • Button "Bounce" Principles
          • Push/Pull Button to Turn ON/OFF LED via HAL
          • Push/Pull Button to Turn ON/OFF LED via PDL
          • GPIO Button Interrupt via HAL
          • GPIO Button Interrupt via PDL
        • GPIO variables & functions
      • PSoCâ„Ē 6S2 Peripherals Interfacing (ADC, PWM)
        • PSoCâ„Ē 6S2 SAR ADC
          • ADC Principles
          • PSoCâ„Ē 6S2 with ADC Labs
            • Reading potentiometer sensor value via an ADC HAL
            • Reading potentiometer sensor value via an ADC PDL
        • PSoCâ„Ē 6S2 PWM & TCPWM
          • PWM Principles
          • PSoCâ„Ē 6S2 for PMW Function Labs
            • LED Brightness using PWM via HAL
            • LED Brightness using PWM via PDL
    • Sensor Interfacing and HMI
      • OLED Display
        • OLED Display Principles
        • Calling BDH’s OLED functions
        • Display ADC via Potentiometer on OLED
      • BDH Shell
        • Shell Principles
        • LED Blinking and CAPSENSE via BDH Shell
        • Adding "History" command
        • Adding "Reboot" command
        • CAPSENSE Button and Slider
          • CAPSENSE Button and Slider with Capsense Tuner
          • CAPSENSE Button and Slider using FreeRTOS
    • Serial Communication & Visualization
      • UART, I2C, SPI Communication via Infineon PSoCâ„Ē6
      • BMX160 Sensor Communication via Infineon PSoCâ„Ē6
        • Reading ADC via HAL with Potentiometer and Displaying GUI on Serial Studio
        • Reading XENSIV-DPS-3XX Pressure Sensor and Displaying GUI on Serial Studio
        • Motion Sensors GUI Integration via Serial Studio
    • IoT Connectivity & Data Analytics via Node-Red
      • Node-Red Installation
      • Setting MQTTS to MQTT Broker
      • Sending PSoC6’s sensor to MQTT (node-red)
    • Edge AI on PSoCâ„Ē
      • Machine Learning on PSoCâ„Ē6 via Edge-Impulse
    • Infineon PSoCâ„Ē Troubleshooting
  • IoT Development with Infineon PSOCâ„Ē & BDH Platform
    • PSoCâ„Ē IoT Development Kit
      • Introduction to CY8CKIT-062S2-43012 Pioneer Kit
      • Development Environment Preparation
        • Hello World and LED Blinking
    • IoT Connectivity
      • Node-Red Installation
      • Controlling PSoCâ„Ē LED using MQTT
      • Setting MQTTS to MQTT Broker
      • Sending PSoC6’s sensor to MQTT (node-red)
    • BDH IoT Connectivity
    • WireLinXâ„Ē IoT PLC
    • BDH X-Brain Data Analytics
      • PSoC6 Data Collection to CSV log file
    • Data Visualization
      • āļŠāļĢāđ‰āļēāļ‡ Dashboard āļ”āđ‰āļ§āļĒ Looker Studio
  • ðŸ–ĨïļOperation Systems
    • Prerequisites
      • Guideline from Ubuntu
        • Ubuntu and VSCode on WSL2
      • āļ•āļīāļ”āļ•āļąāđ‰āļ‡ WSL 2
      • Run Ubuntu on VirtualBox7
    • Zero to Linux Hero
      • Computer OS Architecture
      • Anatomy of Linux System
        • UNIX/Linux History
        • UNIX/Linux Evolution
        • GNU Project
        • Linux OS Architecture
        • Command Line Interface (CLI)
          • Basic Commands
          • 😎Level up your Linux Shell
          • File & Dir. Commands
          • Searching Commands
          • 😎ChatGPT-based Terminal
          • SysAdmin Commands
          • Network Commands
          • Hacker Commands
        • Busybox
        • Shell Script
          • Awk Script
          • Bash Shell Script
            • Bash Snippets
            • Bash Useful Examples
      • Anatomy of Linux Kernel
        • Linux Kernel Principles
        • Linux Environment for Developer
      • Anatomy of Embedded Linux
        • Embedded Linux
        • Host & Target
        • Cross Toolchains
        • Bootloader
        • Building Embedded Linux
    • Linux OS Dev. Engineer
      • Process Management
        • Process Basic
        • Process State
        • Basic Process Mgmt. Commands
        • Advance Process Mgmt. Commands
        • Process API Programming
      • IPC
        • IPC Anatomy
        • Signal Programming
        • Pipe Programming
        • FIFO Programming
        • Msg. Queue Programming
          • System V
        • Share Memory Programming
          • System V
        • Socket Programming
      • POSIX Threads
        • Multi-tasking Basic
        • POSIX Thread Anatomy
        • Threading Programming
      • Applied IPC
        • Remote Commander
        • Multi-Remote Commanders
      • Process Synchronization
        • Mutex Programming
        • Semaphore Programming
      • Applied IPC with Semaphore
  • ⌚Embedded Systems Development
    • Introduction to ESD
      • Why's ESD?
      • What it use for?
      • How it works?
    • Enbedded System Development via PSoC6
      • Basic MCU Interfacing
        • Introduction to CY8CKIT-062S2-43012 Pioneer Kit
        • Development Environment Preparation
        • PSoCâ„Ē 6S2 Peripherals Interfacing (GPIO)
          • Hello World and LED Blinking
          • GPIO Principles
          • PSoCâ„Ē 6S2 GPIO-HAL LED Blink Lab
          • PSoCâ„Ē 6S2 GPIO-PDL LED Blink Lab
          • Button "Bounce" Principles
            • Push/Pull Button to Turn ON/OFF LED via HAL
            • Push/Pull Button to Turn ON/OFF LED via PDL
            • GPIO Button Interrupt via HAL
            • GPIO Button Interrupt via PDL
          • GPIO variables & functions
        • PSoCâ„Ē 6S2 Peripherals Interfacing (ADC, PWM)
          • PSoCâ„Ē 6S2 SAR ADC
            • ADC Principles
            • PSoCâ„Ē 6S2 with ADC Labs
              • Reading potentiometer sensor value via an ADC HAL
              • Reading potentiometer sensor value via an ADC PDL
          • PSoCâ„Ē 6S2 PWM & TCPWM
            • PWM Principles
            • PSoCâ„Ē 6S2 for PMW Function Labs
              • LED Brightness using PWM via HAL
              • LED Brightness using PWM via PDL
      • Sensor Interfacing and HMI
        • OLED Display
          • OLED Display Principles
          • Calling BDH’s OLED functions
          • Display ADC via Potentiometer on OLED
        • BDH Shell
          • Shell Principles
          • LED Blinking and CAPSENSE via BDH Shell
          • Adding "History" command
          • Adding "Reboot" command
          • CAPSENSE Button and Slider
            • CAPSENSE Button and Slider with Capsense Tuner
            • CAPSENSE Button and Slider using FreeRTOS
      • Serial Communication & Visualization
        • UART, I2C, SPI Communication via Infineon PSoCâ„Ē6
        • BMX160 Sensor Communication via Infineon PSoCâ„Ē6
          • Reading ADC via HAL with Potentiometer and Displaying GUI on Serial Studio
          • Reading XENSIV-DPS-3XX Pressure Sensor and Displaying GUI on Serial Studio
          • Motion Sensors GUI Integration via Serial Studio
    • Edge Computing and IoT Connectivity
    • Cloud-Based Data Analytics and Digital Twin
    • Edge Vision AI
    • Resources
      • Basic Hardware and Firmware
        • Environment Preparation
          • āļāļēāļĢāļ•āļīāļ”āļ•āļąāđ‰āļ‡āđ‚āļ›āļĢāđāļāļĢāļĄ Arduino IDE
            • āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļāļēāļĢāđ€āļĢāļīāđˆāļĄāļ•āđ‰āļ™āđƒāļŠāđ‰āļ‡āļēāļ™ Arduino IDE
          • āļāļēāļĢāļ•āļīāļ”āļ•āļąāđ‰āļ‡āđ‚āļ›āļĢāđāļāļĢāļĄāļŠāļģāļŦāļĢāļąāļšāđƒāļŠāđ‰āļ‡āļēāļ™āđ€āļ„āļĢāļ·āđˆāļ­āļ‡āļĄāļ·āļ­āļ§āļąāļ” NI MyDAQ
            • āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļāļēāļĢāļ•āļąāđ‰āļ‡āļ„āđˆāļēāđƒāļŠāđ‰ Digital Multimeter -NI ELVISmx
            • āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļāļēāļĢāļ•āļąāđ‰āļ‡āļ„āđˆāļēāđƒāļŠāđ‰ Oscilloscope-NI ELVISmx
          • āļ•āļīāļ”āļ•āļąāđ‰āļ‡āđ‚āļ›āļĢāđāļāļĢāļĄ KingstVIS
        • Basic measurement
          • Basic Digital and Analog I/O
            • LAB: Basic Digital Input/Output
            • LAB: Basic Analog Input/Output
          • Waveform
            • LAB: Oscilloscope
            • LAB: Oscilloscope and Function Generator
            • LAB: Pulse Width Modulation (PWM)
              • Homework
        • Interfacing and Communication
          • LAB: UART, RS485, RS232 Protocol
          • LAB: I2C Protocol
            • HOMEWORK
          • LAB: SPI Protocol
      • IoT Connectivity
        • Example: IoT with MQTT on Node-red
        • Data logger
        • LAB: Data Visualization
  • 🛠ïļC/C++ for Embedded Programming
    • Development Environment Preparation
      • āļ•āļīāļ”āļ•āļąāđ‰āļ‡ WSL 2
      • āļ•āļīāļ”āļ•āļąāđ‰āļ‡ Ubuntu environment
      • āļ•āļīāļ”āļ•āļąāđ‰āļ‡āđ‚āļ›āļĢāđāļāļĢāļĄ Visual Studio Code
      • āļāļēāļĢāđ€āļŠāļ·āđˆāļ­āļĄāļ•āđˆāļ­ Virtual studio code āđ€āļ‚āđ‰āļēāļāļąāļš WSL
      • āļ•āļīāļ”āļ•āļąāđ‰āļ‡ docker on WSL
    • Principle C/C++ Programming
      • Get started with C++
      • Makefile
        • Makefile Examples
      • Compiling and running
        • How to create a program that you can enter inputs.
          • Lab 1 Exercise
      • Arguments
        • Command line arguments in C and C++
      • signed and unsigned data types
      • Variable and Operator
      • If and If else
      • Loop, Infinite loop, and flag
        • Loop and Flag exercise
      • Array
        • Get to know with arrays
        • Implement example
      • Vector
    • Object Oriented Programming (OOP) in C++
      • Class and Object
      • Encapsulation and Abstraction
      • Polymorphism and Inheritance
    • C/C++ Preprocessing
      • Macro
        • Quiz Macro
      • File Inclusion
      • Conditional Compilation
      • Pragma directive
        • Quiz Pragma
    • String in C++
      • Concatenation
      • Split
    • Type conversions for C/C++
      • Conversion using Cast operator
    • Error handling
    • Data logger
      • āļāļēāļĢāļŠāļĢāđ‰āļēāļ‡āđ„āļŸāļĨāđŒāđāļĨāļ°āđ€āļ‚āļĩāļĒāļ™āđ„āļŸāļĨāđŒ
      • āļāļēāļĢāļ­āđˆāļēāļ™āđ„āļŸāļĨāđŒ
      • āļāļēāļĢāđ€āļāđ‡āļšāļ‚āđ‰āļ­āļĄāļđāļĨāļāļąāļšTime stamp
    • High performance programing
      • Multi-task and Multi-thread
        • Multi-threading example
      • Mutex
      • Queue
      • OpenCV
    • C/C++ Techniques
      • Makefile in action
      • Object Oriented Programming (OOP) in C++
        • Class and Object
        • Encapsulation and Abstraction
        • Polymorphism and Inheritance
      • C/C++ Preprocessing
        • Macro
          • Quiz Macro
        • File Inclusion
        • Conditional Compilation
        • Pragma directive
          • Quiz Pragma
      • Binary, Octal and Hexadecimal Numbers
      • Array and properties of an array
        • Get to know with arrays
        • Implement example
      • What's next?
  • ðŸĪ–Artificial Intelligence (AI)
    • VAMStack Design House, BUU
    • Data Analytics
      • Data cleansing
      • Data analytics
      • Data analytic exercise
    • Machine Learning
      • Neural Network Layers
      • Machine learning type
      • Dataset
      • Using Edge Impulse for AI Model
    • Basic Image Processing
      • Computer Vision using Python Language
        • Installation
        • Computer Vision Basics
          • Pixel and Color
          • Draw image
          • Basic Image processing
          • Morphology Transformations
          • Gaussian blur
          • Simple Thresholding
          • Contour
          • Canny edge detection
        • Case Study
          • Coin counting
          • Color detection & tracking
        • VAM_CV SDK
  • ⚙ïļFPGA Design and Development
    • Verilog HDL via Vivado IDE
      • LAB1: Setting Environment and Create Project
        • Create Vivado Project
      • LAB2: Hardware Description Language Work Flow
        • Simulation code
      • LAB3: Design HDL Project
        • Top Level Design
        • Top-level Simulation
      • LAB4: Asynchronous VS Synchronous Circuit
        • Simulation Synchronous counter
    • C/C++ Programming on Ultra96v2 FPGA Board
      • Application C/C++ on Ultra96v2 Part 1
        • Design Overview
        • Step 1 - Burn the image to SD card
        • Step 2 - Bring up Ultra96v2
        • Step 3 - Installing the Vitis-AI runtime packages
      • Application C/C++ on Ultra96v2 Part 2
        • STEP 1 : Setting auto boot Wifi
        • STEP 2 : How to working on Embedded
        • STEP 3 : How to run the test code
  • ðŸĪ–Robotics
    • Dobot Magician
      • Instruction of Dobot
      • Software Download
      • Basically of Program
        • Teaching and Playback
        • Write and Draw
        • LaserEngraving
        • 3D Printer
    • Robotino
      • Software Download
        • Robotino View
        • Robotino SIM
      • Charging
      • Connecting
      • Follow Line example
        • Basic block in Follow Line
    • RaspBlock
      • Get Started with Raspblock
  • ðŸšĐSpecial Topics
    • Node-Red
      • Set up Raspberry Pi
      • Install node red in Raspberry Pi
      • Get started with Node Red
        • Open node-red
        • Turn off node red
        • Install Dashboard on Node-red
        • Use node red to show message
        • Using Ultrasonic sensor with node-red
    • IoT Cloud
      • Overview
        • How do they work?
          • Basic Knowlege
      • Installations
        • Install Docker
        • Install Mosquitto Broker
        • Install InfluxDB
        • Install Telegraf
        • Install Grafana
      • Get Sensor Value and Send to MQTT
        • Connect ESP3266 to sensor
        • Connect ESP3266 to MQTT
      • Integration
    • Senses IoT
      • SENSES IoT Platform
      • LAB8: MCU send data to IoT platform
    • CrowPi Dev Kit
      • Raspberry Pi with CrowPi
      • Remote to Raspberry Pi
      • Cross-Compile
        • Lab 1: Programming and cross complier
      • Hardware and Interfaces Usage CLI
        • LAB: Usage GPIO via CLI
        • LAB: Scan I2C bus via CLI
      • Python library for Crow Pi
      • wiringPi library (C) for CrowPi
        • Lab2: Crowpi and sensors
    • LVGL Development
      • LVGL - Light and Versatile Embedded Graphics Library
        • Setting program for LVGL Simulator
        • Get started with LVGL simulator
        • Example Library of LVGL
        • Create your own screen
          • Exercise
        • Style
          • Exercise
        • Event
    • Docker OS
      • Docker OS Part 1
        • Part 1 : Installation
        • Part 2 : Basic Docker OS and Linux CLI
      • Docker OS Part 2
        • Part 1 : Docker communication
        • Part 2 : Docker compose
      • Application Gstreamer on devcontainer
        • STEP 1 : Setting gstreamer environment
        • STEP 2 : Create the Gstreamer element on template
        • STEP 3 : Testing and application on your gst element
  • ðŸĪŸRecommended by AIC
    • Skill Roadmap
      • Embedded Engineer
      • Developer
    • Hardware Programming
    • Embedded Programming
    • General-propose Programming
    • Algorithmica
    • Thai Expert Knowledge
    • RT-Thread University Program
      • Infineon PSoC6
      • Kernel
        • Kernel Basics
        • Thread Management
        • Clock Management
        • Inter-thread synchronization
        • Inter-thread communication
        • Memory Management
        • Interrupt Management
        • Kernel porting
        • Atomic Operations
        • RT-Thread SMP
        • Kernel API Changelog
      • Tools
      • Devices & Drivers
        • SENSOR Devices
        • Touch Equipment
        • CRYPTO Devices
        • AUDIO Devices
        • Pulse Encoder Devices
      • Components
        • C Library (libc)
        • ISO/ANSI C Standard
        • POSIX Standard
          • FILE (File IO)
          • Pthread
          • Timer
          • IPC Semaphore
          • IPC Message Queues
          • Dynamic Modules
        • Network Components
          • FinSH Console
          • FAL: Flash Abstraction Layer
          • Virtual File System
          • tmpfs: temporary file system
          • ulog log
          • utest testing framework
          • Power Management
          • RT-Link
        • Software Packages
          • Internet of Things
            • MQTT-umqtt
            • Telnet
          • Tools
            • SystemView
            • SEGGER_RTT
          • LVGL Manual
            • Touch Screen Driver
      • Demo
        • Infineon Gateway
        • Handwriting Recognition (MNIST)
        • Object Detection (Darknet)
        • ROS using RT-Thread
        • Control the car using RT-Thread
        • LiDAR via RT-Thread
        • Detection via RT-Thread and ROS
        • Sensor Driver Development Guide
Powered by GitBook

Assoc. Prof. Wiroon Sriborrirux, Founder of Advance Innovation Center (AIC) and Bangsaen Design House (BDH), Electrical Engineering Department, Faculty of Engineering, Burapha University

On this page

Was this helpful?

  1. Operation Systems
  2. Zero to Linux Hero
  3. Anatomy of Embedded Linux

Building Embedded Linux

āļāļēāļĢāļŠāļĢāđ‰āļēāļ‡āļĢāļ°āļšāļšāļˆāļģāļĨāļ­āļ‡āļŠāļģāļŦāļĢāļąāļšāļŠāļ–āļēāļ›āļąāļ•āļĒāļāļĢāļĢāļĄ ARM āļ”āđ‰āļ§āļĒāļŠāļļāļ”āđ€āļ„āļĢāļ·āđˆāļ­āļ‡āļĄāļ·āļ­ Buildroot āļšāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ QEMU

āļ—āļģāļāļēāļĢāļ•āļīāļ”āļ•āļąāđ‰āļ‡āđ‚āļ›āļĢāđāļāļĢāļĄāđāļĨāļ°āđ„āļĨāļšāļĢāļēāļĢāļĩāļ—āļĩāđˆāđ€āļāļĩāđˆāļĒāļ§āļ‚āđ‰āļ­āļ‡

$ sudo apt install autoconf automake libtool libexpat1-dev libncurses5-dev bison flex patch curl cvs texinfo build-essential subversion gawk python-dev gperf ncurses-dev g++ gcc texi2html nfs-kernel-server

āļŠāļĢāđ‰āļēāļ‡āđ„āļ”āđ€āļĢāļāļ—āļ­āļĢāļĩāļŠāļģāļŦāļĢāļąāļšāđ€āļāđ‡āļš root filesystem āļ‚āļ­āļ‡āļĢāļ°āļšāļšāļ›āļāļīāļšāļąāļ•āļīāļāļēāļĢ Embedded Linux āļ”āđ‰āļ§āļĒāđ‚āļ›āļĢāđ‚āļ•āļ„āļ­āļĨāļ›āļĢāļ°āļĒāļļāļāļ•āđŒ NFS (Network File System) āļœāđˆāļēāļ™āļĢāļ°āļšāļšāđ€āļ„āļĢāļ·āļ­āļ‚āđˆāļēāļĒ LAN

$ mkdir ~/nfsroot

āđāļĨāđ‰āļ§āļ—āļģāļāļēāļĢāļ•āļąāđ‰āļ‡āļ„āđˆāļēāđ„āļ”āđ€āļĢāļāļ—āļ­āļĢāļĩāļ—āļĩāđˆāļ•āđ‰āļ­āļ‡āļāļēāļĢāđāļŠāļĢāđŒāļœāđˆāļēāļ™ NFS āļ āļēāļĒāđƒāļ™āđ„āļŸāļĨāđŒ /etc/exports āļ”āđ‰āļ§āļĒāļ„āļģāļŠāļąāđˆāļ‡āļ‚āđ‰āļēāļ‡āļĨāđˆāļēāļ‡āļ™āļĩāđ‰

$ sudo nano /etc/exports 
/home/student/nfsroot *(rw,sync,no_root_squash,no_subtree_check)

āđ€āļĢāļīāđˆāļĄāđ€āļĢāļĩāļĒāļāļšāļĢāļīāļāļēāļĢ NFS Server āđƒāļŦāļĄāđˆāļ­āļĩāļāļ„āļĢāļąāđ‰āļ‡

$ sudo /etc/init.d/nfs-kernel-server restart

āļ•āļīāļ”āļ•āļąāđ‰āļ‡āđ€āļ„āļĢāļ·āđˆāļ­āļ‡āļĄāļ·āļ­ buildroot āļ‹āļķāđˆāļ‡āđ€āļ›āđ‡āļ™ cross-compiling toolchain

$ wget http://buildroot.uclibc.org/downloads/buildroot-2013.05.tar.gz
$ tar -xzvf buildroot-2013.05.tar.gz 
$ cd buildroot-2013.05/

āļ•āļąāđ‰āļ‡āļ„āđˆāļēāļĢāļ°āļšāļšāļ›āļāļīāļšāļąāļ•āļīāļāļēāļĢāļĨāļĩāļ™āļļāļāļ‹āđŒāđāļšāļšāļāļąāļ‡āļ•āļąāļ§āđ€āļžāļ·āđˆāļ­āđƒāļŦāđ‰āļĢāļ­āļ‡āļĢāļąāļšāļĢāļēāļĒāļĨāļ°āđ€āļ­āļĩāļĒāļ”āļ‚āļ­āļ‡āļŠāļ–āļēāļ›āļąāļ•āļĒāļāļĢāļĢāļĄāđāļĨāļ°āļĢāļēāļĒāļĨāļ°āđ€āļ­āļĩāļĒāļ”āļ­āļ·āđˆāļ™āđ†āļ”āļąāļ‡āļ™āļĩāđ‰

$ make menuconfig

āđ‚āļ”āļĒāđƒāļŦāđ‰āļ•āļąāđ‰āļ‡āļ„āđˆāļēāļ”āļąāļ‡āļ™āļĩāđ‰

Target Architecture ==> ARM (little endian)

Target Architecture Variant ==> arm926t

Target ABI ==> EABI

System Configuration ==> serial port to run getty on (ttyAMA0)

Package Selection ==> Busybox

FileSystem Images ==> cpio the root filesystem āđāļĨāļ° tar the root filesystem

Kernel ==> āļĢāļ°āļšāļļāļŠāļ·āđˆāļ­ defconfig āđ€āļ›āđ‡āļ™ â€œversatile”

Kernel ==> Kernel binary format to zImage

$ make
$ ls -al output/images/
total 6712
drwxr-xr-x 2 student student    4096 2013-07-22 11:45 .
drwxr-xr-x 8 student student    4096 2013-07-22 21:03 ..
-rw-r--r-- 1 student student 1922560 2013-07-22 21:03 rootfs.cpio
-rw-r--r-- 1 student student  858843 2013-07-22 21:03 rootfs.cpio.gz
-rw-r--r-- 1 student student 2181120 2013-07-22 21:03 rootfs.tar
-rw-r--r-- 1 student student 1895000 2013-07-22 11:44 uImage

$ cp output/images/uImage ~/qemu/

āļ§āļēāļ‡ root filesystem āđ„āļ›āļĒāļąāļ‡ āđ„āļ”āđ€āļĢāļāļ—āļ­āļĢāļĩ NFS āļŠāļ·āđˆāļ­āļ§āđˆāļē ~/nfsroot āļ—āļĩāđˆāđ€āļ„āļĢāļ·āđˆāļ­āļ‡ Host āđ„āļ”āđ‰āđ€āļ›āļīāļ”āđāļŠāļĢāđŒāđ„āļ§āđ‰

$ sudo tar -xvf rootfs.tar ~/nfsroot/
$ sudo chown -R student:student ~/nfsroot

āļ‚āļąāđ‰āļ™āļ•āļ­āļ™āļāļēāļĢāļŠāļĢāđ‰āļēāļ‡ tun/tap device āđ€āļžāļ·āđˆāļ­āļāļģāļŦāļ™āļ”āļ§āļ‡āļ‚āļ­āļ‡āļĢāļ°āļšāļšāđ€āļ„āļĢāļ·āļ­āļ‚āđˆāļēāļĒāļ—āđ‰āļ­āļ‡āļ–āļīāđˆāļ™āļ āļēāļĒāđƒāļ™āļĢāļ°āļŦāļ§āđˆāļēāļ‡ QEMU āđāļĨāļ°āđ€āļ„āļĢāļ·āđˆāļ­āļ‡ Host āđ€āļžāļ·āđˆāļ­āđƒāļŦāđ‰āļĢāļ°āļšāļšāļ›āļāļīāļšāļąāļ•āļīāļāļēāļĢāļĨāļĩāļ™āļļāļāļ‹āđŒāđāļšāļšāļāļąāļ‡āļ•āļąāļ§āļ āļēāļĒāđƒāļ™ QEMU āļŠāļēāļĄāļēāļĢāļ– mount āđ„āļ”āđ€āļĢāļāļ—āļ­āļĢāļĩ NFS āļ—āļĩāđˆāđ€āļ›āļīāļ”āđāļŠāļĢāđŒāđ„āļ§āđ‰āļšāļ™āđ€āļ„āļĢāļ·āđˆāļ­āļ‡ Host āđ„āļ”āđ‰ āđ‚āļ”āļĒāļ•āļąāđ‰āļ‡āļ„āđˆāļē IP Address āđƒāļŦāđ‰āļāļąāļšāđ€āļ„āļĢāļ·āđˆāļ­āļ‡ Host āđ€āļ›āđ‡āļ™ 192.168.1.1 āđāļĨāļ°āļ•āļąāđ‰āļ‡āļ„āđˆāļē IP Address āļŠāļģāļŦāļĢāļąāļšāļ­āļļāļ›āļāļĢāļ“āđŒ target āļ‹āļķāđˆāļ‡āđƒāļ™āļ—āļĩāđˆāļ™āļĩāđ‰āļāđ‡āļ„āļ·āļ­ 192.168.1.101

āļ‚āļąāđ‰āļ™āļ•āļ­āļ™āļ•āđˆāļ­āđ„āļ›āļ—āļģāļāļēāļĢāļ•āļīāļ”āļ•āļąāđ‰āļ‡āđ‚āļ›āļĢāđāļāļĢāļĄ uml-utilities (āļ—āļĩāđˆāļĄāļĩāļ„āļģāļŠāļąāđˆāļ‡ tunctl) āđ€āļžāļ·āđˆāļ­āđƒāļŦāđ‰āļŠāļēāļĄāļēāļĢāļ–āļˆāļģāļĨāļ­āļ‡āļŠāļąāļāļāļēāļ“āļĢāļ°āļšāļšāđ€āļ„āļĢāļ·āļ­āļ‚āđˆāļēāļĒ (network traffic)

$ sudo apt install uml-utilities
$ sudo tunctl -u $(whoami) -t tap1
$ sudo ifconfig tap1 192.168.1.1
$ sudo route add -net 192.168.1.0 netmask 255.255.255.0 dev tap1
$ sudo sh -c "echo  1 > /proc/sys/net/ipv4/ip_forward"

āļ‚āļąāđ‰āļ™āļ•āļ­āļ™āļŠāļļāļ”āļ—āđ‰āļēāļĒāļ—āļģāļāļēāļĢāļĢāļąāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ QEMU āđ€āļžāļ·āđˆāļ­āļˆāļģāļĨāļ­āļ‡āļāļēāļĢāļ—āļģāļ‡āļēāļ™āļšāļ­āļĢāđŒāļ”āļŠāļĄāļ­āļ‡āļāļĨāļāļąāļ‡āļ•āļąāļ§ (Versatile Board) āđāļĨāļ°āļ—āļģāļāļēāļĢāđ‚āļŦāļĨāļ” root filesystem āļˆāļēāļāđ€āļ„āļĢāļ·āđˆāļ­āļ‡ Host

$ qemu-system-arm -M versatilepb -m 128M -kernel ~/uImage -append "console=ttyAMA0 root=/dev/nfs rw nfsroot=192.168.1.1:~/nfsroot ip=192.168.1.101" -net nic -net tap,ifname=tap1,script=no -nographic

Set 'tap1' persistent and owned by uid 1000
SIOCADDRT: File exists
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 3.9.4 (student@marabuntu) (gcc version 4.7.3 (Buildroot 2013.05) ) #1 Mon Jul 22 11:44:32 PDT 2013
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00093177
CPU: VIVT data cache, VIVT instruction cache
Machine: ARM-Versatile PB
Memory policy: ECC disabled, Data cache writeback
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: console=ttyAMA0 root=/dev/nfs rw nfsroot=192.168.1.1:/home/student/nfsroot ip=192.168.1.101
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
__ex_table already sorted, skipping sort
Memory: 128MB = 128MB total
Memory: 126192k/126192k available, 4880k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xc8800000 - 0xff000000   ( 872 MB)
    lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc0342850   (3307 kB)
      .init : 0xc0343000 - 0xc035f87c   ( 115 kB)
      .data : 0xc0360000 - 0xc0385440   ( 150 kB)
       .bss : 0xc0385440 - 0xc039f78c   ( 105 kB)
NR_IRQS:224
VIC @f1140000: id 0x00041190, vendor 0x41
FPGA IRQ chip 0 "SIC" @ f1003000, 13 irqs
Console: colour dummy device 80x30
Calibrating delay loop... 300.44 BogoMIPS (lpj=1502208)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0xc027e748 - 0xc027e7a0
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
Serial: AMBA PL011 UART driver
dev:f1: ttyAMA0 at MMIO 0x101f1000 (irq = 44) is a PL011 rev1
console [ttyAMA0] enabled
dev:f2: ttyAMA1 at MMIO 0x101f2000 (irq = 45) is a PL011 rev1
dev:f3: ttyAMA2 at MMIO 0x101f3000 (irq = 46) is a PL011 rev1
...
Console: switching to colour frame buffer device 80x60
brd: module loaded
physmap platform flash device: 04000000 at 34000000
physmap-flash physmap-flash.0: map_probe failed
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <
nico@fluxnic.net
>
eth0: SMC91C11xFD (rev 1) at c8800000 IRQ 57 [nowait]
eth0: Ethernet addr: 52:54:00:12:34:56
mousedev: PS/2 mouse device common for all mice
TCP: cubic registered
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 1 part 10 variant 9 rev 0
eth0: link up
IP-Config: Guessing netmask 255.255.255.0
IP-Config: Complete:
     device=eth0, hwaddr=52:54:00:12:34:56, ipaddr=192.168.1.101, mask=255.255.255.0, gw=255.255.255.255
     host=192.168.1.101, domain=, nis-domain=(none)
     bootserver=255.255.255.255, rootserver=192.168.1.1, rootpath=
input: AT Raw Set 2 keyboard as /devices/fpga:06/serio0/input/input0
input: ImExPS/2 Generic Explorer Mouse as /devices/fpga:07/serio1/input/input1
VFS: Mounted root (nfs filesystem) on device 0:9.
Freeing init memory: 112K
Starting logging: OK
Initializing random number generator... done.
Starting network...
ip: RTNETLINK answers: File exists


Welcome to Burapha Embedded System Lab
Burapha login:  
# ls
# ls -al
total 20
drwxr-xr-x    2 default  default       4096 Jul 23  2013 .
drwxr-xr-x   17 default  default       4096 Jul 23  2013 ..
-rw-------    1 root     root            10 Jul 23  2013 .ash_history
-rw-r--r--    1 default  default          0 May 31  2013 .bash_history
-rw-r--r--    1 default  default        175 May 31  2013 .bash_logout
-rw-r--r--    1 default  default        161 May 31  2013 .bash_profile
#
PreviousBootloaderNextLinux OS Dev. Engineer

Last updated 1 year ago

Was this helpful?

ðŸ–Ĩïļ