EECE7376_HW03

.pdf

School

Northeastern University *

*We aren’t endorsed by this school

Course

7376

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

pdf

Pages

5

Uploaded by ChancellorSealMaster948

Report
EECE7376 – Homework 3 1 / 5 Northeastern University College of Engineering Department of Electrical & Computer Engineering EECE7376: Operating Systems: Interface and Implementation Homework 3 Instructions - For programming Problems: 1. Your code must be well commented by explaining what the lines of your program do. Have at least one comment for every 4 lines of code. 2. At the beginning of your source code files write your full name, students ID, and any special compiling/running instruction (if any). 3. Before submitting the source code file(s), your code must compile and tested with a standard GCC compiler (available in the CoE Linux server). 4. Do not submit any compiled object or executable files. - Submit the following to the homework assignment page on Canvas: 1. Your homework report developed by a word processor (e.g., Microsoft Word) and submitted as one PDF file. The report cover page must include your full name, student ID, course/section/semester information. For answers that require drawing and if it is difficult on you to use a drawing application, which is preferred, you can neatly hand draw “only” these diagrams, scan them, and insert the scanned images in your report document. The report includes the following (depending on the assignment contents): a. Answers to the non-programming Problems that show all the details of the steps you follow to reach these answers. b. A summary of your approach to solve the programming Problems. c. The screen shots of the sample run(s) of your program(s) 2. Your well-commented programs source code files (i.e., the .cc or .cpp files). Do NOT submit any files (e.g., the PDF report file and the source code files) as a compressed (zipped) package. Rather, upload each file individually. Note: You can submit multiple attempts for this homework, however, only what you submit in the last attempt will be graded. This means all required files must be included in this last submission attempt.
EECE7376 – Homework 3 2 / 5 Problem 1 (25 Points) In a memory segmentation operating system, consider a machine with a 12KB physical memory space running an OS that uses a 4KB virtual memory space for its processes, where a 1KB means 1024 bytes. The machine is executing two processes ( A and B ), where each process has 3 allocated segments with the following mappings: a) Show the state of a basic segment table containing the information represented in the diagram above. The table should include the following columns (write all numbers in decimal): Segment . Each of the above segments are representing by an index from 0 to 5 where 0 is for A ’s Code segment and 5 for B ’s Stack segment (i.e., indices are sorted by process (first A , then B ), and then by base virtual address (lower virtual address first)). Process . Process identifier ( A or B ). Virtual address . Base address in virtual address space. Size . The segment size in KB. Physical address . Base address in physical address space.
EECE7376 – Homework 3 3 / 5 b) Assume the following virtual memory access addresses in decimal: i. Process A, address 2148 ii. Process A, address 1324 iii. Process A, address 4095 iv. Process B, address 512 v. Process B, address 2048 vi. Process B, address 3272 Which of the above are valid virtual memory access addresses? and for those valid accesses, find the following: o The corresponding Segment Index (from the table you formed above). o The Offset within the segment in decimal. o The Physical address in decimal. Problem 2 (25 Points) Assume the following simple memory segmentation operating system: The OS supports two segments for a process: o Segment A that starts from the beginning of the address space and is positive growing for code and a heap, and o Segment B that starts from the end of the address space and is negative growing for a stack. The Virtual Address space size is 128 bytes. Physical memory size is 512 bytes. Segment register information: o Segment A base (grows positive) = 0 o Segment A limit = 20 o Segment B base (grows negative) = 511 o Segment B limit = 20 Which of the following are valid virtual memory access addresses? and for those valid accesses, what are the corresponding physical addresses? Explain your answers. a) 29 b) 123 c) 16 d) 90 e) 10 All numbers in this problem are decimal numbers.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help