Skip to content

Add ICMP socket syscall support for toybox ping#50

Merged
pradosh-arduino merged 1 commit into
mainfrom
codex/implement-https-support-for-wget-and-ping
Jul 5, 2026
Merged

Add ICMP socket syscall support for toybox ping#50
pradosh-arduino merged 1 commit into
mainfrom
codex/implement-https-support-for-wget-and-ping

Conversation

@pradosh-arduino

Copy link
Copy Markdown
Collaborator

Motivation

  • Expose a minimal Linux-like socket API so userland toybox utilities (notably ping) can send/receive ICMP using the kernel networking stack.
  • Provide a small kernel-backed FD mechanism for virtual objects (sockets) so they occupy normal file descriptor slots.
  • Surface clearer messaging from wget when HTTPS/TLS is not available while leaving TLS implementation for a later change.

Description

  • Added fd_create_virtual to the stream layer to allocate virtual file-descriptor slots for kernel-backed objects. (source/kernel/C/stream.c, source/includes/stream.h).
  • Declared syscall numbers and errno values for sendto, recvfrom, and setsockopt, and added protocol/errno constants required for the minimal socket implementation. (source/includes/syscalls.h).
  • Implemented a lightweight AF_INET/SOCK_RAW/IPPROTO_ICMP path in the syscall layer: sys_socket, sys_sendto, sys_recvfrom, sys_setsockopt, and cleanup on close; added a small in-kernel socket table and sockaddr struct to map virtual FDs to the ICMP ping implementation. The new syscalls are wired into the syscall dispatcher and syscall name table. (source/kernel/C/syscalls.c).
  • Updated wget usage/help and error messaging to clearly indicate that HTTPS/TLS requires TLS support which is not linked/implemented yet. (source/kernel/C/shell/commands/wget.c).

Testing

  • Ran git diff --check, which reported no whitespace/format issues and completed successfully.
  • Ran make -C source which compiled source files and reached the final link step; compilation of translation units succeeded but the final link failed because the environment lacked generated/version symbols (versions / date) required by the build system.
  • Ran top-level make which failed during ISO staging because required prebuilt/staged artifacts (kernel ELF and Limine files) are not present in this environment; these failures are environmental and not caused by the introduced code.

Codex Task

@pradosh-arduino pradosh-arduino merged commit 2f29589 into main Jul 5, 2026
2 checks passed
@pradosh-arduino pradosh-arduino deleted the codex/implement-https-support-for-wget-and-ping branch July 5, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant