Now, let’s see if we understand this tiny address space we’ve constructed (using the parameters from the question above). What is
the highest legal virtual address in segment 0? What about the lowest legal virtual address in segment 1? What are the lowest and
highest illegal addresses in this entire address space? Finally, how
would you run segmentation.py with the -A flag to test if you
are right?
very unsure, of this of operation systm
What I have tried:
I am self learinng runing that question online very unsure
What is
the highest legal virtual address in segment 0?
(decimal 4692)
What about the lowest legal virtual address in segment 1?
4,442
What are the lowest and
highest illegal addresses in this entire address space?
4693
Finally, how
would you run segmentation.py with the -A flag to test if you
are right?
I am unsure.
to understand the offset for the negative growing address 1k base it 1024 (grows negative) : 0x00001254 (decimal 4692)
~/ostep-homework/vm-segmentation/ (master) $ ./segmentation.py -c
ARG seed 0
ARG address space size 1k
ARG phys mem size 16k
Segment register information:
Segment 0 base (grows positive) : 0x00001aea (decimal 6890)
Segment 0 limit : 472
Segment 1 base (grows negative) : 0x00001254 (decimal 4692)
Segment 1 limit : 450
Virtual Address Trace
VA 0: 0x0000020b (decimal: 523) --> SEGMENTATION VIOLATION (SEG1)
VA 1: 0x0000019e (decimal: 414) --> VALID in SEG0: 0x00001c88 (decimal: 7304)
VA 2: 0x00000322 (decimal: 802) --> VALID in SEG1: 0x00001176 (decimal: 4470)
VA 3: 0x00000136 (decimal: 310) --> VALID in SEG0: 0x00001c20 (decimal: 7200)
VA 4: 0x000001e8 (decimal: 488) --> SEGMENTATION VIOLATION (SEG0)
bash: segmentation.py: command not found
~/ostep-homework/vm-segmentation/ (master) $ ./segmentation.py -A 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
ARG seed 0
ARG address space size 1k
ARG phys mem size 16k
Segment register information:
Segment 0 base (grows positive) : 0x00001aea (decimal 6890)
Segment 0 limit : 472
Segment 1 base (grows negative) : 0x00001254 (decimal 4692)
Segment 1 limit : 450
Virtual Address Trace
VA 0: 0x00000000 (decimal: 0) --> PA or segmentation violation?
Traceback (most recent call last):
File "./segmentation.py", line 143, in <module>
vaddr = int(vstr)
ValueError: invalid literal for int() with base 10: '