<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Mateo Notes</title>
    <link>https://mateoz.ir/</link>
    <description></description>
    <pubDate>Mon, 21 Sep 2026 17:59:26 +0000</pubDate>
    <item>
      <title>What Actually Happens When You Run a Program?</title>
      <link>https://mateoz.ir/what-actually-happens-when-you-run-a-program</link>
      <description>&lt;![CDATA[When we type:&#xA;&#xA;./hello&#xA;&#xA;it feels like something very simple happens.&#xA;&#xA;We execute a file, and suddenly a program is running.&#xA;&#xA;But from the operating system&#39;s point of view, there is a lot more going on.&#xA;&#xA;This post is a small journey from a command in the shell to a running process.&#xA;&#xA;---&#xA;&#xA;1. The Shell&#xA;&#xA;First, the shell receives our command:&#xA;&#xA;./hello&#xA;&#xA;The shell doesn&#39;t magically execute the file itself.&#xA;&#xA;A typical Unix shell creates a new process and asks the operating system to replace that process&#39;s program image with the requested executable.&#xA;&#xA;One important system call involved here is:&#xA;&#xA;execve();&#xA;&#xA;For example:&#xA;&#xA;char *argv[] = {&#xA;    &#34;./hello&#34;,&#xA;    NULL&#xA;};&#xA;&#xA;execve(&#34;./hello&#34;, argv, NULL);&#xA;&#xA;The interesting thing about execve() is that&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>When we type:</p>

<pre><code class="language-bash">./hello
</code></pre>

<p>it feels like something very simple happens.</p>

<p>We execute a file, and suddenly a program is running.</p>

<p>But from the operating system&#39;s point of view, there is a lot more going on.</p>

<p>This post is a small journey from a command in the shell to a running process.</p>

<hr>

<h2 id="1-the-shell">1. The Shell</h2>

<p>First, the shell receives our command:</p>

<pre><code class="language-bash">./hello
</code></pre>

<p>The shell doesn&#39;t magically execute the file itself.</p>

<p>A typical Unix shell creates a new process and asks the operating system to replace that process&#39;s program image with the requested executable.</p>

<p>One important system call involved here is:</p>

<pre><code class="language-c">execve();
</code></pre>

<p>For example:</p>

<pre><code class="language-c">char *argv[] = {
    &#34;./hello&#34;,
    NULL
};

execve(&#34;./hello&#34;, argv, NULL);
</code></pre>

<p>The interesting thing about <code>execve()</code> is that</p>
]]></content:encoded>
      <guid>https://mateoz.ir/what-actually-happens-when-you-run-a-program</guid>
      <pubDate>Mon, 21 Sep 2026 17:40:15 +0000</pubDate>
    </item>
    <item>
      <title>Hello, World</title>
      <link>https://mateoz.ir/hello-world</link>
      <description>&lt;![CDATA[Welcome to Mateo Notes.&#xA;&#xA;This is the first test post of my personal technical blog.&#xA;&#xA;I want to use this place to document what I learn while exploring systems programming, operating systems, Unix, FreeBSD, C/C++, networking, debugging, and computer architecture.&#xA;&#xA;---&#xA;&#xA;Why This Blog?&#xA;&#xA;I have always been interested in what happens underneath the abstractions we use every day.&#xA;&#xA;For example, when we run:&#xA;&#xA;ls -la&#xA;&#xA;it looks simple.&#xA;&#xA;But underneath that command, the operating system has to create and manage a process, interact with the filesystem, access directory entries, perform system calls, and eventually write the result to a file descriptor.&#xA;&#xA;That is the part I want to understand.&#xA;&#xA;---&#xA;&#xA;A Small C Program&#xA;&#xA;Here is a simple example:&#xA;&#xA;include stdio.h&#xA;include unistd.h&#xA;&#xA;int main(void)&#xA;{&#xA;    printf(&#34;PID: %d\n&#34;, getpid());&#xA;&#xA;    return 0;&#xA;}&#xA;&#xA;We can compile it with:&#xA;&#xA;cc -Wall -Wextra -O0 -g main.c -o main&#xA;&#xA;and run it:&#xA;&#xA;./main&#xA;&#xA;The program prints its own process ID.&#xA;&#xA;That tiny example already gives us several things to explore:&#xA;&#xA;Processes&#xA;System calls&#xA;File descriptors&#xA;The C runtime&#xA;The kernel&#xA;Virtual memory&#xA;ELF binaries&#xA;&#xA;---&#xA;&#xA;What I&#39;m Learning&#xA;&#xA;Some of the topics I am currently exploring:&#xA;&#xA;Operating Systems&#xA;Unix internals&#xA;FreeBSD&#xA;C and C++&#xA;Networking&#xA;GDB&#xA;Memory management&#xA;RISC-V&#xA;Computer architecture&#xA;&#xA;I am particularly interested in understanding how things work, rather than only learning how to use them.&#xA;&#xA;  Don&#39;t just learn the API. Understand what happens underneath it.&#xA;&#xA;---&#xA;&#xA;Virtual Memory&#xA;&#xA;One of the topics I&#39;m currently studying is virtual memory.&#xA;&#xA;A process sees something approximately like this:&#xA;&#xA;Process Virtual Address Space&#xA;&#xA;┌─────────────────────┐&#xA;│       Stack         │&#xA;├─────────────────────┤&#xA;│                     │&#xA;│        Heap         │&#xA;├─────────────────────┤&#xA;│        Data         │&#xA;├─────────────────────┤&#xA;│        Text         │&#xA;└─────────────────────┘&#xA;          │&#xA;          ▼&#xA;      Page Tables&#xA;          │&#xA;          ▼&#xA;   Physical Memory&#xA;&#xA;The interesting part is that the addresses used by a process are not simply physical RAM addresses.&#xA;&#xA;The CPU and operating system work together to translate virtual addresses into physical addresses.&#xA;&#xA;That abstraction is one of the foundations that makes modern multitasking systems possible.&#xA;&#xA;---&#xA;&#xA;Debugging&#xA;&#xA;I also want to spend more time understanding programs through debuggers rather than treating them as magical tools.&#xA;&#xA;For example:&#xA;&#xA;gdb ./main&#xA;&#xA;Then:&#xA;&#xA;break main&#xA;run&#xA;disassemble main&#xA;info registers&#xA;&#xA;Being able to move between:&#xA;&#xA;C source&#xA;   ↓&#xA;Compiler&#xA;   ↓&#xA;Assembly&#xA;   ↓&#xA;Machine code&#xA;   ↓&#xA;CPU&#xA;   ↓&#xA;Operating system&#xA;&#xA;is one of the things I find most interesting about systems programming.&#xA;&#xA;---&#xA;&#xA;What to Expect&#xA;&#xA;This blog will mostly contain:&#xA;&#xA;Technical notes&#xA;Experiments&#xA;Small projects&#xA;Unix and FreeBSD explorations&#xA;C/C++ experiments&#xA;Operating system concepts&#xA;Networking experiments&#xA;Debugging sessions&#xA;Things that I got wrong and eventually understood&#xA;&#xA;I don&#39;t want this to be a collection of polished tutorials.&#xA;&#xA;I&#39;d rather document the process of figuring things out.&#xA;&#xA;---&#xA;&#xA;One More Thing&#xA;&#xA;Most of the posts here will start with a question.&#xA;&#xA;Something like:&#xA;&#xA;  What actually happens when a program calls read()?&#xA;&#xA;Then I&#39;ll try to follow that question down the stack.&#xA;&#xA;Maybe it starts in C.&#xA;&#xA;Then assembly.&#xA;&#xA;Then a system call.&#xA;&#xA;Then the kernel.&#xA;&#xA;Then a device.&#xA;&#xA;And eventually, perhaps, hardware.&#xA;&#xA;That&#39;s the kind of rabbit hole I want this blog to be about.&#xA;&#xA;Welcome to Mateo Notes.&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Welcome to <strong>Mateo Notes</strong>.</p>

<p>This is the first test post of my personal technical blog.</p>

<p>I want to use this place to document what I learn while exploring <strong>systems programming, operating systems, Unix, FreeBSD, C/C++, networking, debugging, and computer architecture</strong>.</p>

<hr>

<h2 id="why-this-blog">Why This Blog?</h2>

<p>I have always been interested in what happens underneath the abstractions we use every day.</p>

<p>For example, when we run:</p>

<pre><code class="language-bash">ls -la
</code></pre>

<p>it looks simple.</p>

<p>But underneath that command, the operating system has to create and manage a process, interact with the filesystem, access directory entries, perform system calls, and eventually write the result to a file descriptor.</p>

<p>That is the part I want to understand.</p>

<hr>

<h2 id="a-small-c-program">A Small C Program</h2>

<p>Here is a simple example:</p>

<pre><code class="language-c">#include &lt;stdio.h&gt;
#include &lt;unistd.h&gt;

int main(void)
{
    printf(&#34;PID: %d\n&#34;, getpid());

    return 0;
}
</code></pre>

<p>We can compile it with:</p>

<pre><code class="language-bash">cc -Wall -Wextra -O0 -g main.c -o main
</code></pre>

<p>and run it:</p>

<pre><code class="language-bash">./main
</code></pre>

<p>The program prints its own process ID.</p>

<p>That tiny example already gives us several things to explore:</p>
<ul><li>Processes</li>
<li>System calls</li>
<li>File descriptors</li>
<li>The C runtime</li>
<li>The kernel</li>
<li>Virtual memory</li>
<li>ELF binaries</li></ul>

<hr>

<h2 id="what-i-m-learning">What I&#39;m Learning</h2>

<p>Some of the topics I am currently exploring:</p>
<ol><li>Operating Systems</li>
<li>Unix internals</li>
<li>FreeBSD</li>
<li>C and C++</li>
<li>Networking</li>
<li>GDB</li>
<li>Memory management</li>
<li>RISC-V</li>
<li>Computer architecture</li></ol>

<p>I am particularly interested in understanding <strong>how things work</strong>, rather than only learning how to use them.</p>

<blockquote><p>Don&#39;t just learn the API. Understand what happens underneath it.</p></blockquote>

<hr>

<h2 id="virtual-memory">Virtual Memory</h2>

<p>One of the topics I&#39;m currently studying is <strong>virtual memory</strong>.</p>

<p>A process sees something approximately like this:</p>

<pre><code class="language-text">Process Virtual Address Space

┌─────────────────────┐
│       Stack         │
├─────────────────────┤
│                     │
│        Heap         │
├─────────────────────┤
│        Data         │
├─────────────────────┤
│        Text         │
└─────────────────────┘
          │
          ▼
      Page Tables
          │
          ▼
   Physical Memory
</code></pre>

<p>The interesting part is that the addresses used by a process are not simply physical RAM addresses.</p>

<p>The CPU and operating system work together to translate virtual addresses into physical addresses.</p>

<p>That abstraction is one of the foundations that makes modern multitasking systems possible.</p>

<hr>

<h2 id="debugging">Debugging</h2>

<p>I also want to spend more time understanding programs through debuggers rather than treating them as magical tools.</p>

<p>For example:</p>

<pre><code class="language-bash">gdb ./main
</code></pre>

<p>Then:</p>

<pre><code class="language-gdb">break main
run
disassemble main
info registers
</code></pre>

<p>Being able to move between:</p>

<pre><code class="language-text">C source
   ↓
Compiler
   ↓
Assembly
   ↓
Machine code
   ↓
CPU
   ↓
Operating system
</code></pre>

<p>is one of the things I find most interesting about systems programming.</p>

<hr>

<h2 id="what-to-expect">What to Expect</h2>

<p>This blog will mostly contain:</p>
<ul><li>Technical notes</li>
<li>Experiments</li>
<li>Small projects</li>
<li>Unix and FreeBSD explorations</li>
<li>C/C++ experiments</li>
<li>Operating system concepts</li>
<li>Networking experiments</li>
<li>Debugging sessions</li>
<li>Things that I got wrong and eventually understood</li></ul>

<p>I don&#39;t want this to be a collection of polished tutorials.</p>

<p>I&#39;d rather document the process of <strong>figuring things out</strong>.</p>

<hr>

<h2 id="one-more-thing">One More Thing</h2>

<p>Most of the posts here will start with a question.</p>

<p>Something like:</p>

<blockquote><p>What actually happens when a program calls <code>read()</code>?</p></blockquote>

<p>Then I&#39;ll try to follow that question down the stack.</p>

<p>Maybe it starts in C.</p>

<p>Then assembly.</p>

<p>Then a system call.</p>

<p>Then the kernel.</p>

<p>Then a device.</p>

<p>And eventually, perhaps, hardware.</p>

<p>That&#39;s the kind of rabbit hole I want this blog to be about.</p>

<p><strong>Welcome to Mateo Notes.</strong></p>
]]></content:encoded>
      <guid>https://mateoz.ir/hello-world</guid>
      <pubDate>Mon, 21 Sep 2026 17:37:50 +0000</pubDate>
    </item>
  </channel>
</rss>