SlideShare a Scribd company logo
1 of 14
Download to read offline
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

More Related Content

What's hot

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
 
網路組-Ubuntu介紹
網路組-Ubuntu介紹網路組-Ubuntu介紹
網路組-Ubuntu介紹maryqute520
 
Linux 教育訓練
Linux 教育訓練Linux 教育訓練
Linux 教育訓練Bo-Yi Wu
 
20121111 linux intro
20121111 linux intro20121111 linux intro
20121111 linux introChang Mt
 
[精华回顾]讲座:How To Install Linux
[精华回顾]讲座:How To Install Linux[精华回顾]讲座:How To Install Linux
[精华回顾]讲座:How To Install LinuxNJU OPEN
 
Linux 的檔案系統格式介紹
Linux 的檔案系統格式介紹Linux 的檔案系統格式介紹
Linux 的檔案系統格式介紹Ma Yu-Hui
 
Apache+php+mysql在Linux下的安装与配置
Apache+php+mysql在Linux下的安装与配置Apache+php+mysql在Linux下的安装与配置
Apache+php+mysql在Linux下的安装与配置wensheng wei
 
Linux 系统应用与程序设计
Linux 系统应用与程序设计Linux 系统应用与程序设计
Linux 系统应用与程序设计yiditushe
 
云存储系统设计
云存储系统设计云存储系统设计
云存储系统设计drewz lin
 
1, shell intro
1, shell intro1, shell intro
1, shell introted-xu
 
程式設計師的自我修養 Chapter 8
程式設計師的自我修養 Chapter 8程式設計師的自我修養 Chapter 8
程式設計師的自我修養 Chapter 8Shu-Yu Fu
 
Linux安全配置终极指南
Linux安全配置终极指南Linux安全配置终极指南
Linux安全配置终极指南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
 
基于PXE实现部署Linux服务器
基于PXE实现部署Linux服务器基于PXE实现部署Linux服务器
基于PXE实现部署Linux服务器ekoing
 
Linux基础
Linux基础Linux基础
Linux基础Eric Lo
 
1, linux intro
1, linux intro1, linux intro
1, linux introted-xu
 
Performance tuning
Performance tuningPerformance tuning
Performance tuningTommy Chiu
 
工作站教學
工作站教學工作站教學
工作站教學丕祐 陳
 

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)
 
網路組-Ubuntu介紹
網路組-Ubuntu介紹網路組-Ubuntu介紹
網路組-Ubuntu介紹
 
Linux 教育訓練
Linux 教育訓練Linux 教育訓練
Linux 教育訓練
 
20121111 linux intro
20121111 linux intro20121111 linux intro
20121111 linux intro
 
[精华回顾]讲座:How To Install Linux
[精华回顾]讲座:How To Install Linux[精华回顾]讲座:How To Install Linux
[精华回顾]讲座:How To Install Linux
 
Linux 的檔案系統格式介紹
Linux 的檔案系統格式介紹Linux 的檔案系統格式介紹
Linux 的檔案系統格式介紹
 
Apache+php+mysql在Linux下的安装与配置
Apache+php+mysql在Linux下的安装与配置Apache+php+mysql在Linux下的安装与配置
Apache+php+mysql在Linux下的安装与配置
 
Linux 系统应用与程序设计
Linux 系统应用与程序设计Linux 系统应用与程序设计
Linux 系统应用与程序设计
 
云存储系统设计
云存储系统设计云存储系统设计
云存储系统设计
 
1, shell intro
1, shell intro1, shell intro
1, shell intro
 
程式設計師的自我修養 Chapter 8
程式設計師的自我修養 Chapter 8程式設計師的自我修養 Chapter 8
程式設計師的自我修養 Chapter 8
 
Linux安全配置终极指南
Linux安全配置终极指南Linux安全配置终极指南
Linux安全配置终极指南
 
基于Ubuntu 12.04 LTS Server的无盘工作站
基于Ubuntu 12.04 LTS Server的无盘工作站基于Ubuntu 12.04 LTS Server的无盘工作站
基于Ubuntu 12.04 LTS Server的无盘工作站
 
Introduction to Nand Flash interface (chinese)
Introduction to Nand Flash interface (chinese)Introduction to Nand Flash interface (chinese)
Introduction to Nand Flash interface (chinese)
 
基于PXE实现部署Linux服务器
基于PXE实现部署Linux服务器基于PXE实现部署Linux服务器
基于PXE实现部署Linux服务器
 
Linux基础
Linux基础Linux基础
Linux基础
 
