首页 > 其他 > 详细

Operating System: Three Easy Pieces --- LDE (Note)

时间:2015-10-27 13:02:49      阅读:226      评论:0      收藏:0      [点我收藏+]

ASIDE: Why System Calls Look Like Procedure Calls?

You may wonder why a call to a system call, such as open() or read() looks exactly like

a typical procedure call in C; that is, if it looks just like a procedure call, how does the

system know it is a sytem call, and do all the right stuff? The simple reason: it is a procedure

call, but hidden inside that procedure call is the famous trap instruction. More specifically,

when you call open() (for example), you are executing a procedure call into the C library.

Therein, whether for open() or any of the other syscall calls provided, the library uses an

agreed-upon calling convention with the kernel to put the arguments to open in well-known

locations.

 

Operating System: Three Easy Pieces --- LDE (Note)

原文:http://www.cnblogs.com/miaoyong/p/4913837.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!