Fedora Linux Kernels Running on ARM Processors
Total Page:16
File Type:pdf, Size:1020Kb
Latest Trends in Information Technology Fedora Linux Kernels Running on ARM Processors PETER KOTVAN, PETER FODREK Institute of Control and Industrial Informatics Faculty of Electrical Engineering and Information Technology Slovak University of Technology Ilkovicovaˇ 3, 812 19 Bratislava SLOVAK REPUBLIC [email protected], [email protected] Abstract: This paper will report our experience with installing and using the Fedora Linux distribution on a dedi- cated ARM processor based device. At first we will deal with ARM processors and its specifics. In the next section ARM based devices Dreamplug will be described. We will describe installation of Fedora Linux distribution on Dreamplug and compilation of the Linux kernel. The original Fedora kernel package was altered to support ARM based devices which incorporates different approaches especially to bootstrapping. Key–Words: Fedora, Linux Kernel, ARM processors 1 Introduction 2 ARM architecture and devices There are two main processor architectures used over the course of last years. Usually, a personal computer ARM is a reduced instruction set computer processor contains one of x86 or x86-64, however the most pop- architecture. It is the most widely used 32-bit instruc- ular 32-bit architecture is ARM (Advanced RISC Ma- tion set architecture. The combination of high perfor- chine). As the name says ARM is reduced instruction mance, low power consumption and low heat emis- set computer (RISC). Currently ARM processors are sion resulted in application of this architecture in mo- used primarily in smart phones, tablets and embedded bile phones, PDAs, tablets and cameras. With imple- devices. In the future, it is likely that the computers mentation of multi-cored ARM processors, it is possi- will be, too, powered by these processors. ble to use ARM based devices also for netbooks and Architectural simplicity allowed by RISC instruc- small servers. tion set opened the way to small hardware implemen- tations which allows for the manufacture of proces- Fedora is one of the many GNU/Linux distri- sors with very a low power consumption. The perfor- butions, operating systems that contain Linux ker- mance gain provided by RISC derives from the con- nel maintained by Linus Torvalds and GNU software cept of simplicity that enables a significantly faster ex- collection developed by the Free software foundation ecution of each instruction. The heat produced can founded by Richard Stallman. Fedora, a child sys- be absorbed by passive cooling. These features make tem of Red Hat Enterprise Linux is based on an RPM ARM processors suitable for mobile and embedded packaging system. systems. Typical RISC architecture features: Different booting mechanisms, absence of BIOS • and uboot bootloader on ARM devices are the most large uniform register file significant differences between x86 an ARM based • a load/store architecture, where data processing devices. We take these differences into account and operations only operate on register contents, not implement new features to Fedora kernel package to directly on memory contents provide common Fedora package management for the kernel package also on the ARM machines. • uniform and fixed-length instruction fields, to simplify instruction decode. This paper intends to describe the specifics of ARM also provides: ARM architecture and devices based on it and to pro- vide a grasp of RPM packaging methods and routines, • auto-increment and auto-decrement addressing the creation and the installation of RPM packages. modes to optimize the program loops ISBN: 978-1-61804-134-0 38 Latest Trends in Information Technology • Load and Store Multiple instructions to maxi- The newest product from Globalscale is D2Plug, mize date throughput successor of Dreamplug. In comparison with Dream- plug D2Plug has a VGA and a HDMI video output. • conditional execution of almost all instructions to maximize execution throughput. ARM has 31 general-purpose 32-bit registers. 16 of these registers are visible at any time, the other registers are used to speed up the exception process- ing. All of these 16 registers are the User mode regis- ters. User mode, being unprivileged is different from other modes. One of the specifics of the User mode is that the memory systems and coprocessors may allow only partial access to memory and coproces- sor functionality to the User mode than to a Privi- leged mode. Three of the User mode registers have special function, stack pointer, link register Figure 1: Dreamplug that holds the address of the next instruction follow- ing the Branch and Link instruction and a program The main components are [2]: counter used as a pointer to the instruction which is two instructions after the instruction being executed. • 1.2GHz Marvell 88F6281 processor with Sheeva technology 2.1 Devices • 2MB SPI NOR Flash for uboot Common ARM-based devices available on market are • running mostly on Android, iOS or Symbian oper- Onboard 4GB microSD memory card ating systems. Both Android and iOS belong to the Unix-like operating systems family. Apart from these • 512MB SDRAM closed-source devices there is also a number of open- source and development platforms like BeagleBoard- • JTAG and UART connectors for development xM, PandaBoard, Sheevaplug or Dreamplug. purposes. As the name indicates, the BeagleBoard and the PandaBoard are development boards with no case. Peripherals: Both devices have a video output (BeagleBoard S- video/DVI-D, PandaBoard HDMI) thus can function • Two Gigabit Ethernet connectors as a standard computer when a monitor, a keyboard and a mouse are connected. • Two USB 2.0 ports • eSATA 2.0 port 2.2 Dreamplug • Dreamplug in contrast to the two above-mentioned SD card socket boards, is fully an end-product. It is manufactured by Globalscale technologies, INC. Dreamplug is a suc- • WiFi: 802.11 b/g/n cessor of Sheevaplug and Guruplug. These three de- vices are based on Marwell ARM processors and have • Bluetooth 2.1 + EDR similar hardware design. Sheevaplug, the simplest de- vice has only one ethernet interface and one USB port. • Analog audio output and input The absence of video output makes Dreamplug suitable for server applications such as web/ftp server • S/PDIF fiber optics interface for digital audio or OpenVPN server. Making the advantage of two output ethernet ports, WiFi and bluetooth with an external hard drive connected through USB or eSATA Dream- In the following three sections we will discuss plug can be used as NAS (network attached storage) how ARM devices boot, the installation of operating or as home media server. system and the communication with these devices. ISBN: 978-1-61804-134-0 39 Latest Trends in Information Technology 2.3 Boot sequence and bootloader 2.5 Installation There is a significant difference between x86, x86-64 Dreamplug is originally shipped with the Ubuntu and ARM machines in booting up the device. Stan- Linux operating system. Typical Linux installation dard personal computers use BIOS (Basic Input Out- procedure involves downloading the installation me- put System), software that is built into the computer dia from a web page of a particular distribution, burn- and that is the first program run by PC after power ing it on a CD or a DVD media and after booting up. BIOS is stored on a non-volatile ROM chip on the from it, the installation can be performed. The main motherboard. After turning on the computer, BIOS reasons why there is not a universal installer for Fe- initializes and identifies computer hardware such as dora ARM are significant hardware differences be- CPU, RAM, video card, keyboard, mouse and hard tween ARM platforms especially considering location discs. After this initialization, BIOS locates the boot- of kernel and between different version of uboot boot- loader stored on the hard disc or CD and executes loader installed. However Fedora ARM development it. At this moment, bootloader gains control over team is considering development of such a universal the computer. Common bootloaders used on Linux installer for ARM devices. systems are LILO (LInux LOader) and GNU GRUB Installation of a Fedora distribution was neces- (GNU GRand Unified Botloader). sary to access Fedora specific package management ARM devices do not include BIOS and different and building tools. After disassembling Dreamplug devices can bootstrap in a different way. Most com- the micro SD card was unmounted. uboot can read mon bootloader used for ARM on open-source de- kernel image only from the first partition on the SD vices is Das U-Boot (The Universal Boot Loader). card that has to be formatted to fat. Root file system uboot is typically stored on a small NAND or NOR is stored on another partition. After the formatting non-volatile memory chip on the board or on a µSD into ext3 standard Linux file system the installation card. The purpose of this flash storage can differ. In itself consists of extracting precompiled root file sys- case of the Dreamplug there is a 2MB SPI NOR flash tem downloaded from Fedora ARM website to the SD storage that stores uboot binary and its configuration card. [3] data and the root file system. In contrast, BeagleBoard or BeagleBoard-xM employ larger storages that hold also the kernel binary. 2.6 Communication with Dreamplug Direct communication with Dreamplug can be es- 2.4 uboot on Dreamplug tablished with JTAG module through a uart (univer- sal asynchronous receiver/transmitter) interface. Uart After powering up Dreamplug uboot is loaded into takes data bytes and transmits the individual bits se- memory and executed: quentially. At the destination, a second uart re- U−Boot 2011.06−02334− g8f495d9−d i r t y assembles the bits into bytes. Serial transmission is Marvell−DreamPlug mostly used for non-networked communication be- tween computers and terminals. For communication SoC: Kirkwood 88F6281 A0 minicom DRAM: 512 MiB over uart we can use , serial communication SF: Detected MX25L1606 with page size 256, total 1 MiB software.