Due Date: August 6, 2017 23:59 hoursThe project developed in Lab #2 will be extended by this one. Using stat you will need to open each file within a child process and determine the following: the user ID and the group ID and then compare these to the current user. The 3 cases are: if the user is the owner, the user is in the same group as the owner, or if the owner is outside of the user group. After that information is printed, then print the combination of file permissions that apply to this file: read, write, execute.  Sample code: man stat, man 2 stat, man getpwuid, man readdir, and fileaccess.c Program requirements:The program should take either filenames or wildcards (*.c for example) as input.Create as many child processes as there are files on the command line.The parent process should wait for all the children to finish and then print “ps -H”For each child process:Print if you have owner, group, or general permissions. Hint: getuid(); & getgid();For the appropriate type, print what type of permissions you have: read, write, execute5% Extra Credit: instead of Canvas, submit your assignment via https://education.github.com/ (MUST be private, invite swirsz) I will use Github’s last modified date as the submission date. Make sure to put your full name in the header of your file.(example below)                                                                                                  Last Revised: July 12, 2017$ gcc Lab3.c -o Lab3 && ./Lab3 .. Lab3.cFile: ..You have general permissions: read executeFile: Lab3.cYou have owner permissions: read write execute
Due Date: August 13, 2017 23:59 hoursThe project developed in Lab #2 and #3 part 1 will be extended by this one. Using stat you will need to open each file within a child process and determine the following: the user ID and the group ID and then compare these to the current user. The 3 cases are: if the user is the owner, the user is in the same group as the owner, or if the owner is outside of the user group. After that information is printed, then print the combination of file permissions that apply to this file: read, write, execute.  Sample code: man stat, man 2 stat, man getpwuid, man readdir, man 3 scandir, and fileaccess.c Program requirements:The program should take either filenames or wildcards (*.c for example) as input.Create as many child processes as there are files on the command line.(you may remove the ps -H) The parent process should wait for all the children to finish and then print “ps -H”For each child process:Print if you have owner, group, or general permissions. Hint: getuid(); & getgid();For the appropriate type, print what type of permissions you have: read, write, execute5. If no filename is specified on the command prompt, use dirent to retrieve all files in the current folder.  Modular code will make this task much easier, but is not required.6. Use the output from stat to determine the owner of the file, and then use the passwd structure on the owner of the file to determine the home directory of the user that owns that file.10% Extra Credit: Your print output may occasionally be garbled. How would you fix this? (Hint: Semaphores implemented as pipes – see below) Separate program operations and print statements as best as possible. Consider the printf statements as a critical section. Do not use delays or wait inside your main loop, or make child processes wait in any way.20% Extra Credit: modify the semaphores to use pthreads instead of the pipe constructs P() & V() that are provided below5% Extra Credit: instead of Canvas, submit your assignment via https://education.github.com/ (MUST be private, invite swirsz) I will use Github’s last modified date as the submission date. Make sure to put your full name in the header of your file.(example below)                                                                                                  Last Revised: August 14, 2017
Operating Systems – Summer 2017 - August 22 - 12:35pm – 3:00pmThe Canvas exam will include 8 short answer (40%), 12 multiple-choice (48%), and 1 problem (12%).TextbookChapter 6: Processor SchedulingChapter 7: DeadlocksChapter 8: MemoryChapter 9: Virtual MemoryChapter 10: Disk Structure and SchedulingBring laptop!  Requires Respondus LockDown Browserclosed notes, closed bookmake sure you turn in the paper questionmultiple choice sections is automatic graded, other sections manually gradedfor short answer questions, please provide several significant and distinct ideas in your answers.SUBJECTS (… including additional subjects not explicitly mentioned here)Scheduling TheoryBasic Queuing TheoryHard Drive & Ssd SpeedsHard Drive Block SizeHard Drive Scheduling AlgorithmsDeadlockMemory Paging, Segmentation, ContiguousDefragmentationCaching Theory (Concepts, No Formulas)Page Replacement PoliciesEXAMPLE QUESTIONSDescribe what the bankers algorithm doesCPU scheduling must balance 3 different goals. What are they?Describe the 4 necessary conditions for deadlockDescribe some of the benefits of pagingVirtual addressing allows more efficient uses of memory. Describe at least 2 ways memory is wasted in systems that don’t use virtual addressingDescribe the pros and cons of hierarchical or multilevel paging in comparison to single level pagingDescribe what an inverted page table isDescribe the disk scheduling algorithms FCFS, SSTF, SCAN, and LOOKDescribe direct mapped, set associative, and fully associative cache -- ((Last Revised August 11, 2017))
Terminal Access:(PC) Download Secure Shell or Putty & connect to c322.wirsz.com | ssh.csun.edu | k200.ecs.csun.edushortcut: "C:\Program Files (x86)\PuTTY\putty.exe name@c322.wirsz.com -pw pass"(MAC) use Terminal $ ssh [canvas id]@c322.wirsz.comDue Date:  September 6, 2017 23:59 hoursI.  Create a shell script (script.sh) to run the following commands:Print the folder name of the current working directoryMake a subdirectoryChange the current working directory to that subdirectoryRedirect text on the command line to a file called data.txt and save itDisplay contents of file ‘data.txt’Make a copy of file 'data.txt' into file 'try.txt'In one single command (no use of & or ;), Show the contents of all files ending in .txtMake a new subdirectoryIn one single command (no use of & or ;), a) move a file to that new subdirectory and b) rename itIn one single command (no use of & or ;) show names of all files, a) list details of the files (not contents),  b) show all hidden files, c) travel through all subdirectories and d) send the output to a file called "hold.txt"Display the contents of the file "hold.txt"II. In the header of the shell script, create a comment line describing in just a sentence or two which unix editor you use and why. (possible editors include: pico/nano, vi, emacs/jed, FTP software with a GUI editor)III. You must make your shell script executable in order to run it from the commandline. Run your script, and redirect output to a file. (output.txt) Note: depending on how you implement step #4, the script may pause  during execution and wait for you to type something in to the command-line to write to data.txt. Do not use Ctrl-C or steps 5-11 will not execute.You must submit two files: script.sh and output.txtFurther help: http://linuxcommand.org                                                                                                                Last Revised: August 25, 2017
Due Date:  Sunday night, beginning of week of lab finals 23:59 hours Every UNIX process is guaranteed to have a unique numeric identifier called the process ID. The process ID or PID is always a nonnegative integer. The only way under UNIX (with a few exceptions) to create a new process is when an existing process calls the fork function. You can find details about fork and wait in the manual pages (man fork).The ideal solution is composed of a single parent process which simultaneously opens up multiple child processes which performs their function once and then quits. Code to close up the child processes should be at the end of the program.Also introduced in this lab are command-line options for UNIX programs. By convention, your program should start with the following two variables:int main(int argc, char *argv[])//argc is an integer of the number of arguments//argv “argument vector” is a character array of the argumentsWrite a simple program that uses the fork function. Sample code: man wait & man getpidProgram requirements:The program should take either filenames or wildcards (* for example) as input.Create as many child processes as there are files on the command line. Child processes should run simultaneously, not wait on each other. There are MANY ways that your code may be limited to sequential processing. To test for parallel code, make your child process wait for 1 second. If you have n files and your program is delayed 1 second, your code is parallel. If it is delayed n seconds, it is not parallel. If your code does not run in parallel, you cannot pass this assignmentFor each child process, print the file name and the process ID of the child processThe parent process should wait for all the children to finish then show the output from: system("ps -H");  This statement placed in other locations of your program may be a helpful command to debug your code.1% Extra Credit: instead of Canvas, submit your assignment via https://education.github.com/ (MUST be private, invite swirsz) I will use Github’s last modified date as the submission date. Make sure to put your full name in the header of your file if you submit it by Github.                                                                                            Last Revised: July 17, 2017
Terminal Access: (PC) Download Putty & connect to c322.wirsz.com (CSUN login id, initial password 123456) (MAC) use Terminal $ ssh [abc12345]@c322.wirsz.com Due Dates:     October 13, 2017  23:59 hours     October 27, 2017  23:59 hours – part II – block transmission (50% extra credit) For this assignment will need to write 2 separate programs in C, a client process and a server process. The client process makes a connection to the server, and transmits a RSA encoded message to the server. The server listens for client communication and when it has received the message, it decodes it and displays the message on the screen. • http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/socket.html • http://rosettacode.org/wiki/RSA_code#C • https://gmplib.org/manual/ Program requirements:The client needs to know the server IP address and port number. The server needs only to know the port number. Because you will be transmitting and receiving on the same server, it is recommended that you use the following commands: (port number should be any 4 digit number) gcc server.c -o server -L/gmp install/lib –lgmp && ./server [port number] gcc client.c -o client -L/gmp install/lib -lgmp && ./client localhost [port number] (Note: cut and paste from PDFs often distorts text. Cut & paste from Canvas or type manually)Part I: Fix the sample client and server code so it runs on the C322 server without errors or warnings. Add instructions to close all sockets on the server and client Incorporate the sample RSA code into your server and client code. Client should only have n & e, and server should only have n & d To simplify socket transmission, you may use commands to convert the multi-precision integer value back into a string before transmitting it to the server. (hint: mpz_get_str, mpz_set_str) Part II: break up longer strings into 10 char blocks, encode, transmit, and recombine multiple blocks on the server side.  Note: you should transmit the number of blocks to the server before sending. Your program from Part I should be able to encode strings up to 12 characters in length: swirsz@c322:~$ gcc client.c -o client  -L/gmp_install/lib -lgmp&& ./client localhost 6004 Please enter the message: Hi there C424! Encoded:   7114878424839051301866301460808272575931334 I got your message swirsz@c322:~$ gcc server.c -o server -L/gmp_install/lib -lgmp&& ./server 6004 Encoded:   7114878424839051301866301460808272575931334 Decoded:   375977598150559964853954922339901706 As String: Hi there C424! swirsz@c322:~$                                                                                                 Last Revised: September 21, 2017