Пример #1
0
 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])))
Пример #2
0
    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])
Пример #3
0
    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])
Пример #4
0
 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]))) 
Пример #5
0
 def write_to_ds(self, word, XY):
     ''' Write given word to address ''' 
     user_memory.write(word, self.get_real_address_of_ds(XY))
Пример #6
0
 def write_to_ds(self, word, XY):
     ''' Write given word to address '''
     user_memory.write(word, self.get_real_address_of_ds(XY))