Tuesday, March 15, 2011

Boot up the ARM board with initramfs and generic kernel

Hello everyone,
Today, I am going to explain that how you can boot up the ARM board manually with a generic kernel and initramfs that I made it last time. Please see my previous blog post for more details about initramfs and compiling the kernel.

These are the steps for booting up the board with short explanations:
  1. mmc init    ----------->After getting prompt with Uboot, this command gets your access to SD card
  2. fatload mmc 0 0x80200000 uImage.bin   -----------> This command loads the uImage.bin or uImage to that address in the memory. uImage is your compiled kernel.
  3. fatload mmc 0 0x81600000 uImage.ramdisk  -----------> To load initramfs to that address in memory. The addresses are in hexadecimal notation.
  4. setenv bootargs console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootfstype=ext2 eq rootdelay=1 nohz=off     ---------------> These are the boot args for kernel. When the kernel loads, it uses these arguments during the boot process. You can change the args according to your specification but  mine works with these args without any problems.
  5. bootm 0x80200000 0x81600000    -----------------> This will execute the kernel and initramfs in the memory, which we loaded in the steps 2 and 3, and you will get prompt to log in to the system.
That is all steps that you need to boot your board and get prompt for loging in. Here is a part of the output of my ARM board that shows booting kernel and loading initramfs from images that I already loaded in the memory:

Booting kernel from Legacy Image at 80200000 ...
Image Name: Linux-2.6.28-omap1
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2577980 Bytes = 2.5 MB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading init Ramdisk from Legacy Image at 81600000 ...
Image Name: boot initramfs
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 2631748 Bytes = 2.5 MB
Load Address: 81600000
Entry Point: 81600000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ... 
.
.
.
Regards,
Khosro Taraghi

Monday, March 7, 2011

SBR600 Project - Release 0.1 Update

Hi,
I updated my project (release 0.1) with recent news and accomplishments. Please click on this link Last Update to see the results.

All the best,
Khosro Taraghi 

Kernel Compilation For ARM

Hi,
Since I am trying to make an initramfs for my ARM board, I have to make modules for my hardware before doing anythings. For making modules, you have to compile the kernel. Here is a short explanation about how to compile the kernel for an ARM-based architecture and how to make modules. 
  1. First, download a source code. Here is a list of source code: Source code for kernels. I downloaded linux-2.6.28.1 because I want to add a newer version in my project. You can grab the last version.
  2. Extract compress file, for example, tar xjvf linux-2.6.28.1.tar.bz2 in my case
  3. Change to new directory like: cd linux-2.6.28
  4. Edit the Makefile and  change to the following:   ARCH ?= arm and CROSS_COMPILE ?= arm5tel-redhat-linux-gnueabi-  
  5. To allow a set of defaults to be selected for the particular machine that you are compiling the source for, you should find the proper confing file in arch/arm/configs/ directory. In my case, the proper file is arch/arm/configs/omap3_beagle_defconfig. Then you should run the following make command:    make omap3_beagle_defconfig
  6. After that, use make gconfig to open up the GUI configuration. This is a very useful command that you can customize everything, for example, you can choose to install a specific driver or ipv6 or so many other things.
  7. Compile the kernel source by following commands: 1) make clean 2)make ARCH=arm CROSS_COMPILE=/usr/armv5tel-redhat-linux-gnueabi/bin/ zImage      The zImage in a compress file. you can use uImage instead if you do not want to compress the kernel. In my case, the path to compiler was /usr/armv5tel-redhat-linux-gnueabi/bin/ . You should find the proper address in your case.
  8. Finally, to make the modules, you should use the following command: make modules_install INSTALL_MOD_PATH=/tmp/arm-modules    This can be any path in your choice.I will use these modules later for making iniramfs. 
In my next blog, I will talk about initramfs and how to install an initramfs on Fedora-ARM based kernel in an ARM board.

Regards,
Khosro Taraghi

Sunday, March 6, 2011

Instruction For Setting and Booting TI's OMAP3 Device Family up(ARM Architecture)

Hello,
I thought that it can be useful if I mention very short about how to boot and set up OMAP3 device family. I use a low-cost, fan-less single-board computer with a TI OMAP3530 processor (ARM Cortex-A8 superscalar core ~600MHz paired with a TMS320C64x+ DSP ~430MHz and an Imagination SGX 2D/3D graphics processor). For more detail, click here: OMAP3530 features

Here is a picture of my ARM-based board rev C4:

Rev 4 has 720MHz capable OMAP3 processor and Improved USB Host PHY power rails. For booting this board, you should use MMC/SD memory and usb cable connected to computer to get console and set configurations on the board. In my previous bolg pages, I mentioned that how you can set up minicom in order to communicate with board.
These are the short instructions for preparing your board:
  1. Making partitions for your SD card. You can use fdisk or the easier way that I used is Gparted. use yum install gparted to install the software and put your SD card in the SD card slot in your computer and make 2 partitions. 100 MB for first partition would be fine and allocate the rest of space for second partition.
  2. Format your partitions with ext2 or ext3 using mkfs command. 
  3. If your MMC/SD card formatting is correct and you put MLO, u-boot.bin and uImage on the card (first partition) you should get a u-boot prompt after booting beagle board. for more details about MLO,u-boot.bin and uImage, click on the link above. 
You have 2 options: 1) Automatic boot after 10 seconds, or 2) Manually boot. I use manually boot for now since you can customize the boot setting, environment variables, and args and it is more flexible.

For manually boot, these are instructions to get logging prompt:


  1. mmc init   -------------> to get access to your SD card
  2. fatload mmc 0 80200000 uImage  ---------> to load your generic kernel to memory with address of 80200000 in hexadecimal.
  3. setenv bootargs console=ttyS2,115200n8 noinitrd root=b302 rootfstype=ext2 eq rootdelay=1 nohz=off  ---------> these are the boot args for kernel which is passed to kernel during the boot. The root=b302 is the address of my second partition on the SD card which contains the rootfs (in this case, Fedora 13 ARM beta). You should download the rootfs, decompress, and put it in your second partition. As you see, I do not use initrd for now since I am just trying to boot the board right now and I will use initramfs later.
  4. bootm 0x80200000 ------------> the last command that you should use is bootm. It runs the uImage, which is in the memory, and you will see the logging prompt.
I hope that these short form instructions for booting Fedora-ARM based board would be useful. Please put your comments and questions.

Regards,
Khosro Taraghi 

Installation of Dracut in Fedora 13 ARM Beta Release

Hi,
Since I am working with "RPM based kernel for Fedora-ARM" and Dracut is one of the most important things in this project, I tried to install dracut in my ARM board with yum install dracut. However, installation of dracut in Fedora 13 ARM beta failed. This lines show the problem that I received:

Error: Package: libdrm-2.4.20-1.fc13.armv5tel (fedora)
           Requires: kernel >= 2.6.29.1-52.fc11


It seems that the lack of kernel rpm caused this error. A temporary solution for this error is a fake kernel package. Thanks to Dan Horak for providing a fake kernel package to solve this error(temporary) for now. You can download this package here: Download package

After installing this package, I could install dracut and all dependencies of dracut successfully on Fedora 13 ARM beta. 

Regards,
Khosro Taraghi