Skip to content

Conversation

@clemdiep
Copy link
Contributor

@clemdiep clemdiep commented Nov 5, 2025

Thread have beeing rework to support pthread implementation of MUSL.

The following change have been made:

  • Added clone syscall, used to create thread (and forking on AARCH64)
  • Added support for TLS, which userspace uses to save thread related information. Kernel only see a value which should be put/preserved in a coprocessor register (TPIDR_EL0 for ARM64)
  • Removed user stack allocation in the PCB, as it will be managed by the userspace, only main thread stack is allocated by the kernel
  • Changed execve behaviour to reset all register of the thread instead of recreating a new thread (this is actually what is done by Linux)
  • Rename exit syscall to exit_group and thread_exit to exit as they were actually the implementation in this way
  • Changed thread_create to be more unified between the differents cases. (Before, to fork, it was required to update some register post creation, now the thread creation handle it and every userspace thread (main and child) follow the same path post creation)

closes #215

@clemdiep clemdiep marked this pull request as ready for review November 5, 2025 09:00
@clemdiep clemdiep merged commit 37a2f1a into 144-support-musl Nov 11, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants