t-kernel A Naturalizing OS Kernel for Low-Power Cost-Effective Computers

  • 格式:pdf
  • 大小:398.20 KB
  • 文档页数:2

t-kernel:A Naturalizing OS Kernel for Low-Power Cost-Effective ComputersLin Gu and John A.StankovicDepartment of Computer Science,University of Virginiaemail:lingu@,stankovic@1.INTRODUCTIONLow-power embedded systems traditionally employ a“thin”OS be-cause of resource constraints,hardware variety,and cost efficiency. This results in two problems–First,the embedded system program-mers are limited to professionals with sufficient knowledge on hard-ware;Second,it is much slower for progress in programming lan-guages and software engineering tofind their ways to the systems with embedded microcontrollers,which is98%of the micropro-cessors market.When low-power embedded processors are used in wireless sensor networks(WSNs),the thin OS approach,if fol-lowed,leads to another serious problem–The OS services cannot meet applications’ever-growing requirements.If these three prob-lems are not solved,the transformation of the prosperous research on WSNs into a technology and market success has to be slow.Three features–virtual memory,preemptive priority scheduling, and OS protection–will greatly enhance the functionality and us-ability of WSNs.However,many low-power processors have no hardware support for these features.We design a new OS kernel, t-kernel,that supports virtual memory without write-friendly ex-ternal storage,provides preemptive scheduling without privileged instructions,and guarantees OS protection without hardware mem-ory space protection.Different than“thin”OS’s,the t-kernel is a “thick”OS in terms of functionality and complexity.Nevertheless, it is fully implemented and running on a platform with only4KB of RAM memory,and exhibits a reasonable performance.2.DESIGNTo facilitate future porting,t-kernel assumes a very small set of hardware properties–Reprogrammable(program memory can be rewritten),External storage(low-power,nonvolatile,and relatively large external storage),and Memory(some RAM available).We call computers that meet these three assumptions REM computers.Fig.1(a)shows the hardware and software components in a host node(a REM computer)with t-kernel.The program memory is where the processor fetches instructions,and t-kernel resides in the t-kernel space in the program memory.Besides t-kernel,another program,the application,resides in the external nonvolatile storage. After initializing its own working environment,t-kernel loads and runs the user application.(a)Host node(b)Mica2familyFigure1:The host node with t-kernelThe t-kernel employs a naturalization process–the kernel changes part of the application’s instructions before dispatching it for ex-ecution.After naturalization,the application code has the same functionality,but behaves in a collaborative way that achieves the required system features–it performs virtual memory accesses,en-sures that the application hands over control back to the t-kernel frequently,and protects the kernel’s integrity from problematic or malicious applications.Naturalization is performed at run time dur-ing the process of executing the application.When the controlflow reaches a block of application code,t-kernel reads that block and modifies some of the instructions to enforce the system policy.Only a fraction of instructions in the application code are translated into natins of different types or numbers of instructions,the rest remain-ing the same.Naturalized instructions is trusted and can be executed as native instructions without restraints.3.IMPLEMENTATION AND EV ALUATION We have implemented t-kernel on Mica2family motes[1].This plat-form has an ATmega128MCU,4K RAM,128KB program memory, and512KBflash as the external nonvolatile storage.On such a plat-form,the t-kernel supports64KB of virtual data memory space(16 times of the physical memory).We quantitatively evaluate t-kernel’s performance,including the over-head of naturalization,access speed of virtual memory,swapping overhead,lifetime of the external storage(flash),and,most impor-tantly,applications’execution speed under t-kernel compared to that under a thin OS.We compile a group of kernel benchmark programs which represent typical activities in a WSN.Fig.2compares the relative execution time of the kernel benchmark programs.In sum-mary,we expect current programs to have a relative execution time of1.5–4on t-kernel.With typical WSNs applications spending 90%of their lifetime in microcontroller sleep or idle state,such a slowdown does not stress the system.Hence,we believe,for a wide class of applications,it is an acceptable cost for the significant ben-efit.Figure2:Performance of kernel benchmark programs4.CONCLUSIONThe t-kernel enables solid solutions to a number of critical prob-lems in WSN system design,such as unconditional controllability, distributed debugging,and the ability of performing intensive com-putation.Working independently or as the kernel of bigger OS’s,the t-kernel significantly enhances the functionality of energy-and-cost-effective WSN platforms without increasing hardware complexity. We view it as a small but solid step toward robust,easier-to-use,and versatile OS’s for WSNs and general embedded systems.5.REFERENCES[1]J.Hill,R.Szewczyk,A.Woo,S.Hollar,D.Culler,andK.Pister,“System architecture directions for network sensors,”Proc.of ASPLOS2000,Nov.2000.t-kernel: A Naturalizing OS Kernel for Low-PowerCost-Effective ComputersLin Gu and John A. StankovicDepartment of Computer Science, University of Virginia{lingu, stankovic}@significantly enhances developers’ability to design sophisticated and reliable applications.This work is supported in part by NSF grant CCR-0098269 and CCR-0325197, the MURI award N00014-01-1-0576 from ONR, and the DAPRPA IXO offices under the NEST project(grant number F336615-01-C-1905).。