Weekly Kernel Dev Stream 15: x86 Assembly deep dive, Implement backtrace 🌿

  Рет қаралды 777

offlinemark

offlinemark

20 күн бұрын

(detailed timestamps in comments)
#livecoding #softwareengineering #operatingsystem
This week we go super deep into analyzing the x86-32 cdecl ABI, calling conventions, etc - in order to understand and eventually implement a working stack-based backtrace function.
Best Moment: • Weekly Kernel Dev Stre...
discord: / discord
Welcome! This is my chill Operating Systems development "gardening" project.
The "gardening philosophy" is to have fun, above everything else. This means taking baby steps and locking in small wins before building up for more ambitious projects. People also call this "hacking" on something.
My personal goal & vision is to build a minimal, high quality OS foundation which can be used for play, experimentation, and learning.
I'm personally not an expert systems programmer, although I'd like to be someday. Right now, but I'm just an intermediate one - I worked in infosec for 7 years, and music tech for 3 years. I've been exposed to the Linux kernel in both settings, but in highly constrained contexts, and mostly reading code, not writing it.
0:00 start
0:45: 🌱 Weekly update on kernel development progress and customization with MIT class homework.
9:27: 🧠 Exploring x86 Assembly development on Apple silicon computer with MIT class minimal OS.
18:39: 🧠 Understanding memory allocation in x86 Assembly through symbol table analysis.
26:28: 🧠 Understanding the manipulation of stack frames in x86 Assembly language during function execution.
34:27: 💻 Analysis of x86 Assembly code structure and stack alignment during function calls.
44:04: ⚙️ Exploring x86 Assembly function calls and stack operations.
53:34: ⚙️ Illustrating function calls and program counter manipulation in x86 Assembly.
1:02:56: 🔍 Understanding the stack frame setup and variable access in x86 Assembly language
1:14:31: 🧩 Exploration of x86 Assembly code and stack dump analysis to understand function calls.
1:25:15: 🔍 Understanding the preservation of registers in x86 assembly language and its relevance to calling conventions.
1:35:56: 💻 Exploring x86 Assembly code and printing stack pointer values in hexadecimal format.
1:50:39: 🔍 Discussion on pointer declarations and debugging in x86 Assembly
2:00:54: 🔍 Exploring how to navigate and analyze saved EVP values in the kernel development process.
Recapped using Tammy AI

Пікірлер: 6
@offlinemark
@offlinemark 19 күн бұрын
stream highlight: working backtrace function: kzbin.infoUgkxYYJPZ9tXmhSZiSavHqN8_LpdPwWIQI_r?si=kOjZ04IMR35me5So
@offlinemark
@offlinemark 19 күн бұрын
0:00 start 0:45: 🌱 Weekly update on kernel development progress and customization with MIT class homework. 0:45: Build is working with basic customization in progress. 1:14: Exploring VGA color customization and committing changes. 2:09: Continuing MIT class homework on console functionality. 9:27: 🧠 Exploring x86 Assembly development on Apple silicon computer with MIT class minimal OS. 9:27: Investigating stack pointer assignment and stack space utilization 10:16: Learning about earlyColonel entry code and x86 architecture in Kernel development 10:59: Using Apple silicon computer for development with no issues reported 18:39: 🧠 Understanding memory allocation in x86 Assembly through symbol table analysis. 18:39: Memory allocation involves initializing stack at the top of a memory region. 19:44: Symbol table reveals addresses like boot stack top at hex A, indicating memory layout. 26:28: 🧠 Understanding the manipulation of stack frames in x86 Assembly language during function execution. 26:28: Operating on the bootloaders stack frame and resetting the frame pointer to point to the stack pointer load. 27:23: Declaring extern Char and discussing the storage implications of such declarations in the function. 28:07: Questioning the use of CH star declaration and considering the possibility of using a pointer instead. 34:27: 💻 Analysis of x86 Assembly code structure and stack alignment during function calls. 34:27: The code structure involves pushing immediate values onto the stack, affecting alignment. 35:00: The stack alignment is disrupted by the sequence of push operations, leading to unaligned stack. 36:28: The dependency on EVP and ESP is highlighted in the function prologue for preparation before function call. 44:04: ⚙ Exploring x86 Assembly function calls and stack operations. 44:04: The function recursively checks if an integer is greater than zero before backtracking if not. 45:24: Each function call in x86 Assembly typically pushes 8 words onto the stack, including EBP and saved registers like EBX. 46:06: The individual delves into understanding the assembly code and calling conventions for function calls. 53:34: ⚙ Illustrating function calls and program counter manipulation in x86 Assembly. 53:34: Function calls passing arguments as pointers and integers. 54:58: Explanation of program counter push and branch logic execution. 55:07: Detailed breakdown of instruction flow after function calls. 1:02:56: 🔍 Understanding the stack frame setup and variable access in x86 Assembly language 1:02:56: EBP is pushed to save the frame pointer, followed by accessing variables by moving up the stack 1:04:00: Confusion arises due to switching between Intel and AT&T syntax, affecting the understanding of variable storage 1:05:07: Accessing function arguments involves moving up eight bytes from the base pointer location 1:14:31: 🧩 Exploration of x86 Assembly code and stack dump analysis to understand function calls. 1:14:31: Discussion on the significance of a specific value in the stack dump 1:15:08: Attempt to understand the function calls by analyzing the stack dump 1:16:25: Observation of the page directory in relation to the stack 1:25:15: 🔍 Understanding the preservation of registers in x86 assembly language and its relevance to calling conventions. 1:25:15: The importance of preserving certain registers like EBX across function calls in x86 assembly language. 1:27:41: Caller saved registers must be preserved by the calling function according to x86 calling conventions. 1:28:08: The provided resource on preserved registers in x86 assembly language helped clarify the concept for further assignment work. 1:35:56: 💻 Exploring x86 Assembly code and printing stack pointer values in hexadecimal format. 1:35:56: Introduction to printing stack pointer values using x86 Assembly code 1:37:07: Calling readEVP function to retrieve EVP value and printing it in hexadecimal 1:38:50: Determining the constant value of the stack pointer in the code execution 1:50:39: 🔍 Discussion on pointer declarations and debugging in x86 Assembly 1:50:39: Simplify the approach for now and clean up later 1:50:46: EBP points to a UN32t, while PC does not point to UN32t 1:51:15: Consider debugging to confirm pointer declarations 2:00:54: 🔍 Exploring how to navigate and analyze saved EVP values in the kernel development process. 2:00:54: Analyzing and printing information from the current DVP to understand saved EVP and PC values. 2:01:23: Continuously resetting and detecting new EVP values until eventually saving a null EVP, leading to further analysis in GDB. 2:01:40: Conducting backtrace checks in GDB to verify expected results and ensure no crashes or infinite loops occur during the process. Recapped using Tammy AI
@yashwant12-b50
@yashwant12-b50 18 күн бұрын
keep it up sir
@offlinemark
@offlinemark 18 күн бұрын
Thank you✌
@owensteve9483
@owensteve9483 19 сағат бұрын
That website could you send me a link
@offlinemark
@offlinemark 15 сағат бұрын
pdos.csail.mit.edu/6.828/2016/labs/lab1/
Why Compile a Linux Kernel from Source?
13:38
DJ Ware
Рет қаралды 27 М.
I made the same game in Assembly, C and C++
4:20
Nathan Baggs
Рет қаралды 639 М.
О, сосисочки! (Или корейская уличная еда?)
00:32
Кушать Хочу
Рет қаралды 8 МЛН
I Need Your Help..
00:33
Stokes Twins
Рет қаралды 133 МЛН
Making C Less Dangerous in the Linux kernel
44:59
linux.conf.au
Рет қаралды 76 М.
Debugging the Linux kernel with GDB
36:35
Sergio Prado
Рет қаралды 3,5 М.
How does KERNEL memory allocation work? //Source Dive// 004
44:42
Low Byte Productions
Рет қаралды 44 М.
How Does Linux Boot Process Work?
4:44
ByteByteGo
Рет қаралды 508 М.
5 Coding Projects That Give You An UNFAIR Advantage
9:40
Tech With Tim
Рет қаралды 172 М.
Why Linux is better for (most) developers!
14:59
The Linux Experiment
Рет қаралды 459 М.
Why it Was Almost Impossible to Put a Computer in Space
17:20
Linus Tech Tips
Рет қаралды 1 МЛН
cool watercooled mobile phone radiator #tech #cooler #ytfeed
0:14
Stark Edition
Рет қаралды 6 МЛН
Nokia 3310 versus Red Hot Ball
0:37
PressTube
Рет қаралды 3,7 МЛН