Implementation of Embedded OS

Slides:



Advertisements
Similar presentations
Prashant Somashekar. What will we discuss? -Brief overview of a kernel -How a kernel fits into the hierarchy -Android versus Linux kernel -Building an.
Advertisements

Computer System Laboratory
PIKA Technologies Inc. PADS for the PIKA WARP Appliance March 2009.
Linux Booting Procedure
U-Boot and Linux Kernel Debug using CCSv5
LINUX-WINDOWS INTERACTION. One software allowing interaction between Linux and Windows is WINE. Wine allows Linux users to load Windows programs while.
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Lab4 - Bootloader 2014/10/14/ 13 1.
Linux OS Porting on Create XScale-PXA270
Lab. 1 Run a demo program. Lab. Goal To be familiar with PPRK, pcm7230 and the cross compiler. To understand how to run a program to control the PPRK.
Buildroot CS-423 Dick Steflik. buildroot uClibc – C library for developing for embedded Linux –much smaller than GNU C tools to make a cross-compilation.
Computer System Laboratory
Linux-MVME Targets Using Motorola Board Support
COMPUTER SYSTEM LABORATORY Lab8 - Debugging II. Lab 8 Experimental Goal Learn how to debug Linux in source-level by Domingo and diagnose target boards.
COMPUTER SYSTEM LABORATORY Lab4 - Bootloader. Lab 4 Experimental Goal Learn how to build U-Boot bootloader for PXA /10/8/ 142.
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
U-Boot Debug using CCSv5 In this session we will cover fundamentals necessary to use CCSv5 and a JTAG to debug a TI SDK-based U-Boot on an EVM platform.
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 - Cross Tools 2014/10/7/ 20 1.
Computer System Laboratory
COMPUTER SYSTEM LABORATORY Lab10 - Sensor II. Lab 10 Experimental Goal Learn how to write programs on the PTK development board (STM32F207). 2013/11/19/
Embedded Linux porting Kernel
Computer System Laboratory
Lab 11 Department of Computer Science and Information Engineering National Taiwan University Lab11 - Porting 2014/12/9/ 26 1.
®® Microsoft Windows 7 for Power Users Tutorial 13 Using the Command-Line Environment.
Lab 1 Department of Computer Science and Information Engineering National Taiwan University Lab1 - Sensor 2014/9/23/ 13 1.
Linux in a Virtual Environment Nagarajan Prabakar School of Computing and Information Sciences Florida International University.
Porting Operating Systems Phan Duy Hùng (PhD) ES Lecturer – Hanoi FPT University.
09/21/081 Ho Chi Minh city University of Technology Linux kernel R.M. Introduction of building Linux kernel from source.
1 What is a Kernel The kernel of any operating system is the core of all the system’s software. The only thing more fundamental than the kernel is the.
Conventions Department of Computer Science and Information Engineering National Taiwan University Conventions 2014/9/16/ 3 1.
Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16.
COMPUTER SYSTEM LABORATORY Lab6 - Root Filesystem.
Unit - VI. Linux and Real Time: Real Time Tasks Hard and Soft Real Time Tasks Linux Scheduling Latency Kernel Preemption Challenges in Kernel Preemption.
Implementation of Embedded OS Lab3 Linux Kernel Modules.
Lab 14 Department of Computer Science and Information Engineering National Taiwan University Lab14 – Camera 2014/12/30 1 /14.
Implementation of Embedded OS Lab4 Cortex-M3 Programming.
Lab 12 Department of Computer Science and Information Engineering National Taiwan University Lab12 – Driver 2014/12/16 1 /21.
Implementation of Embedded OS Lab3 Porting μC/OS-II.
Linux Kernel Programming (LKP). LKP New sub-course New sub-course We will learn together We will learn together Evaluation of this part of course will.
Linux Operation System Computer Operation Manual.
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 – Bootloader + OS Kernel 2015/10/27/ 25 1.
Lab 8 Department of Computer Science and Information Engineering National Taiwan University Lab8 - Root Filesystem 2015/11/10/ 22 1.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 - OS Kernel 2014/10/21/ 16 1.
Blackfin buildroot development
1 Setup and Compile Linux Kernel Speaker: Yi-Ji Jheng Date:
Embedded Linux By Gus Wirth. What makes it embedded? ● Rather nebulous, line has blurred over the years ● Limited purpose ● Small resources compared to.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The U-boot bootloader Michael.
An Embedded Wireless Mini-Server with Database Support Presented by: Amit Kumar.
BY: SALMAN 1.
Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010
Operating System Kernel Compilation
Computer System Laboratory
Implementation of Embedded OS
BY: SALMAN.
Computer System Laboratory
Implementation of Embedded OS
UBUNTU INSTALLATION
Implementation of Embedded OS
Computer System Laboratory
Implementation of Embedded OS
Operating System Kernel Compilation
Linux-MVME Targets Using Motorola Board Support
IS3440 Linux Security Unit 7 Securing the Linux Kernel
Computer System Laboratory
Workshop GPIO I2C SPI Panic1 woensdag 10 april 2019.
Computer System Laboratory
Computer System Laboratory
Computer System Laboratory
Linux Operation System
Presentation transcript:

Implementation of Embedded OS Lab1 Linux Kernel Compilation

Goal Learn how to build Linux kernel image for PXA270. / 18 2015/03/31

Environment Host System Build System Target System Software Windows XP VirtualBox + Ubuntu 8.04 Target System Creator XScale PXA270 Software Toolchain Linux for PXA270 linux-2.6.15.3-creator-pxa270.patch mkimage utility Bootloader image Root filesystem image (20M) You can download them from RSWiki IEOS Course Software / 18 2015/03/31

