Beruflich Dokumente
Kultur Dokumente
Todays topic:
Queries and issues with preemptive and foreground/background
a. How do you know when the task resumes when it was initially suspended?
b. Preemptive causes the issue of indefinite suspending
Description
Temperature monitoring
The above block of code should not be broken since when returning is would have old values and can cause
the system to react incorrectly.
In-class activity:
Write psuedocode for propeller and rudder
What would happen is it does not restart when interrupted?
- Here, the system will be expecting an input but is not sure when it will arrive
- The input is sure to arrive
- In class e.g. Waiting on a bus : We know that a bus will arrive but we do not know the exact time at
which it will arrive
2) Processor specific
> Customize certain file for processor
> Start-up code
Linker scripts
> May have to write port for processor (porting)
3) Application specific
> Files that you must write for each project you create
E.g. May have to port once for processor but will have to change application file often
OS_CONFIG.H
- # defines
Tick
- Runs at regular intervals
- OS_TICK_PER_SEC sets this interval
- Why is a tick needed for pre-emptive OS?
> This function generated regular interrupts
> E.g. When a context switch is required, it is only when the tick interval expires and generates an interrupt
then the context switch can occur
IDLE TASK
- Runs when no other task is ready to run
- You do not write this ( part of kernel)
- Consider stack for idle task
Note that in uCOS II : The bigger the number assigned to the priority of a task, the lower its priority
TYPES OF STACKS:
1) C Software stack
2) Hardware stack
Note: Must create stack with enough space to accommodate for interrupts and when other routines are called
Home-Work
1) Write one task for the uCOS II OS