Files
jsix/src/kernel/loader.s
Justin C. Miller 794c86f9b4 [kernel] Add thead kobject class
Add the thread kernel API object and move the scheduler to use threads
instead of processes for scheduling and task switching.
2020-07-12 16:07:20 -07:00

23 lines
526 B
ArmAsm

%include "push_all.inc"
extern load_process_image
global ramdisk_process_loader
ramdisk_process_loader:
; create_process already pushed a cpu_state onto the stack for us, this
; acts both as the cpu_state parameter to load_process_image, and the
; saved state for the following iretq
pop rdi ; the address of the program image
pop rsi ; the size of the program image
pop rdx ; the address of this thread's TCB
call load_process_image
push rax ; load_process_image returns the process entrypoint
swapgs
iretq