当前位置:网站首页>26、 File system API (device sharing between applications; directory and file API)
26、 File system API (device sharing between applications; directory and file API)
2022-07-05 05:23:00 【[T]】
One 、 Sharing between devices and Applications
terminal
1、 Multiple processes print in parallel , How to ensure no confusion
2、 Multiple processes read in parallel , There will be competition
GPU(CUDA)
1、 Every CUDA Applications are a series CUDA Of API call
2、 All drivers realize scheduling ( Isolation )
Disks need to support data persistence
1、 Application data
(1) Executable files and dynamic link libraries
2、 User data
3、 system data
(1)manpage
(2) The system configuration
Two 、 file system : Virtual disk
The goal is :
1、 Provide reasonable API Enable multiple applications to share data
2、 Provide some isolation , Make malicious / Mistakes don't run away in large numbers
The storage device ( Byte sequence ) Virtualization of
1、 disk (I/O equipment )= A sequence of bytes that can be read and written
2、 Virtual disk ( file )= A dynamic byte sequence that can be read and written
(1) Name Management
The name of the virtual disk , Retrieval and convenience
(2) Data management
Random access ( Reading and writing )
3、 ... and 、 Virtual disk : Command management
Locality of information : Set the virtual disk ( file ) Organized into a hierarchy
1、 Directory tree
Root of directory
1、Windows
C:\Program Files\
D:\User
2、Unix/Linux
(1) There is only one root
/home/xxx
3、 Splicing of directory tree
Unix: Allow any directory ” mount “ A directory tree represented by a device
(1) You can mount the device anywhere
mount system call
int mount(const char *source, const char *target,
const char *filesystemtype, unsigned long mountflags,
const void *data);
mount /dev/sdb /mnt
umount mnt
Four 、Linux Startup process
Linux-minimal Running on the ‘initramfs’ Pattern
1、Linux-minimal Start process
export PATH=/bin
busybox mknod /dev/sda b 8 0
busybox mkdir -p /newroot
busybox mount -t ext2 /dev/sda /newroot # take /dev/sda The device is mounted on /newroot
exec busybox switch_root /newroot/ /etc/init
2、 File mount
file = Virtual disk on disk
Mount the file = Virtual disk created on virtual disk
(1)Linux Treatment mode
Create a loopback( Loop ) equipment
The device driver drives the device read/write Translated into documents read/write
Use lsblk Check... In the system block devices(strace)
strace View the process of mounting
ioctl(3, LOOP_CTL_GET_FREE)
ioctl(4, LOOP_SET_FD, 3)
5、 ... and 、 Directory management
1、mkdir
(1) Create a directory
(2) You can set permissions
2、rmdir
(1) Delete an empty directory
(2) No, ” Recursive delete “ System call
rm -rf Traverse delete
6、 ... and 、 Hard links
demand : There are multiple versions of the same runtime
Using a link can avoid a copy
7、 ... and 、 Soft link
Soft link : Store a jump prompt in the file
1、 Soft link is also a file
(1) When referencing this document , Find another file
(2) Can cross file systems , You can link to a directory
边栏推荐
- To the distance we have been looking for -- film review of "flying house journey"
- Reflection summary of Haut OJ freshmen on Wednesday
- Stm32cubemx (8): RTC and RTC wake-up interrupt
- Download xftp7 and xshell7 (official website)
- Support multi-mode polymorphic gbase 8C database continuous innovation and heavy upgrade
- Optimization scheme of win10 virtual machine cluster
- Heap sort summary
- 《动手学深度学习》学习笔记
- Haut OJ 1347: addition of choice -- high progress addition
- To be continued] [UE4 notes] L4 object editing
猜你喜欢
Stm32cubemx (8): RTC and RTC wake-up interrupt
Introduction to tools in TF-A
YOLOv5-Shufflenetv2
Quick sort summary
Gbase database helps the development of digital finance in the Bay Area
Research on the value of background repeat of background tiling
[to be continued] [UE4 notes] L1 create and configure items
Yolov5 ajouter un mécanisme d'attention
《动手学深度学习》学习笔记
[转]MySQL操作实战(三):表联结
随机推荐
小程序直播+电商,想做新零售电商就用它吧!
搭建完数据库和网站后.打开app测试时候显示服务器正在维护.
嵌入式数据库开发编程(六)——C API
Haut OJ 1241: League activities of class XXX
Research on the value of background repeat of background tiling
Learning notes of "hands on learning in depth"
Introduction to tools in TF-A
Collapse of adjacent vertical outer margins
Merge sort
[es practice] use the native realm security mode on es
2022/7/1 learning summary
A three-dimensional button
[turn to] MySQL operation practice (I): Keywords & functions
[转]MySQL操作实战(三):表联结
【论文笔记】Multi-Goal Reinforcement Learning: Challenging Robotics Environments and Request for Research
Acwing 4301. Truncated sequence
Solon Logging 插件的添加器级别控制和日志器的级别控制
[interval problem] 435 Non overlapping interval
xftp7与xshell7下载(官网)
[depth first search] 695 Maximum area of the island