Commit Graph

2503 Commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen 365815401b Add openpty(3). 2016-11-23 22:31:05 +01:00
Jonas 'Sortie' Termansen b38c84852c Add pseudo terminals.
This is a compatible ABI change riding on the previous commit's bump.
2016-11-23 22:31:05 +01:00
Jonas 'Sortie' Termansen 6ef5a5cee3 Detect whether the terminal has a display and a keyboard layout.
A new ioctl TIOCGDISPLAYS allow detecting which displays the terminal
has associated. The ability to set a keyboard layout can be detected
with tcgetblob kblayout.

Improve the user-space multi-monitor support while here.

The kernel now sets TERM rather than init(8).

This is a compatible ABI change riding on the previous commit's bump.
2016-11-23 22:31:04 +01:00
Jonas 'Sortie' Termansen db7182ddc3 Add support for sessions.
This change refactors the process group implementation and adds support
for sessions. The setsid(2) and getsid(2) system calls were added.

psctl(2) now has PSCTL_TTYNAME, which lets you get the name of a process's
terminal, and ps(1) now uses it.

The initial terminal is now called /dev/tty1.

/dev/tty is now a factory for the current terminal.

A global lock now protects the process hierarchy which makes it safe to
access other processes. This refactor removes potential vulnerabilities
and increases system robustness.

A number of terminal ioctls have been added.

This is a compatible ABI change.
2016-11-23 22:30:47 +01:00
Jonas 'Sortie' Termansen d529a1e332 Add factory inode support. 2016-11-23 21:46:06 +01:00
Jonas 'Sortie' Termansen 1240a44298 Type escape colon to enter commands in editor(1). 2016-11-22 21:36:43 +01:00
Jonas 'Sortie' Termansen 3182471881 Switch pager(1) to termios. 2016-11-22 21:36:43 +01:00
Jonas 'Sortie' Termansen 8d7d364037 Switch sh(1) to termios.
sh(1) now restores reasonable terminal attributes. This is not really its
problem, but as long as common Sortix programs don't always restore the
terminal attributes on exit, this will work around the issue in practice.
2016-11-22 21:36:43 +01:00
Jonas 'Sortie' Termansen f6cde2d7a6 Add <limits.h>. 2016-11-22 21:36:43 +01:00
Jonas 'Sortie' Termansen 6841715274 Fix sh(1) prompt for non-root users. 2016-11-19 16:49:48 +01:00
Jonas 'Sortie' Termansen 1de75a6135 Fix sysinstall(8) and sysupgrade(8) requiring tcgetwincurpos. 2016-11-19 16:48:54 +01:00
Jonas 'Sortie' Termansen e1c64ec92d Fix login(8) not preserving terminal attributes. 2016-11-19 16:48:54 +01:00
Jonas 'Sortie' Termansen 4441e279d7 Fix login(8) reopen of /dev/tty as stdout. 2016-11-19 16:48:54 +01:00
Jonas 'Sortie' Termansen 3cfbdb29b5 Fix ls -Ra recursing on dot and dotdot. 2016-11-14 20:47:07 +01:00
Dennis Wölfing 1b3dcad03c Add German keyboard layout. 2016-11-14 20:35:54 +01:00
Nicholas De Nova a942b15f91 Add errc(3) family. 2016-11-06 15:31:52 -06:00
Philippe Michaud-Boudreault 4890297611 Optimize is_power_of_two. 2016-11-06 17:42:13 +01:00
Jonas 'Sortie' Termansen 5585303365 Add following-development(7). 2016-11-05 23:39:26 +01:00
Jonas 'Sortie' Termansen d720f16537 Add ONLCR and OCRNL.
This is a compatible ABI change.
2016-11-05 23:38:40 +01:00
Jonas 'Sortie' Termansen 9603be8e65 Split LogTerminal into a base class with the core terminal semantics.
No semantic change.
2016-11-05 17:00:43 +01:00
Jonas 'Sortie' Termansen d84715c6ef Fix SIGTTIN during tty reading not setting errno to EINTR. 2016-11-05 16:19:50 +01:00
Jonas 'Sortie' Termansen 51e13b9357 Fix terminal escape keystroke not sending escape byte. 2016-11-03 22:31:17 +01:00
Jonas 'Sortie' Termansen a77fb74fd9 Fix sh crash if show_state->current_line is NULL. 2016-11-03 22:10:45 +01:00
Jonas 'Sortie' Termansen e808ddb62e Fix ps and pstree extra operand not using errx. 2016-11-03 22:10:45 +01:00
Jonas 'Sortie' Termansen eacfc72f2f Fix concurrent serial port read and write. 2016-11-03 22:10:45 +01:00
Jonas 'Sortie' Termansen 77defc5e24 Add suggestion to use nano(1) if installed. 2016-11-03 22:02:53 +01:00
Jonas 'Sortie' Termansen 8951adc5f0 Add VMIN support. 2016-11-03 08:36:46 +01:00
Jonas 'Sortie' Termansen c3652da29f Add December 31 2016 leap second. 2016-10-30 21:20:00 +01:00
Jonas 'Sortie' Termansen df0a99a2d2 Add suggestion to use ed(1) if installed. 2016-10-30 19:56:34 +01:00
Jonas 'Sortie' Termansen d4bec88bf6 Add REG_STARTEND. 2016-10-30 18:08:59 +01:00
Pedro Falcato 205a3e7156
Remove not_rsp and not_esp. 2016-10-30 12:03:47 +00:00
Jonas 'Sortie' Termansen 2d91c7d385 Fix exit_thread(2) multi-threaded process destruction. 2016-10-17 18:38:04 +02:00
Jonas 'Sortie' Termansen b3f31b1adb Fix double declaration of __heap_mutex. 2016-10-17 18:38:04 +02:00
Nicholas De Nova 057609ee6c Add logname(1). 2016-10-16 11:27:35 -05:00
Daniel Roskams 207f554b11 Document chroot(8). 2016-10-12 21:51:25 +08:00
Daniel Roskams 27677f2f9a Document unmount(1). 2016-10-11 20:12:48 +08:00
Jonas 'Sortie' Termansen b5240163b6 Fix newlines in passwd(1) unrecognized option errors. 2016-10-09 23:06:42 +02:00
Jonas 'Sortie' Termansen 50669b1556 Fix mkinitrd(8) documentation typos. 2016-10-09 19:18:23 +02:00
Jonas 'Sortie' Termansen 0b39852469 Fix path in update-initrd(8) documentation. 2016-10-09 18:58:37 +02:00
Jonas 'Sortie' Termansen 169e10ab4b Move chroot(8) and unmount(8) to sbin. 2016-10-09 18:56:52 +02:00
Daniel Roskams 2864faaa6c Document memstat(1). 2016-10-08 10:26:15 +08:00
Daniel Roskams 606385b663 Document pager(1). 2016-10-05 23:01:23 +08:00
Jonas 'Sortie' Termansen ac37d66a93 Add sysinstall(8) tip for selecting devices in disked(8). 2016-10-04 00:34:50 +02:00
Jonas 'Sortie' Termansen a90d4dbf23 Allow canceling sysinstall(8) and sysupgrade(8) gracefully. 2016-10-04 00:34:50 +02:00
Jonas 'Sortie' Termansen 252c78f010 Add partition support to sysupgrade(8). 2016-10-04 00:34:50 +02:00
Jonas 'Sortie' Termansen b70ffb70af Add /boot partition support to sysinstall(8). 2016-10-04 00:34:50 +02:00
Jonas 'Sortie' Termansen 3f86ec6544 Default to installing GRUB if an existing installation uses GRUB. 2016-10-04 00:34:50 +02:00
Jonas 'Sortie' Termansen 84c0844f56 Seed kernel entropy with randomness from the previous boot.
The bootloader will now load the /boot/random.seed file if it exists, in
which case the kernel will use it as the initial kernel entropy. The kernel
warns if no random seed was loaded, unless the --no-random-seed option was
given. This option is used for live environments that inherently have no
prior secret state. The kernel initializes its entropy pool from the random
seed as of the first things, so randomness is available very early on.

