background preloader

Smunix.os

Facebook Twitter

Bran's Kernel Development Tutorial on Bona Fide OS Developer. 4.-The GDT and IDT. The GDT and the IDT are descriptor tables. They are arrays of flags and bit values describing the operation of either the segmentation system (in the case of the GDT), or the interrupt vector table (IDT). They are, unfortunately, a little theory-heavy, but bear with it because it'll be over soon! 4.1. The Global Descriptor Table (theory) The x86 architecture has two methods of memory protection and of providing virtual memory - segmentation and paging. With segmentation, every memory access is evaluated with respect to a segment. With paging, the address space is split into (usually 4KB, but this can change) blocks, called pages. Both of these methods have their advantages, but paging is much better.

Segmentation is, however, totally in-built into the x86 architecture. As mentioned before, we're going to try and set up a flat memory model. A ring is a privilege level - zero being the most privileged, and three being the least. 4.2. Access byte format 4.2.1. descriptor_tables.h 4.3. 4.3.1.

Builder

Object moved. Every time the CPU accesses virtual memory, a virtual address must be translated to the corresponding physical address. Conceptually, this translation requires a page-table walk, and with a three-level page table, three memory accesses would be required. In other words, every virtual access would result in four physical memory accesses. Clearly, if a virtual memory access were four times slower than a physical access, virtual memory would not be very popular!

Fortunately, a clever trick removes most of this performance penalty: modern CPUs use a small associative memory to cache the PTEs of recently accessed virtual pages. The TLB works as follows. But what happens if there is no TLB entry with a matching virtual page number? Hardware TLB miss handling: In this case, the CPU goes ahead and walks the page table to find the right PTE. TLB replacement policy Note that if TLB miss handling is implemented in hardware, the replacement policy obviously also must be implemented in hardware.

Wikipedia

News - Kiwi. C++ Extensions. FrontPage - SCons Wiki.