KernelNewbies:

Don't want to start hacking yet, but like to take apart the kernel to see how it works ?


And here is a beautiful ascii-art representation of kernel facilities/structure:

userspace process <-------------------------------------------------------------------------------------+
        |                                                                                               |
        +-------> files/directories                                                                     |
        |               |                                                                               |
        |               +-------> file -> VFS -> filesystem -> file_operations table -> function        |
        |               |                                                                               |
        |               +-------> directory(file) -> VFS -> filesystem -> file_operations -> function   |
        |                                                                                               |
        +-------> character/block devices                                                               |
        |               |                                                                               |
        |               +-------> file -> VFS -> device table -> char/block functions -> driver         |
        |               |                                                                               |
        |               +-------> file -> VFS --------------> filesystem --------------> devfs driver   |
        |                                                                                               |
        +-------> pipes/sockets                                                                         |
        |               |                                                                               |
        |               +-------> system call -> socket -> layer-4 -> layer-3 -> NIC driver             |
        |               |                                                                               |
        |               +-------> descriptor -> buffer -> descriptor -----------------------------------+-------+
        |                                                                                                       |
        +-------> system calls                                                                                  |
        |               |                                                                                       |
        |               +------> interrupt -> system call handler -> sys_syscall() -> do_syscall()              |
        |                                                                                                       |
        +-------> virtual memory                                                                                |
        |               |                                                                                       |
        |               +-------> malloc() -> mmap() -> VMA -> KMA -> page manager -> hardware memory           |
        |               |                                                                                       |
        |               +-------> malloc() -> mmap() -> VMA -> KMA -> kswapd -> swap manager -> block device    |
        |                                                                                                       |
        +-------> process management                                                                            |
        |               |                                                                                       |
        |               +-------> system call(fork) -> system call handler -> sys_fork()/sys_clone() -----------+
        |               |                                                                                       |
        |               +-------> system call(kill) -> system call handler -> sys_kill() -----------------------+
        |               |
        |               +-------> IPC -> system call(ipc) -> system call handler -> sys_ipc() ------------------+
        |                                                                                                       |
        +-------------------------------------------------------------------------------------------------------+

Anybody want to draw this over? ;)

-Brad

Reorganized it to take less horizontal space.

-Renaud

Fixed it so you can view it (removed the equals)

-Izomorfix

Made it more understandable using a bit more whitespace, but I'm not sure if it's still right (see, not understandable enough).

-Devin Torres

Hi, I have some problems with the meaning of the arrows:


>+


}") (fix me - sorry for this, but "Help" doesn't seem to work right now)

A legend is missing with an explanation of the arrows and the nodes (they are more likely self-explanatory). Distinction between different types of nodes (if there are different types) might help (or make things messy).

Something more specific: If a process wants to read from a file it calls something under files/directories or character/block devices? Do functions from files/directories call character/block devices? I'm just wanting to improve the diagram. So if answers are not helpful just ignore the question :)

-Flo

KernelNewbies: KernelSafari (last edited 2005-01-14 13:17:29 by RikvanRiel)