Writing an OS Kernel in a Strictly and Statically Typed Language

OS kernels have been written in weakly typed or non typed programming languages, for example, C. Therefore, it is extremely hard to verify even simple memory safety of the kernels. The difficulty could be resolved by writing OS kernels in strictly typed programming languages, but existing strictly typed languages are not flexible enough to implement important OS facilities (e.g., memory management and multi-thread management facilities). To address the problem, we designed and implemented TALK , a new strictly and statically typed assembly language which is flexible enough to implement OS facilities, and wrote an OS kernel with TALK. In our approach, the safety of the kernel can be verified automatically through static type checking at the level of binary executables without source code.

[1]  Dinakar Dhurjati,et al.  Memory safety without garbage collection for embedded applications , 2005, TECS.

[2]  James R. Larus,et al.  Singularity: rethinking the software stack , 2007, OPSR.

[3]  Nora Szasz,et al.  Specification of a Smart Card Operating System , 1999, TYPES.

[4]  James Gosling,et al.  The Java Language Specification, 3rd Edition , 2005 .

[5]  Guy L. Steele,et al.  Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley)) , 2005 .

[6]  Brian Campbell,et al.  Amortised Memory Analysis Using the Depth of Data Structures , 2009, ESOP.

[7]  David Aspinall,et al.  Heap-Bounded Assembly Language , 2004, Journal of Automated Reasoning.

[8]  George C. Necula,et al.  CCured: type-safe retrofitting of legacy software , 2005, TOPL.

[9]  Maribel Fernández,et al.  Curry-Style Types for Nominal Terms , 2006, TYPES.

[10]  Atsushi Igarashi,et al.  Resource usage analysis , 2002, POPL '02.

[11]  Heng Huang,et al.  Low-Level Linear Memory Management , 2003 .

[12]  James Cheney,et al.  Cyclone: A Safe Dialect of C , 2002, USENIX Annual Technical Conference, General Track.

[13]  Dinakar Dhurjati,et al.  Secure virtual architecture: a safe execution environment for commodity operating systems , 2007, SOSP.

[14]  David Walker,et al.  Alias Types , 2000, ESOP.

[15]  Dinakar Dhurjati,et al.  SAFECode: enforcing alias analysis for weakly typed languages , 2005, PLDI '06.

[16]  Lei Luo,et al.  A provably correct operating system: δ-core , 2001, OPSR.

[17]  John McCarthy,et al.  Recursive functions of symbolic expressions and their computation by machine, Part I , 1960, Commun. ACM.

[18]  Dinakar Dhurjati,et al.  Enforcing Alias Analysis for Weakly Typed Languages , 2005 .

[19]  Akinori Yonezawa,et al.  Compiling C Programs into a Strongly Typed Assembly Language , 2007, ASIAN.

[20]  Gernot Heiser,et al.  OS Verification - Now! , 2005, HotOS.

[21]  Junfeng Yang,et al.  Using model checking to find serious file system errors , 2004, TOCS.

[22]  William R. Bevier,et al.  Kit: A Study in Operating System Verification , 1989, IEEE Trans. Software Eng..

[23]  Philip Wadler,et al.  Once upon a type , 1995, FPCA '95.

[24]  Brian N. Bershad,et al.  Extensibility safety and performance in the SPIN operating system , 1995, SOSP.

[25]  Gerard J. Holzmann,et al.  The Model Checker SPIN , 1997, IEEE Trans. Software Eng..

[26]  Krste Asanovic,et al.  Mondrian memory protection , 2002, ASPLOS X.

[27]  Jochen Liedtke,et al.  On micro-kernel construction , 1995, SOSP.

[28]  前田 俊行,et al.  Writing an operating system with a strictly typed assembly language , 2006 .

[29]  Douglas M. Pase,et al.  System programming in Modula-2 , 1985, SIGP.

[30]  Karl Crary,et al.  From system F to typed assembly language , 1999 .

[31]  William J. Bolosky,et al.  Mach: A New Kernel Foundation for UNIX Development , 1986, USENIX Summer.

[32]  Martín Abadi,et al.  An Overview of the Singularity Project , 2005 .

[33]  James Cheney,et al.  A Linearly Typed Assembly Language , 2003 .

[34]  Anu Gokhale Computer and Network Security , 2002 .

[35]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[36]  Geoffrey Smith,et al.  A Sound Polymorphic Type System for a Dialect of C , 1998, Sci. Comput. Program..

[37]  Dawson R. Engler,et al.  Exokernel: an operating system architecture for application-level resource management , 1995, SOSP.