diff --git a/vm-paging/paging-linear-translate.py b/vm-paging/paging-linear-translate.py index f81201f8..ffe215f3 100755 --- a/vm-paging/paging-linear-translate.py +++ b/vm-paging/paging-linear-translate.py @@ -87,13 +87,13 @@ def convert(size): mustbemultipleof(psize, pagesize, 'physical memory must be a multiple of the pagesize') # print some useful info, like the darn page table -pages = psize / pagesize; +pages = psize // pagesize import array used = array.array('i') pt = array.array('i') for i in range(0,pages): used.insert(i,0) -vpages = asize / pagesize +vpages = asize // pagesize # now, assign some pages of the VA vabits = int(math.log(float(asize))/math.log(2.0)) diff --git a/vm-smalltables/paging-multilevel-translate.py b/vm-smalltables/paging-multilevel-translate.py index 22fa9f9f..b9360b34 100755 --- a/vm-smalltables/paging-multilevel-translate.py +++ b/vm-smalltables/paging-multilevel-translate.py @@ -43,7 +43,7 @@ def __init__(self): # os tracks self.usedPages = [] self.usedPagesCount = 0 - self.maxPageCount = self.physMem / self.pageSize + self.maxPageCount = self.physMem // self.pageSize # no pages used (yet) for i in range(0, self.maxPageCount): @@ -186,7 +186,7 @@ def dumpPage(self, whichPage): print('') def memoryDump(self): - for i in range(0, self.physMem / self.pageSize): + for i in range(0, self.maxPageCount): print('page %3d:' % i, end='') for j in range(0, self.pageSize): print('%02x' % self.memory[(i * self.pageSize) + j], end='')