mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Why /dev/mem has null size?
@ 2020-12-14 17:51 DEMIRDJIAN, Antoine
  2020-12-14 18:13 ` Ahmad Fatoum
  0 siblings, 1 reply; 3+ messages in thread
From: DEMIRDJIAN, Antoine @ 2020-12-14 17:51 UTC (permalink / raw)
  To: barebox

Dear all,

I'm trying to "addpart" to /dev/mem in order to copy my raw boot image inside.
But I noticed that /dev/mem doesn't really exists :

From devinfo :

   `-- mem1
      `-- 0x00000000-0xffffffffffffffff (   0 Bytes): /dev/mem

And more specifically :

barebox@MyBoard:/ devinfo mem1
Resources:
  num: 0
  name: mem
  start: 0x00000000
  size: 0x00000000
Driver: mem
Bus: platform

As a consequence, my addpart fails with "partition end is beyond device".

Do you have any idea why my /dev/mem size is 0x0 ?

Thanks,

--
Antoine D

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Why /dev/mem has null size?
  2020-12-14 17:51 Why /dev/mem has null size? DEMIRDJIAN, Antoine
@ 2020-12-14 18:13 ` Ahmad Fatoum
  2020-12-14 18:38   ` DEMIRDJIAN, Antoine
  0 siblings, 1 reply; 3+ messages in thread
From: Ahmad Fatoum @ 2020-12-14 18:13 UTC (permalink / raw)
  To: DEMIRDJIAN, Antoine, barebox

Hello Antoine,

On 14.12.20 18:51, DEMIRDJIAN, Antoine wrote:
> Dear all,
> 
> I'm trying to "addpart" to /dev/mem in order to copy my raw boot image inside.

The normal usage is to let barebox worry about memory allocation:

  bootm /image and go /image both memory map /image for you.

If you absolutely want to hardcode the load address, use the memcpy
command: https://www.barebox.org/doc/latest/commands/mem/memcpy.html

> But I noticed that /dev/mem doesn't really exists :
> 
> From devinfo :
> 
>    `-- mem1
>       `-- 0x00000000-0xffffffffffffffff (   0 Bytes): /dev/mem
> 
> And more specifically :
> 
> barebox@MyBoard:/ devinfo mem1
> Resources:
>   num: 0
>   name: mem
>   start: 0x00000000
>   size: 0x00000000
> Driver: mem
> Bus: platform
> 
> As a consequence, my addpart fails with "partition end is beyond device".

I don't think addpart is meant to operate on the mem device. /dev/mem
is usually used along with memcpy, md, mw, where /dev/mem is the default
device they operate on.

> Do you have any idea why my /dev/mem size is 0x0 ?

/dev/mem always has size 0 in barebox, because its size makes
it a bit special. Many operations don't make sense for it as well,
so having a zero size makes them fail.

Cheers,
Ahmad

> 
> Thanks,
> 
> --
> Antoine D
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: Why /dev/mem has null size?
  2020-12-14 18:13 ` Ahmad Fatoum
@ 2020-12-14 18:38   ` DEMIRDJIAN, Antoine
  0 siblings, 0 replies; 3+ messages in thread
From: DEMIRDJIAN, Antoine @ 2020-12-14 18:38 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Hello Ahmad,

Le lun. 14 déc. 2020 à 19:13, Ahmad Fatoum <a.fatoum@pengutronix.de> a écrit :
>
> Hello Antoine,
>
> On 14.12.20 18:51, DEMIRDJIAN, Antoine wrote:
> > Dear all,
> >
> > I'm trying to "addpart" to /dev/mem in order to copy my raw boot image inside.
>
> The normal usage is to let barebox worry about memory allocation:
>
>   bootm /image and go /image both memory map /image for you.

I did not know that it was possible to use bootm on a device.
I tried to use "bootm /dev/mmc2" and it works.
Awesome :-)
I thought I had to create a partition in /dev/mem to copy my binary
inside in order to boot...

Sorry for the noise,
Best regards,
Antoine

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2020-12-14 18:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 17:51 Why /dev/mem has null size? DEMIRDJIAN, Antoine
2020-12-14 18:13 ` Ahmad Fatoum
2020-12-14 18:38   ` DEMIRDJIAN, Antoine

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