Heavy SysInit Dependency

Joel Sherrill joel at rtems.org
Wed May 19 14:32:32 UTC 2021


On Wed, May 19, 2021 at 9:07 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> On 19/05/2021 15:25, Joel Sherrill wrote:
> >
> > Yeah. But if you use any method with errno, you get all this. I know the
> > reent structure has to be initialized but why did it trigger opening
> > /dev/console? The console device wasn't configured. Can the post driver
> > hook dependency be cleaved from this chain?
> >
> > https://git.rtems.org/rtems/tree/cpukit/libcsupport/src/libio_init.c#n69
> > <
> https://git.rtems.org/rtems/tree/cpukit/libcsupport/src/libio_init.c#n69>
> >
> > I think that dependency is only needed if you configure the console
> > device driver. Shouldn't the sysinit for the post driver hook be part of
> > configuring the console or simple console?
> >
> > https://git.rtems.org/rtems/tree/cpukit/include/rtems/confdefs/console.h
> > <
> https://git.rtems.org/rtems/tree/cpukit/include/rtems/confdefs/console.h>
> >
> https://git.rtems.org/rtems/tree/cpukit/include/rtems/confdefs/iodrivers.h
> > <
> https://git.rtems.org/rtems/tree/cpukit/include/rtems/confdefs/iodrivers.h
> >
>
> Initializing /dev/console via the console drivers is an option. I guess
> you still get the file system support pulled in via the file descriptors.
>

Ticket and patch coming.

Moving the post driver hook to be triggered dropped ~20k and then
eliminating
using rtems_malloc and removing errno from the powerpc sbrk eliminated
another
~600 bytes.

  45064    5884 268384476 268435424     fffffe0
b-psim/powerpc/psim/testsuites/samples/minimum.exe

That matches exactly what I had with my earlier hacks but now you can
reference errno not pull in the console, libio, open/close, and unmount
overhead.

This seems to be a very acceptable solution. They are now unconnected
dependencies and the linking machinery does its magic.

I wonder what else is lurking as dependencies in the BSPs or implicit
dependency chains. I plan to make a sweep and see which BSPs have
minimum.exe sizes that seem too large.

Thanks.

--joel


> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.huber at embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210519/21a41538/attachment.html>


More information about the devel mailing list