当前位置:网站首页>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
边栏推荐
- 64 horses, 8 tracks, how many times does it take to find the fastest 4 horses at least
- 使用Room数据库报警告: Schema export directory is not provided to the annotation processor so we cannot expor
- Haut OJ 1350: choice sends candy
- 一个新的微型ORM开源框架
- YOLOv5添加注意力机制
- Merge sort
- Use of room database
- 2022上半年全国教师资格证下
- [paper notes] multi goal reinforcement learning: challenging robotics environments and request for research
- Programmers' experience of delivering takeout
猜你喜欢
C语言杂谈1
Applet Live + e - commerce, si vous voulez être un nouveau e - commerce de détail, utilisez - le!
[merge array] 88 merge two ordered arrays
The present is a gift from heaven -- a film review of the journey of the soul
Pointnet++学习
Bucket sort
BUUCTF MISC
Stm32cubemx (8): RTC and RTC wake-up interrupt
Django reports an error when connecting to the database. What is the reason
Web APIs DOM node
随机推荐
YOLOv5添加注意力機制
Do a small pressure test with JMeter tool
被舆论盯上的蔚来,何时再次“起高楼”?
支持多模多态 GBase 8c数据库持续创新重磅升级
Ue4/ue5 illusory engine, material chapter, texture, compression and memory compression and memory
Support multi-mode polymorphic gbase 8C database continuous innovation and heavy upgrade
嵌入式数据库开发编程(五)——DQL
UE fantasy engine, project structure
[interval problem] 435 Non overlapping interval
[转]MySQL操作实战(三):表联结
object serialization
lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: meta line 6 and head, line 8, column 8
Bubble sort summary
Zzulioj 1673: b: clever characters???
When will Wei Lai, who has been watched by public opinion, start to "build high-rise buildings" again?
Add level control and logger level control of Solon logging plug-in
Count sort
2022 / 7 / 1 Résumé de l'étude
【ES实战】ES上的native realm安全方式使用
PMP考试敏捷占比有多少?解疑