<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 2, 2017 at 1:38 PM Philipp Stanner <<a href="mailto:stanner@posteo.de">stanner@posteo.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Dear Patrick, dear Zoran & List,</p>
    <p>thank you, this was *very* helpful. I had some misunderstandings
      regarding function and features of the CPU-modes.</p>
    <p>Let me sum it up again and feel free to correct further mistakes.</p>
    <ul>
      <li>16-Bit-Real Mode: No virtual memory, no segmentation. 2^20
        addresses of memory.</li></ul></div></blockquote><div><br></div><div>and really dumb segmentation to get that 20 bits: 16 bit segment, 16 bit offset, 20 bit address from (seg << 4) + offset</div><div><br></div><div>So a given address in real mode can be created many, many different ways: </div><div>f000:ffff0 and ffff:0 are the same address. The horror. I saw a talk once by the inventor of this mess and he was actually proud of it. Go figure.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><ul>
      <li>Protected Mode (flat mode?): CPU is in Protected Mode, Paging
        is off. The primary difference to Real Mode is that 2^32 Bytes
        of memory are available. Coreboot + Payloads use this mode,
        because they need >1MiB of memory due to various reasons</li></ul></div></blockquote><div><br></div><div>And we want the 32-bit instruction set. Also, flat is not really the right word. You can have a segment descriptor that has a built in offset and a built in limit such that, e.g., you can only address 20 bits of the 32 bit address space starting at, e.g., 0x2000. I think you would find a reading of how the descriptors work very interesting.</div><div><br></div><div>Addresses in protected mode are virtual addresses, and are mapped to physical addresses as determined by the segment used. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><ul>
      <li>Virtual Mode: Paging is on, the MMU is on. Memory can only be
        accessed by using virtual addresses. Details are specified in
        the GDT.</li></ul></div></blockquote><div><br></div><div>no. The GDT is about segments, i.e. protected mode. I don't like the word virtual here unless you want to say virtual address. When I've used the word virtual before on the list, I've gotten in trouble, because people associate virtual memory with swapping pages to a disk. Just call it paged mode and there's less confusion. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><ul>
      <li>Long Mode: Paged virtual 64-Bit mode. Standard mode of modern
        operating systems (while I presume Protected Virtual Mode is the
        Standard for any OS on i386)</li></ul></div></blockquote><div><br></div><div>pretty much.</div><div><br></div><div>thanks</div><div><br></div><div>ron</div></div></div>