public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Help needed: Boot signed RTOS
@ 2013-11-20 17:49 Christopher Preschern
  2013-11-20 18:45 ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Christopher Preschern @ 2013-11-20 17:49 UTC (permalink / raw)
  To: u-boot

Hi,

I try to boot a signed RTOS as FIT Image with the bootm command and I'm 
kind of stuck here - any help well appreciated. When booting, U-Boot 
shows the following error message:
   ?No Linux ARM Kernel Image Image
    ERROR: can't get kernel image!?

My questions:
  - Is it possible to boot a signed RTOS with U-Boot?
  - Is there something I do wrong (I'm rather new to U-Boot)?


I use the following setup:
  - U-Boot 2013.07
  - i.MX28 board
  - safeRTOS which I can boot with the bootelf command

The following mkimage command (which does not yet create a signature) 
works and produces a with bootm bootable "u-rtos" file:
   mkimage -A arm -C none -O qnx -T kernel_noload -d safeRTOS u-rtos

I tried to re-build the above parameters in my .its File (which I need 
to use the signing features of mkimage):

   /dts-v1/;
   / {
     description = "MY-RTOS";
     #address-cells = <1>;
     images {
       kernel at 1 {
         description = "MY-RTOS";
         data = /incbin/("./my-rtos-image");
         type = "kernel_noload";
         arch = "arm";
         os = "qnx";
         compression = "none";
         signature at 1 {
           algo = "sha1,rsa2048";
           key-name-hint = "dev";
         };
       };
     };
     configurations {
       default = "conf at 1";
       conf at 1 {
         kernel = "kernel at 1";
         hash at 1 {
           algo = "sha1";
         };
       };
     };
   };

I run the following command to get my FIT-file:
   mkimage -f rtos.its -k <path-to-my-keys> rtos.fit

When booting the FIT file with bootm, I get the following output:

   => bootm 0x42000000
   ## Loading kernel from FIT Image at 42000000 ...
      Using 'conf at 1' configuration
      Verifying Hash Integrity ... OK
      Trying 'kernel at 1' kernel subimage
        Description:  safeRTOS Kernel
        Type:         Kernel Image (no loading done)
        Compression:  uncompressed
        Data Start:   0x420000b8
        Data Size:    1543860 Bytes = 1.5 MiB
        Sign algo:    sha1,rsa2048:dev
        Sign value:   45bd54112.........99d0d710
      Verifying Hash Integrity ... sha1,rsa2048:dev+ OK
   No Linux ARM Kernel Image Image
   ERROR: can't get kernel image!

It seems that the whole signature-checking works. However U-Boot 
apparently expects a kernel and instead gets my RTOS to boot. How can I 
tell U-Boot that I want to run my bootelf-runable RTOS?

I'm really stuck here - any help is very much appreciated!

thank you & best regards,
Christopher


-- 
   ------------------------------------------------------------------
| Christopher Preschern
| Institute for Technical Informatics - TU Graz
| Tel: +43 (316) 873 - 6404
| EMail: christopher.preschern at tugraz.at

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Help needed: Boot signed RTOS
  2013-11-20 17:49 [U-Boot] Help needed: Boot signed RTOS Christopher Preschern
@ 2013-11-20 18:45 ` Simon Glass
  2013-11-21 11:04   ` Christopher Preschern
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2013-11-20 18:45 UTC (permalink / raw)
  To: u-boot

Hi Christopher,


On Wed, Nov 20, 2013 at 10:49 AM, Christopher Preschern <
christopher.preschern@tugraz.at> wrote:

> Hi,
>
> I try to boot a signed RTOS as FIT Image with the bootm command and I'm
> kind of stuck here - any help well appreciated. When booting, U-Boot shows
> the following error message:
>   ?No Linux ARM Kernel Image Image
>    ERROR: can't get kernel image!?
>
> My questions:
>  - Is it possible to boot a signed RTOS with U-Boot?
>  - Is there something I do wrong (I'm rather new to U-Boot)?
>
>
> I use the following setup:
>  - U-Boot 2013.07
>  - i.MX28 board
>  - safeRTOS which I can boot with the bootelf command
>
> The following mkimage command (which does not yet create a signature)
> works and produces a with bootm bootable "u-rtos" file:
>   mkimage -A arm -C none -O qnx -T kernel_noload -d safeRTOS u-rtos
>
> I tried to re-build the above parameters in my .its File (which I need to
> use the signing features of mkimage):
>
>   /dts-v1/;
>   / {
>     description = "MY-RTOS";
>     #address-cells = <1>;
>     images {
>       kernel at 1 {
>         description = "MY-RTOS";
>         data = /incbin/("./my-rtos-image");
>         type = "kernel_noload";
>         arch = "arm";
>         os = "qnx";
>         compression = "none";
>         signature at 1 {
>           algo = "sha1,rsa2048";
>           key-name-hint = "dev";
>         };
>       };
>     };
>     configurations {
>       default = "conf at 1";
>       conf at 1 {
>         kernel = "kernel at 1";
>         hash at 1 {
>           algo = "sha1";
>         };
>       };
>     };
>   };
>
> I run the following command to get my FIT-file:
>   mkimage -f rtos.its -k <path-to-my-keys> rtos.fit
>
> When booting the FIT file with bootm, I get the following output:
>
>   => bootm 0x42000000
>   ## Loading kernel from FIT Image at 42000000 ...
>      Using 'conf at 1' configuration
>      Verifying Hash Integrity ... OK
>      Trying 'kernel at 1' kernel subimage
>        Description:  safeRTOS Kernel
>        Type:         Kernel Image (no loading done)
>

This means Linux kernel. You probably need a new type - the one you are
using is this one (common/image.c):

{ IH_TYPE_KERNEL_NOLOAD, "kernel_noload",  "Kernel Image (no loading
done)", },

You can add a new type in include/image.h but will need to also add support
for it in a few places.


>        Compression:  uncompressed
>        Data Start:   0x420000b8
>        Data Size:    1543860 Bytes = 1.5 MiB
>        Sign algo:    sha1,rsa2048:dev
>        Sign value:   45bd54112.........99d0d710
>      Verifying Hash Integrity ... sha1,rsa2048:dev+ OK
>   No Linux ARM Kernel Image Image
>   ERROR: can't get kernel image!
>
> It seems that the whole signature-checking works. However U-Boot
> apparently expects a kernel and instead gets my RTOS to boot. How can I
> tell U-Boot that I want to run my bootelf-runable RTOS?
>
> I'm really stuck here - any help is very much appreciated!
>
> thank you & best regards,
> Christopher
>
>
> --
>   ------------------------------------------------------------------
> | Christopher Preschern
> | Institute for Technical Informatics - TU Graz
> | Tel: +43 (316) 873 - 6404
> | EMail: christopher.preschern at tugraz.at
>

Regards,
Simon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Help needed: Boot signed RTOS
  2013-11-20 18:45 ` Simon Glass
@ 2013-11-21 11:04   ` Christopher Preschern
  2013-11-21 17:11     ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Christopher Preschern @ 2013-11-21 11:04 UTC (permalink / raw)
  To: u-boot

Hi Simon,

thanks for the quick answer.

>>        => bootm 0x42000000
>>        ## Loading kernel from FIT Image at 42000000 ...
>>           Using 'conf at 1' configuration
>>           Verifying Hash Integrity ... OK
>>           Trying 'kernel at 1' kernel subimage
>>             Description:  safeRTOS Kernel
>>             Type:         Kernel Image (no loading done)
>
> This means Linux kernel. You probably need a new type

ok thanks - I guess that's a bit too big for me - I don't really have 
the expertise to make these changes.

I had hoped that I just have the wrong configuration in the .its file 
and that it is already possible to boot my FIT-packed ELF file.

thanks anyway.

Best regards,
Christopher


-- 
   ------------------------------------------------------------------
| Christopher Preschern
| Institute for Technical Informatics - TU Graz
| Tel: +43 (316) 873 - 6404
| EMail: christopher.preschern at tugraz.at

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Help needed: Boot signed RTOS
  2013-11-21 11:04   ` Christopher Preschern
@ 2013-11-21 17:11     ` Simon Glass
  2013-11-22 12:56       ` Christopher Preschern
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2013-11-21 17:11 UTC (permalink / raw)
  To: u-boot

Hi Christopher,

On Thu, Nov 21, 2013 at 4:04 AM, Christopher Preschern <
christopher.preschern@tugraz.at> wrote:

> Hi Simon,
>
> thanks for the quick answer.
>
>
>         => bootm 0x42000000
>>>        ## Loading kernel from FIT Image at 42000000 ...
>>>           Using 'conf at 1' configuration
>>>           Verifying Hash Integrity ... OK
>>>           Trying 'kernel at 1' kernel subimage
>>>             Description:  safeRTOS Kernel
>>>             Type:         Kernel Image (no loading done)
>>>
>>
>> This means Linux kernel. You probably need a new type
>>
>
> ok thanks - I guess that's a bit too big for me - I don't really have the
> expertise to make these changes.
>
> I had hoped that I just have the wrong configuration in the .its file and
> that it is already possible to boot my FIT-packed ELF file.
>

Well I suppose you can use the split version of the bootm command to do
this. Something like: 'bootm start <addr>; bootm loados; bootm prep;
loadelf ...'


>
> thanks anyway.
>
>
> Best regards,
> Christopher
>
>
> --
>   ------------------------------------------------------------------
> | Christopher Preschern
> | Institute for Technical Informatics - TU Graz
> | Tel: +43 (316) 873 - 6404
> | EMail: christopher.preschern at tugraz.at
>

Regards,
SImon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Help needed: Boot signed RTOS
  2013-11-21 17:11     ` Simon Glass
@ 2013-11-22 12:56       ` Christopher Preschern
  2013-11-22 16:54         ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Christopher Preschern @ 2013-11-22 12:56 UTC (permalink / raw)
  To: u-boot

Hi Simon,

> Well I suppose you can use the split version of the bootm command to do
> this. Something like: 'bootm start <addr>; bootm loados; bootm prep;
> loadelf ...'

that helped me out - it works. I use the following commands to check and 
load my RTOS.

setenv checkrtos 'bootm start 0x44000000'
tftp 0x44000000 rtos.fit
if run checkrtos;  then bootelf 440000b4; else echo FAILD TO CHECK 
SAFERTOS SIGNATURE; fi

Thank you & best regards,
Christopher

-- 
   ------------------------------------------------------------------
| Christopher Preschern
| Institute for Technical Informatics - TU Graz
| Tel: +43 (316) 873 - 6404
| EMail: christopher.preschern at tugraz.at

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] Help needed: Boot signed RTOS
  2013-11-22 12:56       ` Christopher Preschern
@ 2013-11-22 16:54         ` Simon Glass
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2013-11-22 16:54 UTC (permalink / raw)
  To: u-boot

Hi Christopher,

On Fri, Nov 22, 2013 at 5:56 AM, Christopher Preschern <
christopher.preschern@tugraz.at> wrote:

> Hi Simon,
>
>
>  Well I suppose you can use the split version of the bootm command to do
>> this. Something like: 'bootm start <addr>; bootm loados; bootm prep;
>> loadelf ...'
>>
>
> that helped me out - it works. I use the following commands to check and
> load my RTOS.
>
> setenv checkrtos 'bootm start 0x44000000'
> tftp 0x44000000 rtos.fit
> if run checkrtos;  then bootelf 440000b4; else echo FAILD TO CHECK
> SAFERTOS SIGNATURE; fi
>

OK good. You may want to look at putting a load address into the FIT image
rather than what seems to be a hard-coded offset from the start.


> Thank you & best regards,
>
> Christopher
>


Regards,
Simon

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-22 16:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-20 17:49 [U-Boot] Help needed: Boot signed RTOS Christopher Preschern
2013-11-20 18:45 ` Simon Glass
2013-11-21 11:04   ` Christopher Preschern
2013-11-21 17:11     ` Simon Glass
2013-11-22 12:56       ` Christopher Preschern
2013-11-22 16:54         ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox