fabic974 random (binary) wanderings in the philament empires…

Linux – notes – low-level stuff

TL;DR

… personal notes and pointers about the low-level internals of Linux/kernel/Glibc/etc …

The Linux Kernel

Simplified Structure of the Linux Kernel.svg
By ScotXW - Own work, CC BY-SA 4.0, Link

Shared libraries

  • SO: shared lib. initialization :
    • Linker flags : -Wl,-init,<function> & -Wl,-fini,<function>
    • __attribute__((constructor)) void foo(void) { printf("library loaded!\n"); }
    • The constructor attr. may have a priority specification : void before_main(void) __attribute__((constructor (101))) (SO)
    • Or (via):

        namespace {
          struct initializer {
            initializer() {
              std::cout << "Loading the library" << std::endl;
            }
      
            ~initializer() {
              std::cout << "Unloading the library" << std::endl;
            }
          };
          static initializer i;
        }
      

Memory allocation

Implementations

Note: Mac OS X do not support brk() since it is based on FreeBSD ; instead it provides a libc wrapper brk.c .

Other impl.

Signals

Binaries

Linux kernel

Graphics

DRM & KMS

Other scaffholdings

TODO :

  • Have an online viewer for the Linux man pages versus the BSD man pages, and eventually the related POSIX specifications (+wikipedia etc).

Other pointers

EOF