Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

FreeRTOS Kernel Query

Posted by aimal on August 18, 2017

Hi, I was going into FreeRTOS kernel code and i found few things confusing. ** FreeRTOS version: 9.0.0** port: coretx-M4F RVDS

My queries are:

  1. In tasks.c at Line # 375, we have few lists definitions like: ~~~ Listt pxReadyTasksLists [configMAXPRIORITIES] ~~~ List_t consistis of: a. ListItemt b. MiniListItemt xListEnd

If MiniListItem_t member of List_t is used to inidicate the end of List than why we need every array item to contain MiniListItem_t. i.e. pxReadyTasksLists is an array and each linkedlist element (Listt) of this array should contain both **ListItemt** and MiniListItem_t. Why we need MiniListItem_t in every element of every list? Why not just add it at the end of pxReadyTasksLists and take it out of List_t struct. ................................................................................................................................................................ 2. In file tasks.c function prvInitialiseNewTask the string from string pool is copied to TCB_t character by character. Line # 834.

~~~ if (pcName[x] == 0x00) { break; } ~~~

This statment is intended to check the end of string. My question is how can we check the end of string pool with pcName[x] == 0x00?? shouldn't it be like: pcName[x] == '0'?


FreeRTOS Kernel Query

Posted by rtel on August 18, 2017
  1. In tasks.c at Line # 375, we have few lists definitions like:

Listt pxReadyTasksLists [configMAXPRIORITIES]

List_t consistis of: a. ListItemt b. MiniListItemt xListEnd

If MiniListItem_t member of List_t is used to inidicate the end of List than why we need every array item to contain MiniListItem_t. i.e. pxReadyTasksLists is an array and each linkedlist element (Listt) of this array should contain both *ListItemt* and MiniListItem_t. Why we need MiniListItem_t in every element of every list? Why not just add it at the end of pxReadyTasksLists and take it out of List_t struct.

This is an array of linked lists. Each index in the array has its own unique linked list, and each unique linked list has its own end marker. For example, if you were to access the linked list at array position/index 1 then you want to know where the end of that list is, not the where the end of the list in the first or last position in the array is.

................................................................................................................................................................ 2. In file tasks.c function prvInitialiseNewTask the string from string pool is copied to TCB_t character by character. Line # 834.

if (pcName[x] == 0x00) { break; }

This statment is intended to check the end of string. My question is how can we check the end of string pool with pcName[x] == 0x00?? shouldn't it be like: pcName[x] == '0'?

0 and 00 (and NULL) are all equivalent to each other - any could be used.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS