I'm currently learning about operating system kernels and how they are built from the source code (I'm using Minix).
I'm trying to figure out where the shell commands (ls for example) get executed. I know where to locate the ls.c file (src/bin/ls) I'm just not sure where it gets called when the user types it in the terminal.
My goal is to 'hijack' the ls command to accomplish a different result without editing the command file itself ls.c (for example, the ls command now shuts down the computer or echos a string out). In order to do that I need to know where the text from the user gets parsed and the ls command gets executed.
I looked around in the source and I believe it's located inside the process manager (src/minix/servers/pm) however, this was as far as I got before I got lost.
I know this is a very specific question but hopefully I get get it solved.
Thanks in advance