Quote:
Originally Posted by syg00
If you really have to know, go look at the source.
|
Quote:
Originally Posted by Victor43
Thank you for the post. This is what I am trying to do is to find out whether fork() calls the clone() system call.
|
You're asking a question where you've already received the pathway to the answer.
The truth is that fork() defines system calls, and I feel you'd see this by inspecting the code.
I applaud you for asking deep questions about the kernel implementation, however I do not feel that you can only go by Q&A here, you really do need to study the code for the various kernel components you are asking about.
At that point, it becomes the question of, "are you interested in becoming a deep core kernel developer, or not?", and that's a question you may have a quick response to, "YES!" with excitement, or you may not know. But once you start reading some code, you may find, as I very much have found myself, that a lot of the code in there is not stuff I wish to play around with much.
It's not as simple as running GDB, you can run GDB on code you have, but it won't do you much good going into normal C libraries, because those are binaries, and the same applies to the kernel, you should have the matching kernel source on your system, but what is running has been optimized and has had the symbols removed. So like any debugger when you go into a library or system call, you find yourself at the assembly level, no symbols, and you can single step, but you have no idea what or where it is, especially well enough to discern much.
I've actually done one form of kernel development. Built in variables, and printk's. I asked at the time, "Hey! We probably use KDB here, ... right?" I mean, I was in a kernel development shop. And everybody looked at me askance, meaning, "Knock yourself out cowboy."
And so I gave it a try, but could not get it to work for me, so I mimicked my peers. I'll admit, that I've "configured and compiled" many custom kernels and done some minor code modifications, mostly to drivers, but I'm no kernel developer.
That said, when I've had deep core issues where I needed to modify something in the kernel, I've found what I needed by looking at the code and writing modifications, just not written entire system calls from scratch.
Same point is if I had a burning question about some kernel code, I'd read that code.