0

Typically, when a program starts executing, it begins in user-mode and then depending on the body of the code, if required enters kernel/system mode, and eventually exits in the user-mode where it exits legitimately. But consider the following C program, prog1.c:

void main()
{ 
 //empty bodied prog1.c
}  

I am of the opinion that this program/process only runs in user-mode alone. Particularly, I am also of the opinion that this program/process would never involve any kernel-mode. But want to know experts' opinions.

Thanks, SS

  • 1
    Every function which has to return hides an exit system call, so yeah, behind the scenes you are going through kernel mode even if you as a user didn't trigger it. – Tony Tannous Nov 06 '17 at 10:44
  • The OS will do all sorts of things in kernel-mode to setup the process before main() executes, and more to cleanup the process after main() returns. – asynchronos Nov 08 '17 at 17:03

0 Answers0