The Virtual Dynamic Shared Object (VDSO) is a virtual pseudo library provided by the kernel for fast-path, non-glibc direct to kernel memory syscalls for frequently used syscalls, such as gettimeofday.
man 7 libc
man 8 ld.so
Static libraries end with .a and are linked into the program at compile time. Static libraries are archive files that contain un-linked object files that are linked to a program with the ld command.
.a
Shared libraries end with .so.version and are linked to a program at run time by the dynamic linker, an external program, the location of which is usually included in the executable.
.so.
The dynamic linker (man 8 ld.so), located in the /lib or /lib64 directory as ld-libc-version.so (usually linked from ld-linux*.so*) is a program that find and locate the shared libraries needed by a program, loads them into memory, prepares the program to run by resolving the undefined symbols within the program with the symbols present in the shared libraries, then finally runs the program.
/lib
/lib64
ld-
.so
ld-linux*.so*
It can be used to load and run a program:
> /lib64/ld-2.17.so [ options ] [ program [ options ]]
> /lib64/ld-2.17.so
The linker is modified by env. vars such as:
LD_LIBRARY_PATH - Additional paths to search for libraries.
LD_LIBRARY_PATH
LD_PRELOAD - Libraries to link to first, useful for overriding certain other libraries or specific function calls.
LD_PRELOAD
> ldconfig
/etc/ld.so.cache
/etc/ld.so.conf
ldconfig
> ldd program|library
> ldd
lists the shared library/objects used by a particular program.
LD_TRACE_LOADED_OBJECTS=1 LD_DEBUG=files \ /lib64/ld-linux-x86-64.so.2 /bin/cat
> nm object file|library|executable w/ symbols
> nm
> ar
> ranlib
> strace [ -p pid | program ]
> strace
-p
After power-on, control is given over to the BIOS (Basic Input/Output System) which reads the system configuration from the battery backed CMOS and configures the hardware and performs a set of basic tests called the POST (Power On Self Test.) Current systems are now using the UEFI (Unified Extensible Firmware Interface) BIOS system, which more or less works in a similar manner to the legacy BIOS. The principle difference is in the addition of secure boot and GPT partitioning of disks.
After the boot device has been determined, the boot loader is loaded into memory by the BIOS and control is handed over to it.
The boot loader is usually located on the first sector of the disk, known as the Master Boot Record (MBR.) Too small (512bytes) to load the entire boot loader, the MBR is used to load a secondary boot loader, located elsewhere on the disk which then completes the loading of the OS. Linux typically uses either lilo (LInux LOader) or grub (GNU GRand Unified Bootloader)
The Lilo or Grub bootloaders then load the kernel, which for example may be located at /boot/vmlinux into memory and turn over execution to it.
/boot/vmlinux
The kernel then configures the CPUs and memory and initializes other hardware in the system (via their drivers) and starts the swapper (kswapd), mounts the root (/) file-system and loads /sbin/init as process 1 and starts it. In some systems init has been replaced with SystemD, which has been designed to facilitate more modern boot processes, logging, user authentication and security features such as containers.
/
/sbin/init
1
Init is configured by the file /etc/inittab which tells init what to do at each "Runlevel", which are meant to control what processes and services are supposed to be actively running.
/etc/inittab
* = Reserved
Init also manages "gettys" that connect users to the console or other lines to the system.
Finally init acts as the parent to all orphaned processes and reaps them when they exit.
Scripts for services and startup are usually stored in /etc/init.d/ (or /etc/rc.d/ in the case of Slackware.) Scripts can usually be passed the arguments "start", "stop" and "restart" to start/stop and restart the service. There may be other options depending on the service script.
/etc/init.d/
/etc/rc.d/
Special scripts in Slackware:
# init runlevel # telinit runlevel
# init
# telinit
> runlevel
# shutdown [ -rh ] time [ warning message ]
# shutdown
-rh
# shutdown -r now Reboot immediately
# shutdown -r now
# shutdown -h +10 "Dusting buffers" Halt the machine in 10 minutes.
# shutdown -h +10 "Dusting buffers"
# halt # reboot # poweroff
# halt
# reboot
# poweroff
> man 7 boot bootparam > man 8 init
> man 7 boot bootparam
> man 8 init
DOS/MBR
GPT
# fdisk [ -l ] [ devices... ] -l - List the device or all devices enumerated in /proc/partions if no device given.
# fdisk
-l
/proc/partions
# parted [-l]
# parted
help
mklabel
gpt
msdos
mkpart
rm
print
quit
set
set <partition> boot on flags: boot, root, swap, raid, lvm, etc. state: on, off
/proc/partitions
/proc/mounts
man 5 fstab
/proc/filesystems
man 5 filesystems