Uploaded September 2026 | Updated November 2026, 3 days ago
A missing `main()` function in a C program leads to a deep dive into everything that actually happens between typing a command in your shell and your code finally running.
Join Patreon : patreon.com/ncot_tech
One time donation: ko-fi.com/ncot_tech
Website : ncot.uk
After forgetting to write a `main()` function, the compiler error revealed something unexpected: a reference to `_start`, not `main`. This video traces the full startup sequence of a C program on Linux — how the shell uses `fork()` and `execve()` to launch a process, how the kernel parses the ELF binary format and its program header table, how shared libraries are loaded through memory mapping and page faults, how the dynamic linker (`ld-linux.so`) resolves dependencies like the C standard library, and how the C runtime's `_start` function eventually calls `__libc_start_main` to hand control to your `main()` function. Along the way, GCC constructor and destructor attributes are demonstrated to show code that runs automatically before and after `main()`. If you're interested in Linux internals, compiled languages, systems programming, or how binaries actually execute, this breakdown covers the layers most C programming tutorials skip entirely.
Chapters
--------
00:00 The Bug: A Missing main() Function
00:58 From Terminal to Kernel: fork() and execve()
01:52 Inside the ELF Binary Format
03:07 Shared Libraries and Memory Mapping
04:05 The Dynamic Linker
04:52 Handing Off to the C Runtime
05:05 Inside _start and __libc_start_main
05:56 Constructors, Destructors and atexit()
07:10 What Loads the Kernel? (Next Video Teaser)
07:35 Outro
Keywords
#CProgramming #LinuxInternals #SystemsProgramming #ELFFormat #DynamicLinker #LowLevelProgramming #GCC #OperatingSystems #DevTools #CodingTutorial
A missing `main()` function in a C program leads to a deep dive into everything that actually happens between typing a command in your shell and your code finally running.
Join Patreon : patreon.com/ncot_tech
One time donation: ko-fi.com/ncot_tech
Website : ncot.uk
After forgetting to write a `main()` function, the compiler error revealed something unexpected: a reference to `_start`, not `main`. This video traces the full startup sequence of a C program on Linux — how the shell uses `fork()` and `execve()` to launch a process, how the kernel parses the ELF binary format and its program header table, how shared libraries are loaded through memory mapping and page faults, how the dynamic linker (`ld-linux.so`) resolves dependencies like the C standard library, and how the C runtime's `_start` function eventually calls `__libc_start_main` to hand control to your `main()` function. Along the way, GCC constructor and destructor attributes are demonstrated to show code that runs automatically before and after `main()`. If you're interested in Linux internals, compiled languages, systems programming, or how binaries actually execute, this breakdown covers the layers most C programming tutorials skip entirely.
Chapters
--------
00:00 The Bug: A Missing main() Function
00:58 From Terminal to Kernel: fork() and execve()
01:52 Inside the ELF Binary Format
03:07 Shared Libraries and Memory Mapping
04:05 The Dynamic Linker
04:52 Handing Off to the C Runtime
05:05 Inside _start and __libc_start_main
05:56 Constructors, Destructors and atexit()
07:10 What Loads the Kernel? (Next Video Teaser)
07:35 Outro
Keywords
#CProgramming #LinuxInternals #SystemsProgramming #ELFFormat #DynamicLinker #LowLevelProgramming #GCC #OperatingSystems #DevTools #CodingTutorial










