1 / 13

Multi-Tasking

Multi-Tasking. The Multi-Tasking service is offered by VxWorks with its real-time kernel “WIND”. Scheduling . VxWorks offers: Pre-emptive priority based scheduling Round robin scheduling

gerodi
Download Presentation

Multi-Tasking

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Multi-Tasking The Multi-Tasking service is offered by VxWorks with its real-time kernel “WIND”.

  2. Scheduling • VxWorks offers: • Pre-emptive priority based scheduling • Round robin scheduling Pre-emption: When a high priority task comes in, the low priority task is swapped for the high priority task.

  3. Task Switching • The process of Swapping tasks is called Task switching. • When a high priority task comes in, the processor completes the current assembly instruction of the low priority task, saves the context of the current task and then switches to the high priority task.

  4. Each individual program is considered as a task and has its own context. While switching, the context of the current task is saved in a Task Control Block (TCB) that acts like a Process control block(PCB) of a general purpose operating system. Task Control Block

  5. Contents of TCB • A thread of execution (program counter) • CPU register & floating point registers • Stack of the task. • I/O assignments for stdio • Timers • Kernel Control Structures • Others (Signal handlers etc..)

  6. The difference between a PCB and TCB is, the TCB doesn’t contain the memory address space of the task unlike PCB. Reason: Every task in Vxworks operates in a unique memory address space and the mapping is done through the concept of Virtual Memory Interface (VxVMI).

  7. By default the tasks created in VxWorks are in a Suspended state and every task has to be explicitly activated to be moved to the ready state. • Note: taskSpawn() can be used to create and activate a task simulateneously

  8. APIs used for task information • The basic tasking routines are provide by tasklib.h • These routines provide the means for task creation, control, and information. • VxWorks tasks can be controlled from the host-resident shell (Tornado user shell)

  9. Taskshow library • This library provides routines to show task-related information, such as register values, task status, etc. The taskShowInit( ) routine links the task show facility into the VxWorks system. It is called automatically when this show facility is configured into VxWorks using either of the following methods: • If you use the configuration header files, define INCLUDE_SHOW_ROUTINES in config.h. • If you use the Tornado project facility, select INCLUDE_TASK_SHOW.

  10. taskInfoGet( ) • taskInfoGet( ) - get information about a task • STATUS taskInfoGet ( int tid, /*ID of task for which to get info */ TASK_DESC * pTaskDesc /* task descriptor to be filled in */ ) This routine fills in a specified task descriptor (TASK_DESC) for a specified task. The information in the task descriptor is, for the most part, a copy of information kept in the task control block (WIND_TCB). The TASK_DESC structure is useful for common information and avoids dealing directly with the unwieldy WIND_TCB.

  11. taskShow( ) • taskShow( ) - display task information from TCBs • STATUS taskShow ( int tid, /* task ID */ int level /* 0 = summary, 1 = details, 2 = all tasks */ ) This routine displays the contents of a task control block (TCB) for a specified task. If level is 1, it also displays task options and registers. If level is 2, it displays all tasks.

  12. taskRegsShow( ) • taskRegsShow( ) - display the contents of a task's registers • void taskRegsShow ( int tid /* task ID */ ) This routine displays the register contents of a specified task on standard output.

  13. taskStatusString( ) • taskStatusString( ) - get a task's status as a string. • STATUS taskStatusString ( int tid, /* task to get string for */ char * pString /* where to return string */ ) This routine deciphers the WIND task status word in the TCB for a specified task, and copies the appropriate string to pString.

More Related