Mohit Mishra Profile picture
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.memory allocation chunk 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.Image 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.Diffie-Hellman Key Exchange 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.Process vs Tasks 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.Image - 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๐Ÿ‘‡This picture from Robert Love's "Linux Kernel Development" 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.