Development and Research of Root File System Based on Cortex-A8 Microprocessor

Development and Research of Root File System Based on Cortex-A8 Microprocessor

Advances in Intelligent Systems Research, volume 148 International Conference on Information Technology and Management Engineering (ICITME 2018) Development and Research of Root File System Based on Cortex-A8 Microprocessor Li Zhou1 and Maoqun Yao2,* 1Institute of Service Engineering, Hangzhou Normal University, Hangzhou Zhejiang 311121, China 2Institute of Service Engineering, Hangzhou Normal University, Hangzhou Zhejiang 311121, China *Corresponding author Abstract—The root file system is an integral part of the mainly user software. The kernel layer includes a root file embedded Linux system. Busybox is used in the embedded system, an operating system, and the underlying hardware.[2] environment to build a root file system, the paper mainly studies The architecture of its components is shown in Figure 1. The how to complete the root file system based on Busybox. This specific directories and functions of the Linux root file system article by root in the ubuntu configuration, compile Busybox and are shown in Table 1. build the root file system necessary files to make the root file system. Finally, successfully mount the experiment by nfs remote mount the root file system in the host ubuntu. The method User Applications Use described in the article can be successfully run in the ARM r development board, to provide the necessary environment for the GNC C Library development of embedded systems. spa ce Keywords—Linux system; root file system; Busybox; Ubuntu; System call interface nfs I. INTRODUCTION Inode Directory Virutal file system In the Linux system, the file system is a set of software cache cache whose function is to manage the sectors of the storage device. Ker When the user accesses a file according to the file name at the Individual file systems application layer, the file system converts the file name to nel access to the sector number, thereby realizing that all devices Spa Buffer cache in the Linux system are files. The root file system is a file ce system first. It not only has the function of storing data files, but also the first file system mounted at kernel startup. The kernel code image file is stored in the root file system, and the Device drivers system boots the startup program. After loading the root file system, some initialization scripts and services are loaded into FIGURE I. LINUX SYSTEM ARCHITECTURE memory to run. The root file system provides the most basic link libraries, scripts, and special files for Linux system TABLEI. LINUX ROOT FILE SYSTEM DIRECTORY TABLE operation. In a complete Linux system, only the kernel itself /bin Store linux general user command directory can not work, like common Linux systems such as ubuntu, redhat, centos, etc. must be in the root file system etc directory /sbin Storage administrator system commands under the configuration file / bin, / sbin under the shell /dev Storage device file directory The commands, as well as the library files in the /lib directory, work together. In other words, the root file system /etc Store various configuration files provides the Linux root directory. The common ls, cd, and /lib Store shared libraries and loadable drivers pwd commands are implemented on the root file system. The /root Root user root file system also includes the init process, which /usr Store shared, read-only programs and data implements a leap from kernel mode to user mode[1]. This article will make a good root file system in ubuntu through /(Root /mnt Provide users with temporary mounting of other file systems NFS remote mount to the s5pv210-based development board, directory) and gives the test results. /opt Additional installation software location /tmp The directory where temporary files are stored II. ROOT FILE SYSTEM /var Store variable data, log files A. Root File System Introduction /media Storage and mounting equipment The embedded Linux system can be summarized as an /proc The mount point of the file system application layer and a kernel layer. The application layer is Copyright © 2018, the Authors. Published by Atlantis Press. This is an open access article under the CC BY-NC license (http://creativecommons.org/licenses/by-nc/4.0/). 13 Advances in Intelligent Systems Research, volume 148 B. Build a Root File System [*]Support regular expressions substitutions when Create an empty root file system file in the host ubuntu renaming dev and name it rootfs. Then create necessary subdirectories such [*]Support command execution at device as bin, sbin, dev, etc, lib, var, etc. in the rootfs directory. The addition/removal specific operations are as follows[3]: [*]Support loading of firmwares mkdir rootfs IV. BUILD A ROOT FILE SYSTEM cd rootfs mkdir bin dev etc proc root sbin sys tmp usr var After Busybox is compiled and installed into the specified rootfs directory, the corresponding tool files are generated in III. THE TRANSPLANT OF BUSYBOX the /bin, /sbin, and /usr directories. The necessary configuration files such as inittab, rcS, etc. must also be added Busybox is a big toolbox that integrates many basic [7] commands for Linux systems, such as ls, cd, echo, and so on. to enable the root file to be created. The system works . The Busybox configuration can be done in menuconfig just A. Build Inittab File like the kernel configuration. Busybox is also an open source project. All source code can be downloaded from the Internet. Inittab is a runtime configuration file in the /etc directory. In this research, Busybox makes its own root file system. When the Linux system is running, it parses the text file and decides how to work according to the contents of the A. Modify Makefile and CROSS_COMPILE resolution, including the user's run level settings, login system Graphics may be full colour but make sure that they are In settings, restart settings, etc. Its format is defined in Busybox, the official website to download Busybox1.24.1 to the host and it is parsed in line units. The configuration items for each ubuntu system, decompression is completed, the first step to line of the inittab text file are determined by the four modify the Makefile, because the development board uses the configuration values id: runlevels: action: process. The two cpu Samsung s5pv210 belongs to the Cortex-A8 series configuration values, id and runlevels, can be left blank. Action is a conditional state, and process is the path name of a architecture, so its ARCH belongs to the arm series, In the [8] ubuntu system to find the cross compiler tool chain program that can be executed . That is, the process will be installation, copy the relevant path to the Makefile executed when the conditions of the action are satisfied. The CROSS_COMPILE, the specific code is modified as build code looks like this: follows[4,5]: #Run the system script file ARCH = arm ::sysinit:/etc/init.d/rcS CROSS_COMPILE=/usr/local/arm/arm-2009q3/bin//arm- s3c2410_serial2::sysinit:/bin/login none-linux-gnueabi- ::sysinit:/bin/login ::ctrlaltdel:-/sbin/reboot B. Configure Busybox # Remove all file systems Bussybox in the menuconfig related configuration, and ::shutdown:/bin/umount -a -r then compiled, installed into the rootfs directory. # Restart the init process ::restart:/sbin/init The Busybox runtime needs to be independent of other libraries. When Busybox is configured, Busybox is compiled B. Build an rcS File into a statically linked executable file. Specific steps are as The rcS file is the most important file in the Linux runtime follows[6]: configuration file. Other configurations are derived from the Busybox Settings---> rcS file, which is located in the /etc/init.d directory. In this file, Build Options---> the PATH environment variable is an environment variable [*]Build BusyBox as a static binary(no defined inside the Linux system. This ensures that the user can shared libs) directly use Linux system commands such as ls, cd, and pwd # Vi style line editing commands when entering the command line. Set the system run level in Busybox Library Tuning---> the file to single-user mode, ie runlevel=S. Set the file to user- [*]vi-style line editing commands readable and writable mode, umask=022.Use mount-a to [*]Fancy shell prompts mount all filesystems. Of course, all mount points /proc, /sys, # Uncheck Simplified modutils, use full tool command /var, /tmp, and /dev must be created in the root directory. The Linux Module Utilities---> file can also be used to set the host name and host network card ip. The specific operation is shown in the following [ ]Simplified modutils [9] [*]insmod code : [*]rmmod # Set the environment variable [*]lsmod PATH=/sbin:/bin:/usr/sbin:/usr/bin [*]modprobe # Set user mode to single user mode [*]depmod Runlevel=S # Make sure mdev is supported Prevlevel=N Linux System Utilities--->[*]mdev # Set the file permissions to 022 and user default permissions [*]Support /etc/mdev.conf to 644 [*]Support subdirs/symlinks Umask 022 # Export environment variables 14 Advances in Intelligent Systems Research, volume 148 Export PATH runlevel prevlevel LOGNAME=$USER #mount all devices # basic prompt, # for root user, $ for normal user Mount -a PS1='[\u@\h \W]\#' # Generate dev directory related content # Determines which directories the shell will find commands Echo /sbin/mdev > /proc/sys/kernel/hotplug or programs Mdev -s PATH=$PATH # Set the host name, here set to zhouli # Current host name /bin/hostname -F /etc/sysconfig/HOSTNAME HOSTNAME=`/bin/hostname` # Set the host network card ip # Export environment variables Ifconfig eth0 172.17.64.188 Export USER LOGNAME PS1 PATH C. Build a Device Driver File E. Set up User Login 1) Build fstab file 1) Login interface settings After the mount point is created in the rootfs directory, the There is a user login interface on Linux systems. In this mount-a command in the Busybox parsing the rcS file will experiment, a simple character interface was created to look for the file /etc/fstab.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    4 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us