[試題] 97下 薛智文 嵌入式作業系統實作 期中考

作者: rod24574575 (天然呆)   2015-04-28 17:17:24
課程名稱︰嵌入式作業系統實作
課程性質︰選修
課程教師︰薛智文
開課學院:電資學院
開課系所︰資工所、網媒所
考試日期(年月日)︰2009.05.03 公布考題, 2009.05.11 上課前(10:00am)繳交
考試時限(分鐘):
試題 :
This is a take-home exam. Please turn in a HARD copy in hand writing or any
word processing format, such latex, .doc, .html, … by May 11, 10:00AM in
class. The source codes of uC/OSII 2.0 and 2.86 can be found in lecture wiki
site. Get a password from TA if you have not done so.
1. The major change of uC/OSII 2.86 is it extends the maximum number of tasks
to 256 using the same OSUnMapTbl[] as in the following function to get the
task with the highest priority.
┌────────────────────────────────────┐
│OS_PRIVATE void OS_Sched256 (void) │
│{ │
│ INT8U y; │
│ INT16U *ptbl; │
│ if ((OSRdyGrp & 0xFF) != 0) { │
│ y = OSUnMapTbl[OSRdyGrp & 0xFF]; │
│ } else { │
│ y = OSUnMapTbl[(OSRdyGrp >> 8) & 0xFF] + 8; │
│ } │
│ ptbl = &OSRdyTbl[y]; │
│ if ((*ptbl & 0xFF) != 0) { │
│ OSPrioHighRdy = (INT8U)((y << 4) + OSUnMapTbl[(*ptbl & 0xFF)]); │
│ } else { │
│ OSPrioHighRdy = (INT8U)((y << 4) + │
│ OSUnMapTbl[(*ptbl >> 8) & 0xFF] + 8); │
│ } │
│} │
└────────────────────────────────────┘
We can use the same OSUnMapTbl[] to extend the maximum number of tasks to
512 as in the following function to get the task with the highest priority.
(the 3D idea)
┌────────────────────────────────────┐
│OS_PRIVATE void OS_Sched512 (void) │
│{ │
│ INT8U y, z; │
│ y = OSUnMapTbl[OSRdyGrp]; │
│ z = (INT8U)((y << 3) + OSUnMapTbl[OSDirTbl[y]]); │
│ OSPrioHighRdy = (INT8U)((z << 3) + OSUnMapTbl[OSRdyTbl[z]]); │
│} │
└────────────────────────────────────┘
Please compare in general, adding task, deleting task, task scheduling, …,
using these two approaches, which one is more efficient? Why? How do you
prove it? [30%]
2. Why when we run (in dos shell) 2 sessions of sample program (EX1_X86L) in
uC/OSII 2.0, the clock shown in different session might be different for
many seconds or more? How do you fix it? [30%]
3. Find an OS, describe how you can modify it so that it can run tasks with
distance constraints. Tasks with distance constraints mean they need to run
once after at most (can run more frequently) a well-defined time distance,
such as to synchronize with access points once at most 1 ms for mobile
phones or to decode and display a mpeg4 frame every 33ms. It is different
from periodic tasks, where the task only needs to be run once in a period
of time. [30%] Note that timer interrupt might need to be changed.
4. In embedded OS, what do you think it is the most important feature(s) for
Taiwan industry to be good at? Why? [10%] Hint: low cost, multi-core,
real-time, fast porting, friendly UI, scalability, portability, …

Links booklink

Contact Us: admin [ a t ] ucptt.com