博文

目前显示的是 十月, 2010的博文

Printf从函数库到OS跟踪流程

首先需要弄清楚:API-用户编程借口与 系统调用的区别,这里有一篇非常好的文章: http://www.tek-life.org/2010/10/12/linux%E7%B3%BB%E7%BB%9F%E8%B0%83%E7%94%A8%EF%BC%BBz%EF%BC%BD/ 另外,printf具体内部原理请见: http://www.tek-life.org/2010/10/12/printf%E5%92%8C%E6%A0%87%E5%87%86%E8%BE%93%E5%87%BA%EF%BC%BBz%EF%BC%BD/ 我仅仅是进行了code review arch/x86/boot/printf.c int printf(const char *fmt, ...) { char printf_buf[1024]; va_list args; int printed; va_start(args, fmt); printed = vsprintf(printf_buf, fmt, args); va_end(args); puts(printf_buf); return printed; } void __attribute__((section(".inittext"))) puts(const char *str) { int n = 0; while (*str) { putchar (*str++); n++; } } /* * These functions are in .inittext so they can be used to signal * error during initialization. */ void __attribute__((section(".inittext"))) putchar (int ch) { unsigned char c = ch; if (c == '\n') putchar('\r'); /* \n -> \r\n */ /* int $0x10 is known to have bugs involving touching registers it shouldn't. Be extra c...

A Skills List for Developing Embedded Software

图片
A Skills List for Developing Embedded Software   Dale Word Dept. of Electrical and Computer Engineering California State University, Chico 1. What’s Unique About Embedded Development The very nature of embedded systems dictates that the development of software for them is different than software for general purpose computers. a. Background The key factors that separate embedded computer systems from other type of computer based systems are as follows: · Dedicated Function – Embedded systems are designed to perform one specific set of functions, typically as part of a larger device or system. This is in contrast with a typical desktop system that is a general purpose computing platform, designed to support a variety of applications, each performing a different set of functions. · Limited Resources – Due to the fact that embedded systems are typically a component of a larger system, rather than a standalone computing device, they commonly are designed with limited computing resources. Th...