def setup_ram_allocator(self): mem = self.machine.get_mem() mem_begin = 0x1000 mem_size = self.ram_total - mem_begin log_mem_map.info("setup ram allocator: @%06x +%06x", mem_begin, mem_size) self.alloc = MemoryAlloc(mem, mem_begin, mem_size, self.label_mgr)
def setup_old_dos_guard(self): # create a guard memory for tracking invalid old dos access raw_mem = self.machine.get_mem() self.dos_guard_base = raw_mem.reserve_special_range() if self.label_mgr: label = LabelRange("old_dos guard", self.dos_guard_base, 0x10000) self.label_mgr.add_label(label) log_mem_map.info(label)
def validate(self): # too much ram for 24 bit machine if self.addr_24_bit and self.ram_total >= 0x1000000: log_mem_map.error( "Too much RAM allocated for 24 Bit addr bus of machine!") return False # too much ram if hw access is enabled if self.hw_access and self.ram_total >= 0xbf0000: log_mem_map.error("Too much RAM allocated with hw access enabled!") return False # ok! log_mem_map.info("dos guard base: @%08x", self.dos_guard_base) return True
def validate(self): # too much ram for 24 bit machine if self.addr_24_bit and self.ram_total >= 0x1000000: log_mem_map.error( "Too much RAM allocated for 24 Bit addr bus of machine!") return False # too much ram if hw access is enabled if self.hw_access and self.ram_total >= 0xBF0000: log_mem_map.error("Too much RAM allocated with hw access enabled!") return False # ok! log_mem_map.info("dos guard base: @%08x", self.dos_guard_base) return True
def setup_hw_access(self, mode_str): self.hw_access = HWAccess.from_mode_str(self.machine, mode_str) log_mem_map.info("setup hw access: %s", mode_str)