Binary partitioning

Discussions and support about ChibiOS/RT, the free embedded RTOS.
phug
Posts: 2
Joined: Mon Mar 07, 2022 2:54 pm

Binary partitioning

Postby phug » Mon Mar 07, 2022 3:04 pm

Hello
Does the ChibiOS kernel supports execution of multiple binaries on a single uC core under control of the kernel. I am looking for something similar to a very simplistic time and space segregation solution. Sometimes also called modules or partitions. The main focus is not security. Moreover independent developing, versioning, testing and deployment of separate binaries. I am looking for something that supports the following:

1. The platform core binary:
* Contains the RTOS implementation.
* Contains services and all drivers.
* Exports functionality usable by application logic binaries.
* Can be developed, versioned, tested, deployed without compile time or runtime dependency to any application logic binary. This with the exception that during initialization time, the platform core binary detects and starts a present application logic binary. During runtime the platform core binary schedules tasks within the application logic binaries.

2. A application logic binary:
* Contains application logic.
* Has no direct access to peripherals.
* Can be developed, versioned, deployed without access to source code or object code used to create the platform core binary.
* Can use at runtime functionality provided by the platform binary.
* Shall be replaceable within deployment. This includes: Product variant binaries, OEM binaries and end customer created binaries.

See also the attachment for illustration.

Thanks for support.

Best regards
Peter
Attachments
application_partitioning.png

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Binary partitioning

Postby Giovanni » Mon Mar 07, 2022 3:16 pm

Hi,

Yes, we call those "sandboxes":

https://www.chibios.org/dokuwiki/doku.p ... s:sb:start

See the general architecture structure here:

architecture.png
architecture.png (33.85 KiB) Viewed 3058 times


Giovanni

dto10000
Posts: 3
Joined: Fri Oct 07, 2022 6:52 am

Re: Binary partitioning

Postby dto10000 » Fri Oct 07, 2022 6:53 am

Hi,

Is there more in depth documentation on SB and it's APIs/features?

Thanks!

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Binary partitioning

Postby Giovanni » Fri Oct 07, 2022 7:37 am

Hi,

Sandboxes evolved to full virtualization and are under active development, documentation will be available on next release where the new code will be included.

Now it is possible to run RT+HAL (or another RTOS) in a sandbox under RT+SB+HAL acting as an hypervisor, there are already working demos in repository. Drivers are para-virtualized but it is also possible to let VMs have direct access to specific peripherals.

Probably I will do a live presentation in next weeks on our discord server.

Giovanni

dto10000
Posts: 3
Joined: Fri Oct 07, 2022 6:52 am

Re: Binary partitioning

Postby dto10000 » Tue Oct 11, 2022 1:48 am

I see, is there an ETA on the next release? or a schedule for release cycles?

Just for a conceptual understanding. If I wanted to have multiple applications, I would spin up a VM for each application? or would i just need one VM to handle multiple applications?

Thanks!

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Binary partitioning

Postby Giovanni » Tue Oct 11, 2022 3:57 am

Hi,

Tentatively Q1 2023.

You need a VM for each application if you want your applications to be isolated from each other. Each VM is handled by a thread of the host OS and has its own priority.

About VMs, there are 2 kind of sandboxes:

1) Flash+RAM, applications are statically stored in flash and have a dedicated RAM area.
2) Just RAM, the applications are loaded at runtime as an .elf file stored in a filesystem. This model is very close to a Posix process except there is no memory allocation involved, it is still fully static. A subset of the Posix API is also available.

Giovanni

dto10000
Posts: 3
Joined: Fri Oct 07, 2022 6:52 am

Re: Binary partitioning

Postby dto10000 » Thu Oct 13, 2022 3:09 am

Great, thanks!


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 11 guests