30.10.2014 Views

Operating Systems - To Parent Directory - James Madison University

Operating Systems - To Parent Directory - James Madison University

Operating Systems - To Parent Directory - James Madison University

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Sequence of Operations in Implementing a System Call<br />

count = read(fd, &buffer, nbytes);<br />

Tanenbaum (2008). Modern<br />

<strong>Operating</strong> <strong>Systems</strong>. 3 rd Edition.<br />

Figure 1-17.<br />

© 2008 Pearson Education<br />

1,2,3: Push parameters<br />

onto the stack.<br />

4: Call the library<br />

procedure for<br />

file read.<br />

5: Place the sequence<br />

number for<br />

"file read"<br />

into a systemspecific<br />

register.<br />

6: TRAP (i.e., switch<br />

to execution<br />

of kernel) in<br />

kernel mode.<br />

7: Obtain the address<br />

of the handler<br />

for the "file<br />

read" system<br />

call.<br />

8: Execute "file read".<br />

02-Sep-2008 © 2008 Charles Abzug 55<br />

Sequence of Operations in Implementing a System Call<br />

count = read(fd, buffer, nbytes);<br />

9: Restore USER-mode<br />

and return<br />

from the kernel<br />

to the library<br />

routine.<br />

10: Return from the<br />

library routing<br />

to the User<br />

program.<br />

11: Adjust the Stack<br />

Pointer.<br />

12: Continue executing<br />

the user's<br />

program.<br />

Tanenbaum (2008). Modern<br />

<strong>Operating</strong> <strong>Systems</strong>. 3 rd Edition.<br />

Figure 1-17.<br />

© 2008 Pearson Education<br />

02-Sep-2008 © 2008 Charles Abzug 56<br />

28

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!