Nachos 2


Published on

Nachos - Theoretical Presentation 2

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • le hace falta un chat a esto
  • supongo no vamos a dar todo lo que pongamos aqui vdd? porque la dra puso que daria mas puntos si ponemos inf extra en las presentaciones del blog
  • supongo no vamos a dar todo lo que pongamos aqui vdd? porque la dra puso que daria mas puntos si ponemos inf extra en las presentaciones del blog
  • eee obed no entiendo donde te puse los ??? Las cargas de trabajo  principales del sistema  de archivos relevantes parecen ser esque no eran con punto jajaja aaaa con razon  perdon we soy humano   jaja perdonado xD
  • we si me pueden ayudar a quitar lo blanco que tienen unas lineas :(
  • jajaja ponlo en otra diapositiva terquedad! quieres ponerlo todo en una sola jajaja triana????????
  • Nachos 2

    1. 1. NACHOS 2 Theoretical Presentation Carlos Eduardo Triana Sarmiento Jonathan Alvarado Mata Obed David Guevara Ibarra
    2. 2. <ul><ul><li>User program and its difference with Kernel </li></ul></ul><ul><li>An user program is a sequence of instructions for a specific machine, which it can directly execute by </li></ul><ul><li>loading in memory. </li></ul><ul><li>To ensure safety, security and consistency of kernel data structures, certain memory locations and instructions are available to the kernel only </li></ul><ul><li>Kernel runs in supervisor mode (or kernel mode) and as a manager for all resources available, it works on behalf of the user. Kernel loads one or many of those user programs in memory, allocates and de-allocates memory, registers and frees up resources </li></ul>
    3. 3. Sumarizing, Kernel is what runs in supervisor mode, and all other is user programs Compilers, window managers, and utility programs packaged with a typical operating system are actually user programs though they are part of system software Now we can say that all the Linux distributions are basically same. If we don’t alter the kernel code, they differ only in provided utility programs.
    4. 4. After the system boots up, kernel does some management tasks, creates and initializes the data structures necessary. Unix based operating systems then create Process 0 which runs in kernel mode. Process 0 forks and creates User mode Process called init(). Every other user programs are created by calling fork() copying parent’s address space. Record of parent child relationships are kept inside several kernel data structures. When user process is let to run, the system is in user mode and kernel mode (or supervisor mode) is achieved only via traps or system calls.
    5. 5. When you invoke nachos with the &quot;-x&quot; flag, the MIPS simulator begins executing the user program specified, instruction by instruction (the MIPS simulator is an interpreter that reads in binary instructions and simulates their effect). Whenever an event occurs that the OS needs to know about, the simulator makes a procedure call into the Nachos kernel.
    6. 6. The basic idea of virtual memory its: main memory used as a cache for backing store Virtual memory   is a memory management technique developed for multitasking kernels Virtual memory makes it possible for computers to more easily handle larger and more complex applications All implementations of virtual memory divide a virtual address space into pages, blocks of contiguous virtual memory addresses. Pages are usually at least 4 kilobytes in size. Virtual Memory
    7. 7. Page tables are used to translate the virtual addresses seen by the application into physical addresses by the hardware to process instructions Each entry in the page table holds a flag indicating whether the corresponding page is in real memory or not. If it is in real memory, the page table entry will contain the real memory address at which the page is stored. If the page table entry for the page indicates that it is not currently in real memory, the hardware raises a page fault exception, invoking the paging supervisor component of the operating system.
    8. 8. For example, if you load the operating system, an e-mail, a web browser and word processor into RAM simultaneously, is not enough space to hold it all. If there were no Virtual Memory, then once you filled up the available RAM your computer would have to say: &quot;Sorry, you can not load any more applications, please close another application to load a new one&quot;. With virtual memory, what the computer can do is look at RAM areas that have not been used recently and copy them onto the hard disk. This frees up space in RAM to load the new application.
    9. 9. Pseudo-code VM <ul><li>Construction and initialization </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul><ul><li>  </li></ul>
    10. 10.  
    11. 11. <ul><li>PageFault Exception Handler </li></ul><ul><ul><li>calculate vpn </li></ul></ul><ul><ul><li>if (pageTable(vpn).valid) go case1 else go case2 </li></ul></ul><ul><li>Case 1: page is in MainMemory </li></ul><ul><ul><li>update TLB </li></ul></ul><ul><li>Case 2: page is not in MainMemory </li></ul><ul><ul><li>find a free page: int ppn = memMap.find() </li></ul></ul><ul><ul><li>update coremap: coreMap->updateEntry(ppn, vpn); </li></ul></ul><ul><ul><li>update pageTable: TranslationEntry* entry = currentThread->space->getPageTable(vpn) entry->virtualpage = vpn; entry->physicalPage = ppn; entry->….. </li></ul></ul><ul><ul><li>load a page into ppn mainMemory from swapfile; currentThread->space->readFromSwap(vpn); </li></ul></ul><ul><ul><li>update TLB </li></ul></ul>
    12. 12. File Systems <ul><li>All computer applications need to store and retrieve information, overcoming the limitations of real storage. </li></ul><ul><li>The solution is to store information on disks and other external media files in units called: Files </li></ul><ul><ul><li>The files are a collection of named data. </li></ul></ul><ul><ul><li>The files must be persistent, meaning that should not be affected by the creation or termination of a process. </li></ul></ul><ul><ul><li>Can be manipulated as a unit operations such as: open, close,create, destroy, copy, rename, list. </li></ul></ul><ul><ul><li>The individual data elements within the file can be manipulated by operations such as: read, write, update, insert, delete. </li></ul></ul><ul><li>The &quot;File System&quot; is part of the storage management systemmainly responsible for the administration of the files in secondary storage. </li></ul>
    13. 13. <ul><li>The file system  organize  data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. </li></ul><ul><li>Without a filesystem programs would not be able to access data by file name or directory and would need to be able to directly access data regions on a storage device. </li></ul><ul><li>To achieve optimal performance, the underlying file system configuration must be balanced to match the application characteristics. </li></ul><ul><li>Disk access is much slower than memory access: </li></ul><ul><ul><li>Times measured in milliseconds and nanoseconds respectively. </li></ul></ul><ul><ul><li>It should reduce the number of disk accesses. </li></ul></ul>File system
    14. 14. File system <ul><li>The most common technique to reduce disk accesses is the block buffer cache or cache, is as follows: </li></ul><ul><ul><li>Check all read requests to see if the requested block is in thecache. </li></ul></ul><ul><ul><li>If so, the request is satisfied without a disk access. </li></ul></ul><ul><ul><li>If not, read to enter the cache and then copied to the placewhere needed. </li></ul></ul><ul><ul><li>When loading a cache block in a fully occupied: </li></ul></ul><ul><ul><li>Some block must be removed and re-written to disk if it has been modified after having brought the disc. </li></ul></ul><ul><ul><li>It presents a situation very similar to paging and solved withsimilar algorithms. </li></ul></ul>
    15. 15. <ul><li>An important technique to increase the performance of a file system is to reduce the amount of disk arm movements (access mechanism) </li></ul><ul><li>Another solution is to write the changed blocks (cache) to diskas soon as it has been written (the cache): </li></ul><ul><ul><li>Requires more e / s than other types of caches . </li></ul></ul>
    16. 16. <ul><li>In the worst case should consider a total system failure and its impact on the consistency of the file system: </li></ul><ul><li>If a critical block, a block of an inode is read from the cache and modified without re-writing to disk, a total system failure will leave the filesystem in an inconsistent state. </li></ul>
    17. 17. Control block of a file
    18. 18. Directories in UNIX systems are organized keeping certain hierarchy
    19. 20. Pseudo-code
    20. 21. Bibliography <ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul>