def WS(self, XY): ''' Value of XY in shared memory is sent to ax ''' user_memory.write( self.get_ax(), to_hex(configs.SH_MEMEORY_STARTING_BLOCK * configs.BLOCK_SIZE + to_int(str(XY)[0]) * configs.BLOCK_SIZE + to_int(str(XY)[1])))
def __init__(self, opts = {}): opts['name'] = 'vm_' + str(kernel_data.PID) opts['priority'] = configs.LOADER_PRIORITY Process.__init__(self, opts) self.cs_length = opts['cs_length'] self.ds_length = opts['ds_length'] self.addresses = opts['addresses'] # state self.ic = None self.num = self.ds_length + 1 # skip DATA SEGMENT # prepare DS for i in range(1, self.ds_length): data = user_memory.fetch(self.addresses[i]) if data[0:2] != "DW": processor.pi = 2 kernel.create_resource(InterruptEvent, self, {'process' : self }) else: user_memory.write(to_hex(to_int(data[2:4])), self.addresses[i])
def __init__(self, opts={}): opts['name'] = 'vm_' + str(kernel_data.PID) opts['priority'] = configs.LOADER_PRIORITY Process.__init__(self, opts) self.cs_length = opts['cs_length'] self.ds_length = opts['ds_length'] self.addresses = opts['addresses'] # state self.ic = None self.num = self.ds_length + 1 # skip DATA SEGMENT # prepare DS for i in range(1, self.ds_length): data = user_memory.fetch(self.addresses[i]) if data[0:2] != "DW": processor.pi = 2 kernel.create_resource(InterruptEvent, self, {'process': self}) else: user_memory.write(to_hex(to_int(data[2:4])), self.addresses[i])
def WS(self, XY): ''' Value of XY in shared memory is sent to ax ''' user_memory.write(self.get_ax(), to_hex(configs.SH_MEMEORY_STARTING_BLOCK * configs.BLOCK_SIZE + to_int(str(XY)[0]) * configs.BLOCK_SIZE + to_int(str(XY)[1])))
def write_to_ds(self, word, XY): ''' Write given word to address ''' user_memory.write(word, self.get_real_address_of_ds(XY))