Friendly ARM

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, 8 October 2013

Developing Linux OS for ARM - Part III

Posted on 23:21 by Unknown
Hello. I am back. Its really very long time to pen down where I have stop. I will continue with PART III of developing Linus OS for ARM.

As we already configure primary bootloader AR91Bootstrap in PART II. Its time to configure a secondary bootloader.

In most cases, U­Boot is the secondary bootloader, which is in charge of downloading kernel binaries from FLASH, SD/MMC, USB or ethernet and starting the kernel.

Download the secondary bootloader (U­boot). It can be downloaded
from the following link:

ftp://ftp.denx.de/pub/u-boot/


we will download the u­boot­1.3.4.tar.bz2 at the following path:

/home/sanket/Download/Embedded_Linux_Complete/Sources/u­boot.

Extract the same in the current directory.

Download u­boot patch provided by the AT91 community from the below mentioned link:

ftp://www.linux4sam.org/pub/uboot/u-boot-1.3.4-exp/u-boot-1.3.4-exp.diff

 
Creating a patch is a standard way of adding newly generated code to a large existing code base. It is created by comparing the updated code with the code base for which the patch is to be generated.

Save this to the ~/Embedded_Linux_Complete/Sources/u­boot/u­boot­1.3.4.

/u-boot-1.3.4$ ls

Apply it (patch) on top of the original u­boot in the following way:

/u-boot-1.3.4$ cat u-boot-1.3.4-exp.diff | patch -p1

Once the AT91 u­boot sources  are available, cross­compiling u­boot can be done in two steps : configuration and compiling. Note that both arm­elf­ and arm­linux­ ARM GCC cross­compiler types are suitable for u­boot building. We will use arm­none­-linux­-gnueabi­-gcc.

Here are the building steps for the AT91SAM9260EK board:

/u-boot-1.3.4$ make CROSS_COMPILE=/home/sanket/Download/Embedded_Linux_Complete/Package/GNU_GCC_toolchain/arm-2007q1/bin/arm-none-linux-gnueabi- distclean

distclean command removes the binaries and object files files that 'configure' created. Distclean is like make clean with the exception that make clean removes all the files created by make, where as distclean removes all files that are created by make config.

The U­boot can be made to reside on any of the following storage media: Data flash/NAND flash/NOR flash. In our case we are using the dataflash, but NAND flash can also be used since AT91Bootstap supports both. The AT91Bootstrap will pass the environment variables to U­boot while it tries to bring U­boot up.

So while we compile U­boot we will configure it for Dataflash.

/u-boot-1.3.4$ make CROSS_COMPILE=/home/sanket/Download/Embedded_Linux_Complete/Package/GNU_GCC_toolchain/arm-2007q1/bin/arm-none-linux-gnueabi- at91sam9260ek_dataflash_cs1_config

These environment variables includes the IP address setting of the host, the server from which U­boot would tftp to retrieve some packages and more. When U­boot is up and running on our board we will try and view all these environment variables.

NOTE: In our case, the software packages have been made to reside in the dataflash. In some cases, they might reside in NAND Flash or NOR flash. While compiling u­boot the environment variable location needs to be choosen accordingly. 

To compile u­boot after configuration,

/u-boot-1.3.4$ make CROSS_COMPILE=/home/sanket/Download/Embedded_Linux_Complete/Package/GNU_GCC_toolchain/arm-2007q1/bin/arm-none-linux-gnueabi- 

If the compilation goes well, a uboot.bin file would be generated in your current directory which would be ultimately flashed to the dataflash using a software utility called SAM­BA (Burning Application for SAM controllers).

Once the bootloader is in place, next step would be to build a kernel image. That we would be discussing in my next post.


continue................





Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Developing Linux OS for ARM - Part III
    Hello. I am back. Its really very long time to pen down where I have stop. I will continue with PART III of developing Linus OS for ARM. As ...
  • Developing Linux OS for ARM - Part II
    With the previous understanding of Part I, the first thing that you need to get is the toolchain. The toolchain might be available in source...
  • Developing Linux OS for ARM - Part I
    The first thing that you possibly need to do after getting your hardware ready is to install the necessary software packages and toolchain o...
  • Basic Operating System Overview
    One killer application of Linux is to be used as the operating system of an embedded system. ARM-based CPUs are killer partners of embedded...
  • Difference between ARM and Intel Processor
    The world of CPUs is a dark, deadly, and dangerous place. After all, the CPU is said to be the literal “heart” of the PC – and as such, it’...
  • Developing Linux OS for ARM - Part IV
    Bootstrap is in place ------- > Yes U-boot is in place      ------->  Yes Now its time to build kernel image, which will take­over con...
  • Deploying u-boot, Linux kernel and GPE onto Mini2440
      Before you start, you will need A mini2440 development board, with or without a 3.5"/7" LCD. A software called minicom on your P...

Blog Archive

  • ▼  2013 (2)
    • ▼  October (2)
      • Developing Linux OS for ARM - Part IV
      • Developing Linux OS for ARM - Part III
  • ►  2011 (3)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2010 (2)
    • ►  December (2)
Powered by Blogger.

About Me

Unknown
View my complete profile