New to Embedded, Trying to sort out the SDcard structure

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

New to Embedded, Trying to sort out the SDcard structure

1,194 Views
RodneyFulk
Contributor III

I am not very experienced with Linux in General but I am trying to sort out what is on my SDcard and I am hoping to find some answers.

Can someone explain to me what is going on?

I have been trying to find out on my own where everything is and how it all ties together but I am confused.

I was at a freescale training session but the trainer was very busy and I thought I had a handle on it but not sure...

My impression is that the disk image has the MBR, then the uboot with any of its settings, then the base kernel in uImage form. My impression is that they are "hard coded" onto the hard drive and not really in a partition. This is followed by the root file system which resides in standard partitions.

When the root fs is mounted then the kernel can load any modules it needs and can run any configurations it needs.

Is this accurate or could someone help me out here?

Originally there was a separate /boot partition with Linux but I seldom see that anymore. My impression was that the small boot partition was required to make sure the kernel resided in the beginning of the drive as a limitation of the cmos in standard PC's but is no longer the case.

So then assuming I have the structure correct I should be able to update the uBoot or uImage without affecting the rootfs?

Can you have multiple kernels to load from with our uboot system just like a standard PC does with lilo or grub?

I am assuming the Kernel for Android and Linux are the same and that Android is a framework loaded over the top of the Linux Kernel. So you could easily have a multi boot system that uses the same kernel . If this is the case then you could run either Linux or Android based on what rootfs you decided to load?

And lastly if uboot and uimage are both hard coded onto the drive do they need to reside in /boot as well?

Under my ltib (imx53  11.09.01) I see there is the uncompressed kernel vmlinux, the normal zImage and the uImage files. As well as the uboot.bin file.

Also, since I have the start-r board and the linaro builds do not run on my machine I am wondering if I just use their images and swap out the kernel for the 10.04 ubuntu one that works if this will allow me to run the linaro 12.04 version without issue since it is really the same kernel just compiled with a couple different drivers in the 10.04 ubuntu that I got with my board.

Thank you!

Rodney

0 Kudos
5 Replies

958 Views
daiane_angolini
NXP Employee
NXP Employee

Let me try to reply to every question:

Is this accurate or could someone help me out here?


Yes, that´s right. In order to create the SDCard by your own you need to

* keep MBR (the partition table for SDcard

* copy uboot to 1K

* copy uImage to 1M

* create one (i.e.) EXT4 partition starting after uboot and kernel (i.e. at 20M)


So then assuming I have the structure correct I should be able to update the uBoot or uImage without affecting the rootfs?

Yes, but, sometimes I get crazy and forget to copy uboot (or uImage) to 1K (or 1M) and I break MBR. So, you CAN affect the rootfs if you were crazy =P

Although, if you copy uboot and uImage to the right position, rootfs will be fine.


Can you have multiple kernels to load from with our uboot system just like a standard PC does with lilo or grub?

I have never configured any SDCard for that, but I believe it´s possible. If you´re looking for a way to update your kernel for development, I believe the best answer here would be "use ftp to load kernel"



I am assuming the Kernel for Android and Linux are the same and that Android is a framework loaded over the top of the Linux Kernel.

They are the same, but they have different configuration. You can use android kernel to load linux rootfs, but you cannot use linux kernel to load android roofs.


So you could easily have a multi boot system that uses the same kernel . If this is the case then you could run either Linux or Android based on what rootfs you decided to load?

I´m not sure. Because Android needs a complete diferent partition table. But, if you could have X partition for Android and 1 for linux in the same SDCard, I think it may be possible


And lastly if uboot and uimage are both hard coded onto the drive do they need to reside in /boot as well?

No. In LTIB folder it´s done for development purpose.


Please, let me know if I missed any question

958 Views
RodneyFulk
Contributor III

Thanks, I think this helps me try to understand a little better what I am playing around with.

Main reason right now that I am digging into this is that I want to try using the Linaro 12.04 build and it won't work with the Start-R board so I want to upgrade the kernel. I may just try using the rootfs from the 12.04 build and use it with a working setup from the base ltib system.   Sounds like this should work out just fine.

With the Linaro build for the older non-start-r board I don't get USB ports.

The multiple Kernel questions was more so I understand whats going on. I am guessing it is a very simular setup to a normal x86 Linux install but there you use LiLo or GRUB instead of UBOOT.

I did miss asking 2 things though.

Are the Uboot settings stored just after the uboot image?

And where are the Kernel modules loaded from? Are they stored with the Kernel in the uImage file or are they in the rootfs?

Thank you again for your time!

I am using this 53qsb for now but will be picking up a SololLite board soon so I am looking forward to working with these.

Rodney

Rodney

0 Kudos

958 Views
daiane_angolini
NXP Employee
NXP Employee

Are the Uboot settings stored just after the uboot image?

This I don´t know. I think it´s somewhere "within" the uboot image. (I think it as a whole that will keep the config)

And where are the Kernel modules loaded from? Are they stored with the Kernel in the uImage file or are they in the rootfs?

they will be a *.ko file into your roofs (in the right path, that must match your kernel exactly) - when you built your driver as a module.

you may chose to built your driver into the same binary file as kernel. but I think you know difference between builtin and module...

Message was edited by: Daiane Angolini

0 Kudos

958 Views
RodneyFulk
Contributor III

Yes Built in means it loads with the kernel as part of the kernel.

Module means it is not part of the kernel but separate files that load later as needed.

Thanks.. Will give this a shot and will  let you know how it goes!

One last question...

So If I am understanding correctly I should be able to take another fs image, lets say the rootfs from ANY ARM compatible linux and just format the "old" rootfs partition and copy over the new rootfs as long as I also make sure I update the kernel modules (Assuming I have any).

I ask this because I have a start-r board that I want to install a newer ubuntu and if you download the linaro images it won't run because it is setup for the older imx53qsb. I could just move the file system to my development machine and go that route.

0 Kudos

958 Views
daiane_angolini
NXP Employee
NXP Employee

So If I am understanding correctly I should be able to take another fs image, lets say the rootfs from ANY ARM compatible linux and just format the "old" rootfs partition and copy over the new rootfs as long as I also make sure I update the kernel modules (Assuming I have any).


Yes, exactly!


Try it, and let us know.


(when you face any other error, please, open another discussion)

0 Kudos