Setting up Environment Install VirtualBox, Ubuntu 8.04, and development tools. Please refer to the slides of lab1 from the course Computer System Laboratory (CSL). Check the evaluation board. Please refer to the slides of lab2 from CSL. / 18 2015/03/31

Installing Toolchain Install the toolchain (cross compiler) for PXA270. Step1: download the toolchain. % wget http://eraser.csie.ntu.edu.tw/courses/ieos/10202/lab 2/arm-linux-toolchain-bin.4.0.2.tar.gz Step2: extract the tar.gz file to home directory. % tar zxvf arm-linux-toolchain-bin.4.0.2.tar.gz -C $HOME Step3: append installation directory (bin) to PATH. By adding “export PATH=$PATH:$HOME/arm-unknown-linux- gnu/bin” to $HOME/.bashrc Don’t forget to logout and login again to make the change effective. Test the newly installed cross-compiler. % arm-unknown-linux-gnu-gcc –v You will see the version number (4.0.2) in the output. / 18 2015/03/31

Compiling Linux Kernel (1/3) Step1: download Linux source codes (mt-linux- 2.6.15.3.tar.gz) for PXA270. Step2: extract the source codes. Step3: apply the patch. % cd pxa270/create-pxa270 % wget http://eraser.csie.ntu.edu.tw/courses/ieos/10202 /lab2/linux-2.6.15.3-creator-pxa270.patch % patch -p0 < linux-2.6.15.3-creator- pxa270.patch / 18 2015/03/31

Compiling Linux Kernel (2/3) Step4: configure the Linux kernel. Please make sure the toolchain path has been specified in PATH and the C development library (libc6-dev) has been installed. % cd ../linux % make mrproper % make creator_pxa270_defconfig The “make <platform>_defconfig” command will create .config by the default symbol values from arch/<architecture>/configs/<platform>_defconfig To customize the configuration, please refer to page 9 of this slides. Step5: compile Linux kernel. % make –j4 / 18 2015/03/31

Compiling Linux Kernel (3/3) There are three output files in the source tree. ./vmlinux: uncompressed image in ELF format ./arch/arm/boot/compressed/vmlinux: compressed image in ELF format ./arch/arm/boot/zImage: compressed image in raw format Decompression Function Compressed Kernel (c) ELF Header (b) Uncompressed Kernel (a) / 18 2015/03/31

Configuring Linux Kernel (1/2) The Linux kernel build system (Kbuild) supports a variety of configuration methods, and the most commonly used method is: % make menuconfig Please install libncurses5-dev package in Ubuntu. / 18 2015/03/31

Configuring Linux Kernel (2/2) Many features and drivers are available as modules, and it is possible to choose whether to build them into the kernel. Please always build modules into the kernel, i.e., <*>, in our Labs. You need to add the NIC driver into the kernel as follows. Once the kernel has been configured, you can quit the kernel configuration menu via Esc key or the Exit menu item. Choose “Yes” to save the new configuration. built-in / 18 2015/03/31

Memory Layout of PXA270 (1/3) The Creator XScale PXA270 board has 32MB flash and 64MB SDRAM. Flash memory ranges from 0x00000000 to 0x02000000. SDRAM ranges from 0xa0000000 to 0xa4000000. The locations and sizes of kernel image and root filesystem are specified in Linux kernel (in arch/arm/mach- pxa/mach-creator-pxa270.c). The structure of creator_pxa270_partitions[] is at line 248. / 18 2015/03/31

Memory Layout of PXA270 (2/3) U-Boot 0x00080000 Linux kernel 0x00480000 0xa1080000 U-Boot (TFTP) Root Filesystem 0x01880000 0xa3f80000 U-Boot (domingo) 0x02000000 0xa4000000 Flash RAM / 18 2015/03/31

Memory Layout of PXA270 (3/3) Based on the memory layout, we can configure the partition of the flash in Linux kernel as follows. static struct mtd_partition creator_pxa270_partitions[] = { ... },{ name: "Kernel", offset: 0x00080000, size: 0x00400000, // 4M mask_flags: MTD_WRITEABLE name: "Filesystem", offset: 0x00480000, size: 0x01400000, // 20M } / 18 2015/03/31

Converting to U-Boot Bootable Image (1/2) Since U-Boot has its own format for kernel images, we need to convert the Linux kernel image (vmlinux) to U-Boot bootable image (uImage). Step1: get the raw binary file. % arm-unknown-linux-gnu-objcopy -O binary -R .note - R .comment -S arch/arm/boot/compressed/vmlinux linux.bin Step2: compress the raw binary. % gzip -9 linux.bin / 18 2015/03/31

Converting to U-Boot Bootable Image (2/2) Step3: add the header of U-Boot bootable image. % chmod +x mkimage % ./mkimage -A arm -O linux -T kernel -C gzip -a 0xa0008000 -e 0xa0008000 -n "IEOS Lab1 Kernel" - d linux.bin.gz uImage mkimage can be downloaded from our course website (mkimage). You can see the mkimage usage by executing without arguments. The resulting uImage is the U-Boot image we want. / 18 2015/03/31

Flashing Please refer to the slides of lab2 from CSL for the steps of copying bootloader, kernel, and filesystem. Use the following files instead. Bootloader: u-boot.bin Linux kernel: the one you just compiled (uImage). Filesystem: rootfs_20M / 18 2015/03/31

Testing Your Kernel Image (1/2) After resetting PXA270, you will see your own Linux kernel is booted. U-Boot will display the image name “IEOS Lab1 Kernel” when loading the kernel image. After Linux is booted, use df -h to check the size of filesystem. You will see the size of root filesystem (/dev/mtdblock3). / 18 2015/03/31

Testing Your Kernel Image (2/2) Check the NIC driver has been compiled into the kernel. Please use ifconfig eth0 to check your network card. / 18 2015/03/31