Porting RTOS on LPC2148 - Step 1

Porting RTOS on LPC2148 - Step 1

RTOS porting is of interest for many engineers. We are trying to port RTOS onto LPC2148 using resources available over internet. Before proceeding with the RTOS porting let us list the specifications of LPC2148 relevant to porting:
  •          16-bit/32-bit ARM7TDMI-S CPU
  •          512kB Flash
  •          40kB SRAM
  •          Max. Frequency – 60MHz

Can we port Linux based RTOS/Linux on LPC2148?

Linux porting requires MMU on processor. Also, the RAM/ROM requirements of processor are high. LPC2148 doesn’t have MMU. Also, the memory is less on LPC2148. It doesn’t have a direct addressing capability for an external memory (external memory bus). Even the extendable memory like SD card is used only for data storage and not for programming. So, clear that Linux can’t be ported on LPC2148. Expanding this none of the ARM7 can have Linux ported because of above disadvantages. From ARM9 onwards, we can port Linux.

What are some of the RTOS available for porting?

Free or Open source RTOS:
  • ·         FreeRTOS
  • ·         uCLinux
  • ·         eCOS

Closed or Propeitary RTOS:
  • ·         VxWorks
  • ·         ThreadX
  • ·         uC/OS2
  • ·         QNX
  • ·         Windows CE
  • ·         Symbian
  • ·         RT Linux

GNU WinARM Tool Chain is used by many people around the world for RTOS compilation and porting.

How a no-voice can understand RTOS?
RTOS is a real-time operating system in which tasks are handled efficiently. Tasks are nothing but simple sub-routines. The processing of such tasks is done as per the pre-defined time constraints. An algorithm named scheduling efficiently handles the tasks.

Some of the terminologies in RTOS:

Non-Preemptive multitasking: It is a scheduling algorithm in RTOS where each of the tasks cooperates with each other to share the processing. Other task Priorities are given respect by the running task. High priority task can interrupt the running task and go to Ready-to-Run state. So, a high priority ISR interrupts the low priority task and once the ISR is executed, the low priority task is executed again. The main disadvantage with this algorithm is that high priority task has to wait. This generally is not used in real time systems.

Preemptive multitasking: It is a scheduling algorithm in RTOS where high priority task is always given priority. Until high priority task releases the CPU, low priority task will not be executed. The exact execution time of high priority task can be determined, hence, kernel using this type of tasking is said to be deterministic.

Semaphore: Consider two tasks competing for a usage of common source. Let us say, they have to output data over same UART or something, in that case someone has to synchronize the resource and allocate it to task. This is said to be resource synchronization and is done by semaphore. There is another case where we read from a UART and write it to memory and we read the same from memory to do some other operation. In this case, the task that is reading must be quick enough to be launched after write task is done. This is what we call task synchronization and also is done by semaphore. Semaphores are two types namely, binary semaphore and counting semaphore. Binary semaphore is used in case of resource synchronization. If two tasks have to share a memory, then in that case we use a counting semaphore. 

Post a Comment

3 Comments

  1. bookmarked!!, I really like your blog!

    Visit my homepage :: Kamera

    ReplyDelete
  2. good. but not enough. add some steps to boot with RTOS.

    ReplyDelete
  3. Quite incomplete.

    Timing Interface??
    Context Switching ??
    Debug Support ??

    ReplyDelete