2

I've recently started projects related to board bring up on imx6 and I see u-boot to be used in all projects.

Doing research on u-boot I startd out on wikipedia ( https://en.wikipedia.org/wiki/Das_U-Boot#References )

Where it states that the u-boot boots the operating system by reading kernel and any other related data like dts files, it then executes the kernel with appropriate arguments. However while we load images we only load the u-boot, kernel and rootfs, so how can the u-boot boot the operating system? Is it already present in the boards internal memory? Or Is the running instance of kernel called operating system?

Producer
  • 77
  • 2
  • 10

1 Answers1

1

You did not provide the exact commands you were using, but you may have been confused by the fact that you loaded a file named uImage (what you are refering to as the u-boot kernel image):

However while we load images we only load the u-boot kernel and rootfs

If this is the case, please note that it is not a u-boot image (you are running u-boot already if you can use commands such as bootm), but rather a Linux kernel image in u-boot image format created using the u-boot mkimage utility - see here.

uImage is in fact the Linux Kernel image itself that was converted into a file using a special u-boot format by the u-boot utility mkimage.

A typical command to create a uImage from a Linux kernel zImage file would be for example:
mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux kernel" -d arch/arm/boot/zImage uImage. uImage does contain the Linux Operating system, and this is why you were able to boot your system by loading it along with the rootfs.

Frant
  • 5,382
  • 1
  • 16
  • 22
  • Hi Frant, you're absolutely right, I did load uimage, I also loaded the u-boot binary and the rootfile system, But I'm confused regarding where the O.S comes from as I haven't loaded it and am I right in assuming that the kernal image when executed bu u-boot is called O.S? – Producer Mar 23 '19 at 05:15
  • P.S I forgot to add a comma in my question above, now changed to:However while we load images we only load the u-boot, kernel and rootfs – Producer Mar 23 '19 at 05:16
  • @Producer: You are right that the kernel image loaded/executed by u-boot is the Linux Operating System. The thing is that `uImage` IS the Linux Kernel image converted to a special u-boot format by the u-boot utility `mkimage`. A typical command to create a uImage from a Linux kernel zImage file would be: `mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux kernel" -d arch/arm/boot/zImage uImage`. `uImage` does contain the Linux Operating system, as explained in the answer above, and not the 'u-boot binary'. Does this make more sense ? – Frant Mar 23 '19 at 21:41
  • Ah yes this makes things much more clear thank you Mr. Frant. – Producer Mar 25 '19 at 04:28
  • @Producer: Thank you for the feedback. I used it for improving the original answer: You may want to accept it if you think it does now correctly answer your original question. – Frant Mar 25 '19 at 23:46