mrmp/architecture.py

28 lines
493 B
Python
Raw Normal View History

2021-10-10 13:22:02 +00:00
import os
import distribution
2021-10-10 13:44:03 +00:00
X86 = 'x86_64'
I86 = 'i686'
2021-10-10 13:22:02 +00:00
class Architecture:
2021-10-10 13:44:03 +00:00
def __init__(self, name, bits):
2021-10-10 13:22:02 +00:00
self.name = name
2021-10-10 13:44:03 +00:00
self.bits = bits
2021-10-10 13:22:02 +00:00
self.distribution = distribution.Distribution(self)
# TODO subsystems
self.subsystems = {}
def __str__(self):
lines = [
f'Name: {self.name}',
]
return os.linesep.join(lines)
2021-10-10 13:46:37 +00:00
2021-10-10 13:44:03 +00:00
ARCHITECTURES = {
X86: Architecture(X86, 64),
I86: Architecture(I86, 32),
}