Skip to content

Commit

Permalink
fixed SystemTagList
Browse files Browse the repository at this point in the history
  • Loading branch information
cnvogelg committed Sep 29, 2024
1 parent e8cc4d9 commit 1751f5c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions amitools/vamos/dos/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,33 @@
from amitools.vamos.machine.regs import *


def run_sub_process(runner, proc):
def run_sub_process(scheduler, runner, proc):
log_proc.info("start sub process: %s", proc)

# actually we need to add a new task and do multitasking
# for now we simply run it as a sub run in our task
task = proc.get_task()

# hack cur task
cur_task = scheduler.cur_task
scheduler.cur_task_hook(task)

# return value
get_regs = [REG_D0]
run_state = runner(task.get_init_pc(), task.get_init_sp(), get_regs=get_regs)
run_state = runner(
task.get_init_pc(),
task.get_init_sp(),
set_regs=task.get_start_regs(),
get_regs=task.get_return_regs(),
)
ret_code = run_state.regs[REG_D0]
log_proc.info("return from sub process: ret_code=%d", ret_code)

# cleanup proc
proc.free()

# restore cur task
scheduler.cur_task_hook(cur_task)

return ret_code


Expand Down
2 changes: 1 addition & 1 deletion amitools/vamos/lib/DosLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,7 @@ def SystemTagList(self, ctx):
arg_str,
)
return self.DOSTRUE
return run_sub_process(ctx.runner, proc)
return run_sub_process(ctx.scheduler, ctx.runner, proc)

def LoadSeg(self, ctx):
name_ptr = ctx.cpu.r_reg(REG_D1)
Expand Down

0 comments on commit 1751f5c

Please sign in to comment.