init(8) will emit a fresh /boot/random.seed file on boot to avoid the same
entropy being used twice. init(8) also writes out /boot/random.seed on
system shutdown where the system has the most entropy. init(8) will warn if
writing the file fails, except if /boot is a real-only filesystem, and
keeping such state is impossible. The system administrator is then
responsible for ensuring the bootloader somehow passes a fresh random seed
on the next boot.

/boot/random.seed must be owned by the root user and root group and must
have file permissions 600 to avoid unprivileged users can read it. The file
is passed to the kernel by the bootloader as a multiboot module with the
command line --random-seed.

If no random seed is loaded, the kernel attempts a poor quality fallback
where it seeds the kernel arc4random(3) continuously with the current time.
The timing variance may provide some effective entropy. There is no real
kernel entropy gathering yet. The read of the CMOS real time clock is moved
to an early point in the kernel boot, so the current time is available as
fallback entropy.

The kernel access of the random seed module is supposed to be infallible
and happens before the kernel log is set up, but there is not yet a failsafe
API for mapping single pages in the early kernel.

sysupgrade(8) creates /boot/random.seed if it's absent as a temporary
compatibility measure for people upgrading from the 1.0 release. The GRUB
port will need to be upgraded with support for /boot/random.seed in the
10_sortix script. Installation with manual bootloader configuration will
need to load the random seed with the --random-seed command line. With GRUB,
this can be done with: module /boot/random.seed --random-seed
2016-10-04 00:34:50 +02:00
Jonas 'Sortie' Termansen 4ab5765a95 Refactor sysmerge(8) and sysupgrade(8) compatibility hooks. 2016-10-04 00:34:50 +02:00
Jonas 'Sortie' Termansen 4d40dd35dd Run the existing sysmerge(8) in the make sysmerge targets.
The ABI may have changed and the current system might not be able to run the
new program.
2016-10-04 00:34:49 +02:00