All of lore.kernel.org
 help / color / mirror / Atom feed
* Does FreeRTOS works on Linux?
@ 2021-05-05 18:07 Raul Piper
  2021-05-05 19:30 ` loïc tourlonias
  0 siblings, 1 reply; 8+ messages in thread
From: Raul Piper @ 2021-05-05 18:07 UTC (permalink / raw)
  To: kernelnewbies

Hello,
I am having an embedded linux system and wanted to use any  RTOS on
it. Can I use Free RTOS?
My project has 2 tasks , one is producer and another is consumer
working parallely.

I have seen Free RTOS used in microcontrollers handling this , how can
this be done in Linux(which such APIs if not Free RTOS).

Regards,
R

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: Does FreeRTOS works on Linux?
  2021-05-05 18:07 Does FreeRTOS works on Linux? Raul Piper
@ 2021-05-05 19:30 ` loïc tourlonias
  2021-05-06 14:42   ` Raul Piper
  0 siblings, 1 reply; 8+ messages in thread
From: loïc tourlonias @ 2021-05-05 19:30 UTC (permalink / raw)
  To: Raul Piper; +Cc: kernelnewbies

On Wed, May 5, 2021 at 8:07 PM Raul Piper <raulpblooper@gmail.com> wrote:
>
> Hello,
Hi
> I am having an embedded linux system and wanted to use any  RTOS on
> it. Can I use Free RTOS?
> My project has 2 tasks , one is producer and another is consumer
> working parallely.
I'm afraid I don't understand what you are requesting and I hope that
someone else understand more clearly. But I'll still explain my
understanding.
You want to run a RTOS upon Linux OS, doesn't make it too much OSes?
Then I have several questions:
Do you really need a Real Time Operating System, can't you run your
project in Linux userspace?
Have you tried Linux RTOS extension (again I'm no expert and haven't
tried them but you can look at Xenomai)?
FreeRTOS is a standalone OS and depending on your system there may be
an example running on your architecture in parallel of your embedded
Linux. For example, on one of my project with have an ARM Cortex-A7
with a Linux running in Normal World and FreeRTOS running in Trusted
world.
>
> I have seen Free RTOS used in microcontrollers handling this , how can
> this be done in Linux(which such APIs if not Free RTOS).
>
HTH
> Regards,
> R
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: Does FreeRTOS works on Linux?
  2021-05-05 19:30 ` loïc tourlonias
@ 2021-05-06 14:42   ` Raul Piper
       [not found]     ` <YJTgOwiVQxyc8oyx@kroah.com>
  2021-05-09  6:40     ` loïc tourlonias
  0 siblings, 2 replies; 8+ messages in thread
From: Raul Piper @ 2021-05-06 14:42 UTC (permalink / raw)
  To: loïc tourlonias; +Cc: kernelnewbies

On Thu, May 6, 2021 at 1:01 AM loïc tourlonias
<loic.tourlonias@gmail.com> wrote:
>
> On Wed, May 5, 2021 at 8:07 PM Raul Piper <raulpblooper@gmail.com> wrote:
> >
> > Hello,
> Hi
> > I am having an embedded linux system and wanted to use any  RTOS on
> > it. Can I use Free RTOS?
> > My project has 2 tasks , one is producer and another is consumer
> > working parallely.
> I'm afraid I don't understand what you are requesting and I hope that
> someone else understand more clearly. But I'll still explain my
> understanding.
> You want to run a RTOS upon Linux OS, doesn't make it too much OSes?
> Then I have several questions:
> Do you really need a Real Time Operating System, can't you run your
> project in Linux userspace?
I can do that but Linux is not an ROS afaik. Even though i dont have
strict timing requirements , its like a sensor on i2c(producer) and
then another consumer tasks which not
only feeds on this data but also tell the i2c sensor by sending some
commands to it.
> Have you tried Linux RTOS extension (again I'm no expert and haven't
> tried them but you can look at Xenomai)?
I will explore this.I was thinking if i can use Posix thread to have
two tasks one reading sensors and another sending commands to it.But
then again i am confused
if using a posix thread full fills the requirement of RTOS. The reason
I want to use RTOS is , I am porting a Microcontroller code using RTOS
(free RTOS) to Linux and
afaik FreeRTOS doesnt work on Linux.
> FreeRTOS is a standalone OS and depending on your system there may be
> an example running on your architecture in parallel of your embedded
> Linux. For example, on one of my project with have an ARM Cortex-A7
> with Linux running in Normal World and FreeRTOS running in Trusted
> world.
This is interesting , do you have something to share?
> >
> > I have seen Free RTOS used in microcontrollers handling this , how can
> > this be done in Linux(which such APIs if not Free RTOS).
> >
> HTH
> > Regards,
> > R
> >
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies@kernelnewbies.org
> > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: Does FreeRTOS works on Linux?
       [not found]       ` <CAEwN+MBHdNQ8idf77GAshkgjrbxg84Lz+un4_12QW=Qo4nMhLg@mail.gmail.com>
