Commit graph

2718 commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen
3da0728fd5 Add network interface support to init(8). 2023-01-10 23:31:50 +01:00
Jonas 'Sortie' Termansen
08ddcc89b8 Add domain name system support to getaddrinfo(3). 2023-01-10 23:19:17 +01:00
Jonas 'Sortie' Termansen
580b71ae89 Add getifaddrs(3) and freeifaddrs(3). 2023-01-10 22:31:48 +01:00
Jonas 'Sortie' Termansen
f291054465 Add em(4) driver.
Co-authored-by: Meisaka Yukara <Meisaka.Yukara@gmail.com>
2023-01-09 23:58:19 +01:00
Jonas 'Sortie' Termansen
cbf0c1dc97 Fix endian swapping classes reading volatile values twice. 2023-01-09 23:44:40 +01:00
Jonas 'Sortie' Termansen
3997116656 Add if_nameindex(3). 2022-12-16 23:44:50 +01:00
Jonas 'Sortie' Termansen
2ef6804ead Add networking stack.
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>
2022-12-11 13:40:34 +01:00
Jonas 'Sortie' Termansen
3154492dcf Fix deadlocks and lost wakeups in threading primitives.
The futex and kutex implementations used the same linked list for waiting,
however the futex implementation used kutexs and the same thread could be in
the same list twice in the case of contention. This case corrupted the wait
lists and led to deadlocks and lost wakeups. This change fixes the problem
by having separate data structures for futexes and kutexes.

Mutexes contended by multiple threads could lead to lost wakeups since only
one contended thread was awoken and subsequent unlocks are unaware of the
unawakened contended threads. This change fixes the problem with a temporary
solution of waking all the contended threads until a better design is
implemented.

