Operating Systems 2017F Lecture 8: Difference between revisions

From Soma-notes
Rquaium (talk | contribs)
No edit summary
Rquaium (talk | contribs)
No edit summary
Line 39: Line 39:


Path: List of all folder into which the shell looks at to find a program if not giving it a full path . “looking for the path to find a program we want to run”.
Path: List of all folder into which the shell looks at to find a program if not giving it a full path . “looking for the path to find a program we want to run”.
*memory is not continuous  
*memory is not continuous  
*everything is linux is a file ,  
*everything is linux is a file ,  
Difference between static and dynamic compilation:
Difference between static and dynamic compilation:
Line 59: Line 59:
X clock & : generates a clock ?  
X clock & : generates a clock ?  
How to redirect a file into a text file?
How to redirect a file into a text file?
ps aux | grep xclock > ps.log
 
ps aux | grep xclock > ps.log
 
 
*Generate a file on a strace on a program: we should know the command line to do this  
*Generate a file on a strace on a program: we should know the command line to do this  

Revision as of 03:40, 5 October 2017

This class was review of older classes and answering questions (No new topics)

User mode: only mode available to us Kernel: make a request for memory Kernel: abstracts that, it provides you with the RAM you need to access by providing an address What is a process: a running program

What is a program: set of the instructions, given to the CPU to execute line by line

Command line/sell/terminal: all same thing

How do processes communicate with each other ? They send signals to each other. For example, parent knows that child has executed when it receives signal

PS: list of process

Orphan process: parent has finished executing and terminated leaving an "orphaned" child process who parent process will become a process from a higher level

Zombie process: Process that has finished executing but its entry still exists in the process list (parent does not wait for child to terminate before it dies)

Tutorial 2 question : what happens if you removed that line? The program will get stuck and the parent will be waiting if the child is finished. NOT FINISHED THE CHECKING.

  • we don’t necessarily need a system environment

File system: managing the hard drive, writing and reading to a file etc.

Environment: where we are working

Environment variable: is where configurations are stores, all start with “$” signs. To check resolutions etc. find any info like user etc.

Configurations are stored in an environment variable like $USER

$PATH stores list of all folders that tells shells where to look for

  • envp[] stores all environment variables

Data structure stores data. Inode is a datastructure on a filesystem in linux that is used to store file information (however, it does NOT store the name or actual data of the file).

File system Device files stored in /dev

Path: List of all folder into which the shell looks at to find a program if not giving it a full path . “looking for the path to find a program we want to run”.

  • memory is not continuous
  • everything is linux is a file ,

Difference between static and dynamic compilation:

Dynamically linked file: loads code as it needs it

Libraries are dynamically loaded into memory versus when they are loaded statically

Man pages are helpful…

Commands: LSPCI: shows you which hardware you are working with Ps : to find a process ID , coming from the kernel Ps – aux Pstree: displayes the family tree . systemd : first one , always wait on the child and checks if the child has to report something to prevent zombie processes. SIGCHILD : how processes communicate , they send signals to communicate with each other and SIGCHILD is one of them A child send it to the parent when it is done its task.   X clock & : generates a clock ? How to redirect a file into a text file?

ps aux | grep xclock > ps.log  

  • Generate a file on a strace on a program: we should know the command line to do this

  Echo $USER : to identify user name Envp[] : stores all the env variables you have /proc/ 1237 ls /proc/1237$ Man man Man readlink : shell command , also a system call Xclock ; is the child of the bash terminal (Do a while loop or a for loop to parse it ) ^ /proc/2363 status? The you get the RAM and all info about the process