• [Operating System] {ud923} P3L5: I/O Management


     Visual Metaphor

     I/O Devices

     

     

    I/O Device Features 

    status registers => for CPU to find out what's happening on the device

    command registers => for CPU to control what exactly the device will be doing

    data registers => for CPU to control the I/O of the device

    Figure 36.2 Reference

    Figure 36.2 is referenced from the "I/O Devices" section in Three Easy Pieces.

     CPU Device Interconnect

    Device Drivers

    Here is a link to HP Device Drivers (like the drivers mentioned @1:13).

     Types of Devices

     

    lp => line printer

     

    Click the following links to find out more information about /dev/null (also known as the Null device) and /dev/random.

     if you want to discard the output of  a process  you can send it to /dev/null

    a more robust conterpart of dev/random is dev/urandom => create files with random bites

    Ubnutu VM Setup Instructions

     CPU Device Interactions

    interrupt or polling should be depent on the device type and the objectives.

     interrupt: signal sent from device to CPU

    polling: for CPU to access device

    Method1:Device Access PIO

     

     Method2:Device Access DMA

     

     

    the answer to each question will depend heavily on the size of data packets.

    Typical Device Access

     

     OS Bypass

     

     Sync vs. Async Access

     

    Block Device Stack 

     

    generic block layer => knows how exactly to interact with a particular driver

    => how to pass thoes operations to the particular driver and how to interpret the error messages or notifications or responses that are generated by that driver.

    driver-device => protocal 

     

    Quiz Help

    http://man7.org/linux/man-pages/man2/ioctl_list.2.html

     

     Virtual File System

     

     

    Virtual File System will specify a more detailed set of local file systems, performing the necessary translations.

    Virtual File System Abstractions 

     

    OS represent files via file descriptors. A file descriptor is created when the file is first openen.

    For each file, VFS maintains a persistent data structure called inode. => inode is a standard data structure in Unix-based system. => The file doesn't need to be stored contiguously on disk, and therefore, it's important to maintain this "index" (inode).

    To help with certain operations on directories, Linux maintains a data structure called dentry, stands for directory entry. => FS will maintain a cache of all the directory entries that have been visited. and we call that the dentry cache.

    superblock => like a map that file system maintains so it can figure out how has it organized on disk

     VFS on Disk

     

     ext2 Second Extended Filesystem

    inodes 

     

     inodes with Indirect Pointers

     


     https://zhuanlan.zhihu.com/p/24572756

     


    Maximum File Size:

    • number_of_addressable_blocks * block_size
    • number_of_addressable_blocks = 12 + blocks_addressable_by_single_indirect + blocks_addressable_by_double_indirect + blocks_addressable_by_triple_indirect

    You do not have to include units in your answers.

    ERRATA

    Properly rounding up the first answer results in 17GB or 16GiB (where GB is 10^(33) and GiB is 2^(310).

     Disk Access Optimizations

     

    as opposed to writing out the data in the proper disk location, we write updates in a log. so the log will contain some description of the write that supposed to take place.

    "block", "offset", and "value" essentially describes an individual write.

    Note that journal has to be periodically updated into proper dislocation, otherwise it will just grow indefinitely and it will be really hard to find anything

    Four techniques contribute to reducing the file system overheads and latencies.

    This is done by increasing the likelihood of accessing data from memory, by not having to wait for the slow disk head movements.

  • 相关阅读:
    MySql不同版本安装
    逆向知识第十四讲,(C语言完结)结构体在汇编中的表现形式
    逆向知识十三讲,汇编中数组的表现形式,以及还原数组
    逆向知识第十二讲,识别全局变量,静态全局变量,局部静态变量,以及变量.
    逆向知识十一讲,识别函数的调用约定,函数参数,函数返回值.
    常见注入手法第三讲,远程线程注入
    病毒分析第二讲,分析病毒的主要功能
    病毒分析第一讲,分析病毒注意事项,以及简单分析主要功能
    逆向知识第十讲,循环在汇编中的表现形式,以及代码还原
    逆向实战第一讲,寻找OllyDbg调试工具的Bug并修复
  • 原文地址:https://www.cnblogs.com/ecoflex/p/10928715.html
Copyright © 2020-2023  润新知