[试题] 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