As an introduction, we can identify the following layers of the Linux kernel (bottom to upper layer):
It also contains:
The architecture specific code is in the \arch folder. This contains a subfolder per processor architecture, like \arm or \x86 This contains low-level memory management, interrupt handling, assembly routines, executable and linking format code, and more.
Device drivers code can be found in several folders.
The network stack code is in the \net folder. It contains code for the various network protocols.
The memory management code is in the \mm folder. This includes: memory management at boot time, memory allocation, memory mapping of files, memory swap to hard disk, etc.
The process management code is in the \kernel folder. This includes managing processes, threads, scheduling, stacks, signalling, Berkeley Packet Filter (BPF)...
The File system code is in the \fs folder.
This includes
The system call interface is the set of functions exposed by the kernel to the user space.
The functions are defined in the folder related to the functional domain. They rely on common code (with the possibility of using architecture specific code).
fsopenis defined in \fs\fsopen.c with the use of SYSCALL_DEFINE2 SYSCALL_DEFINE2is defined in \include\linux\syscalls.h. __SYSCALL_DEFINExmacros can be overriden by architecture dependant code, if a different calling convention is used. The \init folder contains the code used to startup of the kernel. Especially, the \init\main.c file is the starting point.
Security related code can be found in the following folders
The \virt folder implements KVM (Kernel Base Virtual Machine).