0
$\begingroup$

Codes written in machine language can have access to both CPU modes (Kernel and user), since the OS is bypassed, correct?

$\endgroup$
  • 3
    $\begingroup$ No, only the OS runs in privileged mode. It doesn't matter how you produce your code. $\endgroup$ – Yuval Filmus Feb 25 '16 at 23:18
7
$\begingroup$

No. The Operating System is going to use context switching and virtual memory to hide the fact that there are multiple processes running on the computer. Native code does not mean you have full control to the CPU registers, global physical memory. Your program, if not privileged, is still running in user mode. You need to use syscalls to do lower level tasks. The operating system provided a virtual and abstract environment for the program to make them convince themselves they are running on a dedicated machine.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.