Commit Graph

2601 Commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen 864a0c9d41 Flush stdout after tix-install verbose message. 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen f2cb4b18e9 fixup! Add daemon support to init(8). 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen cb74742139 fixup! Add daemon support to init(8). 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen dbe049d4b8 fixup! Add ntpd(8) support. 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen 5c90e6589f fixup! Add daemon support to init(8). 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen 613cddd0ae Trianglix 4. 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen e6d802d3dc Add tix-check(8). 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen 96b98dde59 Add automatic installer and upgrader. 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen 47dffdb913 Volatile release. 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen aceb5a42a8 Add tix-upgrade(8). 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen c9cf4b01ba Add display server. 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen 8e3f47ba0b Add pty(1). 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen be0aedeb04 Debug system calls exiting without interrupts enabled. 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen fed2a2c4d0 Networking debug code. 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen 67589d8097 Add ntpd(8) support.
TODO: /etc/ntpd.conf -> /etc/default/ntpd.conf
2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen b6d3ff36f8 Add httpd(8) support. 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen 9ec9ebcd44 Add sshd(8) support.
TODO: Pasting more than 1025 bytes into a Sortix ssh session disconnects it.
TODO: ssh to localhost from tty is corrupted
TODO: /etc/ssh*_config should be in /etc/default/
2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen e32edbc4ec Add libcurl, libssl, and wget to the basic ports set. 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen a9ada6a7ea Add irc(1). 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen 877e777114 Add nc(1). 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen e51e21c180 Add getaddrinfo(1). 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen 06fb1c0bfe Add host(1). 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen 03777cb02e Add ping(8). 2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen c21d49c2d9 Add ifconfig(8).
Co-authored-by: Juhani Krekelä <juhani@krekelä.fi>
2022-02-08 18:48:35 +01:00
Jonas 'Sortie' Termansen 946b10df27 Add dhclient(8). 2022-02-08 18:48:34 +01:00
Jonas 'Sortie' Termansen c35a856091 Add domain name system support to getaddrinfo(3). 2022-02-08 18:48:34 +01:00
Jonas 'Sortie' Termansen fb6ab7fb1d Add getifaddrs(3) and freeifaddrs(3). 2022-02-08 18:48:34 +01:00
Jonas 'Sortie' Termansen 62df107e60 Add if_nameindex(3). 2022-02-08 18:48:34 +01:00
Jonas 'Sortie' Termansen 4d7831da89 Add em(4) driver.
This commit is joint work by Meisaka Yukara <Meisaka.Yukara@gmail.com> and
Jonas 'Sortie' Termansen <sortie@maxsi.org>.
2022-02-08 18:48:34 +01:00
Jonas 'Sortie' Termansen e9cac68ef3 fixup! Add bootloader setting for not loading the src initrd. 2022-02-08 18:48:34 +01:00
Jonas 'Sortie' Termansen 8d88bcdbf8 Add networking stack.
This commit is based on work by Meisaka Yukara <Meisaka.Yukara@gmail.com>
contributed as the commit bbf7f1e8a5238a2bd1fe8eb1d2cc5c9c2421e2c4. See the
individual file headers for which files contain remnants of this work.

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 echo of 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.
2022-02-08 18:48:34 +01:00
Jonas 'Sortie' Termansen 87db1f52a4 Add halt(8), poweroff(8), and reboot(8). 2022-02-08 18:48:34 +01:00
Jonas 'Sortie' Termansen d708a9d32b Add daemon support to init(8). 2022-02-08 18:48:34 +01:00
Jonas 'Sortie' Termansen 9b80a3dfca Enable stack smash protection by default. 2022-02-08 18:48:34 +01:00
Jonas 'Sortie' Termansen 3d1585bcdd Enable undefined behavior sanitization by default. 2022-02-08 18:48:34 +01:00
Jonas 'Sortie' Termansen 2628bc6ae1 Release HTML manual pages. 2022-02-08 18:48:34 +01:00
auronandace f8d4d3d635 Replace perror(3) with err(3). 2022-02-05 18:20:08 +00:00
Jonas 'Sortie' Termansen 23832546d5 Fix chown(2) not supporting -1 to not set the owner and group. 2022-01-15 20:48:54 +01:00
Jonas 'Sortie' Termansen 432e5ddeaf Add bootloader setting for not loading the src initrd. 2022-01-12 21:34:26 +01:00
Jonas 'Sortie' Termansen 31e3a20bca Fix wrong minor ABI version in sysmerge(8) ABI transition notice. 2022-01-12 21:19:53 +01:00
Jonas 'Sortie' Termansen 4e86394e3d Fix the kernel having an .init section linked at a high address.
The .init section for global constructors in the kernel is unused at the
moment as the _init function is never invoked, but its existence means
it got linked at 128 MiB on i686. This address isn't mapped by the
kernel and the bootloader requires the machine to have that much
physical memory. Unfortunately that meant the i686 build didn't work on
machines with less than 129 MiB of memory.
2022-01-12 21:19:53 +01:00
Juhani Krekelä ffc3751713 Fix typos in hier(7), installation(7), and upgrade(7). 2022-01-10 15:20:30 +02:00
Juhani Krekelä 4e72c78dc1 Support i686 without SSE.
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.
2022-01-09 23:38:16 +02:00
Jonas 'Sortie' Termansen ac9c24219b Implement RFC5424 syslog version 1. 2022-01-05 22:00:53 +01:00
Jonas 'Sortie' Termansen 3c43f71084 Implement file descriptor passing.
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.
2021-12-31 22:24:11 +01:00
Jonas 'Sortie' Termansen b9898086c6 Add file descriptor table reservations.
The file descriptor table now allows reserving room for multiple file
descriptors without assigning their numbers. This functionality means
any error conditions happen up front and the subsequent number
assignment will never fail.

This change uses the new functionality to fix troublesome error handling
when allocating multiple file descriptors. One pty allocation error path
was even wrong.

There were subtle race conditions where one (kernel) thread may have
allocated one file descriptor, and another thread spuciously replaces it
with something else, and then the second file descriptor allocation
failed in the first thread, and it closes the first file descriptor now
pointing to a different file description. This case seems harmless but
it's not a great class of bugs to exist in the first place. The new
behavior means the file descriptions appear in the file descriptor table
without fail and never needs to be cleaned up midway and is certainly
immune to shenangians from other threads.

Reviewed-by: Pedro Falcato <pedro.falcato@gmail.com>
2021-12-31 22:24:07 +01:00
Juhani Krekelä 42f6a359d1 Add search to editor(1). 2021-12-13 09:52:21 +02:00
Jonas 'Sortie' Termansen 20648e03d7 Send SIGCHLD to init even for reparented processes. 2021-12-12 22:13:05 +01:00
Jonas 'Sortie' Termansen db4ab331c7 Fix <psctl.h> using the same include guard as <sys/ioctl.h>. 2021-12-12 22:13:05 +01:00
Jonas 'Sortie' Termansen e65ff1827c Add __stack_chk_fail_local needed by some architectures. 2021-12-12 22:13:05 +01:00