You are on page 1of 64

TECHNICAL SEMINAR REPORT On

CONFIGURATION OF LINUX ON ARM PROCESSOR AND MULTITASKING PROGRAMMING


BY P.ANURADHA 09F81A0462

Submitted to the Jawaharlal Nehru Technological University , Anantapur in partial fulfillment of the requirement for the award of degree of BACHELOR OF TECHNOLOGY IN ELECTRONICS AND COMMUNICATION ENGINEERING

Under the esteemed Supervision of M !. M. GNANA PRIYA" M.E." A!!#$%&'( P #)(!!# " ECE D(*& '+(n'

DEPARTMENT OF ECE
GOKULA KRISHNA COLLEGE OF ENGINEERING
,A))%-%&'(. '# /.N.T.U" An&n'&*0 &n. A** #1(. 23 A.I.C.T.E" N(4 D(-5%6

SULLURPETA" S.P.S.R.NELLORE DISTRICT" A.P. 7 824121


AP !" #$%&
%

ACKNO9LEDGEMENT
'otivation and inspiration provided by everybody has helped us in the successful completion of our pro(ect wor)* +e would li)e to ac)nowledge several people who helped us in this pro(ect wor) failing which it would not have shaped up the way it has today* +e are grateful to Sri '*N Satyanarayana, ,-', ../!S0"SS1 who spent his valuable time whenever requested and gave his full support for both technically and morally* +e convey our sincere than)s to our e2ternal guide 'rs* A*"atha, ,', "SS1 for her valuable guidance and suggestions planning and implementation of the pro(ect* +e convey our sincere than)s to 'r* 3*'urali / 'r* pro(ect duration* +e convey our sincere than)s to ,r*S*'*4*Narayana, '*Tech, Ph*,, '!5 Principal, -3.5 for being a source of inspiration* +e are gratified to than) ,r* -* .henchu )rishnaiah, '*Tech, Ph*,, 6ead of the ,epartment of 5lectronics and .ommunication 5ngineering for the )ind guidance* +e would e2press our sincere than)s to our internal guide 'rs* '*-nana priya, '*5*, Associate Prof, ,epartment of 5.5 for her )ind guidance and valuable suggestions throughout the pro(ect* +e e2tend our sincere than)s to all the staff of "SS1 division who gave their valuable suggestions and their ideas for this pro(ect* "ast but not the least we would li)e to than) our lab technicians for their )ind co7operation* amaprasad for their continuous support, which proved to be an e2cellent and invaluable asset throughout the

ABSTRACT
This pro(ect .onfiguration of "inu2 on A ' processor and multitas)ing programming aims to configure "inu2 on A '8 microcontroller, and perform multitas)ing li)e antenna control, control of liquid propellant filling etc* A '8 has software control architecture* "inu2 is an open source operating system in which source code can be altered according to user applications* 94-A base board is used for configuration* :ecause of the low power consumption and the growing number of features A '8 board is used to load "inu2* "T!: images were built using pac)ages li)e cvs, rpm, m&, tcl, bison, libncurses;7 dev*These images are dumped into the e2ternal memory and they are loaded into the NAN, flash which is located on the board* Then these "T!: images are booted using different procedures, which describes the behavior of the "!NU< Patch on A '8 based embedded designs that creates multitas)ing environment* The multitas)ing programming is performed based on pre7emption property* After porting the "inu2 on to A '8 microcontroller it is used for many applications* =ne of the ma(or applications is to control the liquid propellant filling in launch vehicles* "inu2 systems communicate with P".>s and these P".>s are placed in filling stations* Using P".>s the valves get opened then we fill propellants into second and fourth stages of launch vehicles* !f the proportion of the propellants increases then the valves will be opened* The main advantage of "inu2 systems is that it can control propellant filling, temperature and pressure simultaneously*

CONTENTS

&

T%'-(
A$;n#4-(.:(+(n' A2!' &$' T&2-( #) $#n'(n'! L%!' #) )%:0 (! L%!' #) '&2-(! C5&*'( 1 =rgani@ation profile

P&:( N#.
% %% %%% %1 1

C5&*'( 2

=verview of the pro(ect


#*% A ' Processor #*# "!NU< #*? ,ifference between "!NU< and other =S #*& Ubuntu C5&*'( < 4 14 18 22 24

"!NU< on A ' processor


C5&*'( 4

"!NU< target image builder


&*% !ntroduction &*# Start 4' ware appliance &*? .ustomi@e ubuntu &*& !nstallation of pac)ages C5&*'( 8 26 26 2= 28 <0

!nstalling "T!: and build the images

%%

C5&*'( 6

!nstalling images on =5' board


A*% :oard set up A*# "oad the u7boot from S, card A*? u7boot from UA T A*& :oot the u7boot A*; "oading the root file system and "!NU< )ernel C5&*'( = <2 << <4 <6 <6

Universal boot loader u7boot


C5&*'( 8

<= 40 44 46 80 82 ;

:oot options
C5&*'( 9

"inu2 devices
C5&*'( 10

'ulti tas)ing
C5&*'( 11

=utput C#n$-0!%#n B%2-%#: &*53 A**(n.%>?A

1. ORGANI@ATION PROFILE
1.1 ISRO The !ndian Space Program was formally initiated in %8B# by the government of !ndia with a view to provide impetus for the development and application of Space Technology and Space Sciences for the socio7economic benefits of the nation* !S = is a spearhead in !ndia>s space adventures, for space innovations, a separate department was founded named as ,epartment of Space* Under the policy standardi@ed by the ,=S, several sub organi@ations have been found and wor)ing on the intent,ma)ing !ndia as a leader in space innovations* 1.2 SDSC?SHAR Satish ,hawan Space .entre, S6A is located in Srihari)ota, Nellore ,istrict of Andhra Pradesh* !t is located on the 5ast .oast of !ndia at around C$ 3m north of .hennai, and is the launch station for all satellite launch vehicles to ta)e advantage of the earth>s rotation and other factor affecting the flight of a launch vehicle* This is a world7class spaceport with ma(or facilities li)e 4ehicle Assembly and Static Testing D4ASTE for testing and evaluating the roc)et motors*

"aunch

comple2es

containing

'obile

Service

Tower

D'STE

for

Assembly0!ntegration of PS"4 / -S"4 type of roc)ets* "aunch .ontrol .enter D"..E / 'ission .ontrol .enter D'..E for proper launch operations* !ST A. -round Station for .ommand* Precision Trac)ing A,A S, ange !nstrumentation facilities for real time data acquisition and processing* SP =: for preparation and casting of roc)et motors with solid propellant* oc)et / Satellite Telemetry, Trac)ing and

1.< LSSF The "SS1 D"iquid Propellant Storage Services and 1acilitiesE deals with various facilities to service and handle various )inds of roc)et stages Dsolid propelled, liquid propelled, .ryo propelled etc*E* These facilities have necessary infrastructure and procedures to safely handle the stages of roc)et and smoothly carry out the operations related to integration of launch vehicle, ma)ing the vehicle ready for launch, post launch activities li)e fire fighting and also to refurbish a roc)et stage in case of a launch call7off* All these activities require e2treme care in handling manually due to the ha@ardous and to2ic nature of the components held within them* The =rganisation aims at automating most of the operations at these facilities in order to perform these operations in a much safer and accurate manner and also to carry out the activities faster* This will lead to performing more number of launches in a year and also streamlines the way the operations are carried out*

2. OAERAIE9 OF PRO/ECT
!n this pro(ect, we use A '8 to load "!NU<* :ecause, A '8 has software controlled architecture and the "!NU< is an open source i*e*, the source code in the "inu2 distribution can be altered according to the user applications* !n order to load "!NU< at first we have to build images such as rootfs*(ffs, uboot*bin and uimages* These are also )nown as )ernel images* To build )ernel images we need to open ubuntu %#*$& with vmware player* +e should perform tas)s only on ubuntu root file* !n order to install the pac)ages that are downloaded we have to e2ecute the commands* The pac)ages used are m&, bison, tcl, rpm, libncurses;7dev, cvs* .vs is installed on ubuntu root file by specifying command as dp)g Fi pac)age name* Then we have to develop some server applications* These server applications are used to communicate between board and pc* !n these applications we have to run commands to build images* The uboot*bin image is dumped into S, card and then rootfs*(ffs and uimages are dumped into memory stic)* Now the board is made to communicate with pc by using tera term application* "P.?#;$ =5' :=A , uses com ports that are used for serial

communication* The 3ic)start bootloader should be started then the uboot*bin in S, card, uimage and rootfs*(ffs are loaded onto the board i*e*, on NAN, flash* Now the "!NU< is ready to use* Then the multitas)ing is performed where the tas)s are e2ecuted concurrently based on pre7emption property* "!NU< with A '8 has many applications such as antenna control, -S' modem, and ship controlling and also used to control liquid propellants in launch vehicles*

2.1 A + * #$(!!#
1rom the beginning Arm machines have reached to the e2pectation of their developers* !t was developed by Acorn .omputer "td, in %8C$>s* ,ue to the success of their platform they wished to move on from simple .'=S processors to something more powerful which could stand strong against the !:' machines launched in %8C%* There are solutions available in the mar)et such as 'otorola>s AC$$$* :ut the problem is that these are not powerful enough to handle graphics and -U!>s* 6ence the only option with the company is to ma)e their own processor* The company was inspired by the ma)ing of ?# bit processors by some undergraduates at :er)eley* +ith this inspiration they invented the Arm processors* The Arm pro(ect formally too) off in %8C?* They made 4"S! Technology as their silicon partner* The first processor core dubbed as A '%* This was delivered by 4"S! Technology in %8C;* This processor was used in the development of ne2t generation called A '#* These processors are suitable for very different )inds of application, and three profiles were therefore introduced to distinguish what targets they are adapted to

The GAG Application profile features powerful processors found in high7end products li)e smart phones, tablets, or net boo)s* The G G eal7time profile processors can be found* 1or e2ample in control units

for automotive systems or hard dis) drive controllers* They come with specific features suited to real7time environment constraints that allows for fast7 responding code and data* They also all have hardware support for integer division that would otherwise require software emulation*

The G'G 'icro7controller profile processors are smaller and used in numerous embedded systems li)e human interface devices, automotive control systems, power management systems, and others*

6ence in #$$B, 8CH of new cell phones sold had an A ' processor in it and now coming to #$$8, 8$H of all embedded ?#7bit processors was an A ' based*

2.1.1 ARM9 P #$(!!#


An A '8 processor is any of several ?#7bit !S. microprocessors developed by Advanced !S. 'achines "td* The A ' architecture was originally conceived by Acorn .omputers "td* in the %8C$>s* Since then, it has evolved into a family of microprocessors e2tensively used in consumer electronic devices such as mobile phones, multimedia players, poc)et calculators and P,A>S* A '8 has ;stage pipeline* 1etch, decode, e2ecute, memory, write* +ith this design generation, A ' moved from von Neumann architecture DPrinceton architectureE to 6arvard architecture with separate instruction and data buses, significantly increasing its potential speed* 'ost silicon chips integrating these cores will pac)age them as modified 6arvard architecture chips, combining the two address buses on the other side of separated .PU caches and tightly coupled memories* There are two subfamilies, implementing different A ' architecture versions*

%$

2.1.2 A**-%$&'%#n! #) ARM9 * #$(!!# !


%* .onsumer #* 'edical ?* Networ) control &* !ndustrial ;* .ommunications

2.1.< F(&'0 (! #) ARM9 * #$(!!#


%* ?# bit risc processor #* 6igh code densityDless memoryE ?* 6ardware debug technology &* "oad store architecture ;* !nline barrel shifter A* Thumb %A bit instruction set B* =rthogonal instruction set C* 5nhanced instructionsI dsp 8* "arge %AJ?# register file %$* 1i2ed opcode width of ?# bits to ease decoding and pipelining %%* Powerful inde2ed addressing mode* %#* 'ostly single7cycle e2ecution %?* 5nhanced power7saving design*

T5( +&%n *0 *#!( #) 0!%n: ARM9 & ( &! )#--#4!


%* #* ?* &* ;* A* B* ?#7bit performance compared to C7bit .omparable price +ealth of peripherals "arger memory 6igh level operating system support D "inu2, Android, +indows .5 E US: host support Advanced development tools

%%

C*

Advanced debugging

2.1.4 LPC<280 OEM B#& . S*($%)%$&'%#n

Processor 52ternal 1lash ,ata 'emory 5thernet .loc) .rystals ,imension Power .onnectors =ther

N<PGs A '8#A5J7S "P.?#;$ microcontroller in :-A pac)age %#C': NAN, 1"AS6 D%-bitE & ': SP!7N= 1"AS6 D?#'bitE A& ': ,, S, A' K #;A 3: internal %A7bit data bus to ,, S, A' %$$0%$' 5thernet interface based on National ,PC?C&C 5thernet P6L %?*$$$ '6@ crystal for .PU AA 2 &C mm ?*%;47?*?4 powering #$$ pos e2pansion connector Das defined in S=,!'' standardE, $*Amm pitch #;A 3bit !#. 5#P =' for storing non7volatile parameters M;"5,s M :uffered %A7bit data bus

T&2-( 2.1 S*($%)%$&'%#n! #) LPC<280 OEM B#& .

%#

F%:.2.1 BAGA B&!( B#& . C#+*#n(n'!

%?

2.1.8 C#+*#n(n'! #) LPC<280 OEM B#& .


Some of the components in "P.?#;$ =5' board, their drivers and how to use the peripherals from within "inu2 are as follows D%!*-&3

A ?*# inch 94-A color T1T "., display is mounted on the 94-A :ase :oard together with a Solomon Systech SS,%#C8 "., controller* The SS,%#C8 is attached to the SP! bus* The "P.?#;$ also has an embedded "., controller which is compatible with the A ' Prime.ell P"%%$*:oth the SS,%#C8 and "P.?#;$ "., controllers will be used* The SS,%#C8 will be used for initial initiali@ation of the display after a power7 cycle of the display* The frame buffer is e2posed to user space as a device file called 0dev0fb$* !t can be used directly by an application to output graphics onto the display, for e2ample, by memory mapping the file* A more common way is to use a graphical AP! such as 'icro windows, ,irect 1: or S," instead* :y default, functionality called Nconsole on frame bufferO and N:oot up "ogoO has been enabled* T#0$5 S$ ((n The touch screen controller mounted on the 94-A :ase :oard is a Te2as !nstruments TS.#$&A this is a ne2t7generation version to the A,SBC&A controller* The TS.#$&A is compatible with the A,SBC&A*The TS.#$&A controller is a low7voltage controller connected to the SP! bus with low power consumption and high speed Dup to %#; )6@E*There is an embedded touch screen controller on the "P.?#;$ microcontroller, but that isn>t used with the 5mbedded Artists "P.?#;$ =5' :oard* Tslib is an abstraction layer for touch screen panel events* The touch screen can be used only with some commands such as calibration, test*

%&

N('4# ; The "P.?#;$ has an 5thernet interface with a full featured %$ 'bps or %$$ 'bps

5thernet 'A. D'edia Access .ontrollerE* =n the 5mbedded Artists "P.?#;$ =5' :oard the 5thernet bloc) in the "P.?#;$ is connected to the off7chip National Semiconductor ,PC?C&C 5thernet P6L via the '!! interface* The 5thernet driver isn>t used directly from user space applications* !nstead the driver is used by the networ)ing subsystem in the )ernel and applications* These use a high7level interface such as a soc)et AP!* !n the 5mbedded Artists configuration the networ)ing interface is initiali@ed at start7up and given its !P address from the u7boot bootloader as a boot argument* This can chec) the !P address by using the ifconfig command* M(+# 3 C& . The "P.?#;$ has a Secure ,igital DS,E interface that conforms to the S, 'emory .ard Specification 4ersion %*$%* The ''.0S, card interface on the "P.?#;$ is compatible with the A ' Prime.ell ''.! P"%C$0%* !nsert an ''.0S, card in the ''.0S, card connector on the 94-A :ase :oard and then mount the card* The memory card should be 1AT formatted and then the uboot*bin is copied* USB H#!' The "P.?#;$ has an =pen 6ost .ontroller !nterface D=6.!E compliant US: host controller* =ne use7case of using US: host on an embedded system is to attach a US: memory stic) to the system and thereby adding a read7writable file system*

%;

%* Attach a US: memory stic) to the US: A connector on the base board* Now we can observe output in the console #* As can be seen in the log the US: memory stic) is available on sda%* ?* 'ount the memory stic)* &* Now the file system is ready to access* LED! &n. B0''#n! 'ost of the "5,s and buttons on the base board are connected to the P.A8;?# device* The N<P Semiconductor P.A8;?# device is a %A7bit !#. !0= 52pander* The files in the list below are accessible and each file represent a register in the P.A8;?#* !nput$7 This file reflects the state of the device pins Dinputs $ to BE* +riting to this file will have no effect* !nput%7 This file reflects the state of the device pins Dinputs C to %;E* +riting to this file will have no effect* "s$7"5, select $ controls "5, Doutput pinE $ F ?* "s%7 "5, selects % controls "5, Doutput pinE & F B* "s#7 "5, selects # controls "5, Doutput pinE C F %%* "s?7 "5, selects ? controls "5, Doutput pinE %# F %;* Psc$7 the PS.$ register is used to program the period of the P+'$ output* Psc%7 the PS.% register is used to program the period of the P+'% output* Pwm$7 the P+'$ register determines the duty cycle of :"!N3$* The outputs are "=+ D"5, onE when the count is less than the value in P+'$ and 6!-6 D"5, offE when it is greater* !f the value is set to $ the output is always 6!-6* pwm%7The P+'% register determines the duty cycle of :"!N3%* The outputs are "=+ D"5, onE when the count is less than the value in P+'% and 6!-6 D"5, offE when it is greater* !f the value is set to $ the output is always 6!-6* NAND F-&!5 The "P.?#;$ =5' :oard is equipped with a %-bit NAN, 1lash memory from Samsung* The part number for the memory is 381%-$CU$A*The "P.?#;$ %A

microcontroller has two NAN, 1lash controllers, one multi7level controller D'".E and one single level controller DS".E* =ne way of using the NAN, flash is to store the root file system and )ernel image in an 'T, partition*

%*?'6@ ?#*BAC 36@ .rystal

"P.?#;$

Parallel NAN, D?*?vE

%A7bit ,, , S, A' D%*CvE

SP! flash

Ad( 4core D"T.?&&BE

:uffers %*Cv74cc

5thernet

US: =TTransceiver

!#.7
E2PROM

5T6,US:, !#., -P!=, :uffered memory bus, Power etc F%:.2.2 B-#$; D%&: &+ #) OEM B&!( B#& . N<P Semiconductor designed the "P.?#;$ for embedded applications requiring high Performance and low power consumption* N<P achieved their performance ob(ectives using an A '8#A5J7S .PU core with a 4ector 1loating Point co7processor and a large set of standard peripherals, including US: !mplementation which has one ?# 3: !nstruction .ache and one ?# 3: ,ata .ache* 1or low power consumption, the "P.?#;$ ta)es advantage of N<P SemiconductorGs advanced technology development that is software controlled architecture* The "P.?#;$ also includes %#C to #;A 3: of on7 %B

chip static

A', a NAN, 1lash interface, an 5thernet 'A., an "., controller that

supports STN and T1T panels, and an e2ternal bus interface that supports S, and ,, S, A' as well as static devices* !n addition, the "P.?#;$ includes a US: #*$ 1ull Speed interface, seven UA Ts, two !#. interfaces, two SP!0SSP ports, two !#S interfaces, two single output P+'s, a motor control P+', and four general purpose timers with capture inputs and compare outputs, a Secure ,igital DS,E interface, and a %$7bit A0, converter with a touch screen sense option*

F%:.2.< In'( )&$%n: LPC<280 4%'5 ARM9 C#n' #--(

%C

2.2 LINUX
"inu2 is an open source system running on all ma(or processor architectures including arm processors* "inu2 is a very dynamic and fast moving operating system* The "inu2 open source operating system, or "inu2 =S, is a freely distributable, cross7 compiled operating system based on Uni2 that can be installed on P.s, laptops, netboo)s, mobile and tablet devices, video game consoles, servers, supercomputers and more* The "inu2 =S is frequently pac)aged as a "inu2 distribution for both des)top and server use, and includes the "inu2 )ernel that is core of =S* Popular "inu2 =S distributions include ,ebian, Ubuntu, 1edora, and ed 6at* "inu2 allows developing and testing UN!< software on P., including database and < applications* +ith "inu2 we can run UN!< system and can be modified according to user applications* "inu2 has an e2cellent price7performance ratio, is one of the most stable and powerful operating systems available, and because of its =pen Source nature*

2.2.1 L%n0> * #*( '%(!


There are many properties for linu2 among them the ma(or properties are

L%n0> %! ) ((C "inu2 can be downloaded from the !nternet completely for free* The license commonly used is the -NU Public "icense D-P"E* -NU Public "icense allows the user to ma)e changes in linu2 and re7distribute it*

L%n0> %! *# '&2-( '# &n3 5& .4& ( *-&')# +C Since linu2 is freely available and has a nature of open source it can be installed on any hardware* Thus linu2 is portable to any hardware platform devices*

%8

L%n0> 4&! +&.( '# ;((* #n 0nn%n:C As compared with UN!< linu2 has an advantage that it will not reboot every time* So, it can perform number of tas)s at a time with out user control* This property ma)es the linu2 system )eep on running*

L%n0> %! !$&-&2-(C 1rom a Palmtop with # ': of memory to small byte storage with hundreds of nodes adds or removes the appropriate pac)ages and "inu2 fits all* !nstead of supercomputers we can use linu2 to perform higher tas)s using building bloc)s provided with the system* +e can also perform little tas)s, such as ma)ing an operating system for an embedded processor using linu2*

T5( L%n0> OS 5&1( 1( 3 !5# ' .(20:?'%+(C Since it is having a nature of changing and re7distribution mostly the errors are reduced* !f we run any program on linu2 it ta)es very short time to detect errors* :ecause of this property time is saved*

2.2.2 LINUX A.1&n'&:(! L#4 $#!'C -NU Public license provides free download that is installed on any system without any e2ternal license which reduces cost* As soon as the installation is completed we can wor) on it immediately* The linu2 =S which we installed is genuine one that will not e2pires* P( )# +&n$(C "inu2 provides persistent high performance on wor)stations and on networ)s* !t can handle unusually large numbers of users simultaneously, and can ma)e old computers sufficiently responsive to be useful again* F-(>%2%-%'3I "inu2 can be used for high performance server applications, des)top applications, and embedded systems* +e can save dis) space by only installing the components needed for a particular use* +e can also restrict the use of specific computers by installing* 1or e2ample only selected office applications instead of the whole suite* C#+*&'%2%-%'3C !t runs all common UN!< software pac)ages and can process all common file formats*

#$

C5#%$(I The large number of "inu2 distributions gives us a choice* 5ach distribution is developed and supported by a different organi@ation* +e can pic) the one according to user applications*

F0-- 0!( #) 5& . .%!;I "inu2 continues wor) well even when the hard dis) is almost full* M0-'%'&!;%n:I "inu2 is designed to do many things at the same time* e*g*, a large printing (ob in the bac)ground won>t slow down other wor)s* S($0 %'3C "inu2 is one of the most secure operating systems* N1irewallsO prevent access by unwanted visitors or viruses* "inu2 users have an option to select and safely download software, free of charge, from online containing thousands high quality pac)ages* No purchase transactions requiring credit card numbers or other sensitive personal information are necessary* Today the combination of ine2pensive computers and free high7quality "inu2

operating systems and software provide incredibly low7cost solutions for both basic home office use and high7performance business and science applications* The available choices of "inu2 distributions and "inu2 software may be overwhelming at first*

2.2.< C0 (n' A**-%$&'%#n #) L%n0> S3!'(+!


'icrosoft is mainly used in many applications, so plenty of alternatives have been started to ma)e "inu2 an appropriate choice by providing an easy user interface and 'S compatible office applications li)e word processors, spreadsheets, and presentations* =n the server side, "inu2 is used as a server for companies li)e Ama@on, the well7)nown online boo)shop, US Post =ffice, the -erman army because of its stable and reliable platform* 5specially !nternet providers and !nternet service providers have grown fond of "inu2 as firewall, pro2y7 and web server* -roup of "inu2 machines are used in the creation of movies such as PTitanicP, PShre)P and others*

#%

The modern "inu2 not only runs on wor)stations, mid7 and high7end servers, but also on PgadgetsP li)e P,AGs, mobiles, e2perimental wrist watches* This ma)es "inu2 the only operating system in the world covering such a wide range of hardware*

2.2.4 LINUX B##' P #$(!!


+hen the "inu2 )ernel loads, it starts a single user process* !nit* The init process in turn is responsible for starting all other user processes* This ma)es the "inu2 boot process highly configurable* The init process reacts to changes in run level* un levels define operating modes of the system* 52ample includes Nsingle user modeO, Nmulti7user mode with networ)ingO, NrebootO and Npower offO* !n ,ebian0-nu "inu2, the default run level is run level #* =ther "inu2 distributions and other Uni27li)e systems may use different default run levels* The actions ta)en by init when the run level changes are defined in the init tab file* The default configuration in most "inu2 distributions is to use something called NSystem 4 initO to manage user processes* +hen using System 4 init, init will run all scripts that are stored in a special directory corresponding to the current run level*

##

2.< M&%n D%))( (n$(! 2('4((n L%n0> D 9%n.#4! O*( &'%n: S3!'(+! 1. F0-- &$$(!! 1!. n# &$$(!!
Accessing the source code is the most significant difference between "inu2 and +indows* The fact that "inu2 belongs to the -NU Public "icense ensures that users access the code to the )ernel that serves as the foundation of the "inu2 operating system*

2. L%$(n!%n: ) ((.#+ 1!. -%$(n!%n: (!' %$'%#n!


+ith the -P", we can download a single copy of a "inu2 distribution and install it on as many machines according to our requirement* :ut we can>t download a single copy of an application and install it on many machines using 'icrosoft license* i*e*, if we purchase %$ licenses, we can legally install that operating system on only %$ machines using 'icrosoft license* <. C#++&n. -%n( 1!. n# $#++&n. -%n( !n "inu2 operating system the command line will always be an invaluable tool for administration purposes* !t is possible to use the command line with +indows, but not nearly to the e2tent as with "inu2* And 'icrosoft tends to obfuscate the command prompt from users* i*e*, in +indows, the .ommand Prompt e2ists to provide direct communication between the user and the operating system*

4. C(n' &-%E(. 1!. n#n$(n' &-%E(. &**-%$&'%#n %n!'&--&'%#n


+ith "inu2 we have a centrali@ed location where we can search for, add, or remove software* 1or e2ample in pac)age management systems, such as Synaptic we can #?

open up one tool, search for an application , and install that application without having to do any +eb searching * +indows has nothing li)e this* +ith +indows, we must )now where to find the software we want to install, download the software, and run setup*e2e or install*e2e*

8. F-(>%2%-%'3 1!. %:%.%'3


"inu2 supports fle2ibility* for e2ample, the des)top* +ith "inu2, we can ma)e the des)top loo) and feel e2actly how we need* !n +indows what 'icrosoft has declared is the ideal des)top unless we install a third7party application that can alter the des)top appearance*

6. In!'&--&'%#n
"inu2 )ernels in most distributions include the ma(ority of drivers available as modules* They are loaded at boot without user interaction* 'ost drivers are included in the )ernel source tree moreover there are several manufacturers which distribute proprietary drivers* The +indows installation media usually contains enough drivers to ma)e the operating system functional* To this end, PgenericP drivers may be used to provide basic functionality* Almost all "inu2 distributions now have a live ., that may be used for testing, install or recovery* !n +indows, live ., may be installed through the +indows Pre installation 5nvironment or :artP5* !n "inu2, 'ost file systems support resi@ing partitions without losing data* "4' provide dynamic partitioning* !n +indows, e2panding NT1S partitions is possible without problems*

=. S'&2%-%'3
!n "inu2, there are several indirection levels since all applications are separated from the graphic subsystem which itself is detached from the "inu2 )ernel* As a result of #&

that most device drivers are integral parts of the "inu2 )ernel, it almost never crashes* +indows operating systems based on the NT )ernel are technically much more stable than some older versions, as these older versions do not properly protect the )ernelGs data structures*

8. P( )# +&n$(
"inu2 )ernel #*A once used a scheduling algorithm favoring interactive processes* !nteractive is defined as a process that has short bursts of .PU usage rather than long ones* NT7based versions of +indows use a .PU scheduler based on a multilevel feedbac) queue, with ?# priority levels defined* The )ernel may change the priority level of a thread depending on its !0= and .PU usage and whether it is interactive

9. S($0 %'3
!n "inu2, anti7malware tools such as .lamA4 and Panda SecurityGs ,es)top Secure e2ist* =nce malicious software is present on a +indows7based system, it can sometimes be incredibly difficult to locate and remove* !n "inu2, .laims its platform is more secure because all of its code is reviewed by so many people and then the bugs are detected* Anyone with programming e2perience is free to fi2 bugs and submit them for inclusion in future releases and updates* !n +indows, .laims its platform is more secure because of a comprehensive approach to security using the Security ,evelopment "ifecycle* 6owever because +indows is closed7source, only 'icrosoft7employed programmers can fi2 bugs* !n "inu2, users typically run as limited accounts, having created both administrator and at least one user account during installation* !n +indows 4ista, all logged7in sessions run with standard user permissions, preventing malicious programs from gaining total control of the system*

#;

2.4 UBUNTU
Ubuntu is a free and open source operating system based on the ,ebian "inu2 distribution, developed by Ubuntu 1oundation* Ubuntu is composed of many software pac)ages, the vast ma(ority are distributed under a free software license* The only e2ceptions are some proprietary hardware drivers which are needed to safeguard every individual freedom to use the =S* Ubuntu focuses on usability, security and stability* The Ubiquity installer allows the program to be installed to the hard dis) from within the "ive ., environment, without the need for restarting the computer* !t also emphasi@es accessibility and internationali@ation to reach as many people as possible* Ubuntu also comes installed with a wide range of software that includes =pen=ffice*org, 'o@illa 1irefo2, 5mpathy !', Transmission, -!'P and lightweight games such as Sudo)u and .hess* Additional software that is not installed by default can be downloaded and installed using the Ubuntu Software .enter or pac)age manager synaptic* Ubuntu can also run many programs designed for 'icrosoft +indows such as =ffice, through +ine or using a 4irtual 'achine such as 4'ware +or)station or 4irtual :o2* Ubuntu has earned a reputation for being one of the easiest "inu2 distributions to install and use* Ubuntu %#*$& is a long7term support version* This means that it will receive security updates for five years, ma)ing it ideal if we donGt want to )eep upgrading every si2 months*

#A

Ubuntu %#*$& includes the latest version of the Unity interface* =pinion seems to be quite divided over Unity but itGs worth persevering with even if we donGt li)e it at first* The equivalent of the Tas)bar is displayed down the left7hand side of the screen and the icon with the Ubuntu logo wor)s as the Start button* .lic) on this button and start typing to find programs and documents* There are icons that appear so you can browse for software if you are unsure what it is called* Programs are arranged by categories so they should be easy to find* Ubuntu =ne is an online storage service provided with Ubuntu* Sign up is free and comes with ;-: of storage* 52tra storage can be bought as required* There are also versions of the synchroni@ation software for +indows and !=>S devices so it holds up well against competition from the li)es of ,rop bo2* 5mail and internet browsing are provided by Thunderbird and 1irefo2 respectively* !f we want a different browser, it is also possible to install .hromium, the open7source version of -oogle .hrome, through the Software .entre* The =pera browser is also available for Ubuntu* The Software .entre is the primary means of installing software on Ubuntu* Unli)e Add0 emove Programs in +indows it is lin)ed to the Ubuntu servers and we can search for software to install* 'ost of the software is free but some commercial apps and games are starting to appear as well, including the rather fun +orld of -oo* This download is an !S= file that can be used to ma)e an Ubuntu installation disc using the !S= burner tool built into recent version of +indows or a program such as :urn aware* There are two different ways to install Ubuntu* The easiest is to do so from within +indows using the +ubi installer on the disc* A window will appear to select the dis) to install Ubuntu onto and how much space should be used* =ther options include setting up the main user account with a password* .lic) on !nstall and let +ubi get on with it* The computer will be rebooted and the installation will finish automatically* The big

#B

advantage of this system is that you can remove Ubuntu using the Add0 emove Programs tool in .ontrol Panel in +indows* A +ubi installation of Ubuntu can sometimes be sligthly slower than a normal installation, so if we don>t plan on uninstalling Ubuntu, a normal installation is best* estart the computer with the disc in the drive and tell the computer to boot from it* There is a choice between running the disc as a "ive ., and (ust starting the installation straight away* +eGd probably opt for the latter (ust to chec) the internet connection is wor)ing as this ma)es life easier* Ubuntu is a great operating system that is fast, even on older computers* !t can be used to give a new lease of life to older computers but is still a good alternative or accompaniment to +indows* +e have both on some of our computers, and Ubuntu is much more convenient when wanting to quic)ly chec) some information on the internet*

#C

<. LINUX ON ARM9 PROCESSOR ,LPC<280 OEM BOARD6


!t is a much simpler microcontroller with a light weight =S* This will cut the hardware costs on the .PU and can li)ely run something li)e this without e2ternal A' or flash* The hardware is cheapest as there will be very little stress in the processing applications which allow us to get away with minimum processing power and memory* !n order to load arm8 board with we need to prepare the images such as uboot*bin, uimage, rootfs*(ffs#* This can be created in either ubuntu or fedora by installing some pac)ages on it* These pac)ages are loaded on to the NAN, flash then they are booted by running some commands* There by linu2 is installed on A '8*

K(3 2(n()%'! #) -%n0> #n & + * #$(!!#

.omplete scalable operating system providing a reliable multi7tas)ing environment* :ased on an open source model D-P"E* "everage a wide range of UN!< and open source applications* 5arly availability on A ' processor7based platforms* Used in many A ' technology7based designs including networ)ing and wireless space* :road support through open discussion forums*

F(&'0 (!
The "inu2 "P.?#;$ :SP has the following )ernel featuresI

Several stable "inu2 )ernel ports plus a mainline accepted port* Support for most of the "P.?#;$ peripherals*

#8

Support for most commercially available boards* 4ideo and audio support* 6ardware floating point support* 1ull power management support* U7boot boot loader*

U7boot and the "inu2 )ernel are available through a number of different methods* ,evelopers can pull updates from a -!T server, download comprehensive patches with all the changes to date, or use automated build tools to automatically download and install the patches*

S'# &:( &n. 2##' .(1%$(!


NAN, 1"AS6 SP! N= 1"AS6 S, .ard US: SATA

M(+# 3

,, #0,, ? S, A', ?#7bit S".0'".0T".0,, NAN,

C#nn($'%1%'3

US: #*$ .S!, TS S, .ard ?*$ %$0%$$ 5thernet controller .AN bus, DA%$ onlyE :uilt7in SATA #*$ !nterface !Q., SP,!1 and A.8B audio interfaces PS#, SP! , T+! and UA T

?$

4. THE LINUX TARGET IMAGE BUILDER


4.1 In' #.0$'%#n "inu2 Target !mage :uilder is a tool that is used to build "inu2 target images, composed of a set of pac)ages* The "inu2 Target !mage :uilder D"T!:E system will be used to build the u7boot, "inu2 )ernel and root file system* "T!: ease the build and deployment process of several components needed in a "inu2 system* :esides the bootloader and )ernel a lot of needed utilities, modules and libraries are included and will be configured and built automatically by "T!:* Now we have to install "T!: and all necessary pac)ages in a "inu2 distribution* +e have to download the "inu2 distributions as 4'ware virtual appliances and run it in a 4'ware Player* 4.2 D#4n-#&. &n. S'& ' '5( AM4& ( A**-%&n$( ,ownload Ubuntu %#*$& as a 4'ware appliance* +hen it was downloaded it will be in a compressed form it was pac)ed in a tar7g@ compressed file named ubuntu%#*$&des)top*tg@* +e should use B7Rip to unpac) the file* This also must be downloaded* !n order to use the 4'ware appliance we need to install 4'ware Player* ,ownload the 4'ware player and follow the instructions to install the player* Unpac) the ubuntu%#*$&des)top*tg@ file in a location of our choice* Now double7clic) the ubuntu%#*$&des)top*vm2 file to start the 4'ware Player* !f 4'< files haven>t been associated with 4'ware Player we can start 4'ware Player

?%

manually and then select the =pen command and locate the 4'< file* +hen Ubuntu has started we will see a "ogin dialog where we can choose which user to login, 5nter NuserO as the user and NpassO as the password*

F%:.4.1 U20n'0 L#:%n S$ ((n

4.< C0!'#+%E( U20n'0


:y default the )eyboard layout is a US "ayout* !f we have a different )eyboard layout change it by following these instructions* a* -o to the System S Preferences S 3eyboard menu* b* .lic) on the "ayouts tab* c* .lic) the NAddO button* d* Select your )eyboard layout and clic) the NAddO button* e* Select which layout to be the default layout* Lou can also remove the layouts you don>t intend to use* ?#

f* .lic) the N.loseO button* A user with name NuserO has already been added to the system which means that we don>t have to add this user* !f you would li)e to change the password for this user, use the passwd command* a* =pen a terminal application from Applications S Accessories S Terminal* b* un the passwd command as illustrated below and enter the password of our choice when as)ed for it !t should be made sure that we have networ) access by activating the networ) device in 4'ware Player* !t should be connected and of type N:ridgedO* The user NuserO has been added to the admin group which by default has been given administrative rights in the sudoers file* "T!: requires additional rights to be added for this user more specifically a password may not be requested when using the rpm command* a* Start the visudo tool to edit the sudoers file* b* At the end of the file add the necessary commands and save the file* A terminal application is used often and it is therefore convenient to add shortcuts on the des)top and panel for the terminal application* a* -o to Applications S Accessories* b* ight7clic) on Terminal and select NAdd this launcher to panelO* c* ight7clic) again on the Terminal and select NAdd this launcher to des)topO* .hange screen resolution* The default resolution is quite low* .hange it li)e thisI a* -o to System S Preferences S ,isplay* b* Select the esolution you want* c* .lic) the Apply button*

4.4 In!'&-- N($(!!& 3 P&$;&:(!


"T!: will require a number of pac)ages to be installed in our "inu2 distribution before we can actually use "T!:* !f these pac)ages haven>t been installed "T!: will usually complain and list the pac)ages that are missing* "T!: could also fail without

??

listing any pac)age* The instructions below install the pac)ages that are missing in the Ubuntu distribution we are using* %* !nstall a .4S client in order to chec)out "T!: files* #* A few other pac)ages are also needed by "T!:* ?* !nstall the necessary pac)ages by using the instructions* dp)g Fi pac)age name* 4.4.1 S('0* & TFTP S( 1( The T1TP server can be used to transfer files to the target board, for e2ample, download the )ernel image by the u7boot* %* !nstall a T1TP server* #* =pen the configuration file* ?* 'odify the tftp line so that it loo)s li)e below* The last part of the line is where the T1TP server will have its root directory* +e set this to 0home0user &* estart by using reset command ;* The T1TP server is now ready to be used* 4.4.2 S('0* &n NFS S( 1( An N1S Dnetwor) file systemE mounted root file system is quite convenient to use during development of a "inu2 system* The actual root file system will then be located on the development computer and not on the target board, but the target board gets access to the file system using the N1S protocol* %* !nstall the N1S server* #* Add command to the 0etc0e2ports file* ?* After setting up the 0etc0e2ports, e2port the shares*

?&

8. INSTALLING LTIB AND BUILDING THE IMAGES


"T!: is installed, by selecting the configuration applicable for the 5mbedded Artists "P.?#;$ =5' :oard is started where the u7boot, "inu2 )ernel and root file system were started* The following steps have been followed %* =pen a web browser and go to httpI00ltib*org* #* .lic) on the ,ownload lin) in the left menu* ?* !n case of N9uic) installO a lin) to the netinstall*t2t file was found* Then we should ight7clic) on that file and save it in the home directory* &* =pen up a terminal application and run the net install script* ;* +e have to select TL> to continue the installation* A* .lic) 5nter to use the default installation directory* B* +hen "T!: files have been downloaded change directory* C* Now start the "T!: configuration* The first time we run the configuration it will ta)e quite a long time since a lot of pac)ages must be downloaded* 8* After a while a configuration menu will appear* Then we have to hit 5nter to select Platform* %$* Now in the Nplatform choiceO menu selects N5mbedded Artists "P.?#;$ =5' :oard with the N<P "P.?#<< So.O* %%* .lic) the N52itO button* %#* +e have to select NLesO when as)ed to save the configuration* %?* A new configuration menu will appear* 1or now (ust clic) the 52it button and go with the default configuration* %&* Select NLesO when as)ed to save the configuration* "T!: will now download necessary pac)ages, build u7boot, build the "inu2 )ernel and create a root file system* %;* !f everything builds successfully some commands will be appear on the tera term* %A* +e will find the "inu2 )ernel and u7boot images in the boot directory* %B* The J11S# formatted root file system image will be located in the ltib directory*

?;

%C* "ocate the root file system* %8* .opy the images to the 0home0user directory ensuring that they are accessible by the T1TP server* #$* To be able to use the touch screen the device table file must be altered* :y default this file does not enable the input0events device files* Lou can s)ip this step and instead create the device files in runtime* #%* "ocate the line starting with NU0dev0input0eventO and uncomment that line ##* Save the file and then force a recompile of the root file system* #?* Now it>s ready to deploy the "inu2 system to the target board*

?A

6. INSTALLING IMAGES ON OEM BOARD


un the prebuilt images of u7boot, "inu2 )ernel and root file system* The prebuilt images are as follows M u7boot*bin F The Universal :ootloader, )nown as u7boot for short* M u!mage F The "inu2 )ernel image* M rootfs*(ffs# F A J11S# formatted root file system to be stored in NAN, flash* Along with these images we also need a US: memory stic) and an ''.0S, card* A terminal application is also required as an interface towards the board* These all instructions will run on the Tera Term terminal application* 6.1 B#& . !('0* The board is setup and S%" is booted then the following steps have been followed %* .opy the u7boot*bin file to the root directory in a 1AT formatted ''.0S, card* #* .opy the u!mage and rootfs*(ffs files to the root directory of a US: memory stic)* ?* !nsert the ''.0S, card in the ''.0S, card slot on the 94-A :ase board* &* !nsert the US: memory stic) in the US: A connector* ;* .onnect the US: cable that came with the board to the US: mini7: connector mar)ed UA T U$* Also ma)e sure that the cable is connected to your computer* A* The board will now power up* 1ollow the instructions in the User>s 'anual for the "P.?#;$ =5' :oard to install necessary 1T,! US: drivers and identify which .=' port that was assigned to the board* B* Start your terminal application and connect to the .=' port associated with the board* 'a)e sure the automatic !SP (umpers Dmar)ed ST and P#*%$ on the base boardE are open* !f not it>s possible that a terminal application resets the board* C* eset the board by pressing the eset button* The S%" bootloader will boot* 8* Now the board is ready to load the u7boot*

?B

'emory stic) slot

S,card slot UA T U$

F%:.6.1 T#* *& ' #) BAGA 2&!( 2#& .

F%:.6.2 S1L B##' -#&.( 6.2 L#&. '5( 0?2##' F #+ MMCFSD C& . The u7boot is loaded from the memory card and store it in the NAN, flash on the target board then the following steps have been followed* D!f we don>t have accesses to an ''.0S, card load the u7boot from UA T instead*E

?C

%* "oad the u7boot*bin file from the ''.0S, card to S, A' at address $2C?fa$$$$* #* Save the image to the NAN, flash by using a command nsave* ?* Setup the S%" bootloader to automatically load the u7boot* :y using the command aboot flash raw $2C?fa$$$$* &* Set the boot delay to # seconds* +ith Promt command* 6.< L#&. '5( 0?2##' F #+ UART 6ere the u7boot is loaded from UA T and stored it in the NAN, flash on the target board* The output is compared with the tera term terminal application* %* "oad from the UA T to S, A' at address $2C?fa$$$$* #* !n Tera Term Select the 1ile S Send 1ile menu alternative* ?* "ocate and select the u7boot*bin file* 'a)e sure the N:inaryO option is selected* A dialog will appear showing the progress when you have clic)ed the N=penO button* &* +hen the file has been transferred send a :rea) sequence with A"T7b to get bac) by giving command prompt* ;* Save the image to the NAN, flash using nsave* A* Setup the S%" bootloader in order to automatically load the u7boot* B* Set the boot delay to # seconds* C. Now the u7boot is ready to boot*

?8

F%:.6.< T( & '( +

F%:.6.4 ' &n!)( * #: (!! %n '( & '( +

&$

6.4 B##' '5( 0?2##' The u7boot has been loaded to the target and saved in the NAN, flash* Now the board is setuped with the u7boot* %* !ssue the boot command to start u7boot* #* As the boot command start running u7boot will automatically boot to stop that hit any )ey* ?* 5nter print in the u7boot console to see the u7boot environment that is variables such as !P address, 5thernet address, service ip, root path* &* !n order to test the networ) functionality in "inu2 it is compulsary to change the ipaddr variable to an !P address that is valid on networ)* ;* Now save your changes done to the environment* A* Now it is ready to load the root file system and "inu2 )ernel* 6.8 L#&. '5( R##' F%-( S3!'(+ &n. L%n0> K( n(The root file system Drootfs*(ffs#E is loaded from the US: memory stic) and stored in NAN, flash and also the "inu2 )ernel Du!mageE is loaded from the US: memory stic) and the )ernel is booted* %* The default u7boot environment has been prepared with a variable named updateSfs which will load the root file system and store it in NAN, flash* #* !f the root file system is stored in NAN, 1lash then load and boots the "inu2 )ernel* A variable named mtdboot is available in the default environment* This variable will setup the boot arguments to use a root file system in NAN, flash, load the )ernel and then boot it* ?* Now the output is observed on the terminal application when the )ernel boots* As shown in appendi2* &* Now the linu2 is ready to run*

&%

=. UNIAERSAL BOOT LOADER ? U?BOOT


The Universal :oot "oader also )nown as ,as U7boot or u7boot for short it is an open7source boot loader that supports a wide range of different architectures such as A ', PowerP., <Scale, 2CA,'!PS, .oldfire, AC), and 'icro:la@e* 'any board configurations have been made available, for each architecture, by an active community* The u7boot boot loader has actually become the most widely used boot loader on A ' based systems* :esides supporting a wide range of architectures the u7boot also supports a wide range of booting options* :elow is a list of some of these booting options 1rom 1lash memory Dfor e2ample N= or NAN,E 1rom a US: mass storage device 1rom an ''.0S, memory card 1rom a hard dis) or ., =' Using 5thernetI T1TP, :==TP, ,6.P or N1S Using a serial connection

A booting option means a location from where the u7boot searches for the )ernel image to load* !f a '.0S, card has been selected the u7boot will initiali@e the memory card controller and try to read the image from that device* C#n!#-( F En1% #n+(n' The u7boot supports a command line interface usually accessed via a terminal application, such as Tera Term* The terminal application is connected to the serial port associated with the development board* The command line interface allow to manually type in boot commands or update the environment variables that can be later used as boot options*

&#

C#++&n.! !t is possible to discover which commands are available by using the help command* +hen issuing the help command a list of all the available commands will be presented* These .ommands are the ones that have been selected to support when configuring the u7boot* !f more information is needed about a specific command, type NhelpO followed by the name of command* :elow is a list of some of the commands used to modify, list and e2ecute variables in the u7boot environment* Printenv F This command will print the u7boot environment* Setenv F This command is used to set the value of a variable* !f the variable doesn>t e2ist when calling setenv it will be created* !f calling setenv on a variable, but not specifying a value the variable will be deleted* Saveenv F This command will save any changes done to the environment and must be called after setenv has been used in order for the changes to be saved persistently* run F e2ecute the commands found in an environment variable*

N('4# ; R(-&'(. A& %&2-(! The u7boot environment contains a number of variables that are networ) related, i*e*, related to communication over a networ)* 'a)e sure these variables are correctly setup for your networ)* ethaddr F Specifies the 5thernet0'A. address that will be assigned to the development board* The address will also be forwarded to the "inu2 )ernel via the eaSethaddr argument in the boot argument list* ipaddr F Specifies the !P address that will be assigned to the development board* The address will be forwarded to the "inu2 )ernel via the ip argument in the boot argument list.

&?

serverip F This variable specifies the !P address of the T1TP server used when downloading images using T1TP* Set it to the !P address of the computer running your T1TP server* netmas) F ,efines a mas) used to divide your networ) into subnets* =n most office and home networ)s the netmas) is set to #;;*#;;*#;;*$ which means that the ? first octets of the !P address is fi2ed while the last can vary* B##' R(-&'(. A& %&2-(! The variables listed below are all related to the boot process* bootargs F usually contains settings for the console and where to find the root file system* bootcmd F This variable contains the boot commandDsE that will be run during auto booting* bootdelay F This variable defines the delay in seconds until an auto boot will ta)e place*Autoboot can be cancelled by hitting any )ey during boot*

&&

8. BOOTING OPTIONS
Setting up a booting option means specifying from which source the "inu2 )ernel should be loaded as well as specifying where to find the root file system* K( n(- ) #+ USB M(+# 3 S'%$; 'ost computers today have a US: connection and most operating systems support US: and have device drivers for US: mass storage devices* This ma)es it simple to use a US: memory stic) to transfer boot images from the development computer to the development board* 1or this purpose the usb and fatload commands are used to access the memory stic) and transfer the images to the development board* !n the default environment there is a variable named load)ernelSusb which illustrates how to load the )ernel from a US: memory stic)* %* 1irst the US: interface must be initiali@ed with the usb start command* #* Using the fatload command the )ernel image Du!mageE is then loaded via the US: interface, device $ and to load address specified by the loadaddr variable* ?* The final step is to stop the US: interface* K( n(- ) #+ TFTP S( 1( ,uring the development of "inu2 )ernel it is convenient to use the Trivial 1ile Transfer Protocol DT1TPE to download a newly created )ernel* The development cycle is much shorter* The tftpboot command is used when downloading images from a T1TP server* !n the default environment there is a variable named load)ernelStftp which illustrates how to load the )ernel from a T1TP server* &;

!f we need to load the )ernel from a T1TP server ma)e sure that the load )ernel variable contains the content of the load)ernelStftp variable* K( n(- S'# (. %n NAND F-&!5 The "P.?#;$ =5' :oard contains a large NAN, flash that can host the "inu2 )ernel for fast access without the need for a US: memory stic) or networ) access* :efore loading the )ernel from NAN, flash, the NAN, flash must be updated with the )ernel* 1or this purpose the default environment has been setup with a variable named updateS)ernel* %* The load)ernel variable is used by the updateS)ernel variable to load the )ernel to S, A'* #* The second step is to erase the part of the NAN, flash that will be used to store the )ernel* The offset into the NAN, flash as well as the ma2imum si@e of the )ernel is given by the variables nandS)ernelSoff and nandS)ernelSs@* ?* Now the )ernel image is loaded into NAN, flash* !n the default environment there is a variable named load)ernelSnand which illustrates how to load the )ernel from NAN, flash* The nboot command is used to load the )ernel from NAN, device $2$ and offset nandS)ernelSoff to S, A' at address loadaddr* R##' F%-( S3!'(+ NFS M#0n'(. ,uring the development phase of "inu2 system, it is easy to update the root file system without transferring the file system to the development board by using N1S DNetwor) 1ile SystemE* %* we should have N1S setup on the computer* #* Set the rootpath variable in the u7boot environment point to the location of e2ported root file system directory* ?* Use the nfsboot variable to boot "inu2* nfsboot variable will setup the bootargs variable in a way where "inu2 use an N1S mounted root file system*

&A

R##' F%-( S3!'(+ %n NAND F-&!5 The root file system can be stored in the large NAN, flash available on the "P.?#;$ =5' :oard* %* The first step is to update the NAN, flash with the root file system* Two variables have been setup to load the root file system from either a T1TP server or from a US: memory stic)* #* Set the loadrootfs variable to the content of either the loadrootfsStftp or loadrootfsSusb variable* ?* The updateSfs variable has been setup to update the NAN, flash with the root file system* 1irst the loadrootfs variable will be used to load the root file system to S, A'* Then the NAN, flash will be erased at the offset specified by nandSrootfsSoff and si@e specified by nandSrootfsSs@* Now load the file system to NAN, flash* &* To actually update the NAN, flash run the updateSfs variable* ;* Use the mtdboot variable to boot "inu2* 'tdboot variable will setup the bootargs variable in a way where "inu2 loo)s for the root file system in NAN, flash* R##' F%-( S3!'(+ #n MMCFSD C& . This describes how to load the root file system on an ''.0S, card* %* !nsert an ''.0S, card on the computer* !t will most li)ely be auto mounted and discover which device file it has been associated with* 1irst try using the mount command* #* Also use dmesg to locate the device file being used* +e also see that the si@e of the memory card is about ;$$ ': which is correct for our card* ?* Un7mount the memory card by using un7mount* &* un fdis) to edit the partition table on the memory card* ;* "ist the e2isting partition table using the p option* A* Use the d option to delete all partitions on the memory card*

&B

B* .reate a new partition using the n option* C* Select p to create a primary partition* 8* Select % for partition number* %$* Use default value for the first cylinder by hitting the 5nter )ey* %%* Use default value for last cylinder by hitting the 5nter )ey* %#* Select w to write the new partition table to the memory card* %?* 1ormat the memory card to an e2t# file system by m)fs*e2t#* %&* 'ount the memory card when it has been formatted* %;* .opy the root file system to the memory card* %A* Un7mount the memory card, remove it from the development computer and insert it in the development board* %B* :oot into the u7boot console and add an mmc boot variable* %C* un the mmcboot variable

U!( DHCP
!f we don>t want to assign a static !P address to the target board we can also use dynamically assigned !P addresses by using the ,6.P protocol* !n the u7boot we need to e2change the tftpboot command for the dhcp command to load the images using ,6.P* 1or the "inu2 )ernel we need to set the ip argument to dhcp instead of using a static !P address* %* :oot into the u7boot console and change the ipaddr variable to dhcp* #* .hange the load)ernelStftp and loadrootfsStftp variables* ?* Update the load)ernel and loadrootfs variables* &* :oot "inu2*

&C

9. LINUX DEAICES
DEAICE TYPESEAICE Types
,evices are characteri@ed based on their !0= mechanism .haracter ,evices :loc) ,evices Networ) ,evices =thers

C5& &$'( .(1%$(!


.haracter ,evices are devices which can be accessed as a byte stream* Just li)e a file in a file system, e2cept for not able to see) .onsole Serial ports Te2t terminals Parallel ports 'ost devices in real7time systems are character devices

B-#$; .(1%$(!
A bloc) device is one that can hold a file system 'ount a file system !0= is in units of bloc)s :loc) devices are see)7able* 6ence, involve significant overhead eal7time systems do not directly wor) with bloc) devices Any data to be logged is off7loaded to a non7real time Tas)

&8

N('4# ; .(1%$(!
Networ) devices follow message oriented !0= as opposed to stream oriented !0= of character and bloc) devices* Not mapped to a device file* :ut still are named* The AP! is based on soc)et AP!

O'5( ! .(1%$(!
US: devices are driven by a US: module from the US: subsystem .haracter device DUS: serial portE* :loc) device DUS: mass storageE* Networ) device DUS: N!.E*

;$

10. MULTITASKING
!n computing, multitas)ing is a method by which multiple tas)s, also )nown as processes, share common processing resources such as a .PU* +ith a multitas)ing =S, such as +indows <P, we can simultaneously run multiple applications* 'ultitas)ing refers to the ability of the =S to quic)ly switch between each computing tas) to give the impression the different applications are e2ecuting multiple actions simultaneously* As .PU cloc) speeds have increased steadily over time, not only do applications run faster, but =Ss can switch between applications more quic)ly* This provides better overall performance* 'any actions can happen at once on a computer, and individual applications can run faster* The concurrently running processes can represent different programs, different parts of a single program and different instances of a single program* The total number of processes that can run on the system at any time depends on several factors including the si@e of the memory, the speed of the .PU and the si@e of the programs* The linu2 on arm processor creates multitas)ing environment that is which e2ecutes multiple programs given by user* This e2ecution can be done in normal or priority basis according to the user applications* :eing able to do multitas)ing doesnGt mean that an unlimited number of tas)s can be (uggled at the same time* 5ach tas) consumes system storage and other resources* As more tas)s are started, the system may slow down or begin to run out of shared storage multiple processes e2ist for virtually the entire duration of a "inu2 session, even if no user

;%

application programs are running* The only e2ception is a very brief period during booting, when init, which is the first process to be created on a newly booted system, has not yet spawned additional processes*

P #: &+ 1
Uinclude Vsys0mman*hW Uinclude Vnative0tas)*hW Udefine TAS3SP != 88 0J 6ighest T priority J0 Udefine TAS3S'=,5 $ 0J No flags J0 Udefine TAS3SST3SR $ 0J Stac) si@e Duse default oneE J0 TSTAS3 tas)Sdesc%,tas)Sdesc#,tas)Sdesc?X 00three tas) bodies void tas)Sbody% Dvoid Jcoo)ieE Y int count Z $,iX int aZ#,bX 00N,for DiZ$XiV%$XiKKE Y bZaJiX printfDPtas) % is runing[n PEX 0J *** Pcoo)ieP should be NU"" *** J0 printfDP65 5 # into Hd[t bZHd[nP, countKK,bEX 00N,\ \ void tas)Sbody# Dvoid Jcoo)ieE Y int count Z $,i,aZ?,bX 00N,for DiZ$XiV%$XiKKE Y bZaJiX printfDPtas) # is runing[n PEX 0J *** Pcoo)ieP should be NU"" *** J0 printfDP65 5 # into Hd[t bZHd[nP, countKK,bEX 00N,\ \ void tas)Sbody? Dvoid Jcoo)ieE Y int count Z $,i,aZ#,b,cX 00N,for DiZ$XiV%$XiKKE Y bZ#JiX ;#

cZbKaX printfDPtas) ? is runing[n PEX 0J *** Pcoo)ieP should be NU"" *** J0 printfDP65 5 # into Hd[t bZHd[t the value of c is Hd[nP,countKK,b,cEX 00N,\ \ int main Dint argc, char Jargv]^E Y int errX mloc)allD'."S.U 5NT_'."S1UTU 5EX err Z rtStas)ScreateD/tas)Sdesc%,P'yTas)Name%P,TAS3SST3SR,TAS3SP !=, TAS3S'=,5EX if D`errE rtStas)SstartD/tas)Sdesc%,/tas)Sbody%,NU""EX 00rtStas)SinquireD/tas)Sdesc,/structSinfoEX printfDPTas) % is created and started [nPEX rtStas)ScreateD/tas)Sdesc#, P'yTas)Name#P, TAS3SST3SR, TAS3SP !=, TAS3S'=,5EX rtStas)SstartD/tas)Sdesc#,/tas)Sbody#,NU""EX rtStas)SstartD/tas)Sdesc?,P'yTas)name?P,TAS3SST3SR,TAS3SP !=,TAS3S'=,5 ,/tas)Sbody?,NU""EX \ void cleanup DvoidE Y rtStas)SdeleteD/tas)Sdesc%EX \

;?

P #: &+ 2
e2port A .6Zarm e2port . =SSS.='P!"5Zarm7linu27 e2port PAT6Za0pro(ects0buildroot0output0host0usr0binIbPAT6 cd 0home0user0pro(ects gedit multitas)ing*c U include Vstdio*hW int mainDvoidE Y PrintfDN6ello world from 5A`[nOEX return $X \ % =UTPUT U hello 6ello world from 5A`

