COMPUTER SYSTEM LABORATORY Lab6 - Root Filesystem.

Slides:



Advertisements
Similar presentations
Computer System Laboratory
Advertisements

A Guide to Unix Using Linux Fourth Edition
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Lab4 - Bootloader 2014/10/14/ 13 1.
5 Basic utilities When a user logs in to the Linux operating system the directory that they will start in is their home directory. Most users will have.
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
Linux+ Guide to Linux Certification, Second Edition
Linux Linux File System.
The UNIX File System.
Guide To UNIX Using Linux Third Edition
Computer System Laboratory
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.
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.
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 - Cross Tools 2014/10/7/ 20 1.
Guide To UNIX Using Linux Fourth Edition
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
Manage Directories and Files in Linux
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.
Unix Basics Chapter 4.
Linux+ Guide to Linux Certification, Second Edition
Porting Operating Systems Phan Duy Hùng (PhD) ES Lecturer – Hanoi FPT University.
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
Chapter Two Exploring the UNIX File System and File Security.
Conventions Department of Computer Science and Information Engineering National Taiwan University Conventions 2014/9/16/ 3 1.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
March 2, 2005Wah-kai Ngai1 Installation of Geant4 1st HK Simulation Meeting.
Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
Filesystem Hierarchy Dr. Michael L. Collard 1.
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
Chapter Two Exploring the UNIX File System and File Security.
Lab 14 Department of Computer Science and Information Engineering National Taiwan University Lab14 – Camera 2014/12/30 1 /14.
IST 222 Day 3. Homework for Today Take up homework and go over Go to Microsoft website and check out their hardware compatibility list.
Linux+ Guide to Linux Certification, Third Edition
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop V Files and the File System Part B – File System.
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 Development Lecture 7. Schedule Linux Root Filesystem.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 – Bootloader + OS Kernel 2015/10/27/ 25 1.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
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.
Implementation of Embedded OS
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 - OS Kernel 2014/10/21/ 16 1.
Embedded Software Design Week II Linux Intro Linux Kernel.
LINUX Zhengli Zhu, School of Life Sciences. Outline 1. ABC of Linux 2. Basic orers of Linux 3. Bash Programming.
ORAFACT The Linux File System. ORAFACT Filesystem Support Support for dozens of filesystem types including: Minix, ext2, MS-DOS, UMSDOS, VFAT, NTFS, NFS,
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The U-boot bootloader Michael.
Computer System Laboratory
Computer System Laboratory
Implementation of Embedded OS
Computer System Laboratory
Linux 101 Training Module Linux Basics.
UBUNTU INSTALLATION
Structure of Unix OS.
9 Linux on the Desktop.
Implementation of Embedded OS
Lab 1 introduction, debrief
Exploring the UNIX File System and File Security
Computer System Laboratory
Computer System Laboratory
Computer System Laboratory
Computer System Laboratory
Presentation transcript:

COMPUTER SYSTEM LABORATORY Lab6 - Root Filesystem

Lab 6 Experimental Goal Learn how to build your own root filesystem for PXA /10/22/ 222

Lab 6 Environment Host System Windows XP Build System VirtualBox + Ubuntu 8.04 Target System Creator XScale PXA270 Software BusyBox Compiled toolchain mkfs.jffs2 & genext2fs utility You can download all software from RSWiki CSL Course SoftwareRSWiki CSL Course Software 2013/10/22/ 223

Lab 6 Introduction to Root Filesystem A file system is a method of storing and organizing computer files and their data. A root filesystem is the file system that is contained on the same partition on which the root directory, i.e., / in Linux, is located. The exact contents of the root filesystem will vary according to the computer, but they will include the files that are necessary for booting the system. 2013/10/22/ 224 reference: linfo: root filesystem,

Lab 6 Memory Layout of PXA270 32MB Flash ROM Addressing from 0x MB SDRAM Addressing from 0xa /10/22/ 225

Lab 6 Basic Root Filesystem Structure Root filesystem follows FHS (Filesystem Hierarchy Standard). FHS has the guideline of your filesystem. 2013/10/22/ 226

Lab 6 Types of Filesystems Some well-known filesystems Windows : FAT, NTFS Mac OS X : HFS Plus, UFS Linux : ext*, XFS, JFS, ReiserFS We will use JFFS2 & ext2 in this lab. JFFS2 (Journaling Flash File System Version 2) A journaling file system. Writable, compressed, power-down-reliable file system. ext2 (The second extended filesystem) A non-journaling file system. Writable. 2013/10/22/ 227

Lab 6 Create Root Filesystem Skeleton Step1: create a folder for placing root filesystem content. % mkdir $HOME/ Step2: create the essential directories. % cd % mkdir etc lib var proc mnt dev tmp 2013/10/22/ 228

Lab 6 Compiled Toolchain Installation To compile BusyBox, we need to install another cross-compiler. Step1: download cross-compiler (cross tar.bz2).cross tar.bz2 Step2: extract the compiler. % tar jxvf cross tar.bz2 Step3: move files to specified location. % sudo mkdir –p /usr/local/arm % sudo mv /usr/local/arm Step4: append installation directory (bin) to PATH. Test new cross-compiler. % arm-linux-gcc -v 2013/10/22/ 229

Lab 6 Build BusyBox (1/3) BusyBox contains a collection of stripped-down Unix utilities into a single executable. Why BusyBox? You don’t have to configure and build the sources of each utility. Step1: download BusyBox (busybox-1.00.tar.gz).busybox-1.00.tar.gz Step2: extract the source codes. Step3: copy header from kernel source codes of Lab5. % cd busybox-1.00 % cp –R /pxa270/linux/include/linux include 2013/10/22/ 2210

Lab 6 Build BusyBox (2/3) Step3: download Linux verison.h. % wget on.h % cp version.h include/linux Step4: configure BusyBox. % make menuconfig Build Options  Networking Utilities  2013/10/22/ 2211

Lab 6 Build BusyBox (3/3) Step5: compile BusyBox. % make -j4 Step6: install BusyBox. % make -j4 install Step7: move files to your root filesystem folder (slide8).slide8 % mv _install/* 2013/10/22/ 2212

Lab 6 Create Essential Device Files (1/3) Device files allow user programs to access hardware devices on the system through the kernel. The kernel just relies on device file’s type and major number to find which driver manages this device. 2013/10/22/ 2213

Lab 6 Create Essential Device Files (2/3) The official information for device major and minor numbers can be found in Documentation/devices.txt under the kernel source codes. We can use mknod command to create device files in Linux, e.g., if we want to create a character ttyS0 device with major number 4 and minor number 64: % mknod ttyS0 c /10/22/ 2214

Lab 6 Create Essential Device Files (3/3) For the convenience, we use a script to create related device files for our root filesystem: % wget % cp mknod.sh /dev % cd /dev % sudo sh mknod.sh % rm mknod.sh 2013/10/22/ 2215

Lab 6 Add Initialization Scripts (1/2) Step1: add configuration file used by first user-space program (i.e. /sbin/init ). % wget ab % cp inittab /etc inittab describes which processes are started during bootup. The entry syntax of inittab. id : runlevels : action : process ::sysinit:/etc/rcS ::askfirst:/bin/sh sysinit : execute the process during system boot askfirst : prompt “Please press Enter to activate this console.” before execution Some other actions: respawn, ctrlaltdel 2013/10/22/ 2216

Lab 6 Add Initialization Scripts (2/2) Step2: add system initialization script (rcS). % wget % cp rcS /etc Step3: change permission. % cd /etc % chmod 777 inittab rcS Please refer to the website below for more information /10/22/ 2217

Lab 6 Create Root Filesystem Image (1/2) Step1: make a JFFS2 file system image. (Download mkfs.jffs2)mkfs.jffs2 % chmod +x mkfs.jffs2 %./mkfs.jffs2 -v -e 0x pad=0xf r -o rootfs.jffs2 You can see the mkfs.jffs2 usage by executing without arguments. Step1: or a ext2 file system image. (Optional) Install genext2fs package in Ubuntu % genext2fs -b d -e 0 rootfs.ext2 Please refer to the website below for the genext2fs usage /10/22/ 2218

Lab 6 Create Root Filesystem Image (2/2) Step2: now, you can copy rootfs.* image to PXA270. If you choose ext2 format for your root filesystem, you need to change rootfstype in bootargs environment variable in U-Boot. u-boot$ setenv bootargs root=/dev/mtdblock3 rw rootfstype=ext2 console=ttyS0,9600n8 mem=64M ip=... u-boot$ saveenv 2013/10/22/ 2219

Lab 6 Change Filesystem Image Size (1/2) Recall Lab5, if we want to change the size of filesytem, we need to modify creator_pxa270_partitions[] in Linux kernel. Also, the corresponding arguments are required to be set in mkfs.jffs2 and genext2fs commands, e.g. a 15M root filesystem. %./mkfs.jffs2 -v -e 0x pad=0xf r -o rootfs.jffs2 % genext2fs -b d -e 0 rootfs.ext2 2013/10/22/ 2220

Lab 6 Change Filesystem Image Size (2/2) Now, please refer to previous slides to increase the size of your root filesystem to 20M and add tftp client utility. Please calculate new erased end address for root filesystem. It will take about 8 minutes to copy new 20M root filesystem. You can use “ df -h ” command to check the size. You can add tftp client utility to BusyBox. 2013/10/22/ 2221

Lab 6 Lab Requirement & Bonus Show that you can use tftp on your Linux kernel which has a 20M filesystem. Bonus: Answer the question of lab6 on RSWiki CSL course website. Write it in your report.RSWiki CSL course website Please send your report to both TAs. Please use this title format: [CSL] G# Lab# Ver# E.g., [CSL] G13 Lab6 Ver1 2013/10/22/ 2222