Add support for processes setting up an address space to spawn new processes
This commit is contained in:
parent
000ac6ad65
commit
4b67fd4695
12
syscalls.68k
12
syscalls.68k
@ -62,6 +62,17 @@ syscall_vmem_set_flags:
|
||||
move.l #0, d2
|
||||
jmp vmem_set_flags
|
||||
|
||||
; Copies the range of page mappings at address a0 in the primary space with length d1 to the secondary space starting at address a1
|
||||
syscall_vmem_copy_to_secondary:
|
||||
movem.l a0/a1/d1, -(a7)
|
||||
jsr tasking_get_secondary_addr_space
|
||||
jsr vmem_set_secondary_addr_space
|
||||
movem.l (a7)+, a0/a1/d1
|
||||
move.l d1, d0
|
||||
jsr vmem_copy_to_secondary
|
||||
rts
|
||||
|
||||
|
||||
section .data,data
|
||||
syscall_table:
|
||||
align 1
|
||||
@ -73,3 +84,4 @@ syscall_table:
|
||||
dc.l syscall_vmem_map_free
|
||||
dc.l syscall_vmem_map_free_to
|
||||
dc.l syscall_vmem_set_flags
|
||||
dc.l syscall_vmem_copy_to_secondary
|
||||
|
@ -4,6 +4,7 @@ task.stack_frame: so.l 1
|
||||
task.stack_ptr: so.l 1
|
||||
task.next_ptr: so.l 1
|
||||
task.address_space: so.l 4
|
||||
task.secondary_address_space: so.l 4
|
||||
task.sizeof equ __SO
|
||||
|
||||
include term.i
|
||||
@ -176,6 +177,13 @@ tasking_exit:
|
||||
movem.l (a7)+, d2-d7/a2-a6
|
||||
rts
|
||||
|
||||
; Gets the secondary address space of the current process in a0
|
||||
public tasking_get_secondary_addr_space
|
||||
tasking_get_secondary_addr_space:
|
||||
move.l current_process, a0
|
||||
lea.l (task.secondary_address_space,a0), a0
|
||||
rts
|
||||
|
||||
; Push the process pointed to by a0 onto the head of the ready to run list
|
||||
rtr_push_head:
|
||||
cmp.l #0, ready_to_run_head
|
||||
|
Loading…
Reference in New Issue
Block a user