1. Booting From SDcard and Execute Program From different
RootFile System
1. Sample Programs to run from different RootFile system placed in different
partition of SD card:
Program1.c:
#include<stdio.h>
void main(void)
{
printf(“nThis program is running from root file system one!n”);
}
Program2.c:
#include<stdio.h>
void main(void)
{
printf(“nThis program is running from root file system two!n”);
}
2. Cross compilation:
Use the commands given below for cross compilation:
armnonelinuxgnueabigcc program1.c o program1 static
armnonelinuxgnueabigcc program2.c o program2 static
After cross compilation you get two binary files program1 and program2
Copy program1 to first rootfile sytem which is second partition of sd card and copy
program2 to second rootfile system which is third partition of sd card.
3. Boot BBB using uSD card:
Before booting make three partitions in sd card namely “boot”, “FirstRootFs”,
“SecondRootFs” and copy MLO, u-boot.img, uEnv.txt, .dtb file, zImage to “boot”, then
copy Rootfile system and binary file program1 to “FirstRootFs”, at last copy Rootfile
system and binary file program2 to “SecondRootFs”.
1. Execute Program from first Root File system:
Update below line of uEnv.txt in “boot”:
mmcroot=/dev/mmcblk0p2 rw
mmcblk0p2 is sd card second partition – tells were the Rootfile system is placed and it will
boot from second partition.
Now insert uSD card to Beaglebone Black and power up (holding down the boot button to
boot from sd card). After successful boot you get ubuntu login, use the login and the
password as “ubuntu”, you will get ubuntu prompt and run the binary file program1 at
prompt as below.
Ubuntu@ubuntuarmhf~$ ./program1
After successful execution, will get the following output:
This program is running from root file system one! 1
2. Booting From SDcard and Execute Program From different
RootFile System
2. Execute Program from Second Root File system:
Update below line of uEnv.txt in “boot”:
mmcroot=/dev/mmcblk0p3 rw
mmcblk0p3 is sd card third partition – tells were the Rootfile system is placed and it will
boot from third partition.
Now insert uSD card to Beaglebone Black and power up (holding down the boot button to
boot from sd card). After successful boot you get ubuntu login, use the login and the
password as “ubuntu”, you will get ubuntu prompt and run the binary file program2 at
prompt as below.
ubuntu@ubuntuarmhf~$ ./program2
After successful execution, will get the following output:
This program is running from root file system two!
2