@ 2021-05-08  8:46         ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2021-05-08  8:46 UTC (permalink / raw)
  To: Raul Piper; +Cc: loïc tourlonias, kernelnewbies

On Fri, May 07, 2021 at 10:14:34PM +0530, Raul Piper wrote:
> On Fri, May 7, 2021 at 12:07 PM Greg KH <greg@kroah.com> wrote:
> >
> > On Thu, May 06, 2021 at 08:12:48PM +0530, Raul Piper wrote:
> > > On Thu, May 6, 2021 at 1:01 AM loďc tourlonias
> > > <loic.tourlonias@gmail.com> wrote:
> > > >
> > > > On Wed, May 5, 2021 at 8:07 PM Raul Piper <raulpblooper@gmail.com>
> wrote:
> > > > >
> > > > > Hello,
> > > > Hi
> > > > > I am having an embedded linux system and wanted to use any  RTOS on
> > > > > it. Can I use Free RTOS?
> > > > > My project has 2 tasks , one is producer and another is consumer
> > > > > working parallely.
> > > > I'm afraid I don't understand what you are requesting and I hope that
> > > > someone else understand more clearly. But I'll still explain my
> > > > understanding.
> > > > You want to run a RTOS upon Linux OS, doesn't make it too much OSes?
> > > > Then I have several questions:
> > > > Do you really need a Real Time Operating System, can't you run your
> > > > project in Linux userspace?
> > > I can do that but Linux is not an ROS afaik. Even though i dont have
> > > strict timing requirements , its like a sensor on i2c(producer) and
> > > then another consumer tasks which not
> > > only feeds on this data but also tell the i2c sensor by sending some
> > > commands to it.
> >
> > That should be fine, Linux can be a "Real Time Operating system" if you
> > use the RT patchset if your workloads require it.
> >
> OK I need to check on this RT Patchset if at all I need real time features.
> 
> > If you do NOT have strict timing requirements, then there is no need to
> > worry about any of this, so I do not understand your wish to slow your
> > system down by running a "ROS".  Why?
> >
> Typo this is RTOS (not R OS - Robot operating system ;) )
> > > > Have you tried Linux RTOS extension (again I'm no expert and haven't
> > > > tried them but you can look at Xenomai)?
> > > I will explore this.I was thinking if i can use Posix thread to have
> > > two tasks one reading sensors and another sending commands to it.But
> > > then again i am confused
> > > if using a posix thread full fills the requirement of RTOS. The reason
> > > I want to use RTOS is , I am porting a Microcontroller code using RTOS
> > > (free RTOS) to Linux and
> > > afaik FreeRTOS doesnt work on Linux.
> >
> > What is your "requirement" exactly?
> Read the data from the sensor and also change the type of data sent by the
> sensor by analysing the received data by sending the command to the sensor
> periodically based on trigger.There is some batch of data which a
> "simultaneously" running algorithm
> is evaluating and send the command based on calculated trigger,  to sensor
> to change the data stream.This batch of data is of size 40-60 bytes length
> and may vary each time a batch is  being read.
> So in summary i wany two tasks to run together.
> RTOS is one option
> Posix thread is Another

"real time" has nothing to do with "posix threads" at all.

I suggest reading up on what these terms really mean and figure out your
specific requirements to determine what you have to do here.

good luck!

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: Does FreeRTOS works on Linux?
  2021-05-06 14:42   ` Raul Piper
       [not found]     ` <YJTgOwiVQxyc8oyx@kroah.com>
@ 2021-05-09  6:40     ` loïc tourlonias
  2021-05-11  2:39       ` jim.cromie
  2021-05-11  3:44       ` Valdis Klētnieks
  1 sibling, 2 replies; 8+ messages in thread
From: loïc tourlonias @ 2021-05-09  6:40 UTC (permalink / raw)
  To: Raul Piper; +Cc: kernelnewbies

> if using a posix thread full fills the requirement of RTOS. The reason
> I want to use RTOS is , I am porting a Microcontroller code using RTOS
> (free RTOS) to Linux and
> afaik FreeRTOS doesnt work on Linux.
> > FreeRTOS is a standalone OS and depending on your system there may be
> > an example running on your architecture in parallel of your embedded
> > Linux. For example, on one of my project with have an ARM Cortex-A7
> > with Linux running in Normal World and FreeRTOS running in Trusted
> > world.
> This is interesting , do you have something to share?
Sorry, this is intellectual property from my company so I can't share
source code but we have started from the FreeRTOS porting sample
related to our architecture. We are working on a ARM Cortex-A7 which
have an isolation between a normal world and a secure world. Linux is
working on the normal world for the UI and FreeRTOS is running on the
secure world. Communication between the two worlds is made by SMC.

Regards
Loïc

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: Does FreeRTOS works on Linux?
  2021-05-09  6:40     ` loïc tourlonias
@ 2021-05-11  2:39       ` jim.cromie
  2021-05-11  3:44       ` Valdis Klētnieks
  1 sibling, 0 replies; 8+ messages in thread
From: jim.cromie @ 2021-05-11  2:39 UTC (permalink / raw)
  To: loïc tourlonias; +Cc: Raul Piper, kernelnewbies

On Sun, May 9, 2021 at 12:41 AM loïc tourlonias
<loic.tourlonias@gmail.com> wrote:
>
> > if using a posix thread full fills the requirement of RTOS. The reason
> > I want to use RTOS is , I am porting a Microcontroller code using RTOS
> > (free RTOS) to Linux and
> > afaik FreeRTOS doesnt work on Linux.
> > > FreeRTOS is a standalone OS and depending on your system there may be
> > > an example running on your architecture in parallel of your embedded
> > > Linux. For example, on one of my project with have an ARM Cortex-A7
> > > with Linux running in Normal World and FreeRTOS running in Trusted
> > > world.
> > This is interesting , do you have something to share?
> Sorry, this is intellectual property from my company so I can't share
> source code but we have started from the FreeRTOS porting sample
> related to our architecture. We are working on a ARM Cortex-A7 which
> have an isolation between a normal world and a secure world. Linux is
> working on the normal world for the UI and FreeRTOS is running on the
> secure world. Communication between the two worlds is made by SMC.
>
> Regards
> Loïc
>

You should look at Xenomai

it uses the Adeos interrupt pipeline to pick off and handle certain
interrupts and events
in real-time, and pass the rest off to the linux kernel that does all
setup and housekeeping

they have API interfaces for VXworks, and other commercial RTOSs
one of those APIs is probably your path of least portage.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: Does FreeRTOS works on Linux?
  2021-05-09  6:40     ` loïc tourlonias
  2021-05-11  2:39       ` jim.cromie
@ 2021-05-11  3:44       ` Valdis Klētnieks
  2021-05-11  7:54         ` loïc tourlonias
  1 sibling, 1 reply; 8+ messages in thread
From: Valdis Klētnieks @ 2021-05-11  3:44 UTC (permalink / raw)
  To: lo�c tourlonias; +Cc: Raul Piper, kernelnewbies

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 410 bytes --]

On Sun, 09 May 2021 08:40:56 +0200, loïc tourlonias said:

> related to our architecture. We are working on a ARM Cortex-A7 which
> have an isolation between a normal world and a secure world. Linux is
> working on the normal world for the UI and FreeRTOS is running on the
> secure world.

Is there a easily comprehensible explanation of how that whole ARM normal/secure
stuff is supposed to work?


[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* Re: Does FreeRTOS works on Linux?
  2021-05-11  3:44       ` Valdis Klētnieks
@ 2021-05-11  7:54         ` loïc tourlonias
  0 siblings, 0 replies; 8+ messages in thread
From: loïc tourlonias @ 2021-05-11  7:54 UTC (permalink / raw)
  To: Valdis Klētnieks; +Cc: Raul Piper, kernelnewbies

On Tue, May 11, 2021 at 5:44 AM Valdis Klētnieks
<valdis.kletnieks@vt.edu> wrote:
>
> On Sun, 09 May 2021 08:40:56 +0200, loïc tourlonias said:
>
> > related to our architecture. We are working on a ARM Cortex-A7 which
> > have an isolation between a normal world and a secure world. Linux is
> > working on the normal world for the UI and FreeRTOS is running on the
> > secure world.
>
> Is there an easily comprehensible explanation of how that whole ARM normal/secure
> stuff is supposed to work?
I'll try to explain shortly. On ARM Cortex-A family, the core has two
isolated worlds (normal/secure). The two worlds have their own context
(register, stack ...) and the normal world have less privileges than
the secure world.
The core starts in the secure world and the secure software configures
the context of the normal world before giving the execution to the
normal world with a specific ARM instruction SMC 0.

The communication between normal and secure worlds is done through
SMC. When the normal world requires privileged access (secure clock
configuration for example), it askes the secure world the access by
calling a SMC instruction (with a specific ID), then a SMC exception
is triggered in the secure context. The secure monitor catches this
exception and handles it before returning to the normal world.

I haven't found any block diagram or data flow to explain this.
I've only found some useful links from ARM community:
https://www.microcontrollertips.com/embedded-security-brief-arm-trustzone-explained/
https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/architecting-more-secure-world-with-isolation-and-virtualization

HTH

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

end of thread, other threads:[~2021-05-11  7:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05 18:07 Does FreeRTOS works on Linux? Raul Piper
2021-05-05 19:30 ` loïc tourlonias
2021-05-06 14:42   ` Raul Piper
     [not found]     ` <YJTgOwiVQxyc8oyx@kroah.com>
     [not found]       ` <CAEwN+MBHdNQ8idf77GAshkgjrbxg84Lz+un4_12QW=Qo4nMhLg@mail.gmail.com>
2021-05-08  8:46         ` Greg KH
2021-05-09  6:40     ` loïc tourlonias
2021-05-11  2:39       ` jim.cromie
2021-05-11  3:44       ` Valdis Klētnieks
2021-05-11  7:54         ` loïc tourlonias

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.