COSSystemSuorce

所属分类:Windows编程
开发工具:C/C++
文件大小:109KB
下载次数:76
上传日期:2010-12-04 21:58:44
上 传 者765345
说明:  外国人写的COS系统,对做COS开发的很有帮助,从中可以学习设计原理
(Foreigner COS system, helpful to do COS development, from design principles can be learned)

文件列表:
COSSystemSuorce\Acknowledgements (3512, 2004-11-15)
COSSystemSuorce\Authors (34, 2004-11-07)
COSSystemSuorce\ChangeLog-demo (2569, 2004-11-07)
COSSystemSuorce\Copying (17982, 2004-11-07)
COSSystemSuorce\COPYING-GEEKOS (1398, 2004-11-07)
COSSystemSuorce\doc\bget (17528, 2004-11-07)
COSSystemSuorce\doc\components (1658, 2004-11-07)
COSSystemSuorce\doc\file-system (1287, 2004-11-07)
COSSystemSuorce\doc\multiboot.tar.gz (18703, 2004-11-06)
COSSystemSuorce\include\ascii.h (5157, 2004-11-07)
COSSystemSuorce\include\bget.h (1016, 2004-11-07)
COSSystemSuorce\include\cos\block_dev.h (1810, 2004-11-07)
COSSystemSuorce\include\cos\debug.h (1511, 2004-11-07)
COSSystemSuorce\include\cos\gdt.h (2715, 2004-11-07)
COSSystemSuorce\include\cos\heap.h (1467, 2004-11-07)
COSSystemSuorce\include\cos\init.h (1280, 2004-11-07)
COSSystemSuorce\include\cos\int.h (2217, 2004-11-07)
COSSystemSuorce\include\cos\mem.h (1562, 2004-11-07)
COSSystemSuorce\include\cos\page.h (3179, 2004-11-07)
COSSystemSuorce\include\cos\string.h (2079, 2004-11-07)
COSSystemSuorce\include\cos\symbols.h (1149, 2004-11-07)
COSSystemSuorce\include\cos\sysinfo.h (2337, 2004-11-07)
COSSystemSuorce\include\cos\thread.h (2672, 2004-11-07)
COSSystemSuorce\include\cos\tss.h (2222, 2004-11-07)
COSSystemSuorce\include\cos\vtext.h (1286, 2004-11-07)
COSSystemSuorce\include\cosbase.h (2114, 2004-11-07)
COSSystemSuorce\include\multiboot.h (2662, 2004-11-07)
COSSystemSuorce\include\psnprintf.h (1478, 2004-11-07)
COSSystemSuorce\include\x86-asm.h (1639, 2004-11-07)
COSSystemSuorce\include.mak (676, 2004-11-07)
COSSystemSuorce\kernel\bget.c (23587, 2004-11-07)
COSSystemSuorce\kernel\blockio.c (2221, 2004-11-07)
COSSystemSuorce\kernel\boot.s (4508, 2004-11-07)
COSSystemSuorce\kernel\debug.c (2416, 2004-11-07)
COSSystemSuorce\kernel\defs.inc (1817, 2004-11-07)
COSSystemSuorce\kernel\gdt.c (5289, 2004-11-07)
COSSystemSuorce\kernel\heap.c (4825, 2004-11-07)
COSSystemSuorce\kernel\idt.c (2662, 2004-11-07)
COSSystemSuorce\kernel\int.s (6581, 2004-11-07)
... ...

psnprintf A portable snprintf function ---------------------------- Contents of this file: 1. License 2. Brief Documentation 3. Unit tests 4. Benchmarking program 5. Known problems / TODO 6. Contact Details 7. Use of psnprintf in COS (Added by Paul Barker) 1. License ---------- This work free for commercial and non-commercial use alike. See license.txt for details. 2. Documentation ---------------- Copy psnprintf.cpp into your source directory and psnprintf into your header directory. In your source files: #include "psnprintf.h" The psnprintf function is defined as: int psnprintf(char *str, size_t n, const char *format, ...) str is your buffer n is the size of your buffer (including NULL) format is a printf style format string Return value is number of characters that would have been printed your buffer was large enough. If the size of your buffer >= the return value, the string was completely formatted into the buffer. Otherwise the buffer was completely filled, and the last byte is a terminating NULL. psnprintf does not quite conform to C99 specification as it ALWAYS terminates your buffer with a NULL, unless n is given as 0 (zero buffer size). 3. Unit tests ------------- The function is extensively tested with the unit test program provided in the test/ directory. See "test/build.txt" for information on how to build and run these unit tests on your platform. 4. Benchmarking --------------- A simple benchmarking program is provided in the test/ directory. It compares psnprintf's performance to your system's native sprintf and snprintf. In my experiences psnprintf almost always comes out equal or faster. See "test/build.txt" for information on how to build and run the benchmarking program on your platform. 5. Known Problems / TODO ------------------------ - Unit tests currently fail on Windows due to inconsitency in printf. On UNIX sprintf(buf, "%.0f", 0.0) gives "0.0", whereas on Windows it gives "0" (which is probably more correct). Currently psnpritnf follows the UNIX convention, though this might change. - Some unit tests fail on Linux due to inconsistency in printf. - Some unit tests fail on Solaris due to insconsistency in printf. - Floating point support not fully implemented. Format character 'f' is available but 'e', 'E', 'g' and 'G' will give no output unless the value is special (NaN or Infinity). - Both the numerical functions (double and integer) are quite messy due to various padding/alignment/precision options. Should look into this to clean it up a bit. - Unit testing code is UGLY and was written in a big hurry. Consists of way too many macros and is probably unnecessarily complicated. Demands a complete rewrite (perhaps not relying on system's sprintf?) 6. Contact Details ------------------ The author of the function is Alex Holkner. He can be reached at: alex@partiallydisassembled.net or aholkner@cs.rmit.edu.au 7. Use of psnprintf in COS (Added by Paul Barker) ------------------------------------------------- I have made some changes in order to use the psnprintf library in the COS kernel. See the source and header files for information: kernel/psnprintf.c include/psnprintf.h Also see the license at: license-psnprintf-0.4 This code is used as the backend to my TRACE(...) and *printk(...) functions. Many thanks to Alex Holkner! - Paul Barker (16/10/04)

近期下载者

相关文件


收藏者