码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-10-27 13:04:02      阅读:117      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!