;&

11. OUTPUT
This window shows the connectivity of board with pc using tera term application*

;;

After successfully porting "inu2 on A '8 board the "inu2 logo will appears as an output shown below

;A

CONCLUSION
.onfiguration of "!NU< =N A '8 provided multitas)ing environment and usage of this configuration leads to less cost* !t is mostly preferred because of its pre7 emption property, malware protection, and ruggedness* !ts usage of .PU is less* .onfiguration of "!NU< =N A '8 is used in many applications such as web cam, -S' modem, automobile brea) testing, antenna control, radars, memory card, mobiles, pac)et filtering firewall using net filters, control of liquid propellant filling, temperature and pressure simultaneously in launch vehicles* Since, it is a developing system it can be suitable for all real time applications* !n order to meet the future requirements the configuration of linu2 on A '8 can be converted into real time using two methods* The two methods are ,ouble )ernel method li)e 2enomai and converting )ernel into real time using patches i*e*, by adding timers to the )ernel*

;B

BIBLIOGRAPHY
]%^ Andrew sloss, ,ominic symes, .hris wright, NA ' system developers guideO* ]#^ 3arim yoghmour, => eilly, N:uilding "inu2 embedded systemsO* ]?^ .raig hallabaugh, +esley, N5mbedded "inu2 I hardware, software and interfacingO* ]&^ Alessandro rubini, => eilly, N"inu2 device driversO,third edition* ];^ obert love, Sams, N"inu2 )ernel developmentO* ]A^ P*-andham, NPorting the "inu2 )ernel to an A ' based development boardO* ]B^ Peter chubb, 5tinenne "esueur, N"inu2 internalsO* ]C^ -ernot )vas, N"inu2 on A 'O* ]8^ . :i, L "iu, N esearch of )ey technologies for 5mbedded "inu2 based on A 'O* ]%$^ 5manuele Acri, N52ploiting A ' "inu2 systemsO*

9EBSITES ]%^ httpI00 www*embeddedartists*com ]#^ httpI00www*linu2(ournal*com ]?^ httpI00www*linu27mag*com ]&^ httpI00www*embedded*com0shared0printable articles ];^ httpI00www*l2r*linu2*no

;C

APPENDIX?A ,B-#$; .%&: &+ #) OEM 2#& .6

B-#$; .%&: &+ #) OEM 2#& . SPI NOR F-&!5 There is a ?#'bit D& ':yteE N= flash connected to the SP! bus* I2C E2PROM There is a #;A 3bit 5#P =' accessible via the !#. interface D!#.%E* The "P.?#;$ has two on7chip !#.communication channels D!#.% and !#.#E* 'ore

;8

peripheral units are easily connected to the two7wire !#. bus, (ust as long as the addresses do not collide* The address of the #;A)bit 5#P =' is $2A$* 1.2A A.G0!'&2-( C# ( A#-'&:( The core %*#4 voltage is ad(ustable and is generated by the step down switching regulator "T.?&&Bfrom "inear Technologies* This regulator is capable of generating A$$mA, which also by far e2ceed the needed current by the "P.?#;$* This is a trade7off that is important for hand held0portable equipment* The "T.?&&B can generate voltages up to #4, which by far e2ceed the limits for the "P.?#;$* In*0' A#-'&:( The input voltage to the "P.?#;$ =5' :oard is given by the requirements of the "P.?#;$* The recommended input voltage range is ?*%;4 to ?*?4* E'5( n(' In'( )&$( An e2ternal P6L D,PC?C&C from National SemiconductorE implements a %$$0%$'bps 5thernet interface* The e2ternal P6L is connected to the 5thernet 'A. on the "P.?#;$ via the '!! interface* USB In'( )&$( There is a US: #*$ D=T-, 6ost and ,eviceE interface on the "P.?#;$* An e2ternal P6L D!SP%?$%E is needed for the .PU* B0))( ,uring read operations the buffer acts as an input and during write operations it acts as an output* The data bus buffer is controlled by the signals :"S$ and :"S%, each controlling lower and upper bytes of the %A7bit data bus* These signals are active when accessing the e2ternal static memory regions* The buffers are dual voltage buffers and act as level translators between the internal %*C4 signal levels and the e2ternal levels*

A$

APPENDIX?B ,LINUX COMMANDS6


"inu2 commands that have been commonly use is as follows T"oad image name raw $C2fa$$$$> to particular image on to the board* Tprompt time> to give time delay* Tnsave> to and for save changes Tsaveenv>* Tdp)g Fi paca)ge name> to install pac)ages* Tyum install tftp server> to install tftp server* Trun updateSfs> to run images on NAN, flash*

!nstallations of the pac)ages have been using the following commandsI b apt7get install cvs b apt7get install rpm b apt7get install m& b apt7get install libncurses;7dev b apt7get install bison b apt7get install tcl b apt7get install tftpd

A%

APPENDIX?C ,B#& . )(&'0 (! #n '( & '( + &**-%$&'%#n6


After running all the commands which are related to installation the output that was observed on tera term application is UU :ooting )ernel from "egacy !mage at C$%$$$$$ *** !mage NameI "inu27#*A*#B*C !mage TypeI A ' "inu2 3ernel !mage DuncompressedE ,ata Si@eI %A$##B# :ytes Z %*; ': "oad AddressI C$$$C$$$ 5ntry PointI C$$$C$$$ 4erifying .hec)sum *** =3 "oading 3ernel !mage *** =3 =3 Starting )ernel *** Uncompressing "inu2*************************************************************************** done, booting the )ernel* c"inu2 version #*A*#B*C DuserdbagvappE Dgcc version ?*&*;E U% P 55'PT 'on Sep #C $8I;%I&; .5ST #$$8 .PUI A '8#A5J7S ]&%$A8#A&^ revision & DA 'v;T5JE, crZ$$$;?%BB 'achineI 5mbedded Artists "P.?#;$ =5' board with the "P.?#;$ 'icrocontroller A#

'emory policyI 5.. disabled, ,ata cache writebac) .PU$I , 4!4T write7bac) cache .PU$I ! cacheI ?#BAC bytes, associativity &, ?# byte lines, #;A sets .PU$I , cacheI ?#BAC bytes, associativity &, ?# byte lines, #;A sets :uilt % @onelists in Rone order, mobility grouping on* Total pagesI %A#;A 3ernel command lineI rootZ0dev0mtdbloc)? rw rootfstypeZ(ffs# ipZ%8#*%AC*;*#?& eaSethaddrZ$$I%aIf%I$$I$$I$$ consoleZttyS$,%%;#$$nC *** mmc$I host does not support reading read7only switch* assuming write7enable* mmc$I new S, card at address eA#& mmcbl)$I mmc$IeA#& SU#;A #&B$&$3i: mmcbl)$I p% !P7.onfigI -uessing netmas) #;;*#;;*#;;*$ !P7.onfigI .ompleteI deviceZeth$, addrZ%8#*%AC*;*#?&, mas)Z#;;*#;;*#;;*$, gwZ#;;*#;;*#;;*#;;, hostZ%8#*%AC*;*#?&, domainZ, nis7domainZDnoneE, bootserverZ#;;*#;;*#;;*#;;, rootserverZ#;;*#;;*#;;*#;;, rootpathZ 41SI 'ounted root D(ffs# filesystemE* 1reeing init memoryI %$$3 init startedI :usy:o2 v%*%%*# DE starting pid #8A, tty GGI G0etc0rc*d0rcSG 'ounting 0proc and 0sys Setting the hostname to n2p 'ounting filesystems scsi $I$I$I$I ,irect7Access San,is) .ru@er C*$# P9I $ ANS!I $ ..S sd $I$I$I$I ]sda^ %;B$&$A? ;%#7byte hardware sectors DC$&$ ':E sd $I$I$I$I ]sda^ +rite Protect is off sd $I$I$I$I ]sda^ Assuming drive cacheI write through sd $I$I$I$I ]sda^ %;B$&$A? ;%#7byte hardware sectors DC$&$ ':E sd $I$I$I$I ]sda^ +rite Protect is off sd $I$I$I$I ]sda^ Assuming drive cacheI write through

A?

sdaI sda% sd $I$I$I$I ]sda^ Attached S.S! removable dis) scsi $I$I$I%I .,7 =' San,is) .ru@er C*$# P9I $ ANS!I $ mountI mounting usbfs on 0proc0bus0usb failedI No such file or directory Starting syslogd and )logd unning sysctl Setting up networ)ing on loopbac) deviceI Setting up networ)ing on eth$I 0etc0rc*d0init*d0networ)I line %&8I udhcpcI not found

A&

You might also like