Link to home
Start Free TrialLog in
Avatar of arut
arut

asked on

System call overhead

I request your valuable feedback on the following questions:

1)system call overhead - what happens on a system call
  and what is the overhead involved.

  If all tasks run in privileged mode/supervisor mode,
  how can we reduce system call overhead.

2)My understanding of address space :
  The text, data, and bss portions of a task

  If two tasks share a common address space which portions
  (text/data/bss) are shared.

 
Avatar of chris_calabrese
chris_calabrese

Gosh these sound like homework questions...
Once a system receives a system call, it sets the priority of the processor to the priority of the calling function. That essentially cuts off all other requests that have lower priority from "interrupting" the processor.

Save program pointers (eg: IP - Instruction Pointer) and user data (data on the stack for example).

Processor must change mode from user to supervisor (that takes time)

Fetch a section of the code (Critical Section) and execute the system call. There can only be once process in Critical Section at any one time.

Execute the call, exit the critical section, change mode back to user mode.

Restore program pointers and data and continue executing the caller application (the application that made the system call).

Changing processor mode takes a lot of time (talking in terms of milliseconds, that's a long time for processor, esp in this modern day and age). If all codes run in supervisor mode, the longest part of the process will be eliminated. (Code will seem to run faster, but only because there's no "context switching".)

Of course there are security issues. Imagine a virus running in supervisor mode! In comparison, imagine ALL users of a computer network being administrator-equivalent.
Avatar of arut

ASKER

A few more clarifications:

Is it the processor which runs in supervisor/user mode?
(Changing processor mode takes a lot of time ...)

What are the advantages/disadvantages if all tasks run in supervisor mode (in the case of an RTOS).

Also please clarify my question on address space.

Thanks,
Arut
RTOS and BSS, what are they?
Avatar of arut

ASKER

RTOS - real time operating system

bss - place where global and static variables are stored  
      in memory
ASKER CERTIFIED SOLUTION
Avatar of st_steve
st_steve

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial