# What is the difference between address space size and the "bound" when using base and bounds?

1

Tool used: relocation.py

From the homework of chapter 15 - Operating Systems three easy pieces (last page):

1. Run with these flags:-s 1 -n 10 -l 100. What is the maximum value that base can be set to, such that the address space still fits into physical memory in its entirety?

When running `./relocation.py -s 1 -n 10 -l 100` I get this output:

``````ARG seed 1
ARG phys mem size 16k

Base-and-Bounds register information:

Base   : 0x00000899 (decimal 2201)
Limit  : 100

VA  0: 0x00000363 (decimal:  867) --> PA or segmentation violation?
VA  1: 0x0000030e (decimal:  782) --> PA or segmentation violation?
VA  2: 0x00000105 (decimal:  261) --> PA or segmentation violation?
VA  3: 0x000001fb (decimal:  507) --> PA or segmentation violation?
VA  4: 0x000001cc (decimal:  460) --> PA or segmentation violation?
VA  5: 0x0000029b (decimal:  667) --> PA or segmentation violation?
VA  6: 0x00000327 (decimal:  807) --> PA or segmentation violation?
VA  7: 0x00000060 (decimal:   96) --> PA or segmentation violation?
VA  8: 0x0000001d (decimal:   29) --> PA or segmentation violation?
VA  9: 0x00000357 (decimal:  855) --> PA or segmentation violation?

For each virtual address, either write down the physical address it translates to
OR write down that it is an out-of-bounds address (a segmentation violation). For
this problem, you should assume a simple virtual address space of a given size.
``````

From the output, I can see `ARG address space size 1k` and `Limit : 100` which confuses me..

I can see that the physical memory is 16k, should the maximum base be 16k - 1k so that the process will have a maximum addressable address of 16k? But, in this case, I believe the maximum allowed address would be 16k - 1k + 100 since the limit is 100...

Is there a place in the address space that is not addressable? Meaning that I'm only allowed to address from `base` up to the address `base + bound`, no more no less, but the address space is actually from location `x` up to location `y` where `x <= base && y >= base + limit`?

operating-system
virtual-memory
asked on Stack Overflow Aug 6, 2020 by StackExchange123 • edited Aug 6, 2020 by StackExchange123