LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Embedded & Single-board computer (http://www.linuxquestions.org/questions/forumdisplay.php?f=78)
-   -   Basic question linux for real time (http://www.linuxquestions.org/questions/showthread.php?t=947356)

elico 05-29-2012 05:54 AM

Basic question linux for real time
 
Hi all
I just finished a EMBEDDED SYSTEMS PROGRAMMING , we learned
programming of bare metal boards like ARDUINO and LINUX based
boards as well .

My question is : what is the benefit of LINUX to real time
based solutions ?

Why real time is not done with regular C programming
like in the case of ARDUINO ?

Please explain with some detal and examples .

Thanks
Elico

neonsignal 06-15-2012 03:23 AM

The benefit of Linux in a real-time environment is the same as any operating system; a scheduler, memory management, file systems, device drivers, libraries, applications and so on. For many projects, it is not reasonable to replicate all of this work.

Certainly there are smaller embedded applications that can be implemented from scratch. And there are alternative systems and libraries that are more suitable for systems that have hard real-time constraints.

michaelk 10-04-2012 01:48 PM

In some regards this question is similar to your other thread. As stated all the hard work of I/O programming is part of the operating system and so it saves time.

Regarding your second question of real time programming requires strict timing constraints and c compilers typically can not optimise the code satisfactory to meet the those requirements. Those sections of the program must be written using assembly.

http://www.linuxquestions.org/questi...ed-4175429706/

elico 10-04-2012 01:56 PM

Thanks
Eliahu

theNbomr 10-05-2012 07:20 PM

Linux is not real-time.
You can still program in C under Linux, of course. What you cannot do is access real hardware from C in userspace (or from any other language). The kernel has exclusive right to access or grant access to hardware. Most real-time OS's are not so heavily protected, and often do not use any protected memory or MMU. Limiting the ability to access hardware directly in application code reduces the feasibility of providing real-time performance.
You can always load your own bare-metal code onto a system intended to run a full-on OS. Of course, you would lose the benefit of ready-made drivers, filesystems, multi-tasking, etc.

--- rod.

onebuck 10-06-2012 09:34 AM

Hi,
Quote:

Originally Posted by elico (Post 4690143)
Hi all
I just finished a EMBEDDED SYSTEMS PROGRAMMING , we learned
programming of bare metal boards like ARDUINO and LINUX based
boards as well .

My question is : what is the benefit of LINUX to real time
based solutions ?

Why real time is not done with regular C programming
like in the case of ARDUINO ?

Please explain with some detal and examples .

Thanks
Elico

Look at this paper from IBM for real time linux;
Quote:

Summary: It's not that Linux® isn't fast or efficient, but in some cases fast just isn't good enough. What's needed instead is the ability to deterministically meet scheduling deadlines with specific tolerances. Discover the various real-time Linux alternatives and how they achieve real time—from the early architectures that mimic virtualization solutions to the options available today in the standard 2.6 kernel.

This article explores some of the Linux architectures that support real-time characteristics and discusses what it really means to be a real-time architecture. Several solutions endow Linux with real-time capabilities, and in this article I examine the thin-kernel (or micro-kernel) approach, the nano-kernel approach, and the resource-kernel approach. Finally, I describe the real-time capabilities in the standard 2.6 kernel and show you how to enable and use them.
You can get more papers from IBM, one that does address/provide some useful info: Real-Time Linux Kernel Characteristics

Be sure to look at the parent article: Installing and using real time Linux

HTH!


All times are GMT -5. The time now is 12:18 PM.