阅读笔记:如何给opensolaris增加一个系统调用
【程序编程相关:SA239第6章读书笔记】 【推荐阅读:SA239第8章读书笔记】原作者: eric schrock 原文来自: http://blogs.sun.com/roller/page/eschrock 【扩展信息:SA239第4章读书笔记】译注者: badcoffee email: blog.oliver@gmail.com
blog: http://blog.csdn.net/yayong 2005年7月 按:给操作系统增加系统一个简单的系统调用是熟悉os的内核代码的一个好方法,本文给出了在solaris内核中增加一个系统调用的基本步骤. how to add a system call to opensolaris when i first started in the solaris group, i was faced with two equally difficult tasks: learning the development model, and understanding the source code. for both these tasks, the recommended method is usually picking a small bug and working through the process. for the curious, the first bug i putback to on was 4912227 (ptree call returns zero on failure), a simple bug with near zero risk. it was the first step down a very long road.as a another first step, someone suggested adding a very simple system call to the kernel. this turned out to be a whole lot harder than one would expect, and has so many subtle(细微的) aspects(方面) that experienced solaris engineers (myself included) still miss some of the necessary changes. with that in mind, i thought a reasonable first opensolaris blog would be describing exactly how to add a new system call to the kernel.
for the purposes of this post, we will assume that its a simple system call that lives in the generic kernel code, and well put the code into an existing file to avoid having to deal with makefiles. the goal is to print an arbitrary(随意的) message to the console whenever the system call is issued.注:
1. 做solaris开发面临2个难题,一个是需要了解solaris开发的模式,或者说是process上的东西;而另一个就是理解solairs源代码 了.... 下一页