Hdfs
HdfsHdfs
Hdfs
 
1, linux intro
1, linux intro1, linux intro
1, linux intro
 
Performance tuning
Performance tuningPerformance tuning
Performance tuning
 
工作站教學
工作站教學工作站教學
工作站教學
 

Viewers also liked

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 LinuxTushar B Kute
 
File System Implementation - Part1
File System Implementation - Part1File System Implementation - Part1
File System Implementation - Part1Amir Payberah
 
Kernel development
Kernel developmentKernel development
Kernel developmentNuno 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 DelvareAnne Nicolas
 
Financial Trading Application Design
Financial Trading Application DesignFinancial Trading Application Design
Financial Trading Application DesignIsaac Maier
 
Unit 4
Unit 4Unit 4
Unit 4siddr
 
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 Businessjeffjohnsonau
 
Diapositivas restaurante
Diapositivas restauranteDiapositivas restaurante
Diapositivas restaurantepardo1107
 
Disk scheduling
Disk schedulingDisk scheduling
Disk schedulingniralim40
 
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 2016Quantopian
 
Diapositivas del restaurante
Diapositivas del restauranteDiapositivas del restaurante
Diapositivas del restauranteguinel
 

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
 
Vfs
VfsVfs
Vfs
 
1 04 rao
1 04 rao1 04 rao
1 04 rao
 
Linux Vfs
Linux VfsLinux Vfs
Linux Vfs
 
File System Implementation - Part1
File System Implementation - Part1File System Implementation - Part1
File System Implementation - Part1
 
File System Modules
File System ModulesFile System Modules
File System Modules
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Kernel development
Kernel developmentKernel development
Kernel development
 
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
 
OSCh12
OSCh12OSCh12
OSCh12
 
File system
File systemFile system
File system
 
OOP PROJECT REPORT
OOP PROJECT REPORTOOP PROJECT REPORT
OOP PROJECT REPORT
 
Financial Trading Application Design
Financial Trading Application DesignFinancial Trading Application Design
Financial Trading Application Design
 
Unit 4
Unit 4Unit 4
Unit 4
 
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
 
4. linux file systems
4. linux file systems4. linux file systems
4. linux file systems
 
Diapositivas restaurante
Diapositivas restauranteDiapositivas restaurante
Diapositivas restaurante
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
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
 
Diapositivas del restaurante
Diapositivas del restauranteDiapositivas del restaurante
Diapositivas del restaurante
 

Similar to Virtual file system (VFS)

X64服务器 lamp服务器部署标准 new
X64服务器 lamp服务器部署标准 newX64服务器 lamp服务器部署标准 new
X64服务器 lamp服务器部署标准 newYiwei Ma
 
5, system admin
5, system admin5, system admin
5, system adminted-xu
 
康盛创想项目部Linux 服务器部署标准(最新版)
康盛创想项目部Linux 服务器部署标准(最新版)康盛创想项目部Linux 服务器部署标准(最新版)
康盛创想项目部Linux 服务器部署标准(最新版)Yiwei Ma
 
unix toolbox 中文版
unix toolbox 中文版unix toolbox 中文版
unix toolbox 中文版Jie Bao
 
Zh tw introduction_to_hadoop and hdfs
Zh tw introduction_to_hadoop and hdfsZh tw introduction_to_hadoop and hdfs
Zh tw introduction_to_hadoop and hdfsTrendProgContest13
 
Linux基础
Linux基础Linux基础
Linux基础zhuqling
 
Bypat博客出品-利用cent os快速构建自己的发行版
Bypat博客出品-利用cent os快速构建自己的发行版Bypat博客出品-利用cent os快速构建自己的发行版
Bypat博客出品-利用cent os快速构建自己的发行版redhat9
 
Hdfs raid migration to hadoop 1.x
Hdfs raid migration to hadoop 1.x Hdfs raid migration to hadoop 1.x
Hdfs raid migration to hadoop 1.x Jiang Yu
 
CentOS5 apache2 mysql5 php5 Zend
CentOS5 apache2 mysql5 php5 ZendCentOS5 apache2 mysql5 php5 Zend
CentOS5 apache2 mysql5 php5 Zendwensheng wei
 
Use Alluxio to Unify Storage Systems in Suning
Use Alluxio to Unify Storage Systems in SuningUse Alluxio to Unify Storage Systems in Suning
Use Alluxio to Unify Storage Systems in SuningAlluxio, Inc.
 
Cephfs架构解读和测试分析
Cephfs架构解读和测试分析Cephfs架构解读和测试分析
Cephfs架构解读和测试分析Yang Guanjun
 
Unix常用命令 1
Unix常用命令 1Unix常用命令 1
Unix常用命令 1tony2yy_fish
 
Unixtoolbox zh cn
Unixtoolbox zh cnUnixtoolbox zh cn
Unixtoolbox zh cnxdboy2006
 

Similar to Virtual file system (VFS) (20)

X64服务器 lamp服务器部署标准 new
X64服务器 lamp服务器部署标准 newX64服务器 lamp服务器部署标准 new
X64服务器 lamp服务器部署标准 new
 
5, system admin
5, system admin5, system admin
5, system admin
 
Ubuntu
UbuntuUbuntu
Ubuntu
 
康盛创想项目部Linux 服务器部署标准(最新版)
康盛创想项目部Linux 服务器部署标准(最新版)康盛创想项目部Linux 服务器部署标准(最新版)
康盛创想项目部Linux 服务器部署标准(最新版)
 
unix toolbox 中文版
unix toolbox 中文版unix toolbox 中文版
unix toolbox 中文版
 
Zh tw introduction_to_hadoop and hdfs
Zh tw introduction_to_hadoop and hdfsZh tw introduction_to_hadoop and hdfs
Zh tw introduction_to_hadoop and hdfs
 
Linux基础
Linux基础Linux基础
Linux基础
 
Bypat博客出品-利用cent os快速构建自己的发行版
Bypat博客出品-利用cent os快速构建自己的发行版Bypat博客出品-利用cent os快速构建自己的发行版
Bypat博客出品-利用cent os快速构建自己的发行版
 
Hdfs raid migration to hadoop 1.x
Hdfs raid migration to hadoop 1.x Hdfs raid migration to hadoop 1.x
Hdfs raid migration to hadoop 1.x
 
Rootkit 101
Rootkit 101Rootkit 101
Rootkit 101
 
CentOS5 apache2 mysql5 php5 Zend
CentOS5 apache2 mysql5 php5 ZendCentOS5 apache2 mysql5 php5 Zend
CentOS5 apache2 mysql5 php5 Zend
 
Linuxguide4f2e
Linuxguide4f2eLinuxguide4f2e
Linuxguide4f2e
 
LinuxGuide4F2E
LinuxGuide4F2ELinuxGuide4F2E
LinuxGuide4F2E
 
Use Alluxio to Unify Storage Systems in Suning
Use Alluxio to Unify Storage Systems in SuningUse Alluxio to Unify Storage Systems in Suning
Use Alluxio to Unify Storage Systems in Suning
 
Cephfs架构解读和测试分析
Cephfs架构解读和测试分析Cephfs架构解读和测试分析
Cephfs架构解读和测试分析
 
Unix常用命令 1
Unix常用命令 1Unix常用命令 1
Unix常用命令 1
 
Linux system security
Linux system securityLinux system security
Linux system security
 
Rsync服务器架设方法.v0.1b
Rsync服务器架设方法.v0.1bRsync服务器架设方法.v0.1b
Rsync服务器架设方法.v0.1b
 
Unixtoolbox zh cn
Unixtoolbox zh cnUnixtoolbox zh cn
Unixtoolbox zh cn
 
unixtoolbox_zh_CN
unixtoolbox_zh_CNunixtoolbox_zh_CN
unixtoolbox_zh_CN
 

More from 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_josWaylin Ch
 
第一屆 啟動扶輪 - 華南生活探索營
第一屆 啟動扶輪 - 華南生活探索營第一屆 啟動扶輪 - 華南生活探索營
第一屆 啟動扶輪 - 華南生活探索營Waylin Ch
 
公式訪問投影片0827
公式訪問投影片0827公式訪問投影片0827
公式訪問投影片0827Waylin Ch
 
0911 juluosdev
0911 juluosdev0911 juluosdev
0911 juluosdevWaylin Ch
 

More from Waylin Ch (7)

linux mm
linux mmlinux mm
linux mm
 
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
 
Edm
EdmEdm
Edm
 
第一屆 啟動扶輪 - 華南生活探索營
第一屆 啟動扶輪 - 華南生活探索營第一屆 啟動扶輪 - 華南生活探索營
第一屆 啟動扶輪 - 華南生活探索營
 
Edm
EdmEdm
Edm
 
公式訪問投影片0827
公式訪問投影片0827公式訪問投影片0827
公式訪問投影片0827
 
0911 juluosdev
0911 juluosdev0911 juluosdev
0911 juluosdev
 

Virtual file system (VFS)