581305-6 Computer Organization I, 2 ov, course exam 17.12.2001     (toisella puolella suomeksi in English)

Write in each answer sheet: your name and signature, id-number, course name, and page nr/total nr of pages
  1. [12 p] Process.
    1. [2 p] Define concept prosess. How does it differ from program?
    2. [2 p] What is the representation of a process in the system?
    3. [2 p] What is an operating system process? How does it differ from ordinary process?
    4. [2 p] What happens in the system at process switch? What happens to the previous process?
    5. [2 p] Give an example on an occasion when a process in running state is transferred to ready-to-run state.
    6. [2 p] Give an example on an occasion when a process in waiting state is transferred first to ready-to-run state and then immediately to running state.


  2. [12 p] Machine instruction execution.
    1. [2 p] Define concept  instruction execution cycle. What phases belong to it?
    2. [4 p] What happens at the processor in different instruction execution cycle phases when instruction "ADD  R5, =345" is executed?
    3. [3 p] Define concept exception (interrupt). What type exceptions are there? How are exeptions handled in the processor?
    4. [3 p] Define concept priviledged state (supervisor state). How does it affect instruction execution?



  3. [12 p] Java. Assume that program MyProg is written in Java and that it will be executed in the system with interpretation.
    1. [2 p] What needs to be done for program MyProg before the actual execution begins? In what form is MyProgs representated during execution time and how is that representation achieved?
    2. [2 p] How does program MyProg's execution finally occur at execution time? Which process (processes) known by the operating system is executed during program MyProg execution?
    3. [2 p] Some people claim that executing Java programs with interpretation is slower that executing similar compiled C-programs in that same environment. Give a answer with good reasoning to this claim.
    4. [2 p] How does the situation to cases (a) and (b) change, if  JIT-compilation is used?
    5. [2 p] How does the situation to cases (a) and (b) change, if Java-processor is used?
    6. [2 p] How does the situation to cases (a) and (b) differ from the case where your program would be written in C and it would be executed in the "normal way"?


  4. [12 p]  Activation records. TTK-91 machine subroutines are implemented with activation records.
    1. [3 p] Define concept activation record. What information and fields does it have?
    2. [2 p] Which fields in activation record are used in the actual body of the subroutine and how are they referred to?
    3. [2 p] Define concept activation record stack.
    4. [3 p] When and how is a new activation record stored to the activation record stack? How many machine instructions does it take?
    5. [2 p] When and how is an activation record removed from the activation record stack? How many machine instructions does it take?

Follow the subroutine (function) implementation and call mechanism introduced in lectures and in practice sessions.  Use a descriptive and comprehensive example in you answers to all cases.


TTK-91 assembly language instructions are: NOP, STORE, LOAD, IN, OUT, ADD, SUB, MUL, DIV, MOD, AND, IR, XOR, SHL, SHR, COMP, JUMP, JNEG, JZER, JPOS, JNNEG, JNZER, JNPOS, JLES, LEQU, JGRE, LNLES, LNEQU, NGRE, CALL, EXIT, PUSH, POP, PUSHR, POPR, SVC