Additional details are tweaked to be more reliable and simpler.
2022-12-10 21:29:23 +01:00
Jonas 'Sortie' Termansen
006145d335 Add EHOSTDOWN. 2022-12-04 23:18:17 +01:00
Jonas 'Sortie' Termansen
c3a3ff86ec Add -p option to time(1). 2022-12-04 23:18:17 +01:00
Jonas 'Sortie' Termansen
cbf16b4891 Fix absolute timers triggering in the wrong order. 2022-12-03 22:43:33 +01:00
Jonas 'Sortie' Termansen
68a278ddb3 Fix pty write and read logic. 2022-12-03 22:36:34 +01:00
Jonas 'Sortie' Termansen
2ace33176c Add sh(1) prompt variable expansion. 2022-11-20 22:15:51 +01:00
Jonas 'Sortie' Termansen
159415c3b1 Implement profile(5) and shrc(5) in sh(1). 2022-11-19 18:01:30 +01:00
Jonas 'Sortie' Termansen
c6af3bc074 Add sh(1) history builtin. 2022-11-19 18:01:30 +01:00
Jonas 'Sortie' Termansen
3c69791078 Save sh(1) history in ~/.sh_history. 2022-11-19 18:01:30 +01:00
Jonas 'Sortie' Termansen
f4152b3863 Document sh(1). 2022-11-16 21:10:46 +01:00
Jonas 'Sortie' Termansen
6bab3819e2 Replace /etc/proper-shells with /etc/proper-sh defaulting to dash. 2022-11-16 21:10:46 +01:00
Juhani Krekelä
212539c9de Update to dash-0.5.11.5. 2022-11-16 20:29:22 +01:00
Juhani Krekelä
cc9c031e5e Update to libressl-3.6.1. 2022-11-16 20:23:51 +01:00
Jonas 'Sortie' Termansen
a8c05711aa Switch bga(4) to the new PCI API. 2022-11-16 20:22:29 +01:00
Jonas 'Sortie' Termansen
aefec2f7cd Don't warn on read-only /var/log filesystem. 2022-11-16 20:22:29 +01:00
Jonas 'Sortie' Termansen
07dd21146b Fix sh(1) changing foreground group when non-interactive. 2022-11-16 20:16:34 +01:00
Jonas 'Sortie' Termansen
0f348c192b Fix sethostname(2) nul termination. 2022-10-23 14:42:10 +02:00
Jonas 'Sortie' Termansen
b1b9fdc2d8 Fix READYFD example in daemon(7). 2022-10-21 22:51:25 +02:00
Jonas 'Sortie' Termansen
64e23ccb22 Fix init(5) example saying a non-virtual daemon is virtual. 2022-10-21 21:05:58 +02:00
Jonas 'Sortie' Termansen
71edc766e7 Add halt(8), poweroff(8), and reboot(8). 2022-10-20 23:28:48 +02:00
Jonas 'Sortie' Termansen
f2d50bbf9c Add daemon support to init(8).
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.
2022-10-20 23:26:03 +02:00
Jonas 'Sortie' Termansen
875030f3f3 Add session(5). 2022-09-18 23:21:04 +02:00
Jonas 'Sortie' Termansen
050ba71ca0 Fix utime(3) not handling times being NULL. 2022-09-18 23:21:04 +02:00
Jonas 'Sortie' Termansen
0e119b8480 Fix bad example for picking basic ports in release-iso-modification(7). 2022-09-18 23:21:04 +02:00
Juhani Krekelä
6f2fef4090 Update to nano-6.3. 2022-09-10 20:55:37 +02:00
Jonas 'Sortie' Termansen
55df3bbd7b Add default git origin remote. 2022-09-10 20:55:37 +02:00
Jonas 'Sortie' Termansen
cabfa4e4f7 Document /etc/default and /etc/examples. 2022-09-10 20:54:32 +02:00
Jonas 'Sortie' Termansen
add59b27da Fix extfs(8) read-only compat mode. 2022-09-10 20:54:32 +02:00
Jonas 'Sortie' Termansen
8789069f7e Fix invalid port LICENSE values. 2022-08-28 23:00:38 +02:00
Jonas 'Sortie' Termansen
14841fb43c Fix libevent requiring <net/if.h>. 2022-07-11 12:44:09 +02:00
Jonas 'Sortie' Termansen
154f5b5cce Add license information for libSDL, libjpeg, libtheora. 2022-07-11 00:25:00 +02:00
Jonas 'Sortie' Termansen
5aecdea33d Update to ffmpeg-5.0.1. 2022-07-11 00:25:00 +02:00
Juhani Krekelä
68a444c85e Update to cairo-1.16.0. 2022-07-11 00:25:00 +02:00
Juhani Krekelä
1e742f9206 Update to glib-2.56.4. 2022-07-11 00:25:00 +02:00
Jonas 'Sortie' Termansen
33032d624c Update to curl-7.84.0. 2022-07-11 00:25:00 +02:00
Jonas 'Sortie' Termansen
6b7d733ea3 Update to libxkbcommon-0.8.4. 2022-07-11 00:25:00 +02:00
Jonas 'Sortie' Termansen
bfa2dc437a Update to pixman-0.40.0. 2022-07-11 00:25:00 +02:00
Jonas 'Sortie' Termansen
6d9e1383ad Update to libvorbis-1.3.7. 2022-07-11 00:25:00 +02:00
Jonas 'Sortie' Termansen
9149b99951 Update to libogg-1.3.5. 2022-07-11 00:25:00 +02:00
Juhani Krekelä
969a4da5b6 Update to pcre-8.45. 2022-07-11 00:25:00 +02:00
Jonas 'Sortie' Termansen
5e8186a8b0 Update to fontconfig-2.14.0. 2022-07-11 00:25:00 +02:00
Juhani Krekelä
e4c8d42b7c Update to dbus-1.14.0. 2022-07-11 00:25:00 +02:00
Juhani Krekelä
37be665d4d Update to mpc-1.2.1. 2022-07-11 00:25:00 +02:00