Publish a user task only after loading succeeds

This figure documents the historical i386 source baseline. Current native x86-64/AArch64 qualification is recorded separately; this is not an ELF64 or native SMP implementation diagram.

Publish a user task only after loading succeeds Resolve and validate static ELF32 bytes, create a blocked user task, then allocate private PT_LOAD pages, copy file contents and zero the remaining segment memory. Set up argc/argv and validated launch I/O before making the task ready. The user trampoline enters ring 3; failed loading rolls back owned pages and the partial task. resolve->validate validate->child child->map map->args map->cleanup invalid range / allocation fails args->stdio stdio->ready stdio->cleanup assignment fails ready->enter resolve Resolve registered / installed ELF read static ELF32 bytes validate Validate ELF header + segment bounds child Create user task as BLOCKED private directory + stack pages map For each PT_LOAD: allocate user frames → copy file bytes zero remaining memory args Build argc / argv on user stack stdio Validate / assign launch I/O handles ready Publish task READY enter Scheduler → user trampoline IRET to entry point in ring 3 cleanup Load failure: roll back pages finish partial task
Publish a user task only after loading succeeds Resolve and validate static ELF32 bytes, create a blocked user task, then allocate private PT_LOAD pages, copy file contents and zero the remaining segment memory. Set up argc/argv and validated launch I/O before making the task ready. The user trampoline enters ring 3; failed loading rolls back owned pages and the partial task. resolve->validate validate->child child->map map->args map->cleanup invalid range / allocation fails args->stdio stdio->ready stdio->cleanup assignment fails ready->enter resolve Resolve registered / installed ELF read static ELF32 bytes validate Validate ELF header + segment bounds child Create user task as BLOCKED private directory + stack pages map For each PT_LOAD: allocate user frames → copy file bytes zero remaining memory args Build argc / argv on user stack stdio Validate / assign launch I/O handles ready Publish task READY enter Scheduler → user trampoline IRET to entry point in ring 3 cleanup Load failure: roll back pages finish partial task

A new user task starts blocked while its private image, arguments and I/O are prepared.

Text equivalent and source references
  • Resolve and validate static ELF32 bytes, create a blocked user task, then allocate private PT_LOAD pages, copy file contents and zero the remaining segment memory.
  • Set up argc/argv and validated launch I/O before making the task ready. The user trampoline enters ring 3; failed loading rolls back owned pages and the partial task.

Launch / failure flow. Source paths refer to the atlas baseline; the kernel checkout is private.

  • kernel/core/elf.c · elf_load_args_io, elf_setup_args
  • kernel/core/task.c · task_create_user, task_entry_trampoline_user, task_rollback_user_pages