AnsweredAssumed Answered

Using a statically compiled C file as rootfs

Question asked by nabilb on May 29, 2015
Latest reply on May 31, 2015 by Yuri Muhin

Hello guys !

 

I want to boot my imx53-qsb board using not a normal rootfs but a statically compiled hello_world.c file in other words a hello_s.out.

To achieve that, I wrote a hello_world.c file cross compiled it statically to get my hello_s.out I put it in the mmcblk0p1 ext4 partition of my sd card. I put my uImage and my u-boot.imx in the mmcblk0.

 

I set after that my u-boot environment variables like this :

 

setenv bootargs_base 'setenv bootargs console=ttymxc0,115200'

setenv bootargs_mmc root=/dev/mmcblk0p1 rw rootfstype=ext4 init=/hello_s.out

setenv bootcmd_mmc 'run bootargs_base bootargs_mmc;mmc dev 0;mmc read ${loadaddr} 0x800 0x4000;bootm'

setenv bootcmd 'run bootcmd_mmc'

saveenv

run bootcmd

 

 

But the board boots and i got an error :

Please append a correct "root=" boot option; here are the available partitions:

b300         3872256 mmcblk0 driver: mmcblk

  b301         3868160 mmcblk0p1

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

 

 

Any solution please ?

Thanks

Outcomes