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

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

1 Answer 1


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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