title: Global variable, assembly
body: <pre><code>.code32
  .globl var
  var:
      .long 0
  </code></pre>
  
  <p>Let's assume elf binary format.
  This is a piece of assembly ( I have no idea what exactly assembly it is, 
  I am familiar with <code>nasm</code>). 
  I cannot understand what does it mean. </p>
  
  <p>How is it interpreted? 
  . It looks like global variable, but where it in an elf format file? In global section or in data section? When will be known address of var? After compilation or after linking?</p>
  
  <p>Actually, the problem is with understanding Pintos's <code>start.S</code> file.
  <a href="https://github.com/abhinav-upadhyay/Pintos/blob/master/threads/start.S" rel="nofollow">https://github.com/abhinav-upadhyay/Pintos/blob/master/threads/start.S</a></p>
  
  <p>Please note, that in line <code>202</code> there is the same issue. But, I cannot understand why in the line <code>48</code>:
  <code>addr32 movl %eax, init_ram_pages - LOADER_PHYS_BASE - 0x20000</code>
  It looks like <code>init_ram_pages</code> was virutal address. But, please note that in the line <code>48</code> the CPU is in real mode still! </p>