1 / 17

Operating Systems Exercises

Operating Systems Exercises. Submission Guidelines. Fall 2008. Exercises. 3 to 4 exercises Each exercise: 10% of grade Two-Three weeks for each exercise Last exercise oral exam: no later than 22.1.2008. Teams. Exercises may be done in teams of any size. Yes, any size.

bradley
Download Presentation

Operating Systems Exercises

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Operating Systems Exercises Submission Guidelines Fall 2008

  2. Exercises • 3 to 4 exercises • Each exercise: 10% of grade • Two-Three weeks for each exercise • Last exercise oral exam: no later than 22.1.2008

  3. Teams • Exercises may be done in teams of any size. • Yes, any size. • That means 3, 5, 7, 11 members or even the whole class.. • Just remember that the grade is shared between all team members, and that each student will take part in the oral exam.

  4. Oral exam • You will be asked questions such as: • Where in your code do you open the TCP socket • Where in your code do you open the output file • Does this (XXX) function block? • Is this argument – (for example a char * argument for function) a void * or a null terminated string? • No trick questions • All questions can later appear in the final exam • Anybody who actually written the code should have clean sailing in the oral exam. • About 3 questions per student (maybe bit more maybe bit less)

  5. Grading The grade will comprise of two elements: • Correctness: Your implementation should run and function properly (correct results/behavior). This is compulsory. • Oral exam: All team members are required to know and understand the exercise they submitted.

  6. Grades • Exercise doesn’t run at exam date – 0 • All Exercises that run start at 100. • Resubmitting prior to exam date - -25 points to the group score • Each hour of delay - -10 points to the group score • Exercise run but a team member doesn’t answer 3 questions – 0 (and if according to our estimation of code and documentation the work was copied there may be further disciplinary procedures) • Team member didn’t answer two questions out of 3 – (-30 to group score) • Team member didn’t answer one question out of 3 – (-10 to group score) • Unclean work (failing to close files or sockets, leaving zombies, not opening syslog etc) may result in a warning or anywhere between -10 to -50 depending on severity • There may be bonus assignments

  7. How to Submit • Send your solution to: bodekostau@gmail.com • In the subject line, write “OS exercise 1 by ID 111111111”, where “1” is the exercise number, and “111111111” is an ID number for one of the team members. • Include a list of team members’ names and ID numbers. • Attach a document (doc, rtf, txt) with a short description (1-2 pages) of your implementation, main functions/procedures and any other useful information. (arguments, parameter names etc.)

  8. Your solution Please include: • Source code • Working makefile • A document describing your solution, how it works and how to use it Your solution should compile perfectly and run correctly without any modifications. The testing will be done on the same virtual machine as yours, (for kernel assignments) or on TAU student account. so a non-compiling or non-working exercise will not be accepted.

  9. Coding style Try to submit reasonable code: • Write notes throughout you code (always a good idea) • Check for function return values • Check various inputs and user behaviors (robustness) • Points will not be deducted for code style but will be deducted if the program crashes on certain cases or inputs etc. • For example : in the current ex. I will give you the assignment of reading directory. Don’t automatically assume you can read the directory (for example you may have no permissions or I may ask you to read a file not a directory) check for function output and check for errors.

  10. Oral Exam • Will announce dates to chose from. • Each team will coordinate a time for the exam. • About 5-15 minutes per team. • All team members should attend. • The grade is given to the team, all members share the same grade. • You will be asked general and specific questions about the exercise. • The aim is to test basic understanding and familiarity with the implementation. No person that has actually done the work should fail to answer even 1 question. • No tricks

  11. First exercise • Submission dead line : 7/Dec midnight • Oral exam dates : 9,10,11 Dec • Please send email to the bodekostau@gmail.com with your requested time • Times will be handed in “first requested-first served” method each team will have 15m slot

  12. Miscellanea Late submissions, can’t make it to oral exam, other problems: only with TA approval (Nezer). Bodek mailbox: Schreiber, box 296

  13. Daemon process code(from Stevens) Int daemon_init() { pid_t pid; if (pid=fork() <0) return -1; else if (pid !=0) exit(0); // parent dies setsid(); if (pid=fork() <0) return -1; else if (pid !=0) exit(0); // parent dies chdir(“/”); // change working directory // umask(0) – this function will be discussed when we talk about files return(0); }

  14. UDS Almost identical to internet socket Only change – domain in socket command and struct sockaddr (sockaddr_un instead of sockaddr_in) for connect and bind You may look at Beej guide for IPC for exact syntax (I am not going to cover this practically identical code.)

  15. UDS source - server #define SOCK_PATH "echo_socket" if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { perror("socket"); exit(1);} local.sun_family = AF_UNIX; strcpy(local.sun_path, SOCK_PATH); unlink(local.sun_path); len = strlen(local.sun_path) + sizeof(local.sun_family); if (bind(s, (struct sockaddr *)&local, len) == -1) { perror("bind"); exit(1);}

  16. UDS – client if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { perror("socket"); exit(1);} printf("Trying to connect...\n"); remote.sun_family = AF_UNIX; strcpy(remote.sun_path, SOCK_PATH); len = strlen(remote.sun_path) + sizeof(remote.sun_family); if (connect(s, (struct sockaddr *)&remote, len) == -1) { perror("connect"); exit(1);}

More Related