Embedded Systems Ch 3A Linux Development Environment

Similar documents
Unix Introduction to UNIX

CMSC 104 Lecture 2 by S Lupoli adapted by C Grasso

Basic Unix Commands. CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Introduction to Linux

Hand-on Labs for Chapter 1 and Appendix A CSCE 212 Introduction to Computer Architecture, Spring

Introduction to Linux

EE414 Embedded Systems Lab 1. Cross Development Environment. 1. Purpose. 2. Problem Statement. 3. Technical Backgrounds

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Introduction to Supercomputing

Programming and Data Structure Laboratory (CS13002)

Linux/Cygwin Practice Computer Architecture

EE516: Embedded Software Project 1. Setting Up Environment for Projects

Introduction to Linux Environment. Yun-Wen Chen

Linux Survival Guide

Oregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011

Using colinux to develop under Windows XP

EKT332 COMPUTER NETWORK

Development Environment & Linux Guide

Linux Tutorial. Ken-ichi Nomura. 3 rd Magics Materials Software Workshop. Gaithersburg Marriott Washingtonian Center November 11-13, 2018

Introduction to Linux. Fundamentals of Computer Science

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

Introduction to Linux (Part II) BUPT/QMUL 2018/03/21

Chapter 2 Operating-System Structures

Linux Systems Administration Getting Started with Linux

CMPT 300. Operating Systems. Brief Intro to UNIX and C

Introduction of Linux

Linux Shell Script. J. K. Mandal

Developing Environment for Intel Mainstone Board

Chapter 1 An Introduction to C++, Unix, SSH and Komodo Edit

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

Outline. Structure of a UNIX command

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

Introduction to Linux

Lab 3a Using the vi editor

Practical Session 0 Introduction to Linux

Intermediate Programming, Spring Misha Kazhdan

An Introduction to Unix

Topics. Operating System. What is an Operating System? Let s Get Started! What is an Operating System? Where in the Book are we?

Topics. Operating System I. What is an Operating System? Let s Get Started! What is an Operating System? OS History.

Linux Exercise. pwd answer: We call this directory (into which you get when you log in) your home directory.

DTK2410 Specification

Introduction to the Linux Command Line

Parallel Programming Pre-Assignment. Setting up the Software Environment

h/w m/c Kernel shell Application s/w user

CS370 Operating Systems

Computer Center, CS, NCTU. Outline. FreeBSD version 9.0-RELEASE 9.1-RC1. Installing FreeBSD. From CD-ROM From USB

Chapter-3. Introduction to Unix: Fundamental Commands

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

Physics REU Unix Tutorial

CS 261 Recitation 1 Compiling C on UNIX

Getting Started. Running Utilities. Shells. Special Characters. Special Characters. Chapter 2 Unix Utilities for non-programmers

CISC 220 fall 2011, set 1: Linux basics

CS101 Linux Shell Handout

ITEC451 Network Design & Analysis Laboratory Guide: Appendix

Exercise 1: Basic Tools

CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C

Getting Started With UNIX Lab Exercises

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

Using the Unix system. UNIX Introduction

Release Note MPI/XMP-Linux Support Package

NETW 110 Lab 3 Post-Installation Configuration Page 1

INF322 Operating Systems

Introduction to the UNIX command line

Session 1: Accessing MUGrid and Command Line Basics

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

Linux Command Line Primer. By: Scott Marshall

AMS 200: Working on Linux/Unix Machines

Introduction to Linux

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

COSC UNIX. Textbook. Grading Scheme

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Introduction to Red Hat Linux I: Easy Reference Index Page

Stop all processes and then reboot - same as above startx. Log in as superuser from current login exit

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Mauro Ceccanti e Alberto Paoluzzi

Chapter 1 An Introduction to C++, Unix, SSH and Komodo Edit

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Getting Started with UNIX

CS4350 Unix Programming. Outline

Course 144 Supplementary Materials. UNIX Fundamentals

Development Environment. ICLAB NCTU Institute of Electronics

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011

Please choose the best answer. More than one answer might be true, but choose the one that is best.

(7) Get the total energy from the output (1 Hartree = kcal/mol) and label the structure with the energy.

Washington WASHINGTON UNIVERSITY IN ST LOUIS

CS480. Compilers Eclipse, SVN, Makefile examples

UNLV Computer Science Department CS 135 Lab Manual

Set 1 MCQ Which command is used to sort the lines of data in a file in reverse order A) sort B) sh C) st D) sort -r

Unix Tutorial. Beginner. CS Help Desk: Marc Jarvis (in spirit), Monica Ung, Corey Antoniuk 2015

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Esercitazione Introduzione al linguaggio di shell

