Operating Systems 2018F Lecture 17

From Soma-notes

Video

The video from the lecture on November 9, 2018 is now available.

Notes

alloc pages -> frames -> page

'FUSE' - filesystem in userspace interface for userspace programs to export a filesystem to the LINUX kernel

What is a filesystem from a kernel?

  • A device file (character device, block device), depends on file operations.
  • A filesystem is just this scaled up, it should not only include these file operations, but it should also include operations for directories, and mounting, unmounting.

If you can define those, you can make a filesystem

FUSE makes a "special" filesystem that allows you to create other filesystems

Filesystems are abstractions of file operations Filesystems talk to rest of the kernel through a virtual filesystem interface

Are all userspace filesystem in memory? Standard ntfs implementation on most linux distributions, is written in userspace

Microkernals vs monolithic kernal microkernel: everything turns into a process monolithic kernel: it's faster


memoryll.py mounting dev/fuse any file operation is going to this python program

remember.c To increase storage, update: saved_data_max saved_data_order

Debugging kernel code is difficult, but kernel can be watched while running

In Class

Lecture 17
----------

Filesystems

What is it?


Well, what's a device file?
 - struct file_operations which gives functions for file operations
   (read, write, etc)

filesystems just take this idea further


When you access a file
 - process does a file-related system call
 - kernel calls generic system call function for requested operation
 - kernel calls filesystem-specific function for requested operation

e.g.
 - process does a write system call on file on an ext4 filesystem
 -   kernel runs generic write syscall code
 -     kernel runs ext4 write code

filesystems are abstractions of file and directory-related operations
 - allow many instantiations that we call filesystems

filesystems talk to rest of the kernel through a virtual filesystem interface
 (VFS)


Sidebar:
Microkernels vs monolithic kernels

Why microkernels
 - better security: if a service crashes, it is just a process
 - easier development: servers are just a process

Why monolithic kernels
 - faster
 - you depend on it anyway, so security benefits are illusory