CS 3733 Operating Systems


FAQ Spring 1998


[4/26/98] Critique of Assignment 5:

  • Part I:
  • Part II:

    [2/20/98] Critique of Assignment 2 Part I:

  • Not following the specification for play_file:
  • Programming errors:

  • Poor programming style:


    [2/17/98]Question

    Just so I am sure what it is I am seeing, can you give a brief description of what each of the performance monitors is?

    Answer:

    Actually the performance meter has a man page under perfmeter which you may want to look at.... here is an excerpt:

              cpu     Percent of CPU being utilized.
              pkts    Ethernet packets per second.
              page    Paging activity in pages per second.
              swap    Jobs swapped per second.
              intr    Number of device interrupts per second.
              disk    Disk traffic in transfers per second.
              cntxt   Number of context switches per second.
              load    Average number of runnable processes  over  the
                      last minute.
              colls   Collisions per second detected on the ethernet.
              errs    Errors per second on receiving packets.
    
    P.S. Paging here does mean faults [2/11/98]Question

    Can "system" be used in our programs to "cat" the audio files? Can "system" be used to call audioconvert? I was unable to find an audioconvert library function.

    Answer:

    This is a lab on device independent I/O. You may not use "system" in your program. By the way, "system" forks a child to run the program. In real life this is a very high-overhead approach.

    You should use audioconvert as follows. Initially you can use it to remove the headers from your recorded digit files so that you can play them. (You will save the raw files to disk and use those as input.)

    Once you get that working, you should compare the raw file and the file with the header to see what you have to do to take off the header yourself.


    [2/10/98] Question:

    In the assignment due on Wednesday, one of the functions we must write is supposed to remove the "audio header" from a file before sending it to the audio device in a write. I have looked through the book, man pages, and answerbook to find out what the audio header is. I looked at the first few lines of an audio file and found a .snd string before everything became giberish. Can you point me in a direction on this header.

    Answer:

    Do a man on audioconvert. With the -raw option this filter will remove the header.


    [1/31/98] Critique of Assignment 1 part II:

    [1/21/98] Question: I copyed the program 2.10 and changed "oshacker" to my name. No matter what, it beeps every 10 seconds. Even if I do not have any incoming mail. Could you please tell me why?

    Answer: The mybiff program in the text beeps as long as your mail inbox is not empty. I recommend that you use mailx to read your mail. When you save a message (s) or reply to a message (r) or explicitly delete a message (d) or read the message and then quit from mail (q) rather than exit from (x), the message is removed from your inbox. If you x from mailx or don't read the message, it is still there the next and the file still exists.


    [1/20/98] Question: The lint output on my code keeps generating messages about some external variables that are not initialized or used. The -m and -u options are not turning these messages off. I tries the -x option and it did turn them off; however, this is not in line with the specs on the assignment. Also, the lint output includes messages regarding return values for fprintf, close, and sleep (obviously, I failed to error trap those statements). Questions: Should we not get the external variable messages with the -m option; and, if not and we still do, can we use -x? What else does -x do? Are we to error trap the fprintf, close, and sleep statements?

    Answer: You may also use the -x option. You do not have to trap errors for fclose and fprintf but you must for fscanf and you probably should for sleep.


    [1/20/98] Question: Once we get the user name with getuid() and getpwuid(), what do we do with it? The text does not specify.

    Answer: Program 2.10 hardcodes in the path (/var/mail) and the user (oshacker). These are used to get the username to replace oshacker.


    [1/20/98] Question: I have tried printing a "New mail for:" message; however, since the process is running in the background, you do not get a new prompt after the message. It can really be irritating and confusing. I suppose the process could fork() and have the child write the message. Or there could be another option flag that allows the user to choose whether to have the message written to the screen.

    Answer: Well forking a child isn't a bad strategy, but you shouldn't be printing a message unless you are guaranteed that you are starting mybiff from the console window. This isn't in the spec which is to just ring the bell.



    Revision Date: 2/20/98