Operating Systems 2018F Lecture 18: Difference between revisions

From Soma-notes
No edit summary
 
Line 5: Line 5:
==Notes==
==Notes==


What is dev/fuse
How did i do a mount
Mount is a priveleged operation normally, it lets you shadow entire portions of the filesystem
fusermount breaks under strace
bin/fusermount is red because of the 's' permission bit.
'''What is the 's' permission bit?'''
s stands for setuid in the owner position, and setgid in the group position.
It allows a program to run with privileges different from the process that did the execve
Normally execve of a process will run as the user (the uid that is currently running)
'''setuid''' gives it the privileges of root instead
'''getuid()''' is who ran the process
'''geteuid()''' is with what privelges is this process running
normally these are equal, but it changes when you run '''setuid'''
(same thing for gid)
If you run memoryll as root, the mnt point and all the files under it are exclusive to root
One of the features of userspace mounting of filesystems, is that they are exclusive to the user that mounted them.
'''getattr()'''
'''system calls'''
writev and read, its a way of using multiple buffers
mount - mounts dev/fuse and fd 3
===In Class===
===In Class===
<pre>
<pre>

Latest revision as of 08:48, 23 November 2018

Video

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

Notes

What is dev/fuse How did i do a mount

Mount is a priveleged operation normally, it lets you shadow entire portions of the filesystem

fusermount breaks under strace

bin/fusermount is red because of the 's' permission bit.

What is the 's' permission bit? s stands for setuid in the owner position, and setgid in the group position. It allows a program to run with privileges different from the process that did the execve

Normally execve of a process will run as the user (the uid that is currently running)

setuid gives it the privileges of root instead

getuid() is who ran the process geteuid() is with what privelges is this process running normally these are equal, but it changes when you run setuid (same thing for gid)

If you run memoryll as root, the mnt point and all the files under it are exclusive to root One of the features of userspace mounting of filesystems, is that they are exclusive to the user that mounted them.

getattr() system calls writev and read, its a way of using multiple buffers mount - mounts dev/fuse and fd 3

In Class

Lecture 18
----------

To Do
-----
  strace memoryll
  uid vs euid
  scheduling and __schedule

Optional reading:
  https://utcc.utoronto.ca/~cks/space/blog/unix/RawTtyInputThenAndNow

Scheduling
----------

System calls => enter supervisor mode (kernel) from user mode (processes)

scheduler => enter user mode (processes) from supervisor mode (kernel)

Scheduling algorithms

Challenges of scheduling
 - maximize use of resources (throughput)
 - minimize wait time (latency)
 - minimal computational complexity
    scheduling is pure overhead
 - make sure "important" things get done
    - obey user preferences
    - do important system things



Classic scheduling
Batch scheduling
 - shortest job first
    - lowers latency for shorter jobs but isn't "fair"
 - first in, first out
    - fair, but can have bad consequences

"time sharing" - preemptible scheduling
 - each process gets a "time slice"
 - when process is interupted, what to do next?
   key question
     - is it waiting for I/O?