Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

EmbeddedLinuxsystemdevelopment

Bootloaders

Bootloaders
Thebootloaderisapieceofcoderesponsiblefor
Basichardwareinitialization
Loadingofanapplicationbinary,usuallyanoperatingsystem
kernel,fromflashstorage,fromthenetwork,orfromanother
typeofnonvolatilestorage.
Possiblyuncompressionoftheapplicationbinary
Executionoftheapplication
Besidesthesebasicfunctions,mostbootloadersprovideashell
withvariouscommandsimplementingdifferentoperations.
Loadingofdatafromstorageornetwork,memoryinspection,
hardwarediagnosticsandtesting,etc.
2

Bootloadersonx86(1)
Thex86processorsaretypicallybundledonaboardwithanon
volatilememorycontainingaprogram,theBIOS.
ThisprogramgetsexecutedbytheCPUafterreset,andis
responsibleforbasichardwareinitializationandloadingofa
smallpieceofcodefromanonvolatilestorage.
Thispieceofcodeisusuallythefirst512bytesofanharddisk

Thispieceofcodeisusuallya1ststagebootloader,whichwill
loadthefullbootloaderitself.
Thebootloadercanthenofferallitsfeatures.Ittypically
understandsfilesystemformatssothatthekernelfilecanbe
loadeddirectlyfromanormalfilesystem.
3

Bootloadersonx86(2)

GRUB,GrandUnifiedBootloader,themostpowerfulone.
http://www.gnu.org/software/grub/
Canreadmanyfilesystemformatstoloadthekernelimage
andtheconfiguration,providesapowerfulshellwithvarious
commands,canloadkernelimagesoverthenetwork,etc.
LILO,theoriginalLinuxLoader
http://freshmeat.net/projects/lilo/
Syslinux,fornetworkandremovablemediabooting
http://syslinux.zytor.com

Bootloadersonembeddedarchitectures(1)
Onembeddedarchitectures,thelowlevelbootingprocessisveryCPUand
boarddependent
SomeboardshaveaNORflashfromwhichtheCPUstartsexecuting
instructionsafterreset.Inthatcase,thebootloadermustdirectlybeflashed
insidetheNORattheproperlocation
SomeCPUshaveanintegratedbootcodeinROMthatautomaticallyloadsa
smallportionofaDataFlashorNANDflash,usuallytoastaticRAM.Inthat
case,aminimalfirststagebootloaderisrequired,thatwillloadthemain
bootloader(BootROMonAT91SAMCPUs,SteppingstoneonS3C24xx
CPUs,etc.).
ThebootloaderonembeddedarchitecturesstartsrightafterCPUreset,soit
mustinitializeallthedevices,includingthememorycontrollerinordertoaccess
theDRAM.
AsthebootprocessisveryCPUandboarddependent,
refertothevendordocumentation.

Bootloadersonembeddedarchitectures(2)
Wewillfocusonthegenericpart,themainbootloader,offeringthe
mostimportantfeatures.
Thereareseveralopensourcegenericbootloaders
UBoot,theuniversalbootloaderbyDenx
ThemostusedonARM,alsousedonPPC,MIPS,x86,m68k,
NIOS,etc.Clearlythemostwidelyusedcommunitysolution.
http://www.denx.de/wiki/UBoot
RedBoot,basedonRedHateCos
http://sources.redhat.com/redboot/
uMon:MicroMonitorgeneralpurpose,multiOSbootloader
http://microcross.com/html/micromonitor.html
Therearealsoalotofotheropensourceorproprietary
bootloaders,oftenarchitecturespecific
6

EmbeddedLinuxsystemdevelopment

Accessingaserialconsole

Minicom(1)
Definition:serialcommunicationprogram
AvailableinallGNU/Linuxdistributions
Capabilities(allthroughaseriallink):
SerialconsoletoaremoteUnixsystem
Filetransfer
Modemcontrolanddialup
Serialportconfiguration

Minicom(2)
Startbyrunning
minicom -stosetup
Minicom
Abitaustereatfirstglance,
butquicklygetsfriendly
(seethelabsfordetails)

Otherterminalemulators
GTKTerm:http://www.jlsinfo.com/julien/linux/
Graphical.LesspowerfulthanMinicom,butwithasimplerand
moreattractiveinterface.Availableinrecentdistros.
CuteCom:http://cutecom.sourceforge.net/
Anothergraphicalanduserfriendlyterminalemulator.
Availableinrecentdistros.
picocom:http://freshmeat.net/projects/picocom/
Tinyterminalemulator(20K),canbeusedinembeddedsystems.
GNUScreen:canalsobeusedonaserialconsole:
screen <device> <baudrate>
Example:
screen /dev/ttyS0 115200
10

You might also like