狠狠撸

狠狠撸Share a Scribd company logo
1
Virtual FileSystem(VFS)
Wayling
2011.12.20
2
Outline
? Introduce VFS
? VFS implement
? Ramfs
? Vfs/ramfs to Bos
3
virtual file system(1/2)
ls mkdir mount
libc
VFS
cpiofs
procfs
arfs
devfs
tarfs
ramfs
filesystem
4
virtual file system(2/2)
? vfs framework
– vnode / file / dirent struct
– mount / mkdir
? no file I/O
– device model
– file block struct
– read / write
? no lock
– no Synchronized
5
VFS implement (call trace)
? mount->sys_mount->ramfs_mount
? mkdir->sys_mkdir->ramfs_mkdir
? open_dir->sys_opendir->ramfs_opendir
? read->sys_read->ramfs_read
? write->sys_write->ramfs_write
6
VFS implement (vnode)
7
vfs 轉換
? 轉換vnode 到個別檔案系統的節點
– namei / lookup
? 找到對應filesystem,root point
? 分解路徑
? 轉換
/test/test1
/ /test /test/test1
Filesystem 相關
8
mount
? “/” ,根目錄比較特別,需要直接用mount建立,
其他目錄皆需用mkdir創建
? sys_mount掛載一個檔案系統,所有操作皆會
被轉為此檔案系統各自的操作
/
ramfs
/test
ext2
9
mkdir
? sys_mkdir建立vnode轉為個別檔案系統的節
點之操作
依據路徑
轉換vnode
是否存在 目錄存在
建vnode,
呼叫對應檔案系統之mkdir
10
vnode 查詢
? vnode查詢頻繁,故使用hashfunction查詢
vnode_table
11
ramfs(1/2)
? vnode -> ramfs_node
? ramfs 自我組織
/
/test1
/test2
/test
12
ramfs 填填看(2/2)
13
vfs/ramfs to Bos
? Porting from prex/xboot
? Github
https://github.com/benwei/bos/tree/feature-
vfs
? fs
– vfs
– ramfs
? ls command
14
reference
? [vfs-feature]
? https://github.com/benwei/bos/tree/feature-
vfs
? [xboot]
? https://github.com/jerryjianjun/xboot
? [prex]
? https://github.com/AndrewD/prex
Ad

More Related Content

What's hot (20)

FAT file system implementation from scratch in boot-loader (chinese)
FAT file system implementation from scratch in boot-loader (chinese)FAT file system implementation from scratch in boot-loader (chinese)
FAT file system implementation from scratch in boot-loader (chinese)
Sneeker Yeh
?
网路组-鲍产耻苍迟耻介绍
网路组-鲍产耻苍迟耻介绍网路组-鲍产耻苍迟耻介绍
网路组-鲍产耻苍迟耻介绍
maryqute520
?
Linux 教育訓練
Linux 教育訓練Linux 教育訓練
Linux 教育訓練
Bo-Yi Wu
?
20121111 linux intro
20121111 linux intro20121111 linux intro
20121111 linux intro
Chang Mt
?
[精华回顾]讲座:How To Install Linux
[精华回顾]讲座:How To Install Linux[精华回顾]讲座:How To Install Linux
[精华回顾]讲座:How To Install Linux
NJU OPEN
?
Linux 的檔案系統格式介紹
Linux 的檔案系統格式介紹Linux 的檔案系統格式介紹
Linux 的檔案系統格式介紹
Ma Yu-Hui
?
础辫补肠丑别+辫丑辫+尘测蝉辩濒在尝颈苍耻虫下的安装与配置
础辫补肠丑别+辫丑辫+尘测蝉辩濒在尝颈苍耻虫下的安装与配置础辫补肠丑别+辫丑辫+尘测蝉辩濒在尝颈苍耻虫下的安装与配置
础辫补肠丑别+辫丑辫+尘测蝉辩濒在尝颈苍耻虫下的安装与配置
wensheng wei
?
Linux 系统应用与程序设计
Linux 系统应用与程序设计Linux 系统应用与程序设计
Linux 系统应用与程序设计
yiditushe
?
云存储系统设计
云存储系统设计云存储系统设计
云存储系统设计
drewz lin
?
1, shell intro
1, shell intro1, shell intro
1, shell intro
ted-xu
?
程式設計師的自我修養 Chapter 8
程式設計師的自我修養 Chapter 8程式設計師的自我修養 Chapter 8
程式設計師的自我修養 Chapter 8
Shu-Yu Fu
?
尝颈苍耻虫安全配置终极指南
尝颈苍耻虫安全配置终极指南尝颈苍耻虫安全配置终极指南
尝颈苍耻虫安全配置终极指南
wensheng wei
?
基于Ubuntu 12.04 LTS Server的无盘工作站
基于Ubuntu 12.04 LTS Server的无盘工作站基于Ubuntu 12.04 LTS Server的无盘工作站
基于Ubuntu 12.04 LTS Server的无盘工作站
Shawn Zhung
?
Introduction to Nand Flash interface (chinese)
Introduction to Nand Flash interface (chinese)Introduction to Nand Flash interface (chinese)
Introduction to Nand Flash interface (chinese)
Sneeker Yeh
?
基于笔齿贰实现部署尝颈苍耻虫服务器
基于笔齿贰实现部署尝颈苍耻虫服务器基于笔齿贰实现部署尝颈苍耻虫服务器
基于笔齿贰实现部署尝颈苍耻虫服务器
ekoing
?
尝颈苍耻虫基础
尝颈苍耻虫基础尝颈苍耻虫基础
尝颈苍耻虫基础
Eric Lo
?
1, linux intro
1, linux intro1, linux intro
1, linux intro
ted-xu
?
Performance tuning
Performance tuningPerformance tuning
Performance tuning
Tommy Chiu
?
工作站教学
工作站教学工作站教学
工作站教学
丕祐 陳
?
FAT file system implementation from scratch in boot-loader (chinese)
FAT file system implementation from scratch in boot-loader (chinese)FAT file system implementation from scratch in boot-loader (chinese)
FAT file system implementation from scratch in boot-loader (chinese)
Sneeker Yeh
?
网路组-鲍产耻苍迟耻介绍
网路组-鲍产耻苍迟耻介绍网路组-鲍产耻苍迟耻介绍
网路组-鲍产耻苍迟耻介绍
maryqute520
?
Linux 教育訓練
Linux 教育訓練Linux 教育訓練
Linux 教育訓練
Bo-Yi Wu
?
20121111 linux intro
20121111 linux intro20121111 linux intro
20121111 linux intro
Chang Mt
?
[精华回顾]讲座:How To Install Linux
[精华回顾]讲座:How To Install Linux[精华回顾]讲座:How To Install Linux
[精华回顾]讲座:How To Install Linux
NJU OPEN
?
Linux 的檔案系統格式介紹
Linux 的檔案系統格式介紹Linux 的檔案系統格式介紹
Linux 的檔案系統格式介紹
Ma Yu-Hui
?
础辫补肠丑别+辫丑辫+尘测蝉辩濒在尝颈苍耻虫下的安装与配置
础辫补肠丑别+辫丑辫+尘测蝉辩濒在尝颈苍耻虫下的安装与配置础辫补肠丑别+辫丑辫+尘测蝉辩濒在尝颈苍耻虫下的安装与配置
础辫补肠丑别+辫丑辫+尘测蝉辩濒在尝颈苍耻虫下的安装与配置
wensheng wei
?
Linux 系统应用与程序设计
Linux 系统应用与程序设计Linux 系统应用与程序设计
Linux 系统应用与程序设计
yiditushe
?
云存储系统设计
云存储系统设计云存储系统设计
云存储系统设计
drewz lin
?
1, shell intro
1, shell intro1, shell intro
1, shell intro
ted-xu
?
程式設計師的自我修養 Chapter 8
程式設計師的自我修養 Chapter 8程式設計師的自我修養 Chapter 8
程式設計師的自我修養 Chapter 8
Shu-Yu Fu
?
尝颈苍耻虫安全配置终极指南
尝颈苍耻虫安全配置终极指南尝颈苍耻虫安全配置终极指南
尝颈苍耻虫安全配置终极指南
wensheng wei
?
基于Ubuntu 12.04 LTS Server的无盘工作站
基于Ubuntu 12.04 LTS Server的无盘工作站基于Ubuntu 12.04 LTS Server的无盘工作站
基于Ubuntu 12.04 LTS Server的无盘工作站
Shawn Zhung
?
Introduction to Nand Flash interface (chinese)
Introduction to Nand Flash interface (chinese)Introduction to Nand Flash interface (chinese)
Introduction to Nand Flash interface (chinese)
Sneeker Yeh
?
基于笔齿贰实现部署尝颈苍耻虫服务器
基于笔齿贰实现部署尝颈苍耻虫服务器基于笔齿贰实现部署尝颈苍耻虫服务器
基于笔齿贰实现部署尝颈苍耻虫服务器
ekoing
?
尝颈苍耻虫基础
尝颈苍耻虫基础尝颈苍耻虫基础
尝颈苍耻虫基础
Eric Lo
?
1, linux intro
1, linux intro1, linux intro
1, linux intro
ted-xu
?
Performance tuning
Performance tuningPerformance tuning
Performance tuning
Tommy Chiu
?

Viewers also liked (20)

Part 03 File System Implementation in Linux
Part 03 File System Implementation in LinuxPart 03 File System Implementation in Linux
Part 03 File System Implementation in Linux
Tushar B Kute
?
Vfs
VfsVfs
Vfs
Waqas !!!!
?
1 04 rao
1 04 rao1 04 rao
1 04 rao
dimitar9
?
Linux Vfs
Linux VfsLinux Vfs
Linux Vfs
Meiri Lerner
?
File System Implementation - Part1
File System Implementation - Part1File System Implementation - Part1
File System Implementation - Part1
Amir Payberah
?
File System Modules
File System ModulesFile System Modules
File System Modules
Anil Kumar Pugalia
?
Linux File System
Linux File SystemLinux File System
Linux File System
Anil Kumar Pugalia
?
Kernel development
Kernel developmentKernel development
Kernel development
Nuno Martins
?
Kernel Recipes 2016 - New hwmon device registration API - Jean Delvare
Kernel Recipes 2016 -  New hwmon device registration API - Jean DelvareKernel Recipes 2016 -  New hwmon device registration API - Jean Delvare
Kernel Recipes 2016 - New hwmon device registration API - Jean Delvare
Anne Nicolas
?
OSCh12
OSCh12OSCh12
OSCh12
Joe Christensen
?
File system
File systemFile system
File system
kendersec
?
OOP PROJECT REPORT
OOP PROJECT REPORTOOP PROJECT REPORT
OOP PROJECT REPORT
Minahil Saeed
?
Financial Trading Application Design
Financial Trading Application DesignFinancial Trading Application Design
Financial Trading Application Design
Isaac Maier
?
Unit 4
Unit 4Unit 4
Unit 4
siddr
?
Why You Need FPGA In Your High-Frequency Trading Business
Why You Need FPGA In Your High-Frequency Trading BusinessWhy You Need FPGA In Your High-Frequency Trading Business
Why You Need FPGA In Your High-Frequency Trading Business
jeffjohnsonau
?
4. linux file systems
4. linux file systems4. linux file systems
4. linux file systems
Marian Marinov
?
Diapositivas restauranteDiapositivas restaurante
Diapositivas restaurante
pardo1107
?
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
niralim40
?
Market Timing, Big Data, and Machine Learning by Xiao Qiao at QuantCon 2016
Market Timing, Big Data, and Machine Learning by Xiao Qiao at QuantCon 2016Market Timing, Big Data, and Machine Learning by Xiao Qiao at QuantCon 2016
Market Timing, Big Data, and Machine Learning by Xiao Qiao at QuantCon 2016
Quantopian
?
Diapositivas del restauranteDiapositivas del restaurante
Diapositivas del restaurante
guinel
?
Part 03 File System Implementation in Linux
Part 03 File System Implementation in LinuxPart 03 File System Implementation in Linux
Part 03 File System Implementation in Linux
Tushar B Kute
?
File System Implementation - Part1
File System Implementation - Part1File System Implementation - Part1
File System Implementation - Part1
Amir Payberah
?
Kernel Recipes 2016 - New hwmon device registration API - Jean Delvare
Kernel Recipes 2016 -  New hwmon device registration API - Jean DelvareKernel Recipes 2016 -  New hwmon device registration API - Jean Delvare
Kernel Recipes 2016 - New hwmon device registration API - Jean Delvare
Anne Nicolas
?
Financial Trading Application Design
Financial Trading Application DesignFinancial Trading Application Design
Financial Trading Application Design
Isaac Maier
?
Why You Need FPGA In Your High-Frequency Trading Business
Why You Need FPGA In Your High-Frequency Trading BusinessWhy You Need FPGA In Your High-Frequency Trading Business
Why You Need FPGA In Your High-Frequency Trading Business
jeffjohnsonau
?
Diapositivas restauranteDiapositivas restaurante
Diapositivas restaurante
pardo1107
?
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
niralim40
?
Market Timing, Big Data, and Machine Learning by Xiao Qiao at QuantCon 2016
Market Timing, Big Data, and Machine Learning by Xiao Qiao at QuantCon 2016Market Timing, Big Data, and Machine Learning by Xiao Qiao at QuantCon 2016
Market Timing, Big Data, and Machine Learning by Xiao Qiao at QuantCon 2016
Quantopian
?
Diapositivas del restauranteDiapositivas del restaurante
Diapositivas del restaurante
guinel
?
Ad

More from Waylin Ch (7)

linux mm
linux mmlinux mm
linux mm
Waylin Ch
?
0911 juluosdev a_journey_of_filesystem_on_jos
0911 juluosdev a_journey_of_filesystem_on_jos0911 juluosdev a_journey_of_filesystem_on_jos
0911 juluosdev a_journey_of_filesystem_on_jos
Waylin Ch
?
第一屆 啟動扶輪 - 華南生活探索營
第一屆 啟動扶輪 - 華南生活探索營第一屆 啟動扶輪 - 華南生活探索營
第一屆 啟動扶輪 - 華南生活探索營
Waylin Ch
?
公式访问投影片0827
公式访问投影片0827公式访问投影片0827
公式访问投影片0827
Waylin Ch
?
0911 juluosdev a_journey_of_filesystem_on_jos
0911 juluosdev a_journey_of_filesystem_on_jos0911 juluosdev a_journey_of_filesystem_on_jos
0911 juluosdev a_journey_of_filesystem_on_jos
Waylin Ch
?
第一屆 啟動扶輪 - 華南生活探索營
第一屆 啟動扶輪 - 華南生活探索營第一屆 啟動扶輪 - 華南生活探索營
第一屆 啟動扶輪 - 華南生活探索營
Waylin Ch
?
公式访问投影片0827
公式访问投影片0827公式访问投影片0827
公式访问投影片0827
Waylin Ch
?
Ad

Virtual file system (VFS)