0

I'm searching about some materials in Operation System course during reading a book with this subject.

I have a question and need your helps. What is the process of relation between a specific library of any programming language (now I'm talking about C library) and OS?

For example totally, what happens when you use scanf() function in C programming in a cycle until the data meets OS (for example a close source OS) methods?

Mehrdad
  • 41
  • 1
  • 1
  • 4
  • 1
    Why not check it out on an open-source OS/lib? All the code and data is there, just waiting for you to analyse it and/or step through it with your debugger:) What is the problem with you doing that? – Martin James Feb 19 '16 at 12:49
  • It's just such a exercise. Would you explain more please? I wanna a perspective of process and the type of data not important. Which titles I should search about? – Mehrdad Feb 19 '16 at 14:09
  • Start here: https://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/fscanf.c;h=4c10444a0a0899c2a9f3a580f8fac08c27e54834;hb=HEAD – Daniel Jour Feb 20 '16 at 09:07
  • In general it is something like: *Your program -> scanf -> libc -> system call -> kernel*. When you type, the kernel get invoked by the keyboard interrupt, record the keypresses and return. The first program that ask for keypresses (for example a window manager or a terminal) read them and process them (for example dispatching them to the focused widget or storing them). If no key press is present, the system call put the process on wait. – Margaret Bloom Feb 20 '16 at 16:12
  • This question is problematic. If you are asking this from a high level, it is not clear what aspects you are interested in. If you want to know everything, that would take an entire book to describe. Topics here include switching into kernel mode to execute a system service and interrupt handling.. – user3344003 Feb 24 '16 at 05:29
  • Thank you all my friends. I didn't mind in high level. I meant just codes and functions in the libraries. I've started from stdio to systemcal in OS. – Mehrdad Mar 02 '16 at 09:37

0 Answers0