{"format":"brushup-mindmap-v1","id":"os-00-sheet5","title":"I/O管理","structure":"timeline-h","theme":"auto","root":{"id":"7f2b43614e7932310d72fad486","topic":"I/O管理","expanded":true,"children":[{"id":"0d6a42a9b16ae27302131a70eb","topic":"I/O设备分类","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-1fc7cca04627a2.svg"},"children":[{"id":"ba0a825f80f86ca8ac27db0a81","topic":"特性分类","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"17cb6344d7cba6078ab86aa180","topic":"人机交互类","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"3c270c74-7fbb-4b21-a9fb-cf99373c587c","topic":"如：打印机、显示器、键盘、鼠标","expanded":true},{"id":"13894973-505c-454a-8ff2-82b53053c016","topic":"交互速度较慢，一般是以字节为单位交换的","expanded":true}]},{"id":"9d484dc718abbba71f30380ee0","topic":"存储设备","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"cca6a799-b827-4f57-a714-5df4a3732085","topic":"如：磁盘、磁带、光盘","expanded":true},{"id":"c1ae1f75-0b73-4c39-b9be-c93402fc3e10","topic":"交互速度快，一般以多字节组成的一个块来进行交换的","expanded":true}]},{"id":"7e6a11a224582cf99e82f8c0f5","topic":"网络通信","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"06581685-2d7f-4e66-8932-cdc606b01ea8","topic":"如：网络接口、调制解调器","expanded":true},{"id":"97ae2f82-02ae-4358-a8c9-19035eb92469","topic":"速度居中","expanded":true}]}]},{"id":"d1caef215c68a745d52e6a6024","topic":"传输速率分类","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"28eb69ff2d8a896f3d7c7af57f","topic":"低速设备","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"b1450c27-2d4c-4a01-9df1-ce40846088bf","topic":"几B到几百B/s","expanded":true},{"id":"3389c064-2a1c-4a45-985e-381e10fe054a","topic":"键盘、鼠标","expanded":true}]},{"id":"f33aed9db69919a32386c86c6f","topic":"中速","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"68132e4c-02c2-4706-af9d-49563641cbee","topic":"几千B到几万B/s","expanded":true},{"id":"901baca7-3b1d-48ac-b970-10bc3d20c00f","topic":"打印机","expanded":true}]},{"id":"8588d66a84a9136ab8036bb9a3","topic":"高速","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"f572b626-7907-4d98-92e0-e5fe1b08b668","topic":"兆B/s","expanded":true},{"id":"82aab58e-2488-4a52-9b98-16e722363aec","topic":"磁盘、U盘","expanded":true}]}]},{"id":"316a97a297ca81c3ac229b9517","topic":"信息交换分类","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"2769477717696bdbccd51aeb7a","topic":"块设备：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"61083c74645aecad944c7bc3f6","topic":"单位：","expanded":true,"children":[{"id":"f4689e353768bba15a23f9bbc1","topic":"以数据块为单位存取","expanded":true,"children":[{"id":"201db6c4-6d25-49bb-af1e-4a08659f7cb4","topic":"可寻址、支持随机存取","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"74d92a229279ccc6296b39b4b0","topic":"随机：","expanded":true,"children":[{"id":"7ccb544d191ab0e60e3cf865b3","topic":"可寻址，可随机存取","expanded":true}]},{"id":"b658ac96d08ac61b22432a718b","topic":"例如：","expanded":true,"children":[{"id":"80aae5193d1962dcc8b41ab9f9","topic":"磁盘","expanded":true}]}]},{"id":"9cfbb500656a2ee1617af9b266","topic":"字符设备：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"c2b92af95eda9eec8a924840d3","topic":"单位：","expanded":true,"children":[{"id":"85192c02b1799fcd4d051916de","topic":"字符","expanded":true,"children":[{"id":"f195afad-5eb8-4835-9394-461f180712f9","topic":"不可寻址、不可随机存取，使用中断驱动","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"dc5ab7b446ab04bb3d573a5934","topic":"随机：","expanded":true,"children":[{"id":"2dda8046135b771e28232bbe01","topic":"不可寻址","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"fb0a3682fe5933ab8a8499fd84","topic":"例如：","expanded":true,"children":[{"id":"891b88d33f0ac6a6c5df8a0265","topic":"打印机","expanded":true}]}]}]},{"id":"285a216d-2b53-4fcd-b617-463c45cea322","topic":"IO应用程序接口","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"a3114cb7-bfbb-4151-9517-57c3cf6a8569","topic":"字符设备接口","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"99a0766f-8df0-42f3-b13a-6fc7284007c7","topic":"例如：键盘、打印机","expanded":true},{"id":"2e3dc4ed-2901-4794-853c-6fd6dd2404da","topic":"输入输出：get、put指令","expanded":true,"children":[{"id":"37349513-be58-4199-aba9-8cddd2acd1b6","topic":"IO设备内部用一个字符缓冲区","expanded":true}]},{"id":"8642a4f9-4a5c-4eaa-b5a1-21f3e695aa28","topic":"控制：in-control指令","expanded":true}]},{"id":"87f8fd77-ca29-494a-955e-b8961fbc0db2","topic":"块设备接口","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"6274b3da-f765-4469-ab26-b9965b2392c9","topic":"交换数据块、例如：磁盘","expanded":true},{"id":"8063bcbe-b3ee-4eaf-bd4b-d1e7d6d4b9d7","topic":"通常使用DMA的IO方式","expanded":true}]},{"id":"648244e2-5a36-4580-acc4-f19b1071869b","topic":"网络接口","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"66afeccb-7a03-4aab-9686-503cfc584c1c","topic":"网络通信接口、例如socket","expanded":true}]},{"id":"6dd40feb-387e-4a96-8397-fe3321e5819e","topic":"阻塞IO","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"8b0b79b9-11b1-429e-8039-6785680c088d","topic":"阻塞IO是调用IO的时候，阻塞进程","expanded":true}]}]}]},{"id":"0b69a88cea299ca6e0384bc6fb","topic":"I/O控制器","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-bca4f4c7be28bf.svg"},"children":[{"id":"d7803490-2d67-470d-84f7-436eb38c5e12","topic":"I/O接口","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"06afd3e0-ccc4-4821-a343-9092f3089fa5","topic":"I/O控制器","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"68cf8728-f565-482a-8a58-757c1c271a29","topic":"设备控制器","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"dbaf8463-c2ab-4068-8d9a-fb8b3caab96d","topic":"I/O内部","expanded":true,"children":[{"id":"539ecc1a-69c2-4ed3-bd23-25e73bd90b76","topic":"机械部件","expanded":true,"children":[{"id":"8502dc1a-e09e-4075-a91a-7bcb976ddacb","topic":"看得见摸得着的实体","expanded":true}]},{"id":"74e36f2d-840e-49f4-81c8-9dc24ad68dab","topic":"电子部件","expanded":true,"children":[{"id":"0b2b380e-5082-43fc-bcaa-4f2d748ac643","topic":"藏起来的电路板","expanded":true}]}]},{"id":"454b6ce1cb0bc0b3edb79a75bc","topic":"I/O控制器组成","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"1a98e2211d291bd08175ca02c6","topic":"图示","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-b315506c02dc5b.png","width":686,"height":409.6},"children":[{"id":"cf224b2a-7eb7-428b-859b-f948987fc0ab","topic":"由图可知：","expanded":true},{"id":"c53b4f8e-e491-4bda-9523-a5d4de9513c6","topic":"1. 一个I/O控制器，管理多个IO设备","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"032258d7-f851-4300-947a-e1328b3f1991","topic":"一个I/O设备中，也可以连接多个I/O控制器（多通路IO系统）","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"301986af-1d87-49ef-b624-18bd694743f6","topic":"2. 每个I/O控制器中可以有多个(相同或不同的)寄存器。","expanded":true},{"id":"8d07e13c-7c77-44db-a7b9-edf38ca3bee2","topic":"3. 一个I/O控制器中有一个I/O逻辑，负责接受和识别CPU的命令，通过这个I/O逻辑，可以使这个I/O控制器管理的设备和CPU能够进行交互","expanded":true},{"id":"7508e12f-3834-498b-8291-930ec5cef618","topic":"4. I/O逻辑把命令发送到对应的接口处，由接口处的线来进行数据、控制的发送。同时也可以获得设备发来的状态","expanded":true,"children":[{"id":"c2e2701a-f9a4-4dff-be83-466d3e0084ba","topic":"这里的I/O逻辑到设备的接口模型和CPU到I/O控制器的模型基本一致","expanded":true,"style":{"background":"#8EDE99"}}]}]}]},{"id":"39c8835291ea798f7caf7bb817","topic":"I/O控制器功能","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"6413ca6f-3bed-472c-8b46-3af5272d37af","topic":"CPU无法直接控制I/O设备中的机器部件，所以I/O设备中还要有一个电子部件来作为中介","expanded":true},{"id":"450b2231516995ba3ae0d91e4f","topic":"又称：","expanded":true,"children":[{"id":"737a82c679aadeb064d61b7de7","topic":"设备控制器","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"4ebabf1166298a106fbeaac505","topic":"功能：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"426a34e02c986d127e5ce9ec71","topic":"接受和识别CPU命令","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"f14b17a32d89351cd95c9af63d","topic":"把CPU的命令：例如read/write，放到【控制寄存器】中，同时通过【控制线】告知I/O设备发送了命令","expanded":true}]},{"id":"9e788de5a589482d30aac821c4","topic":"向CPU报告设备状态","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"6459899d0a8939d1f185cb0457","topic":"【状态寄存器】，表示空闲忙碌","expanded":true}]},{"id":"fcf9829b6d8b5405f30f7a92b0","topic":"数据交换","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"8ddaaaba234a4db982945ab185","topic":"读写数据都放到【数据寄存器】","expanded":true}]},{"id":"f599b47a60f8f4e996b48a775c","topic":"地址识别","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"baa8f6bcc5d948a4739ecb5683","topic":"把逻辑IO寄存器地址翻译为物理地址，通过【地址线】进行传输","expanded":true}]}]}]},{"id":"4b48044e-7b90-4e97-b7ab-37d53260e7b6","topic":"I/O 端口","expanded":true,"children":[{"id":"e4ba7430-eddf-49fa-9619-8ad5e7e8c0bb","topic":"设备控制器中可被CPU直接访问的寄存器","expanded":true,"children":[{"id":"d6b780c0-e56b-4114-8b31-ca16d4da65af","topic":"上面白框","expanded":true}]},{"id":"802d6911-cfc5-4a58-88fd-e6718439f790","topic":"独立编址I/O","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-eee794b1609bd7.png","width":210.38,"height":182.21},"children":[{"id":"ddeadcab-978e-4e30-ad5b-b323516bdd5b","topic":"统一编址 = 内存映射I/O","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-50765270cd8a7d.png","width":145.64,"height":175.45},"children":[{"id":"0b5326dd-75df-4f1c-bd30-3e90103436fb","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-8afe1875b1bf46.png","width":507.04,"height":273.91}}]}]},{"id":"f63841ae-7726-457f-9cdb-ea0930b61c0f","topic":"内存映射I/O简化了指令","expanded":true,"style":{"background":"#FF9595"}},{"id":"379738be-7639-4b3d-8f5f-74cbe86e95c2","topic":"寄存器独立编址让指令设计变得复杂，需要单独设计和read write相区别的指令(input output)","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"d869db0e88d99c188315ebb4b7","topic":"I/O控制方式","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-39db04436ae9b5.svg"},"children":[{"id":"f69abaa24c28418f41329befc4","topic":"程序直接控制","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"da3b7fc4637b892c1f97e83885","topic":"图：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"6f36e1fb-ed09-4ab6-8109-71e6b812c618","topic":"图示","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-5cf7eabd06d185.png","width":299.32,"height":388.05},"children":[{"id":"503df6f3-de26-4227-9438-03c57042ab0c","topic":"CPU不停的进行轮询测试","expanded":true,"style":{"background":"#FDD834"}}]}]},{"id":"2d9976145c298dd541b53893f0","topic":"CPU干预：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"645eb6d5-05ee-4a03-b9f6-5f019cb16ff6","topic":"非常大","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"3868eaf2edebf3d903cd89f77a","topic":"读写单位：","expanded":true,"children":[{"id":"2f381e60-c5f3-4fa4-a437-dbe3b8ebe12c","topic":"字 word","expanded":true,"children":[{"id":"a9a9fb58-117b-49d7-97ba-9432703da3a1","topic":"NOT 字节byte（因为读取的单位是按数据总线的位数决定的）","expanded":true}]}]},{"id":"da5a0cf73e9b2eec790c3a321c","topic":"数据流向：","expanded":true,"children":[{"id":"0ad78f2c-5dfe-43f2-b954-984f676a7801","topic":"I/O控制器 -> CPU -> 内存","expanded":true}]}]},{"id":"1eea4eafda79e1b68df47b4dc5","topic":"中断驱动方式","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"181b169f2d0a7f2074e13a7dd2","topic":"图：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"0d19a901-bf10-44d6-b819-1f7d06927d1a","topic":"图示","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-ae5009cb96313b.png","width":194.06,"height":378.76},"children":[{"id":"aab2a43c-ec0f-41b1-98f3-b069f8da550d","topic":"CPU中断去做其他事情","expanded":true,"style":{"background":"#FDD834"}}]}]},{"id":"97f8fc6dbf1a0eb096bb284ae3","topic":"CPU干预：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"33cbd714-16e6-4464-b092-4bb4ff7837d2","topic":"不高，可以切换到其他进程","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"a8fad1e0ea2a32f6bc966a689b","topic":"读写单位：","expanded":true,"children":[{"id":"7911b462-e607-46c4-bd30-6a9ab049d84c","topic":"字","expanded":true}]},{"id":"27189935568b7dcf16d6d9d19d","topic":"数据流向：","expanded":true,"children":[{"id":"561cc890-8e5e-4f34-9acc-93f98eb94d7a","topic":"I/O控制器 -> CPU -> 内存","expanded":true}]},{"id":"d0a88e1195ebd047168b7979d3","topic":"何时检查中断：","expanded":true,"children":[{"id":"7472e0db-9feb-472d-a6af-75f4521ae41a","topic":"在指令周期的末尾的时候进行检测","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"52fab144b92b0a69efdd782611","topic":"中断时，CPU：","expanded":true,"children":[{"id":"f1c2bf31-b974-4363-9823-afd666b73808","topic":"保存在执行程序的上下文，然后去执行中断处理程序","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"6c4ac94c011ad843b21819d3dc","topic":"DMA方式","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"8bdf8dfe-4341-4083-8b2d-58629a224959","topic":"图：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"63fd3a20-7b97-47c2-8824-3b90b2ff0dee","topic":"图示","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-c540ad2b4672d6.png"}}]},{"id":"8b69b54ee7fadf9bef7ada1f8b","topic":"DMA控制器的组成：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"0203f08c-6604-4c17-94b4-e5ea354d0b66","topic":"图示","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-eb0255b53cd2bb.png","width":529.02,"height":207.75},"children":[{"id":"b17956e6c9e87de7fae76b9b90","topic":"四个寄存器的作用：","expanded":true},{"id":"34dd60bc-4bda-425d-ab17-5fc3a65199ec","topic":"DR：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"16305bf5-cfaa-48ea-8946-fae971e34ef9","topic":"Data Register，用于暂存设备和内存交换的数据","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"d9e00c90-8f52-4d5b-ac15-136c129bdddd","topic":"MAR：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"0adb6c7d-75fa-41ee-81b0-727bf3bc5186","topic":"Memory Address Register，指明内存的起始地址","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"2070b83e-b419-4b33-898c-a2b71baad01c","topic":"DC：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"8ee5a0d9-bb6b-48e0-b39a-df86924b3ef7","topic":"Data Count，存在本次要传送的字数（或字节数，都可以）","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"6feecaa4-56bd-400e-b1fa-248bf0d139d7","topic":"CR：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"017b9644-5de9-44c0-a48d-792951bb6a6d","topic":"Command Register，用于接受CPU发来的命令","expanded":true,"style":{"background":"#8EDE99"}}]}]}]},{"id":"7fe929e95c3b100d5b4fea3449","topic":"CPU干预：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"7a3061f8-b880-4b97-9568-131fc53c0191","topic":"很低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"662aa101-8021-4958-824c-c1b7d2af1116","topic":"CPU指明内存的哪个部分和磁盘的哪个部分需要进行数据交换","expanded":true}]}]},{"id":"c3aae8e9f08b2db7183e6a685d","topic":"读写单位：","expanded":true,"children":[{"id":"1663cac2-6ac6-4249-9412-ecfe28eb7db8","topic":"一个块","expanded":true}]},{"id":"b2fbbd9ae978c7c5a8653a35e1","topic":"数据流向：","expanded":true,"children":[{"id":"884b5f79-235b-4b3b-9ea2-40e006a71a08","topic":"内存 <-> I/O","expanded":true}]},{"id":"ad6b6e7016886067bc48885c40","topic":"缺点：","expanded":true,"children":[{"id":"6c5bf547498acc960b36dab233","topic":"一次只能读一个/多个连续块","expanded":true,"style":{"background":"#FF9595"}},{"id":"94b98d7d124bf0bd24fa3be663","topic":"读写多个离散的块很麻烦","expanded":true}]},{"id":"25d03a6b-6587-44a7-9d20-7660c828fce2","topic":"例如：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"ef34e640-ec67-496b-8e94-1c0df1936598","topic":"磁盘","expanded":true,"style":{"background":"#FFABD5"}}]}]},{"id":"4ad8efc5950a82da6390e8a9a9","topic":"通道方式","expanded":true,"style":{"background":"#D0D0D0"},"children":[{"id":"d77dbf88-9618-4d44-beab-666d9626968b","topic":"通道技术是一种硬件机制","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"70cec1d9-e6f5-4900-8d53-dfcbee8ac6b8","topic":"在计组中有学，例如有通道三总线模型等等","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"2c62cf05-c5d6-43ac-8aab-d825b79e6067","topic":"将众多指令直接编写在通道文件中，CPU交付于I/O处理，I/O将指令执行完成后再通知CPU","expanded":true,"style":{"background":"#FDD834"}},{"id":"2d4b8105-9e5f-43f9-aeb2-4fbc033126ab","topic":"又称为","expanded":true,"children":[{"id":"93e3ab4e-e576-4544-841b-842d17588077","topic":"I/O处理机","expanded":true}]},{"id":"6b385483279a9462c1a2d95339","topic":"CPU干预：","expanded":true,"children":[{"id":"c74a1055-3ed3-4ac7-a088-1e89bdae785c","topic":"最低","expanded":true}]},{"id":"163acf5575c901fc2208288046","topic":"读写单位：","expanded":true,"children":[{"id":"aa98e46f-7639-410e-a154-a0d161bea440","topic":"多组连续的块 = 一组离散的块","expanded":true}]},{"id":"fdebef6076ea6d2f1498e87d02","topic":"数据流向：","expanded":true,"children":[{"id":"11c5e0b9-7856-4cd3-b02d-69facf496d59","topic":"内存 <-> I/O","expanded":true}]},{"id":"16a6924c-b244-41d7-9145-e48d47544d75","topic":"通道分类（拓展）","expanded":true,"style":{"background":"#D0D0D0"},"children":[{"id":"a5bd5036-29ab-4742-94e2-dba2bd703230","topic":"字节多路通道","expanded":true,"children":[{"id":"6c911c37-eb05-4e36-993e-f0c3c966e2c0","topic":"大量的低速、中速I/O设备","expanded":true}]},{"id":"131ce963-4a97-48e6-ab61-531a96261575","topic":"数组选择通道","expanded":true,"children":[{"id":"00d72e6f-ef38-4eaf-8a0d-475317f1dbd7","topic":"少量的高速I/O设备","expanded":true}]},{"id":"ac748b46-02f1-4de7-a0bd-61906dd75b97","topic":"数组多路通道","expanded":true,"children":[{"id":"8405e704-917f-4d7f-bc04-9fdb5c439333","topic":"大量的高速I/O设备","expanded":true}]}]},{"id":"93399750-f444-4a04-a1b7-f40215c34255","topic":"通道控制设备控制器，设备控制器控制设备","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"d6b2edf6-76dd-4a6f-93c5-7881ef258c8d","topic":"DCT、COCT、CHCT、SDT","expanded":true}]}]},{"id":"a7deafe4-e47b-48a0-b5b7-ffd13455a0c7","topic":"总结：中断时机","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"bb82009d-6c16-4672-aa9f-583c90d78c35","topic":"程序直接控制方式","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"d87816d5-4dd9-41f2-ac07-0b520c610757","topic":"没有中断：CPU定期轮询检查I/O操作是否完成","expanded":true}]},{"id":"ede161f2-52a8-4ead-8604-a021979e9941","topic":"中断控制方式","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"dd0544c0-fe21-4051-828f-5b28b409f359","topic":"中断发生的时机：每完成一个字的读写（CPU完成的读写），I/O控制器向CPU发出一个中断信号","expanded":true}]},{"id":"936a9e65-f923-4c41-928c-1edbc12bc677","topic":"DMA控制方式","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"d129f84a-198f-42a7-bc77-9936a0c38097","topic":"中断发生的时机：CPU向DMA控制器指明读写操作相关参数，每完成一整块数据的读写（DMA完成的读写），DMA控制器向CPU发出中断信号","expanded":true}]},{"id":"dda52e9e-0ddc-41ff-9fe3-9411a38b6e0d","topic":"通道控制方式","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"34a23382-13e1-42d3-9e15-be7d4736f691","topic":"中断发生的时机：CPU向通道指明通道程序在内存中的地址，通道执行完通道程序后，通道向CPU发出中断信号","expanded":true}]}]}]},{"id":"40fa0fc48949c07e0324d97904","topic":"I/O软件层级结构","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-0eb260ceca6ca7.svg"},"children":[{"id":"edc5492e-2276-4ad1-b71e-caf80e698d19","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"5bee01d3-8729-47c5-a7fc-03fa76721260","topic":"10-13、17","expanded":true}]},{"id":"b4722863-e7a9-4530-b753-77792548f41f","topic":"一共有五层","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"2a9817fd-f7fc-4c30-860d-9da1f08b9c3d","topic":"用户层I/O软件","expanded":true,"style":{"background":"#FF9595"}},{"id":"f54fb409-a159-45ec-8673-c2514d52f95d","topic":"设备独立性软件","expanded":true,"style":{"background":"#FF9595"}},{"id":"cd29cdfd-2929-4a4c-bc3a-823fd57b3a2e","topic":"设备驱动程序","expanded":true,"style":{"background":"#FF9595"}},{"id":"effd6a0e-dd21-4301-b5b0-6fdfb69c72de","topic":"中断处理程序","expanded":true,"style":{"background":"#FF9595"}},{"id":"6e787a53-f80f-46b4-a026-a31bfb51b66c","topic":"硬件","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"63d81ed47f0ae2e06523b88f2b","topic":"用户层I/O软件","expanded":true,"icons":["priority:1"],"style":{"background":"#FDD834"},"children":[{"id":"c33a03d6878987455077a9aa39","topic":"向上：","expanded":true,"children":[{"id":"6a89b221ee7a2e450a70eb02ef","topic":"实现和用户交互的【接口】","expanded":true},{"id":"24fb4a373769a8f1f6c84b22a3","topic":"可以直接调用提供和IO有关的【库函数】","expanded":true}]},{"id":"6f9a8755b72a48fb1c9379eae6","topic":"向下：","expanded":true,"children":[{"id":"13b9ab97993a1202258b5b8135","topic":"将用户请求【翻译】为格式化的IO请求，通过【系统调用】请求OS提供服务","expanded":true}]}]},{"id":"1b9a870115f9def009186847be","topic":"设备独立性软件","expanded":true,"icons":["priority:2"],"style":{"background":"#FDD834"},"children":[{"id":"503b1a83982bf9961837996622","topic":"又称：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"25faccfeca6bf75dc39e990cad","topic":"设备无关程序、系统调用处理程序","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"63b8ea6a51d8197eb5de5ab851","topic":"向上：","expanded":true,"children":[{"id":"2c7a70a4689a904c1f01f90152","topic":"提供read/write调用","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"06346a29-70c4-40fc-b550-36ba44a16220","topic":"即提供把系统指令翻译为设备操作命令","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"30da8690ba4bf239fe9d7b732b","topic":"提供设备保护","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"c2d1b502-d25b-4947-8f52-8dd434338e96","topic":"即文件保护","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"26a94c49c729bb5c2c968b7638","topic":"差错处理","expanded":true,"children":[{"id":"f18c97c4-2eaf-4af9-9337-a516b2f4b885","topic":"不会考","expanded":true}]},{"id":"cfda5f5084da85cc366e8acd4f","topic":"设备分配和回收","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"1e2011d8-e587-463f-9c09-382fd71d74b1","topic":"即文件的分配与回收","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"823a58c132eab6b7bdd57a433c","topic":"数据缓冲区管理","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"756f1ea2-b8c6-4a4d-bc6d-3ec556be2dd4","topic":"屏蔽设备之间的传输差异","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"3f58ae3de4a8a04cff0e18e4cb","topic":"建立逻辑设备名","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"6fe156d6-91e2-497c-a6e0-76aa42bb0cf1","topic":"逻辑设备名是用户提供的，而设备只有物理设备名，故系统中有一个LUT(Logic Unit Table)逻辑设备表来根据逻辑设备来映射到一个物理设备上","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"df1cffc6-424e-4b95-bc30-e41e9d443ccd","topic":"LUT存在每个用户的PCB中（在多用户中）","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"ccee014c-8697-4a5d-9953-e9f560807a2a","topic":"使用逻辑设备名的好处","expanded":true,"children":[{"id":"d95595a5-c14f-4e49-a940-f4f95245c5f5","topic":"增加了设备分配的灵活性","expanded":true},{"id":"64e30ed0-db24-4004-9221-ceeab47c9d41","topic":"易于实现I/O重定位","expanded":true}]},{"id":"52b8f445-ff54-44a1-a352-0be5df739ae1","topic":"LUT在有些题目中又叫做DMT(device mirror table)","expanded":true,"style":{"background":"#FFABD5"}}]}]}]},{"id":"5de4e21b-28ca-4c10-9bb1-0c52328cff48","topic":"计算机在对一个设备进行了区分和识别过后，会分配给它一个”绝对号”","expanded":true,"style":{"background":"#FFABD5"}},{"id":"3d4363f8-37ce-4392-93af-9c4f93798978","topic":"高速缓存、SPOOLing技术等也是这个部分的知识点","expanded":true,"style":{"background":"#BA69C8"}}]},{"id":"278a7f38ad7a6e3d44c9fa401f","topic":"设备驱动程序","expanded":true,"icons":["priority:3"],"style":{"background":"#FDD834"},"children":[{"id":"b77b0bc274bb77fb38ec0afaf2","topic":"例：","expanded":true,"children":[{"id":"537931354f99be5155adcaafec","topic":"第一次插上键盘，安装”驱动程序“","expanded":true}]},{"id":"948c4bcc-0546-40b5-abc9-f4ade6087372","topic":"根据商家的驱动程序，把逻辑地址转为物理地址","expanded":true,"style":{"background":"#FDD834"}},{"id":"29c6fd60-6c4c-4809-9a98-682ab848c1c3","topic":"每一类设备需要设置一个驱动程序","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"c84809a8-ade9-46eb-9746-4d1fd33028ee","topic":"例如系统中有2个绘图机3个打印机，只需要两个驱动程序即可","expanded":true,"style":{"background":"#FFABD5"}}]}]},{"id":"9159898c0589fe90f2e1e9a8da","topic":"中断处理程序","expanded":true,"icons":["priority:4"],"style":{"background":"#FDD834"},"children":[{"id":"f4a96ee70ea904a2c13acbc8b2","topic":"用来保存被中断的CPU环境","expanded":true},{"id":"e4c1eabe-d870-495f-a315-10668b84b85a","topic":"执行进程上下文的切换、对中断信号进行测试、读取设备状态和修改进程状态","expanded":true}]},{"id":"062b7833e3fa9dfb2ac688aa6e","topic":"硬件设备","expanded":true,"icons":["priority:5"],"style":{"background":"#FDD834"},"children":[{"id":"9ce9abbcf3c82d1d5e7fd826fe","topic":"两个部件：","expanded":true,"children":[{"id":"832b31c07a2ad355e0c029d92f","topic":"机械部件","expanded":true},{"id":"39b9b83928b832b6d4904af2e5","topic":"电子部件","expanded":true,"children":[{"id":"84f708c4-9d50-4179-9246-30c543a5db30","topic":"设备控制器（设备适配器）","expanded":true}]}]}]},{"id":"bd883cd396f8bb8af7dc5bf176","topic":"I/O子系统概述","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-ca59f6498b6110.svg"},"children":[{"id":"e03845b06bf928144a9cbae597","topic":"层次：","expanded":true,"children":[{"id":"751bca38c2ea00d45d921ac6a7","topic":"设备无关性软件","expanded":true,"children":[{"id":"a9a6a886-8c78-46f9-a0e1-16a398b0fa88","topic":"逻辑设备到物理设备的映射，也同样要找到设备的驱动程序","expanded":true}]},{"id":"1d8b39e7bd3987cb84453980eb","topic":"设备驱动程序","expanded":true},{"id":"52d8afd96d0ade54872d3b08b7","topic":"中断处理程序","expanded":true}]},{"id":"f46af7e377e921b1e706b875ef","topic":"功能：","expanded":true,"children":[{"id":"0c59cb172f3b399e338ef869cf","topic":"I/O调度：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"83e915272e09e7c3d8df8acd1e","topic":"磁盘调度算法（打印机也可以用","expanded":true,"style":{"background":"#FF9595"}},{"id":"c94edefa-0f3c-41f7-a037-5992ef0976bb","topic":"OS开发人员为每一个设备都维护了一个请求队列来实现调度","expanded":true}]},{"id":"548bb41b2d38a108ed8b4ad636","topic":"缓冲与高速缓存：","expanded":true,"children":[{"id":"f21954fc05c9fcd1266dbb7826","topic":"缓冲区","expanded":true}]},{"id":"6469a41b7c4bbded4033d856cf","topic":"设备分配与回收：","expanded":true,"children":[{"id":"9008c0a32358192ecf374b4e78","topic":"文件的分配和回收","expanded":true}]},{"id":"cf9ac000541ac04e366c69ceeb","topic":"假脱机：","expanded":true,"children":[{"id":"7b7b685c1a3853b44599ab8219","topic":"SPOOLing技术，在I/O子系统层中，现实生活中在用户层","expanded":true}]},{"id":"f7a8bd847a5b3ea2b2c2ab65ef","topic":"设备保护：","expanded":true,"children":[{"id":"038aa2ddc759403d99b44bd514","topic":"文件保护","expanded":true}]},{"id":"94b9b166d2ea1bb665a8599f09","topic":"差错处理","expanded":true}]}]}]},{"id":"5989ad1ce1b8cd9ce3de0a5c08","topic":"高速缓存和缓冲区","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-249db71a608952.svg"},"children":[{"id":"3d3919179c0bc35fbd247aa7d3","topic":"磁盘高速缓存","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0299b6bb-aa5a-4b8e-8123-9b0a9ef4ab0e","topic":"Disk Cache","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"2a9b8373d6792fcb4c74cb33c7","topic":"概念：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"50da86399719dcc445993a739b","topic":"将一个指令又存在内存中，又存在磁盘中","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"5f5249ca-f431-4338-84fc-254b05f894c2","topic":"作用：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"899d8d08-ed27-4afc-9499-e538ad9f830e","topic":"提高I/O的速度，访问更高效","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c0619a05-baab-4ca2-af83-090f280fc8df","topic":"例如进程的指令既在磁盘中，也在内存中，同时还在CPU一级二级cache中","expanded":true}]}]},{"id":"0a59a4ac3b287feb628dd89b93","topic":"形式：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"4dabbef781dba18ba08bfa9cf0","topic":"1. 在内存中【单独开辟空间】，大小固定","expanded":true,"style":{"background":"#8EDE99"}},{"id":"eb68a188dcf9164a87cfdac332","topic":"2. 把未利用的内存空间作为【缓冲池】，供请求分页和IO共享","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"694897136dd86209129f08ecda","topic":"缓冲区","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"afa9fcbdf49a8cb843bd2b752f","topic":"目的：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"f468bfb90909f5cb226d583146","topic":"1. 缓和CPU和I/O的速度矛盾","expanded":true,"style":{"background":"#8EDE99"}},{"id":"4cf86985f459c52237b24aab7e","topic":"2. 减少CPU中断频率","expanded":true,"style":{"background":"#8EDE99"}},{"id":"3c3a450b0d9bb66c11148a6be4","topic":"3. 解决数据粒度不同","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"a9c02467-14b3-409c-b0a7-578b4c210718","topic":"例如CPU一次产生一个块，I/O一次只能读一次char","expanded":true}]},{"id":"8289c1bbeb0a725188e77bc992","topic":"4. 提供CPU和I/O的并行","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"d58a8220-c5fe-4376-ac0b-5fbff3a34b61","topic":"实现方法：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"860c1fd2-2d52-4728-bab3-423c11553e56","topic":"使用硬件缓冲区，成本太高，一般不用","expanded":true},{"id":"4e441a19-f377-42d0-8bd5-2e7783449ad9","topic":"采用内存缓冲区","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"f48872dc-639c-41e4-8436-891ab6a2a2a7","topic":"采用缓冲技术","expanded":true}]}]},{"id":"3ebc2c8f-6b43-47c3-8a00-794f22682a29","topic":"需要缓冲的例子：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"ffdd739d-4ae5-4241-a545-c402af37a559","topic":"鼠标、键盘","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"e86a5d42-245a-4df4-811e-8f4035f75f12","topic":"若有更高优先级的进程到来，鼠标点击事件不应被丢失，则放在buffer中","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"e38d7250-aeeb-4d3b-912d-dc0620e01121","topic":"多任务的磁盘驱动器、磁带驱动器","expanded":true,"style":{"background":"#FFABD5"}},{"id":"57262a4d-6c44-463e-956e-b2115acb360c","topic":"图形卡","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"39079276-0154-4dc8-88f4-7d4495b2ee4f","topic":"图形学开篇，使用双缓冲来实现图像更换","expanded":true,"style":{"background":"#FFABD5"}}]}]},{"id":"b456ebea-3a06-4e30-b803-5982cf95dcb9","topic":"若无特殊说明，缓冲区大小为一个块","expanded":true},{"id":"2ca2d4d1-0f44-4ef7-bcce-db82c1d58eaa","topic":"高速缓存和缓冲区的对比","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"9bc2283d-cb30-46cc-909a-6e26da60c0d3","topic":"图示","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-3d9608091b5852.png","width":624.25,"height":170.39}}]},{"id":"59ade475-22e3-47eb-819e-3f49a4734bec","topic":"预读 + 滞后写","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"ab6344db-2137-4114-9cc1-65f116aeae4c","topic":"预读：读区域A的时候，把A的下一块也同时读入到buffer中","expanded":true,"style":{"background":"#FFABD5"}},{"id":"19ee04b0-e52c-4664-8c76-1980e5a2aed7","topic":"滞后写：在需要把A写回时，先不写回，先挂载到buffer中，直到这块buffer需要使用再写回","expanded":true,"style":{"background":"#FFABD5"}}]}]},{"id":"09c9e6027959818f0e77caa61a","topic":"缓冲技术","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"0a8b03bd-9cfa-48d3-8d39-1434482de10d","topic":"注：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"4b614beb-72f2-45eb-8cd3-289b13b207ee","topic":"下图中计算周期时假设的是工作区已经满了，所以设备 -> 缓冲和工作区 -> CPU可以同时运行，如果初始情况为空：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"f0275293-4534-4e3d-aea7-3694c7367816","topic":"图示","expanded":true,"style":{"background":"#FFABD5"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-3387a4ae309fe2.png","width":414.19,"height":165.45}}]}]},{"id":"9fbb23d2a3fa7bb17f548b672e","topic":"1. 单缓冲","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"4f8b2a44d23ae46d16a81b3d71","topic":"流程图：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"62178fd5-a3a1-4a7f-aa36-a8e8299e8fa5","topic":"图示","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-8200603473401d.png","width":260.49,"height":210.73},"children":[{"id":"d9a62e35-a135-48c3-815b-9b99da7a9c25","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-b3bea6cc86f543.png","width":403.48,"height":315.02}}]}]},{"id":"056aab5c56aa3a2977c2c93354","topic":"描述：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"35e1176d-9d9e-4d3b-8d3f-12629c5802fd","topic":"开始状态缓冲区的数据为空，工作区数据为满","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"a122091e-1cc7-474e-8cd6-c1b4dc3db650","topic":"CPU处理工作区时间为C，设备把数据写入到缓冲区的时间为T","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"3d3afb0f-7606-4cde-89df-8472a844c42c","topic":"缓存区写满 + CPU处理完毕后，然后缓冲区中的数据传入到工作区中（不由CPU参与）","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"124af6469db8d3ec5219db189b","topic":"2. 双缓冲","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"8288340fe8db6dbc410deaa344","topic":"流程图：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"f805b1bd-66d1-46d1-82ff-9212138258f5","topic":"图示","expanded":true,"style":{"background":"#FF9595"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-a25e6b18bd9e16.png","width":383.95,"height":217.92},"children":[{"id":"4793fd4d-4775-46c7-93aa-6645747295c1","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-920754f9af3f47.png","width":405.02,"height":470.2}}]}]},{"id":"054260f1-038f-4135-bd8c-3ed3548f5ed1","topic":"描述：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"688ab472-5c48-4269-8b59-8eb83d305c77","topic":"假设开始状态，工作区为空，缓冲区A为满，缓冲区B为空","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"b884c34d-e8ac-4e77-a8cd-0d83bdbf074e","topic":"那么可以同时进行 ：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b01aca75-cd93-4138-927d-83076fc239a0","topic":"缓冲区A -> 工作区（时间M）","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"09699738-bb6b-4910-8aaf-421cada5da6d","topic":"I/O设备 -> 缓冲区B（时间T）","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"7be2ee9f-9697-4b15-9d56-6aa15a1a4067","topic":"根据上述情况做完以后来进行CPU对工作区的处理（时间C），根据这个时间的长短来决定周期","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"e8179c6c-bf9d-48ad-b9e9-ed1cc7cbc04d","topic":"缓存通信","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"baa3b1f9-63f4-477f-af60-7ef99f61b4ca","topic":"如果两台机器都只有单缓冲","expanded":true,"children":[{"id":"5e12b5d9-7480-43fb-bf40-55174d9d7826","topic":"只能单向传输","expanded":true,"children":[{"id":"5e07cd0d-9473-4c05-9cc0-21fc1e454130","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-2d97c5af6b3014.png","width":174.18,"height":144.88}}]}]},{"id":"f26ed7e1-f3cb-418f-b047-a2e3f7ec56e8","topic":"如果都有双缓冲","expanded":true,"children":[{"id":"bc49dc7a3739afb72722695183","topic":"可以实现双线传输","expanded":true,"children":[{"id":"b611e90a-bcc7-4743-a1f3-efeb9ffb363a","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-420d7b9d820532.png","width":188.09,"height":151.08}}]}]}]},{"id":"b28a3ca27e8ab8485c69c9fa47","topic":"”管道“通信：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"473bb6a845893004ce5dbb5009","topic":"”管道“通信就是一个缓冲区，要实现双向通信，就需要两个”管道“","expanded":true,"style":{"background":"#FDD834"}}]}]},{"id":"6278d17bfbd870f5be66b940e5","topic":"3. 循环缓冲","expanded":true,"children":[{"id":"214b7499509af789bccd1bc02e","topic":"流程图：","expanded":true,"children":[{"id":"c752ab84-d6c9-4f07-af3e-52a4aa72fa43","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-796a7a8542e1ae.png","width":142.24,"height":169.75}}]},{"id":"48aa7df3243a2817b10b1b1a07","topic":"描述：","expanded":true,"children":[{"id":"33631286-8d5e-446b-90f1-e907baeb58a4","topic":"包含多个大小相等的缓冲区，形成循环链表的形式。另外有两个指针in/out，分别是输入指针和输出指针。in指向空缓冲，out指向满缓冲","expanded":true}]}]},{"id":"d87ad8f16d5b35e3daf48a03c6","topic":"4. 缓冲池","expanded":true,"children":[{"id":"e9e8f33cb309c987a381a931fb","topic":"组成：","expanded":true,"children":[{"id":"5f9ba2cccd8ba7a867dfca7fe6","topic":"多个公共缓冲区组成缓冲池","expanded":true},{"id":"d7cc4b40-f185-42a9-b8fe-e25dbdec9ead","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-39f53f9db891cb.png","width":307.42,"height":190.4}}]},{"id":"0be9f452fc8a0552ecde19d751","topic":"三个队列：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"aad8614d4f1a03c3f0051bedda","topic":"空缓冲队列","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"c49a0a68fe6bb5cdcbf64a65d9","topic":"输入队列","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"3f8abe89848a3670efb45bfe4d","topic":"输出队列","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"f21bb3de610b6f2948c9eb6e60","topic":"四种缓冲区：","expanded":true,"children":[{"id":"01ca5b0e8ad989e2dfca2a96f0","topic":"收容输入数据缓冲区 hin","expanded":true},{"id":"95c83271238af6a12c5afb6266","topic":"提取输入数据缓冲区 sin","expanded":true},{"id":"58a996bdb19883058a227a7902","topic":"收容输出数据缓冲区 hout","expanded":true},{"id":"f7da624fc2eaffd9ce22f8b126","topic":"提取输出数据缓冲区 sout","expanded":true}]},{"id":"bf0b94f0ef881cd19458481e4d","topic":"四种操作：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"17fab5221d5a7009bfe5e891d4","topic":"输入进程进行输入：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a3a85352b62a111e5bbf9befe2","topic":"从空缓冲队列中提取一个缓冲区，将其作为hin，把数据输入，“装满后”挂到输入队列队尾","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"928af698c37949fd94a4290443","topic":"计算进程读取输入：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"349a94f42c787702c5c9bbc21a","topic":"把输入队列队首缓冲区提出，作为sin，用完后把它挂到空缓冲队列中","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"2b0bddaff689965ef0cc099e55","topic":"计算进程提供输出：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"98face90efb983aaaad2b929e3","topic":"从空缓冲队列中提取一个缓冲区，将其作为hout，把数据输入，“装满后”挂到输出队列队尾","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"a7faba31676b965df2f6f90b70","topic":"输入进程获得输出：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"ea9b2b4c100913be83361a6aa1","topic":"把输出队列队首缓冲区提出，作为sout，用完后把它挂到空缓冲队列中","expanded":true,"style":{"background":"#8EDDF9"}}]}]}]}]}]},{"id":"69aa754371398475972fdbd2ab","topic":"设备的分配和回收","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-127eb26f8b6f75.svg"},"children":[{"id":"6459f14d00caae9d91f27823f6","topic":"三种分类：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"dbdbfa2f223b3d8c661089c58e","topic":"独占","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"1b6b6272fee8c3f861b09bd924","topic":"打印机","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"cdfabc0ced893a05ea530a1adc","topic":"共享","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0b1a24f410bb5d2bb0620a92b1","topic":"磁盘","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"a4186b92bb79d6dd8b267852a1","topic":"虚拟","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"301b1cb4e85925fa2075e90997","topic":"SPOOLing技术","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"8fc830a1ce499dc9a9e2d9a319","topic":"数据结构：","expanded":true,"children":[{"id":"6a6b175405f98a06c548e89cd2","topic":"DCT：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"d4412508-2e42-4038-be0f-6a38368f0c8b","topic":"一个DCT表就表征一个设备，表中内容就是设备的各个属性","expanded":true,"style":{"background":"#FDD834"}},{"id":"9a8a7b91657ac6be2f304b7e8f","topic":"称为：","expanded":true,"children":[{"id":"173a65246f580fcfbdc1a88c41","topic":"Device Control Table 设备控制表","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"c2d9bd4d13c81c2cd388a9adad","topic":"内容：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"1afbad6ff7d925a105b619452f","topic":"设备类型type","expanded":true,"style":{"background":"#8EDE99"}},{"id":"8bb9db3ab12bdabf36e42bba5b","topic":"设备标识符: deviceid","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"43dcd2d2-eac8-4c99-afa3-dad500e3b9f0","topic":"唯一id","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"51c87211f4986f1b73c059b957","topic":"设备状态：等待/空闲","expanded":true,"style":{"background":"#8EDE99"}},{"id":"e46ab6a287489435c5f6eadb2a","topic":"指向控制器的指针","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"97671b39-a5af-4bab-a1dc-62448ded613a","topic":"用来找该设备对应的I/O控制器","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"0b4d94f4-cd2c-424e-95a1-f2ee54418c6e","topic":"父级指针","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"1d0a0b9fa91b01df9437a8bb69","topic":"重复执行次数或时间","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"1aeef6f7-7934-418f-8c1b-d3716952f03c","topic":"I/O设备会在自己发现执行失败了很多次以后才会认定为I/O失败","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"c0a9b4b10439ded45b40980d5d","topic":"设备队列的队首指针","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"4dd7beb1-c642-4d4d-b40d-2accdb41323f","topic":"指向正在等待该设备的【进程队列】","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"d25d90fb-6759-463f-a516-18e4fcfcbe2a","topic":"如果一个进程想要使用这个设备，那么就把该进程的PCB插入到该设备对应的DCT的设备队列中","expanded":true}]}]}]}]},{"id":"1949383e768ba8ad6ade98bf3e","topic":"COCT：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"8c027947-a2bf-4e05-bc35-411eb8534619","topic":"用来管理众多DCT，因为【一个控制器会管理多个设备】","expanded":true,"style":{"background":"#FDD834"}},{"id":"e91822e3198a616a419bea52d1","topic":"称为：","expanded":true,"children":[{"id":"30d928cdf6299d88ddb2fabcfe","topic":"Controller Control Table 控制器控制表","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"529b8fb845296efa501e8b1f3d","topic":"内容：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"d18a57de6fd8bccd3d6efab8f0","topic":"设备标识符: controllerid","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"e0a9c4a5c7887eaf328abb4759","topic":"设备状态：等待/空闲","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"04e8b5bf6ea800d00fa87b3ac3","topic":"指向通道的指针","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"3f2e6c1b-e4b3-4fd4-9e30-a29b1a1a65e0","topic":"父级指针","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"c4a865d716a932a8c2beea7671","topic":"控制器队列的队首指针","expanded":true,"style":{"background":"#8EDDF9","fontWeight":"bold"}},{"id":"d5fb12b89b193509c6137b4481","topic":"控制器队列的队尾指针","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"af5a288d8c6a0d3e57875a6103","topic":"CHCT：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"f32ec7bc-215b-4359-a525-43798c2d7e41","topic":"用来管理众多COCH的，一个通道管理很多个控制器","expanded":true,"style":{"background":"#FDD834"}},{"id":"37aae4ed6ac95ea883b019b30c","topic":"称为：","expanded":true,"children":[{"id":"d61bc2d31f29f087348a2ab9b7","topic":"Channel Control Table 通道控制表","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"46ab93b882fb6d8041ec8a2e75","topic":"内容：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"771a630ea429595157392a1ae7","topic":"设备标识符: channelid","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"09ca965415898d2dd0c418b112","topic":"设备状态：等待/空闲","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"d1ca16b6513b8137bd6e4ac104","topic":"控制器队列的首地址","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"31799c79-52cc-4faf-a5d3-2eec1453e4e1","topic":"孩子节点，找到第一个相连的控制器","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"e8a9b267dd59a81c0434bbb092","topic":"通道队列的队首指针","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"d28a74124fc8e3b300dbc99b39","topic":"通道队列的队尾指针","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"85e992bb1488ab7eb20dda63ec","topic":"SDT：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"9ac2e194-2bf7-4d8e-85ce-11b4a2073f9c","topic":"整个系统只有一个SDT表，管理所有物理设备","expanded":true,"style":{"background":"#FDD834"}},{"id":"d59bd153cfd9247303fc98966f","topic":"称为：","expanded":true,"children":[{"id":"497aef22aef87005e19ffb5767","topic":"System Device Table 系统设备表","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"5cbb79b8a5f81e8b9b99cb0e35","topic":"SDT是一个表，每一个设备就占一个表项（前面的同理）","expanded":true},{"id":"0e1a64077258dad4e104081e78","topic":"内容：","expanded":true,"children":[{"id":"9119ad5757abd8dad0e9aa8baa","topic":"设备类型","expanded":true},{"id":"f8e94da0e1da09fd176b8b003b","topic":"设备标识符","expanded":true,"children":[{"id":"82f81170409a461d497a69a468","topic":"物理设备名","expanded":true}]},{"id":"ecda60f27a8afcbc2901f969de","topic":"DCT","expanded":true},{"id":"8e1b0663dbfae058293aa8f437","topic":"驱动程序入口","expanded":true}]}]},{"id":"3cd9ba91-b6eb-4d09-b597-c4b6be5eb284","topic":"设备分配的步骤：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"7847d543-8ef3-40d0-950b-e9244b228e39","topic":"1. 根据进程请求的【物理设备号】去查SDT的【设备标识符】，获得对应DCT","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"f87ee7a8-0246-43d5-9b97-d244d1013ed1","topic":"如果请求的是【逻辑设备号】，就去查SDT的【设备类型】","expanded":true}]},{"id":"4979a580-db05-42b9-8a9f-4f193f077100","topic":"2. 找到DCT，如果设备忙碌(【设备状态】)就挂到等待队列，如果不忙碌就获得该设备","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"d3c3d563-1ad4-4211-bcd3-c168b9fb5dff","topic":"将该逻辑设备的<逻辑设备名、物理设备名、驱动程序入口地址>加入到LUT表中","expanded":true}]},{"id":"8ef8c4a1-7f36-4f4f-a97b-a69ceb362bb5","topic":"3. 根据DCT去找【父指针】，找到COCT，控制器忙碌就挂，不忙就用","expanded":true,"style":{"background":"#FF9595"}},{"id":"8cb51a5c-9410-42c9-aaa2-bc9b0f5d20bf","topic":"4. 根据COCT去找【父指针】，找到CHCT，忙挂闲用","expanded":true,"style":{"background":"#FF9595"}},{"id":"de6844ba-7288-40af-8602-a89c8b456562","topic":"只有上述四个步骤都分配完成才算成功","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"ecf05c35-d25e-4290-8e2f-942bd26a7d05","topic":"使用【物理设备号】请求不如【逻辑设备号】好","expanded":true}]}]}]},{"id":"c5ca7ab73e59bec4b0672b893b","topic":"设备分配策略：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"a0791d41d64b99b424bcf95114","topic":"设备分配方式：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"5799a2e8942b20ea95e6f8cd6f","topic":"静态分配","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"330ab4ae843a0e1ec46289dbe8","topic":"作用：","expanded":true,"children":[{"id":"f5ab899ae40bfa9f06c0f9d70b","topic":"OS一次性分配该作业需要的所有设备、控制器、通道信息","expanded":true}]},{"id":"e83a601c837b138c4379a95f5e","topic":"死锁：","expanded":true,"children":[{"id":"17ca46234f4bb929a8e0c89be3","topic":"不会”死锁“，破坏了”请求保持“","expanded":true}]}]},{"id":"d59a6b1900e919f073376808fe","topic":"动态分配","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"9fe9a912eadbf5115aeb89cd65","topic":"作用：","expanded":true,"children":[{"id":"488a65e9714b4975e9d10a19a7","topic":"通过进程需求来提供设备","expanded":true}]},{"id":"e27a44a29afb5f4f0ed148d330","topic":"死锁：","expanded":true,"children":[{"id":"95694d7cc4f8268173d3a87fd2","topic":"有可能”死锁”","expanded":true}]}]}]},{"id":"6d9a57e7a6c97e2b6405eb8872","topic":"设备分配算法：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"e4a890ce34cb8c653ffe38547d","topic":"先请求先分配","expanded":true,"style":{"background":"#8EDE99"}},{"id":"cb8b02ccac4a4f4e9a27baf808","topic":"优先级高优先","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"c54a8ab7302aedde771f3a448d","topic":"逻辑名到物理名的映射：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"b9c8e8c672e8336e8dda29b307","topic":"LUT：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"709baa68bcca4535a5b0ca4c29","topic":"名称：","expanded":true,"children":[{"id":"90bbd60e5b08959cdc5ffbfb75","topic":"逻辑设备表","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"af1b22f867687653cfbbd8055e","topic":"表项：","expanded":true,"children":[{"id":"bd9894b59909c8aec70fa9bcdc","topic":"逻辑设备名、物理设备名、驱动程序入口","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"57a836b5e17b876f30b1d81673","topic":"单用户：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"77381ab656e9e9008b66ebb3df","topic":"每个设备都在这个LUT中，不运行出现相同的逻辑设备名","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"0f3983d96a59e81fdf6f2b9288","topic":"多用户：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"7cbaf023a93bdc9f075d0875a5","topic":"每个用户在登录时，系统会给用户【创建一个进程和一个LUT】，这个LUT会放入到PCB中","expanded":true,"style":{"background":"#FDD834"}}]}]}]}]},{"id":"1b2a4e89fe3bdc1047adfb3882","topic":"SPOOLing技术","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-9e593d6b1135b0.svg"},"children":[{"id":"4a969a57-e697-47f9-869a-6bbf7c1c734e","topic":"体现操作系统：虚拟性","expanded":true},{"id":"65ca9108-8604-47f5-981b-e5e541c2cd83","topic":"SPOOLing和缓冲区的区别","expanded":true,"children":[{"id":"425ca82c-2e93-4e94-89e5-e226c94b4b93","topic":"CSDN","expanded":true,"hyperlink":"https://ask.csdn.net/questions/698957"},{"id":"1970c162-9573-4a2b-bc36-11aa2ad5ad55","topic":"缓冲区：","expanded":true,"children":[{"id":"226d7b3c-1846-4399-82c4-a4a6ea9c69be","topic":"为了能够尽快的利用分到的时间片资源，往往大家都是将任务写入buffer，然后等buffer满了在一次性提交任务。这样的批处理能够减少申请资源的次数","expanded":true}]},{"id":"6c8d7259-be29-43bc-b54d-bead23b9222f","topic":"SPOOLing：","expanded":true,"children":[{"id":"d117ce2d-c9ee-48d5-8bda-96cbb270a046","topic":"spooling技术本质上是添加了一个消息队列+异步执行+完成回调，可以让一个独占资源变成共享资源的一个功能","expanded":true}]}]},{"id":"6defbf37-b09d-4c1d-accf-a4f8ec2c4a63","topic":"用空间换时间的技术","expanded":true,"children":[{"id":"11cde93b-4591-4c46-8403-092b14310c01","topic":"vs 请求分页系统：时间换空间","expanded":true}]},{"id":"ee4af19332f9002d4ac83b5553","topic":"脱机技术：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"5cea55ec51396043f712784bb2","topic":"批处理阶段引入了脱机输入/输出技术（用磁带完成）","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-ac3217dfd65f4d.png","width":580.57,"height":219.43}}]},{"id":"182a6942-ff97-4c28-8e3d-7526690b290f","topic":"SPOOLING技术","expanded":true,"children":[{"id":"a0e865c2-aa91-4150-b969-fe1f816b0d35","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-7ec1eec1507d1d.png","width":478.85,"height":289.83},"children":[{"id":"24089f26537aa69d64a98a1f8d","topic":"共享打印机：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"ec80ef27-8aad-42ba-8752-1ffb0dc7fc21","topic":"当系统同意其打印时：有用户（输出进程）开辟一个空闲磁盘区","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"f4f9727462cbd239dc4bd9d26f","topic":"步骤：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"7f6bd371dd2bc0d584525b7cb5","topic":"1. 输出进程在输出井中给用户进程分配一个空闲磁盘块","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"3c48e604792b5f8a693a69533d","topic":"2. 输出进程为用户进程申请一个空白的“用户请求分页表”，将用户的打印填入其中，再将表挂到请求打印队列上","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"d182b40c-5605-44ad-a5f4-160bc931fb3d","topic":"特点：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"ce3f3938-9b42-454c-9b92-7cf8345c59c3","topic":"提高了IO速度","expanded":true,"style":{"background":"#FDD834"}},{"id":"2504073b-6394-483c-8a89-cb8aa908a2fa","topic":"将独占设备改造为了共享设备","expanded":true,"style":{"background":"#FDD834"}},{"id":"b5c5ca38-2f9e-4e28-a70c-457b99f88c61","topic":"实现了虚拟设备功能","expanded":true,"style":{"background":"#FDD834"}}]}]}]},{"id":"4ad55f1b-753b-4735-9a43-529d1afa0795","topic":"SPOOLing的外围控制机","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"ac7c779d-28bc-4d7d-a25d-f1ad8b8cdc45","topic":"SPOOLing需要利用【专门的外围控制机】","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"4785ae50-0fc7-4a20-a638-7371decb0952","topic":"这里的外围控制机指使用软件模拟的外围控制机，而非物理上的","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"21168efd-d415-433a-b388-b128d4b79ff4","topic":"输入和输出进程来模拟外围控制机","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"f10c95cf-dc97-407f-b546-f1f110c4e3db","topic":"SPOOLing需要专门的【外存设备】","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"79976e15-0563-4e87-9c9e-71c415c8cbef","topic":"SPOOLing需要磁盘上的输入井和输出井","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"808be85c-18fe-461b-9ebd-c094f320bf71","topic":"考频：中","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"0a72ae88-843c-46c1-8f06-807191d0cee4","topic":"09、11-13、15、16、20、22","expanded":true}]}]},{"id":"8e240f08-94b7-4c98-a2c1-b6c25dd48ca4","topic":"磁盘的结构","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-127eb26f8b6f75.svg"},"children":[{"id":"80f33463-55c0-4035-955e-c2f1dc83f98d","topic":"磁盘的概念","expanded":true,"children":[{"id":"4da3a1cc-6709-482a-b9c5-e065610acc27","topic":"磁道","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"404da2cd-01bb-40f1-b619-8f2f6f2a0d86","topic":"一个又一个的【同心圆】","expanded":true}]},{"id":"8e88aae4-52b8-44af-802b-d4c31ad8c41c","topic":"磁道间隙","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"e7ffdad4-f86c-472f-8492-055d012f5e59","topic":"每两个同心圆之间的【间隙】","expanded":true}]},{"id":"b4c2573e-c87a-4929-8486-93ad5332f359","topic":"扇区","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"46f2acc4-a8de-44d7-92ed-e3911e480470","topic":"一个磁道可以分为若干个【扇区】","expanded":true},{"id":"070f7b60-69ec-4439-9af1-d3a3428fc7cd","topic":"又称：磁盘块（物理上）","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"8abfc589-0b5e-4fa6-ab05-cbd4eb70fdb0","topic":"扇区间隙","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"95ffd97c-5ab7-44b7-997a-6a8ef51c5be8","topic":"每两个扇区之间的间隙","expanded":true}]},{"id":"444ab841-f0cb-4d5d-aea4-1bc929cbffc8","topic":"柱面","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"06559b5a-f902-4ad7-a23f-a204393109f0","topic":"多个磁盘垂直叠在一起时，所有磁道组成的垂直面就是柱面","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-0726c6e00e39f4.png","width":395.71,"height":358.48}}]},{"id":"bcf1a4c2-11b0-4750-9073-307c443f37c7","topic":"块","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"40b13aae-7e08-487d-a1d3-c72329b58d3a","topic":"物理块","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"de6e2b32-8f5d-4adf-97d0-141284d5c2a7","topic":"扇区","expanded":true,"style":{"background":"#FDD834"}},{"id":"65a590c4-5574-4fe8-a5fe-84d59f29fe57","topic":"物理上读写一次的基本单位","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"b3ecd541-dd6b-4ed9-a0ac-97611b2a4ed2","topic":"逻辑块","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"2490e1b5-063d-4cab-9fe4-8c3b818bfbba","topic":"簇","expanded":true,"style":{"background":"#FDD834"}},{"id":"777d320d-807a-4e89-b52c-01feea93054b","topic":"OS中存储空间分配的最小单位","expanded":true,"style":{"background":"#FDD834"}}]}]},{"id":"987f8b02-4bff-4219-b978-76e4ad645f2d","topic":"磁盘地址形式：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"efc9f607-4fc3-4125-8541-c66deaf9f1b8","topic":"<柱面、盘面、扇区>","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"fa41df33-654d-41ca-86f9-c203e4f599b8","topic":"因为移动磁头是需要很多时间的","expanded":true}]}]}]},{"id":"735e5650-5c4c-4513-bb83-8af574aea0f5","topic":"磁盘的类型","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"274277d5-090f-46e1-9cb5-a5d5a1fce3b2","topic":"磁头","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"2f1bacde-5af0-4842-ace1-45c783b30039","topic":"固定头磁盘","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"c687b00a-818c-40c6-b264-de0219b94d3f","topic":"每个磁道一个磁头","expanded":true}]},{"id":"0f29e461-3e87-45b6-bc7a-67fadff41f8c","topic":"活动头磁盘","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"555c595a-8969-4b7b-8797-b35891afac88","topic":"每个磁盘一个磁头，磁头可以来回移动","expanded":true}]}]},{"id":"da55ba97-3b35-4885-84d3-a99b64b598b8","topic":"磁盘","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"853e7c5a-402e-4ef2-8ccb-7bffad35eac6","topic":"固定盘磁盘","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"f1765732-aa4c-4bce-8355-4a89da86e407","topic":"磁盘永久固定","expanded":true}]},{"id":"fd5b4949-b748-4080-b5fb-885b240eacc3","topic":"可换盘磁盘","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"5d1a2e0c-514a-4414-a192-696fa95a144f","topic":"磁盘可以移动和更换","expanded":true}]}]}]},{"id":"c9c1c6bc-7ea6-4ed8-b3f1-2f651722a950","topic":"存储介质","expanded":true,"children":[{"id":"037eb757-03ec-44b2-8036-caffb26e7e8b","topic":"可以随机存储的：","expanded":true,"children":[{"id":"3826d35c-8d33-4b5a-82c4-1ce22b548012","topic":"光盘","expanded":true},{"id":"1cdf1634-5cde-41ab-9c51-3e6560868c71","topic":"磁盘","expanded":true},{"id":"fc4aa098-3d51-482b-a663-646016f4693d","topic":"U盘","expanded":true}]},{"id":"156f16ef-26ce-4131-84e4-d56e8c14a388","topic":"只能顺序存储的：","expanded":true,"children":[{"id":"438e2322-4b54-4eed-9f03-df643ff7b368","topic":"磁带","expanded":true}]}]},{"id":"3601f8e3-2e43-4261-bd1c-b76d386defee","topic":"磁盘是共享设备","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"6b14ae52-c6a2-4704-901f-f0903dbfe1bd","topic":"但是同一时刻只有一个进程/作业可以启动磁盘","expanded":true,"style":{"background":"#FFABD5"}},{"id":"42ca5210-bba1-4bc7-bf90-eb5080cedd0b","topic":"此处和PV互斥有些不一样，例如读磁盘是多读者，那么对应过来多个进程可以在自己的运行时间内访问磁盘","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"9a5aea65-ac90-4323-b13f-552da041956a","topic":"而如果是写磁盘，那么PV信号量会控制其他正在处理机上的进程不能使用该磁盘","expanded":true,"style":{"background":"#FFABD5"}}]}]}]},{"id":"179a4141-ba4e-4c88-b655-77acb4ddf5ca","topic":"磁盘的管理","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-b909c9ea94bb18.svg"},"children":[{"id":"b81e8dbe-3d97-4e27-aa46-4c47d92230f3","topic":"磁盘初始化","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"e039e1c4-5626-48eb-89a0-879e900960b9","topic":"第一步：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"65d12ae3-6058-40b2-ba47-8e9c2ef321ff","topic":"名称：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0934e26e-fb0d-4d91-8c5d-fd331c1c456a","topic":"低级格式化","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"66feb9a5-c958-4d3c-930a-d3200effe2be","topic":"分磁道、分扇区","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"a3bc0b48-3504-45d9-a553-d5b5a079a6f7","topic":"内容：","expanded":true,"children":[{"id":"e34f4a03-aaa6-4841-9d09-7b4e217ba67b","topic":"在出厂之前把磁盘的各个磁道分为扇区。","expanded":true}]},{"id":"acbcfa3e-8d36-44a0-a684-b592bd59adb2","topic":"每个扇区分为：","expanded":true,"children":[{"id":"4acbeda6-9fb6-405d-9996-68893590b219","topic":"数据区域","expanded":true},{"id":"f0f17389-cc9f-44da-843b-d2d7df5da10d","topic":"头、尾包含磁盘控制器\n所需要的信息例如：","expanded":true,"children":[{"id":"c8efc407-bb39-443e-83ea-6c6754efb3e5","topic":"数据结构","expanded":true},{"id":"cdcc087e-eacc-4060-b00d-e87c33191df6","topic":"扇区校验码","expanded":true}]}]}]},{"id":"f30b4ff4-6943-4032-8ab8-438f106faad0","topic":"第二步：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"64568738-33de-4286-b87e-a33c3d6c7125","topic":"做法：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"772a1840-28b6-47e3-92bb-6de64e6b17af","topic":"将磁盘分区，每个分区由若干柱面组成","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"2ce67983-af82-4cd5-99ba-1a37fc071c1b","topic":"分柱面","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"2e5371fd-73e5-4421-8378-2cdd8db14239","topic":"例如：","expanded":true,"children":[{"id":"e9101b5e-bbc9-483a-b80a-af3eda795c19","topic":"分为CDEF盘","expanded":true}]},{"id":"f2119ba0-adeb-49bb-adb5-3c2d0b6e7c62","topic":"物理地址：","expanded":true,"children":[{"id":"4c77e3bb-d76e-41c2-8848-c616d47e30c3","topic":"因为是<柱面、盘号、磁道号>","expanded":true}]}]},{"id":"44d8f52f-66e3-4a44-a565-8d1fe37ab70e","topic":"第三步：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"cea3b2b7-ba63-4311-85ec-ba2c0b379d69","topic":"名称：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"583f2d14-1270-4da8-a9e6-6843373760a8","topic":"逻辑格式化","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b1799f29-6f87-465a-a2a5-2a8c90b7fb1c","topic":"创建文件系统","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"4be16670-8e97-4d45-a47f-770c1616b9e4","topic":"作用：","expanded":true,"children":[{"id":"37b160c1-4688-46c9-b0a9-f50ea9193311","topic":"创建文件系统","expanded":true,"children":[{"id":"49611760-70e0-452e-b244-c239ffc24131","topic":"根目录","expanded":true},{"id":"961b065d-001e-49c1-8093-2db9cd04313c","topic":"管理空闲磁盘块\n的数据结构，如：","expanded":true,"children":[{"id":"a26ed662-bcb7-46a6-bcaf-92f54df37492","topic":"位示图","expanded":true},{"id":"5cb64d68-c862-4f1b-b196-bd1542997fa8","topic":"空闲表","expanded":true},{"id":"864dccd7-529d-4336-b983-7a78524b6d07","topic":"空闲盘块链","expanded":true},{"id":"c1125248-180c-4a09-9407-9837c02b7972","topic":"空闲盘区链","expanded":true},{"id":"1fde8ea1-6d88-457d-9351-90d33b53ef81","topic":"超级块","expanded":true}]}]}]}]}]},{"id":"866a082e-3923-4eaa-8b59-a5af7960ec8f","topic":"引导块","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"6bf0939d-fd7e-4b8e-8fc1-05f3452e043b","topic":"概念：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"86324902-baa6-4221-9b87-66ead960afaa","topic":"计算机启动时会从引导块中读入一个初始化程序（自举程序）","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"d23a58ad-264c-40a4-9904-08e200003b05","topic":"初始化程序作用：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"f4305805-7e45-4638-82c0-12aaa871dd3c","topic":"初始化程序可以初始CPU、寄存器、设备控制器、内存etc，然后可以启动操作系统","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"35596421-307c-4a6f-b8bc-c0903a9decdf","topic":"自举程序存储位置：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"b45239a7-a8cf-4b1d-b2bd-a6fff8acbb13","topic":"【自举程序】存在ROM中\n 或：\n【自举装入程序】在ROM中，完整的自举程序在磁盘启动块（引导块）上，一般是在一个固定的位置","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"095a4a84-2701-409c-912b-3c60c36297cb","topic":"拓展","expanded":true,"children":[{"id":"5e57dea2-7563-4673-be5d-e594788860e2","topic":"引导控制块","expanded":true,"children":[{"id":"65a8602c-fd9d-4840-8046-2409409dd3b8","topic":"包含OS从该分区引导OS所需要的信息","expanded":true},{"id":"07891de3-305e-460c-b2a6-36122babc396","topic":"UFS中称为引导块，NTFS中称为分区引导扇区","expanded":true}]},{"id":"c6579792-6dc7-489a-98dc-0ac708f81959","topic":"分区控制块","expanded":true,"children":[{"id":"f5bcf14a-df53-4480-aefb-b6ff8e062166","topic":"包含分区信息（分区块数、块大小、空闲块情况）、空闲FCB数量、指针","expanded":true},{"id":"72c193e3-e4ec-48e9-91d4-37b8db211b65","topic":"UFS称为超级块、NTFS称为主控文件表","expanded":true}]}]}]},{"id":"a0d1e81a-9451-4ddb-8d3d-df97403a79a6","topic":"坏块","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"a32e469d-6910-4735-9c98-853a48b887fc","topic":"简单磁盘","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"71a2e647-2f05-4958-b909-9b2d53abde6c","topic":"在FAT中标明，程序不会使用它","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"36c14efc-d117-4fd5-a3fa-8433488b92e5","topic":"复杂磁盘","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"59622cf8-4ff1-439a-993c-141c006e7acd","topic":"磁盘控制器维护一个磁盘坏块链表，同时会有一些块用来作为备用（扇区备用）","expanded":true,"style":{"background":"#8EDDF9"}}]}]}]},{"id":"110279f6-19b4-4a9e-b203-bf6ad62c2560","topic":"磁盘调度算法","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-05bb20abd63104.svg"},"children":[{"id":"6ff6bf9f-921d-41c8-bbea-d5641bb38516","topic":"考频：高","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"839ea0b6-46d3-4c42-b603-c02ee5539571","topic":"09、15、17*2、18、21、10大、19大、21大","expanded":true}]},{"id":"f6847a58-1d27-42d9-a9dd-feb67d985e3b","topic":"图示+公式：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"02d5ab0c-4f6a-477b-b803-421a8fb5b739","topic":"1. 启动时间  2. 寻找/寻道时间  3. 旋转【延迟】时间  4. 传输时间","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-39c9edd55a153c.png","width":645.46,"height":388.38}}]},{"id":"f8e8826d-7e8f-4800-bb5a-78b945502004","topic":"可以优化的","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"96095680-52b3-4f8d-a792-bea404bbf760","topic":"延迟时间","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"4e6346af-a914-4f26-bebb-613d145d4c30","topic":"平均：","expanded":true,"children":[{"id":"128c7ef5-f7c8-4731-bf7b-fadec5a1ef48","topic":"1/2r","expanded":true}]},{"id":"091d7e4b-6c10-49fd-9063-24035b36c8e7","topic":"有关：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"094e3654-1483-490f-811d-30d358ad7173","topic":"磁盘空闲空间分配程序","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"b1f9f91b-8437-408f-9839-2eb6a5410ba2","topic":"是否错位编号","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"f6b38175-06a0-4924-ad9b-031a1ea80c9d","topic":"程序规定的分配方式是直接分配相邻块（每次读取的旋转时延为一整圈）","expanded":true,"style":{"background":"#FF9595"}},{"id":"27538cc5-6547-4bdd-a69c-ccad09770d2e","topic":"若是相邻一个分配（每次读取的旋转时延为一个簇）","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"17eff9a6-783d-45d8-90e5-ef9c45cb80f7","topic":"物理结构","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"743e9bc0-fc61-4011-b5d1-4bf995f92020","topic":"是连续分配还是链接分配","expanded":true,"style":{"background":"#FFABD5"}},{"id":"704fcfa2-3580-41df-b775-d9d4d8e4c170","topic":"连续分配：可以只转圈","expanded":true},{"id":"0ae5742b-c628-4f97-8528-2014d6b0cb5f","topic":"链接分配：可能需要换柱换盘块","expanded":true}]}]},{"id":"23f4b67d-3ba4-418e-8fa3-0ee4701adf91","topic":"数据处理时间的影响：","expanded":true,"children":[{"id":"8ee44c67-c27e-47f3-aea2-7e9359516acb","topic":"会影响间隙大小，其实影响不大","expanded":true}]}]},{"id":"ba7b1621-8375-4377-a612-309b4e08e20c","topic":"寻道时间","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"8be0495e-2279-4135-833c-49667d1a35da","topic":"有关：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"65614858-fdd3-4cf7-835d-7bfb0c31f0af","topic":"磁盘调度算法","expanded":true,"style":{"background":"#FFABD5"}}]}]}]},{"id":"392c13a5-25b7-47f0-acd8-4d5feb6ff662","topic":"调度算法","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"6c066949-9c5e-42bf-8007-0f89aec010fb","topic":"FCFS算法","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"a266cc09-78e2-407c-bb31-3fc3df27e347","topic":"根据进程请求访问磁盘的先后顺序进行调度","expanded":true,"style":{"background":"#FDD834"}},{"id":"b85007d6-0939-4c4c-85f2-af1002dbc592","topic":"优点","expanded":true,"children":[{"id":"5b687fad-b195-452e-92ac-fe861125b381","topic":"公平、简单","expanded":true}]},{"id":"415f8b90-369d-41ad-946c-adc4b058618b","topic":"缺点","expanded":true,"children":[{"id":"98d84c06-5058-4ab6-aeb3-20ba5824b87c","topic":"平均寻道距离大，I/O较少可以使用","expanded":true}]}]},{"id":"9b6617bf-91b7-4ac6-a144-d0e61277378c","topic":"SSTF算法","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"0c387b6c-3bc5-453e-950d-ba92c0c4f0a2","topic":"调度处理的磁道是与当前磁头所在磁道距离最近的磁道","expanded":true,"style":{"background":"#FDD834"}},{"id":"79846687-570e-4445-a628-180af61280e5","topic":"优点","expanded":true,"children":[{"id":"89da89b0-b16b-485e-8abc-e5aebb96c893","topic":"性能比FCFS好（贪心算法）","expanded":true}]},{"id":"fbe15800-d7a8-408f-b2ca-0b0ff65f4d5e","topic":"缺点","expanded":true,"children":[{"id":"2d4374f0-20b6-44ad-b694-f2868e50be74","topic":"可能出现“饥饿”现象","expanded":true}]}]},{"id":"31475d43-cff5-4838-aedf-ea7aacf767ce","topic":"SCAN算法","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"bc3b3f00-a190-4e44-80fd-b225eee98932","topic":"（电梯调度算法）","expanded":true},{"id":"8196205c-d457-4e74-a731-13212aab5839","topic":"磁头【当前移动方向】上选择与当前磁头所在磁道距离最近的请求作为下一次服务的对象","expanded":true,"style":{"background":"#FDD834"}},{"id":"f3098dcf-9b62-4f54-a7ed-faf8c3607caf","topic":"优点","expanded":true,"children":[{"id":"ed4f846f-1c63-49d6-beb5-d14042c7ffd1","topic":"性能好，不会有“饥饿”","expanded":true}]},{"id":"6cc2499c-73ec-41fc-9834-b32d80995534","topic":"缺点","expanded":true,"children":[{"id":"d34a7648-4a21-4cfa-b73c-bc5b7a37d48f","topic":"不利于远离磁头一端的访问","expanded":true}]},{"id":"9f8f64d7-b571-459f-843b-444b45f05c2c","topic":"LOOK调度","expanded":true,"children":[{"id":"461b62d5-66d8-4c1e-95c2-24c382518627","topic":"不用扫到两端，扫到最左/最右的磁盘请求就行","expanded":true}]}]},{"id":"af51976e-c5c8-4747-bc67-b862affcc446","topic":"C-SCAN算法","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"7b6572a9-bbeb-4783-b1ee-48124803891d","topic":"回返时直接快速移动至起始端而不服务任何请求","expanded":true,"style":{"background":"#FDD834"}},{"id":"154fe42f-0bd8-419b-85af-ab026e578881","topic":"优点","expanded":true,"children":[{"id":"397d3aac-3cdd-46de-8a24-44354dbb7e74","topic":"磁道请求公平","expanded":true}]},{"id":"d9ff43ab-f8c7-4693-b27a-46b17acb70ac","topic":"C-LOOK调度","expanded":true,"children":[{"id":"50c02e08-459d-48d6-942d-cff9dc00435b","topic":"同理","expanded":true}]}]},{"id":"6baa0e33-f389-47b4-98a2-b85782eeaab1","topic":"磁臂黏着","expanded":true,"style":{"background":"#7986CB"},"children":[{"id":"794276d5-7b80-42c2-ab0d-eb1cd8260e3f","topic":"只有FCFS没有，如果在算法访问某个磁道时，这个磁道又进行了请求，就会一直被访问","expanded":true,"style":{"background":"#7986CB"},"children":[{"id":"57bd16cc-2671-4293-bb23-2007aabb582a","topic":"很诡异，记住就行","expanded":true}]}]}]},{"id":"7d94871b-913b-4f04-afb6-edd76857a915","topic":"错位编号","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"1a0e9ca4-df18-4b5e-865b-a3a87e7bf417","topic":"同一盘面","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"40cea28d-5d9f-4e6a-95a7-38c3726e16d9","topic":"同一盘面，物理地址相邻的扇区，在磁盘中应交错存放（留一些处理时间给磁头）","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"9c1005cf-e067-436b-a443-92a53d784f4d","topic":"不同盘面","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"9803ba44-eb47-428b-8c98-bb8a6a1ce77e","topic":"同柱面不同盘面的扇区错位编号，可以缩短连续读写两个相邻盘面的时间","expanded":true,"style":{"background":"#FF9595"}}]}]}]},{"id":"9dfc5982-ed71-4adb-8057-ec8f88025243","topic":"固态硬盘SSD","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-640feabdb028d5.svg","width":80.39,"height":81.72},"children":[{"id":"63ee90bd-6a38-4971-8ade-7305162a1c84","topic":"基于闪存的存储器","expanded":true,"children":[{"id":"cf6cb678-46e9-4f70-a924-05f79829796b","topic":"存储介质：NAND颗粒","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"0a1da727-533e-4596-8885-d06f8a0a34f1","topic":"读写速度比较：","expanded":true,"children":[{"id":"06390056-f2fa-405f-a8f2-6b230f69a478","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-587b202b3b391d.png","width":720.53,"height":297.85},"children":[{"id":"8e244fde-d96a-4469-a194-09094270cf19","topic":"（硬件茶谈）","expanded":true}]}]},{"id":"82602153-7b82-46a0-8436-c8d80343543b","topic":"组成：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"22c1d3d0-c437-49e5-8fe7-8820c2c7c7e0","topic":"闪存翻译层 + 多个闪存芯片","expanded":true,"style":{"background":"#FDD834"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-31ca5ac5ea8a23.png","width":543.71,"height":321.43},"children":[{"id":"00ef815c-35cf-44b4-b8be-5e37e8715c35","topic":"读写单位","expanded":true,"children":[{"id":"c0e9a5c0-53dc-43f8-9f33-0720e4ef46a4","topic":"CPU下令要读取一个块的内容","expanded":true},{"id":"2cffbf74-50e9-4b52-8c52-0c55730676ac","topic":"SSD的读取单位：一个页","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"e7e26ca0-ee5a-4132-aea9-5ada13a941ce","topic":"SSD接受到这个块的地址","expanded":true},{"id":"c1aee4a9-8967-4e62-8915-46fb38620d17","topic":"SSD的闪存翻译层把它翻译为SSD中对应的数个页的地址","expanded":true},{"id":"09fdc5ee-c827-406e-9333-de36680f92a2","topic":"SSD把这些页的数据发到IO总线上，返回CPU","expanded":true}]},{"id":"96c3dec3-1437-4e7e-a561-f4d3645c6104","topic":"具体大小：机械磁盘的一个块大小可能在1KB；SSD的一个页大小是512B~4KB，一个块中有32~128个页","expanded":true,"style":{"background":"#8EDE99"}}]}]}]},{"id":"cf2369e7-dd58-4502-8be5-2e15c6086675","topic":"读写原则：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"adc33221-f646-427e-ba1b-25e4f6a9e6d4","topic":"读：以一个页为单位来读 ✅","expanded":true,"style":{"background":"#FF9595"}},{"id":"43f6e780-77a2-4903-b319-4be79a8f98d2","topic":"写：以一个页为单位来写","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"89df4543-cfd0-46e5-8517-cedc05a9d26c","topic":"擦除：以一个块的单位来擦除","expanded":true},{"id":"e8659d30-8c2b-4f29-adb0-41001dbbbdfe","topic":"擦除方法：先把要写那页的整块复制到另一块，然后再擦除原来那块","expanded":true,"children":[{"id":"422905e3-c7e8-4efc-9935-185f26b19d3d","topic":"复制过后，在闪存翻译层中会建立新的： ‘逻辑地址’ —— ‘物理地址’ 的转换关系","expanded":true}]},{"id":"26817d0c-a6db-4c14-aaf9-a06264f1aa0f","topic":"擦除的缺点：","expanded":true,"children":[{"id":"e5731d80-d9e0-4442-a5b0-c84645bf8897","topic":"擦除多了会造成磨损","expanded":true}]}]}]},{"id":"95d954a5-1c83-4132-8368-9d0fc35bf722","topic":"平均磨损","expanded":true,"children":[{"id":"4cb781e0-0e11-4194-a174-fd1081dd0f1a","topic":"静态平均：","expanded":true,"children":[{"id":"f47ab9e3-4dee-433e-9925-9d5ef7d3c15d","topic":"SSD在进行擦除后的数据迁移的时候，会让寿命比较老的闪存块担任“读”的责任，让新的闪存块担任“写”的责任","expanded":true}]},{"id":"5bd133b4-4172-4b05-aa6d-7121a3c95f3d","topic":"动态平均：","expanded":true,"children":[{"id":"a7e4af31-bec6-446e-925b-b9450664c6ac","topic":"在SSD写入新数据的时候，会优先选择磨损次数少的块进行写入","expanded":true}]}]},{"id":"edc7c097-179a-488e-94a8-65c4af8d2ef1","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"585eb8d4-fae8-40be-b725-dac4369f3ac5","topic":"无","expanded":true}]}]},{"id":"3bd95fe83a5ac3450b7c3a3bc8","topic":"END","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-c2539473d179e5.svg"}}]},"relations":[{"id":"a91313e6-e535-4ffc-8b0f-1902a777db81","from":"eb68a188dcf9164a87cfdac332","to":"694897136dd86209129f08ecda","bidirectional":false},{"id":"6152572a-b23d-4e9a-8481-811a567f8110","from":"ecf05c35-d25e-4290-8e2f-942bd26a7d05","to":"f87ee7a8-0246-43d5-9b97-d244d1013ed1","bidirectional":false},{"id":"51598d91-b867-4b44-8df6-bef3ceec5097","from":"ba7b1621-8375-4377-a612-309b4e08e20c","to":"392c13a5-25b7-47f0-acd8-4d5feb6ff662","bidirectional":false},{"id":"f8b43d78-289b-4bfb-8f39-ce158c0e5d88","from":"c0e9a5c0-53dc-43f8-9f33-0720e4ef46a4","to":"2cffbf74-50e9-4b52-8c52-0c55730676ac","bidirectional":false,"label":"闪存翻译层"}],"summaries":[{"id":"85bdd685-1ebb-45c7-88a3-b3595b9c0aa6","parentId":"4ebabf1166298a106fbeaac505","start":0,"end":3,"label":"【数据寄存器】\n【控制寄存器】\n【状态寄存器】\n【地址线】\n【控制线】"},{"id":"97fc62a4-a766-4013-a085-e974f19df12a","parentId":"b4722863-e7a9-4530-b753-77792548f41f","start":0,"end":4,"label":""},{"id":"a9257bb4-e63e-457d-8710-5ae90d612a77","parentId":"056aab5c56aa3a2977c2c93354","start":0,"end":2,"label":"总时间：max(T, C) + M"},{"id":"cf050910-7b43-433c-bce5-ed71cada7165","parentId":"054260f1-038f-4135-bd8c-3ed3548f5ed1","start":0,"end":2,"label":"总时间：max(T, M+C)"},{"id":"2d4b1783-abed-4a84-9cd0-b8dd7aec15d8","parentId":"529b8fb845296efa501e8b1f3d","start":3,"end":4,"label":"指向正在等待该控制器的【进程队列】"},{"id":"8302ccd0-bf28-4699-baba-fb0bf12e180c","parentId":"8fc830a1ce499dc9a9e2d9a319","start":3,"end":3,"label":""},{"id":"e7352edd-e086-4c3e-b057-212e5cec3ef7","parentId":"80f33463-55c0-4035-955e-c2f1dc83f98d","start":0,"end":3,"label":""},{"id":"0d1103c2-a01f-4a86-990a-3088795e0345","parentId":"037eb757-03ec-44b2-8036-caffb26e7e8b","start":0,"end":1,"label":"存储原理类似，一个用磁性物质存，一个用光学物质存"},{"id":"eba62e36-eacb-41d5-abb6-2295b6c363a0","parentId":"392c13a5-25b7-47f0-acd8-4d5feb6ff662","start":2,"end":3,"label":"若无特殊说明，默认采用LOOK而不是SCAN（C-LOOK / C-SCAN）"},{"id":"367ac7b2-b215-4c62-b5a6-666c384b3db5","parentId":"95d954a5-1c83-4132-8368-9d0fc35bf722","start":0,"end":0,"label":"静态平均的效果比动态平均效果更好"}],"boundaries":[{"id":"eea9fe5b630986243bf058c142","parentId":"40fa0fc48949c07e0324d97904","start":3,"end":5,"label":"I/O子系统"},{"id":"b713e7d1-969f-4fd6-8264-816547176719","parentId":"40fa0fc48949c07e0324d97904","start":4,"end":5,"label":"直接处理硬件","style":{"stroke":"#BA69C8"}}]}