This change adds all the kernel parts of a network stack. The network stack
is partial but implements many of the important parts.
Add if(4) network interface abstraction. Network interfaces are registered
in a global list that can be iterated and each assigned an unique integer
identifier.
Add reference counted packets with a cache that recycles recent packets.
Add support for lo(4) loopback and ether(4) ethernet network interfaces.
The /dev/lo0 loopback device is created automatically on boot.
Add arp(4) address resolution protocol driver for translation of inet(4)
network layer addresses into ether(4) link layer addresses. arp(4) entries
are cached and evicted from the cache when needed or when the entry has not
been used for a while. The cache is limited to 256 entries for now.
Add ip(4) internet protocol version 4 support. IP fragmentation and options
are not implemented yet.
Add tcp(4) transmission control protocol sockets for a reliable transport
layer protocol that provides a reliable byte stream connection between two
hosts. The implementation is incomplete and does not yet implement out of
band data, options, and high performance extensions.
Add udp(4) user datagram protocol sockets for a connectionless transport
layer that provides best-effort delivery of datagrams.
Add ping(4) sockets for a best-effort delivery of echo datagrams.
Change type of sa_family_t from unsigned short to uint16_t.
Add --disable-network-drivers to the kernel(7) options and expose it with a
bootloader menu. tix-iso-bootconfig can set this option by default.
Import CRC32 code from libz for the Ethernet checksum.
This is a compatible ABI change that adds features to socket(2) (AF_INET,
IPPROTO_TCP, IPPROTO_UDP, IPPROTO_PING), the ioctls for if(4), socket
options, and the lo0 loopback interface.
This commit is based on work by Meisaka Yukara contributed as the commit
bbf7f1e8a5238a2bd1fe8eb1d2cc5c9c2421e2c4. Almost no lines of this work
remains in this final commit as it has been rewritten or refactored away
over the years, see the individual file headers for which files contain
remnants of this work.
Co-authored-by: Meisaka Yukara <Meisaka.Yukara@gmail.com>
This change implements a dependency tracking daemon(7) system in init with
overridable init(5) configuration, parallel startup, readiness signaling,
rotating logs, reliable stopping, and handling of leaked processes.
The /etc/init/target file is replaced by the new /etc/init/default per the
new init(5) format. The old configuration is migrated upon upgrade using an
upgrade hook.
extfs(8) now signals readiness using READYFD for fast mounting.
Filesystems that fail to be repaired are now mounted read-only.
The mounting and filesystem checking code is synchronized with sysinstall.
The duplicated array_add utility function now protects against overflows.
tix-iso-bootconfig(8) gains the --init-target option.
tix-iso-liveconfig(8) gains the --daemons option.
This change imports the ports collection from the former porttix and srctix
repositories and converts them to port(5) files with metadata pointing to
the upstream release tarballs with patches checked into this repository.
Ports are now developed and versioned along with the operating system and
are automatically built per the PACKAGES environment variable. The patches
are licensed under the same license as the relevant ports.
Tix has gained support for the new port(5) format. tix-port(8) is the new
high level ports build even point that handles downloading pstream releases
into the new mirror cache directory, applying the patches, building the port
with the lower-level tix-build(8), and finally installing the binary
package. The new tix-vars(8) program parses port(5) files and the new
tix-rmdiff(8) program produces input for tix-rmpatch(8).
The old doc/ directory is discontinued in favor of manual pages documenting
the new ports system.
The obsolete porttix-create(8) and srctix-create(8) programs are removed.
Previously Sortix would initialize SSE unconditionally as part of the
boot process. Since earlier i686 CPUs like Pentium 2 did not include
SSE, Sortix would not run on them. With this SSE is only enabled for
CPUs that include it, which should theoretically allow Sortix to boot on
all i686 CPUs. Additionally, this removes -msse -msse2 compiler flags
from trianglix/Makefile.
This change refactors the Unix socket / pipe backend to have a ring buffer
containing segments, where each segment has an optional leading ancillary
buffer containing control messages followed by a normal data buffer.
The SCM_RIGHTS control message has been implemented which transfers file
descriptors to the receiving process. File descriptors are reference counted
and cycles are prevented using the following restrictions:
1) Unix sockets cannot be sent on themselves (on either end).
2) Unix sockets themselves being sent cannot be sent on.
3) Unix sockets cannot send a Unix socket being sent on.
This is a compatible ABI change.
The idle thread is now actually run when the system is idle because it
truly goes idle. The idle thread is made power efficient by using the hlt
instruction rather than a busy loop.
The new futex(2) system call is used to implement fast user-space mutexes,
condition variables, and semaphores. The same backend and design is used as
kutexes for truly sleeping kernel mutexes and condition variables.
The new exit_thread(2) flag EXIT_THREAD_FUTEX_WAKE wakes a futex.
Sleeping on clocks in the kernel now uses timers for true sleep.
The interrupt worker thread now truly sleeps when idle.
Kernel threads are now named.
This is a compatible ABI change.