Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'float' object cannot be interpreted as an integer #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions vm-paging/paging-linear-translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions vm-smalltables/paging-multilevel-translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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='')
Expand Down