Elektrine lite

← Feed

@jschauma@mstdn.social

2026-10-15 14:09 UTC

Advanced Programming in the #UNIX Environment Week 6: Memory Layout of a Process In this video lecture, we are trying to get a visual understanding of what a process looks like in memory. We create a program that prints out the addresses of different elements of a program and observe the alignment of the text, data, and bss segments as well as the placement of the heap and stack. We also illustrate what a stack overflow looks like. https://youtu.be/aHmcowhoOzU

Replies (1)

  • @jschauma@mstdn.social 2026-10-16 17:16

    Advanced Programming in the #UNIX Environment Week 5: Program Startup How does a program start? "Uhm... you write 'main()' and that's it!" Not so fast! The C startup routine needs to set up the environment and moves arguments etc. into the right registers for main to be called, which then returns an int to be passed to exit(3), so use your debugger to better understand how the process begins and ends its life, often more like _start() -> ___start() -> exit(main(...)) https://youtu.be/Yul4d-BDdx8

    Open ##5275668