engineer | engineering | learning to learn the low-level system
Jun 23 โข 12 tweets โข 2 min read
๐๐ฒ๐ง๐๐ฆ๐ข๐ ๐๐๐ฆ๐จ๐ซ๐ฒ ๐๐ฅ๐ฅ๐จ๐๐๐ญ๐ข๐จ๐ง ๐๐ก๐ฎ๐ง๐ค ๐๐ญ๐ซ๐ฎ๐๐ญ๐ฎ๐ซ๐โฃ
Memory allocators like ๐ฆ๐๐ฅ๐ฅ๐จ๐ organize heap memory into discrete chunks that can exist in either allocated or free states.
Each chunk contains essential metadata along with the actual payload space requested by the application. โฃ
The chunk structure begins with ๐ฉ๐ซ๐๐ฏ_๐ฌ๐ข๐ณ๐ field storing the size of the previous chunk, followed by a size field that records the current chunk's total size along with status flags.
Jun 10 โข 7 tweets โข 2 min read
The fundamental architecture of the GNU/Linux operating system
These programs are what you see and use daily, running in whatโs called user space. Itโs a neat separation, keeping things organized and secure by isolating them from the deeper system stuff.
Just below that sits the GNU C Library, or glibc, which acts like a bridge. This layer provides the essential functions and tools that user applications rely on to talk to the system.
Whether itโs handling input/output or managing memory, glibc makes sure everything runs smoothly by offering a standardized set of commands.
Apr 13 โข 8 tweets โข 2 min read
Unlocking Secrets: How Diffie-Hellman Keeps Your Data Safe
This way of key exchange is a clever way for two people, or systems, to create a secret key they can both use, even if theyโre communicating over an open channel like the internet.
Letโs say you and a website want to share a secret. You each start by picking a random number, called a private key. These private keys are super important, and you keep them hidden, never sharing them with anyone.
Using your private key and a known number (a constant that everyone agrees on), you each create a public key. This public key isnโt secretโyou send it to each other without worrying about who might see it.
Feb 17 โข 6 tweets โข 2 min read
What comprises the state of a running program (a process or task)?
The state of a running program, often referred to as a process or task, is a comprehensive snapshot that encapsulates all necessary information to resume its execution exactly where it left off.
This state includes the values stored in the CPU registers (such as EAX, EBX, ECX, EDX, ESI, EDI, EBP, ESP, EIP, and the segment registers like CS, DS, SS, ES, FS, GS), which are critical for maintaining the context of the program's execution.
Jan 15 โข 4 tweets โข 1 min read
Virtual to Physical: The CPU's Address Translation Journey
The CPU generates a logical address to refer to data in memory, which is not the actual physical location
๐งตRead the whole thread for better understanding ๐
Also I have attached the article link for further reading.
- The Memory Management Unit (MMU) translates the logical address into a physical address in RAM
- The Translation Look-aside Buffer (TLB) stores recent translations for faster access
Jan 2 โข 4 tweets โข 1 min read
Understanding Linux's Approach to Interrupt Stacks: Hardware and Software
In Linux, when a hardware device creates an interrupt, the CPU halts its current task and moves to an interrupt service routine (ISR). This process is essential for timely handling of hardware events, regardless of other ongoing tasks.
๐งตRead the whole thread๐
Interrupt handlers use two stack types. The kernel stack is used in user or kernel mode for function calls and variables. During a user mode interrupt, the CPU switches to kernel mode, saving the user context with the process's kernel stack for the ISR. If an interrupt occurs in kernel mode, it uses the same process's kernel stack.