Hello I Need To Write A Program La2pa In C That Translates A Logical Address To


I need to Write a program la2pa in C that translates a logical address to a physical address. The page table should be read from a file. The program takes two inputs, a page table file and a logical address, and produces one output, a physical address

I will provide you a page table file with the following format






4 0

where the first line gives the page size, the rest of the file give a mapping between the logical page and the physical page. ‘-1’ means the page is not mapped.

Your program must handle abnormal inputs

If the input is an invalid logical address, your program must print “invalid logical address”

If the input is an unmapped logical address, your program must print “page fault”

Both the input and the output of the program should be in hexadecimal format.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply