In modern OSes, kernel procedures, as a rule, work in privileged processor mode (other names are kernel mode, supervisor mode). In this mode, programs have direct access to all hardware resources, such as ports of external devices, real addresses of RAM elements, etc.
Protected processor mode, or user mode, isolates the RAM allocated to the process from other processes. In addition, access to external devices in user mode is possible only through calls to the OS kernel. All application programs and OS utilities work in user mode.