Saint Louis University. Intro to Linux and C. CSCI 2400/ ECE 3217: Computer Architecture. Instructors: David Ferry

Maintaining the System Software

MV 4412 Android 4.0 Compilation

EECS2301. Lab 1 Winter 2016

Filesystem Hierarchy Operating systems I800 Edmund Laugasson

Unix Basics. Systems Programming Concepts

Helpful Tips for Labs. CS140, Spring 2015

Introduction to Linux

AN INTRODUCTION TO UNIX

Transcription:

Embedded Systems Ch 3A Linux Development Environment Byung Kook Kim Dept of EECS Korea Advanced Institute of Science and Technology

Overview 1. Embedded Linux 2. Cross-Development System 3. Setting Linux Development Environment 4. 개발시스템환경구축 5. Linux Basics Embedded Systems, KAIST 2

1. Embedded Linux Software for embedded target Simple systems (Ex. Automatic electric power meter) Application software, modem communication software More complex systems (Ex. PDA) Application/service software 개인정보관리, game, 전자상거래, 원격가전제어, 무선전화, Web surfing, chatting, etc. Hardware dependent platform driving software Software driving internal and external hardware Device driver for LCD, keypad, touch panel, network, etc. Network software xdsl, cable modem, Ethernet, Bluetooth, Wifi, CDMA, etc. Fundamental software Operating system, DBMS, GUI, MMI, Web server Embedded Systems, KAIST 3

Embedded Linux (II) Operating system for embedded systems Why OS? Complex programs and diverse services (network and devices) Fast development time and expandability OS: 컴퓨터에연결된 hardware alc software 자원을효울적으로관리하는프로그램. ~60% of embedded systems utilize OS. Constraints Should fit within system s memory RAM: data ROM or flash: program Operating systems Wind River Systems: VxWorks, Tornado Palm computing: Palm OS Microsoft: Windows CE -: Embedded Linux - Next OS to be applied (49%) Embedded Systems, KAIST 4

Embedded Linux (III) Linux originated by Linus Torvalds Vast application software Stability of kernels Success in servers and workstations using PC Advantages of Linux Compatible with Unix Open source, free Stable (than Windows) Improved hardware utilization Powerful networking and Internet support Vast application programs Multi-user, multi-tasking Supports POSIX (Portable Operating System Interface for Computer Environment). Embedded Systems, KAIST 5

Embedded Linux (IV) Disadvantages of Linux Standardization Software reliability Much development effort Embedded Linux Scaled-down Linux for embedded processors to fit into ROM or flash. 낮은성능의프로세서와적은크기의메모리를가진내장형시스템용으로개발된리눅스. With or without memory management software (or virtual memory) Ported processors 32bit: Intel x86, Motorola Power PC, ARM9, MIPS, etc. 64-bit: IA-64 W/O MMU: ARM7, Motorola 68K, Intel i960, AXIS, etc. Embedded Systems, KAIST 6

2. Cross-Development System Embedded system software Embedded system을개발하는데필요한모든 software User: Software running on the embedded system Developer: Software for cross development environment Software development tools Editor: Edit source files Compiler: Translates into object files Linker: Links object files and libraries Debugger: Step-by-step execution and status check Embedded Systems, KAIST 7

Cross-Development System (II) Stand-alone system PC and Workstation Self-contained for general purposes Hardware: CPU. Memory, general-purpose user interface, Disk, Software: Operating system, application program, editor, compiler, linker Native compiler PC 에서동작되는프로그램은 PC 상에서동작되는컴파일러를이용하여개발하고, 동일한시스템내에서프로그램의수행이가능하다 Embedded system Self-contained for a specific purpose Limited hardware: CPU, memory, specific I/O, Flash or ROM Software: Embedded OS, application program Cross compiler 개발호스트를구축하여개발호스트에서컴파일하여작성된프로그램을장비에다운로드라는작업을통하여실행프로그램을써넣고이를수행하게된다. Embedded Systems, KAIST 8

Cross-Development System (III) Development stages for embedded system In the host Hardware에독립적인 software 설계및개발 Host에서 compile, run, and debug Embedded processor에서실행가능한 code로 cross compile Download the executable code to the embedded target In the target (with the host) Run and debug using debugging tools Transfer the verified program to ROM or flash in the embedded target. Embedded Systems, KAIST 9

3. Setting Linux Development Environment Partitioning Disk Tools Windows 98, ME: fips, fdisk Windows 2000, XP: Partition Magic (Commercial software) Partition Windows requires at least one disk partition (C:) Add one more partition for user space (D:) Linux requires at least two disk partitions (/ and swap) Add one more partition for user space (/home) Solution Primary partition: C: for Windows Secondary partition: Up to 4 logical partitions 1 st partition: D: for windows 2 nd partition: / for Linux (1 GB or more) 3 rd partition: Swap for Linux (2x memory size) 4 th partition: /home for Linux (2 GB or more). Embedded Systems, KAIST 10

Setting Linux Development Environment (II) Installing Linux Suggested Linux: Redhat Linux 9.0 http://www.redhat.com Installation menu Install mode: Test, graphic, expert, rescue Installation type: Workstation, server, Laptop, Custom Drive partition: Disk druid, fdisk Boot loader: LILO boot loader (Linux Loader) Selectable boot for Windows or Linux Network addresses IP address, Netmask, network, broadcast, hostname, gateway, primary DNS, secondary DNS, tertiary DNS Time zone: Seoul Root and user ids and passwords Selection of packages Selection of video cards Boot diskette X windows setting Embedded Systems, KAIST 11

Setting Linux Development Environment (III) Install new kernel (if necessary) Select modules for I/O devices # make menuconfig # make xconfig Install cross development software Assembler Compiler Linker Set network environments Nfs (Network File System) Tftp (Tiny File Transfer Protocol) Embedded Systems, KAIST 12

4. 개발시스템환경구축 1. 최소개발시스템 BOOT image load: JTAG with EzFlash Very slow Kernel and Ramdisk load: Serial with zmodem Moderate Embedded Systems, KAIST 13

개발시스 템환경 구축 (II) Development flow Embedded Systems, KAIST 14

개발시스템환경구축 (III) 2. 일반적개발시스템 Bootp 및 tftp 를이용한 application program download Bootp: 개발 board 의 IP 획득 Tftp: Tiny file transfer protocol Nfs: Network File System Embedded system 을위한 file system Embedded Systems, KAIST 15

개발시스 템환경 구축 (IV) Development flow Embedded Systems, KAIST 16

개발시스템환경구축 (V) 3. 대규모개발시스템 Embedded Systems, KAIST 17

개발시스 템환경 구축 (VI) Development flow Embedded Systems, KAIST 18

5. Linux Basics Getting Started # login: username or root # password: user_password or root_password # logout # shutdown h now ; Shutdown the computer Basic commands # date ; Display date and time Wed Sep 1 12:12:29 EDT 2004 # who ; List users currently logged in # man command ; Display manual of the command # pwd ; Print the complete pathname of the current directory # cd /usr/src/linux ; Change directory to /usr/src/linux Embedded Systems, KAIST 19

Linux Basics (II) File manipulation # ls [-la] ; List files in the current directory # cat filename ; Prints the file with filename # cp source_file dest_file ; Copy source_file to dest_file # cp file /dev/ttys0 ; Copy file to COM1 # rm junk_file ; Remove junk_file # mv old_file to new_file ; Rename the old_file to new_file Manipulating directories # mkdir new_dir ; Make a new_dir directory # rmdir old_dir ; Delete the old_dir directory # mv old_dir new_dir ; Rename old_dir directory to new_dir # cd new_dir ; Change directory to new_dir # cd.. ; Change to upper directory # cd / ; Chenage to root directory Embedded Systems, KAIST 20

Linux Basics (III) System inquiries # ps ; List active processes with process_id # kill -9 process_id ; Kill the process with process_id # du ; Disk usage of the current directory # df ; Display file system usage # su ; Become the superuser (root) # password: root_password # exit ; Become a normal user Embedded Systems, KAIST 21

Linux Basics (IV) Editing files with vi # vi file.c ; Visual edit file.c # Ctrl-F, Ctrl-B : Move forward/backward a full screen # space, backspace, return ; Move cursor right/left/next_line # i esc ; Insert characters before cursor (until escape) # a esc ; Insert characters after cursor (until escape) # o esc ; Insert line by line after the current line # O esc ; Insert line by line before the current line # x ; Delete the current character # dw ; Delete the current word # dd ; Delete the current line # r file ; Read the file # s/old/new/g ; Substitute old to new globally # :q ; Quit without saving # :wq ; Quit after saving Embedded Systems, KAIST 22

Linux Basics (V) Compile and run # mkdir /embedded/test # cd /embedded/test # vi hello.c # gcc o hello hello.c ; Cross-compile and link the program to produce hello. #./hello ; Run hello #include <stdio.h> void main() { printf("hello, Embedded system! n"); } Hello, Embedded board! ; Output: print a string on the console Embedded Systems, KAIST 23

Linux Basics (VI) Make command # vi Makefile # vi defs.h # vi main.c # vi average.c main.o average.o: defs.h average: main.o average.o gcc o average main.o average.o -lm # make average.o ; Compile average.c to average.o # make average ; Compile main.c to main.o Link main.o, average.o, and lib into average #./average ; Run average Embedded Systems, KAIST 24