Commit graph

9203 commits

Author SHA1 Message Date
Ori Bernstein 4eeefed7b0 cwfs: fix iounit negotiation
cwfs had an issue with iounit negotiation as a result
of the conversion to 9p2000 -- with the move to variable
size messages, the fixed message overhead decreased, but
the advertised message size was still adding the old
fixed overhead.

This meant that if the kernel negotiated the maximum io
size, cwfs would negotiate something larger than it
supported, and would hang up when an io of that size
was made.

In addition, the size of messages was stored in a short,
which means that negotiating an iounit larger than 16384
bytes would overflow the message count, and cause things
to fall over.

Finally, whle we're here, we clean up some duplicated
and unused constants.
2022-06-07 22:38:04 +00:00
Jacob Moody 13065e16b3 auth/box: don't bother switching to none
Changing the user to none doesn't do much for us
here. For kernel drivers that check the user of the
current proc we'll be none, but anything from devmnt
will still be accessed using creds from the original
attachment. Instead, running with none can be done
by chaining with auth/none:

auth/none auth/box ...
2022-06-10 04:10:54 +00:00
Jacob Moody 1b5ea51ee1 auth/box: bind in the binary by default
This prevents stuttering on the command line by
not having to give a -r flag for the binary itself.
2022-06-08 02:44:35 +00:00
Jacob Moody 056ad652a4 auth/box: build restricted namespaces using components from the parent. 2022-06-07 05:38:08 +00:00
Jacob Moody f4840cdba5 kernel: add devskel for pc and pc64 2022-06-07 05:25:44 +00:00
Jacob Moody df92301d8f ip/ipconfig: refactor plan9 vendor parsing
Unless ip/dhcpd is started with the -6 option,
we only receive v4 addresses. If we do see the
v6 options we should prefer them but should
also make sure we grab the v4 addresses as a fallback.

None of the v6 options should overwrite valid
overrides given at the command line.

Add our custom types to logging.
2022-06-05 20:56:57 +00:00
Jacob Moody 207d124dfe ip/dhcpd: properly skip past ipv6 addresses in addrsopt
If the first address passed happened to be an ipv6
address we would send a malformed option by never including
a ipv4 address.
2022-06-05 18:02:58 +00:00
Jacob Moody d8d433894a kernel: cleanup unused fields from devpipe
We don't need to multiply session path by 2, the definition
for NETQID is:

Meaning we don't need to save room between session paths
for individual Qid paths. This doubles the amount of
pipe sessions we can have before a wrap.
2022-06-05 12:29:50 +00:00
Ori Bernstein 926be5e34e git/import: use patch(1)
we have a new, pretty patch(1), lets use it.
2022-06-04 23:35:49 +00:00
Ori Bernstein 5d37407e3c diff: avoid empty hunks when there are no changes
Currently, diff outputs a file header, even if there are
no changes to the file. This is wonky.

It means that the header chunks are ambiguous, since
not all header chunks are followed by '@@ hunk', and
'--- file', '+++ file' lines can be generated from
file content.

This changes the way that we decide to print the file
header, so we only print it when outputting the first
hunk on flushchanges.

Flushchanges is called once per regular file, at the
end of `diffreg`, so we output a hunk header once per
file.
2022-06-04 02:21:19 +00:00
Ori Bernstein 9eb9c9e560 patch(1): remove options that don't exist
the summary mentions options that existed during
development, but no longer do.
2022-06-04 02:13:58 +00:00
Ori Bernstein 9e547f50d1 patch(1): add the manpage
forgot it in the last commit
2022-06-04 02:12:12 +00:00
Ori Bernstein 07e1620911 patch: implement a new, simpler patch program to replace ape/patch
ape/patch is a giant, ugly ball of code from almost 25 years ago,
which has not and will likely never been updated or maintained.

the world has since settled on unified diffs, and we just need a
simple program that can parse and apply them.
2022-06-04 01:56:01 +00:00
xfnw e72da2cdc8 Merge remote-tracking branch 'origin/front' into front 2022-05-31 21:03:39 -04:00
Jacob Moody 6efb7620e6 chdev: dont pollute environment 2022-05-31 19:30:23 +00:00
xfnw 647266573c Merge remote-tracking branch 'origin' into front 2022-05-30 21:56:43 -04:00
Jacob Moody 1d09995353 kernel: be more careful about argc for /dev/drivers writes
Not crashing on 'chdev &' is important.
2022-05-30 21:55:39 -04:00
Ori Bernstein fe2cbbb402 git: performance enhancements
Inspired by some changes made in game of trees, I've
implemented a number of speedups in git9.

First, hashing the chunks during deltification with
murmurhash instead of sha1 speeds up the delta search
significantly.

The stretch function was micro-optimized a bit as well,
since that was taking a large portion of the time when
chunking.

Finally, the full path is not stored. We only care about
grouping files with the same name and path. We don't care
about the ordering. Therefore, only the hash of the path
xored with the hash of the diretory is kept, which saves
a bunch of mallocs and string munging.

This reduces the time spent repacking some test repos
significantly.

9front:
	% time git/repack
	deltifying 97473 objects: 100%
	writing 97473 objects: 100%
	indexing 97473 objects: 100%
	58.85u 1.39s 61.82r 	 git/repack

	% time /sys/src/cmd/git/6.repack
	deltifying 97473 objects: 100%
	writing 97473 objects: 100%
	indexing 97473 objects: 100%
	43.86u 1.29s 47.51r 	 /sys/src/cmd/git/6.repack

openbsd:

	% time git/repack
	deltifying 2092325 objects: 100%
	writing 2092325 objects: 100%
	indexing 2092325 objects: 100%
	1589.48u 45.03s 1729.18r 	 git/repack

	% time /sys/src/cmd/git/6.repack
	deltifying 2092325 objects: 100%
	writing 2092325 objects: 100%
	indexing 2092325 objects: 100%
	1238.68u 41.49s 1373.15r 	 /sys/src/cmd/git/6.repack

go:
	% time git/repack
	deltifying 529507 objects: 100%
	writing 529507 objects: 100%
	indexing 529507 objects: 100%
	345.32u 7.71s 369.25r     git/repack

	% time /sys/src/cmd/git/6.repack
	deltifying 529507 objects: 100%
	writing 529507 objects: 100%
	indexing 529507 objects: 100%
	248.07u 4.47s 257.59r 	 /sys/src/cmd/git/6.repack
2022-05-30 21:55:39 -04:00
Jacob Moody 674fcda107 aux/listen: Allow per service namespace files 2022-05-30 21:55:39 -04:00
Jacob Moody 9fe925eaa5 kernel: add /rc to devroot
This makes it much easier to run a rc
program without needing to bind in all of '#s/boot'.
2022-05-30 21:55:39 -04:00
Jacob Moody 96d07474b8 ip/ftpd: use chdev in /lib/namespace.ftp
/lib/namespace.ftp is used for anonmyous logins.
2022-05-30 21:55:39 -04:00
Jacob Moody 449fe7d8ed auth/newns: add chdev command 2022-05-30 21:55:39 -04:00
Jacob Moody e6c589312e add chdev(1) 2022-05-30 21:55:39 -04:00
Jacob Moody 00b7d2385a kernel: add chdev command to devcons 2022-05-30 21:55:39 -04:00
glenda 54328d2e65 /lib/theo: This is a bug in a diff I put into snapshots. 2022-05-30 21:55:39 -04:00
Michael Forney 9b19835bd4 tmparse: remove incorrect isalpha definition
Checking the range of c|0x60 incorrectly classifies many characters
as alphabetic (digits, control characters 0x01-0x20, and punctuation
characters '!'-':'). This prevents tmparse from parsing dates with
a timezone bounded by those characters (for example, "12:11:56 (PDT)").

Instead, just reuse the isalpha macro provided by ctype.h.
2022-05-30 21:55:39 -04:00
Ori Bernstein 24e5308c2a kbmap: add latin american keymap (thanks ssf) 2022-05-30 21:55:39 -04:00
Ori Bernstein 7c71da0344 diff: clean up some comments
I did the tidying and fixes. Let's remove those
comments.
2022-05-30 21:55:39 -04:00
Ori Bernstein 8eb33669cd patch(1): remove bell labs patch scripts
bell labs is dead, and nobody is listening; 9front
has our own patch submission proces.
2022-05-30 21:55:39 -04:00
Ori Bernstein 8eedca7656 diff: retain original file names
When diffing non-regular files, like /dev/null,
pipes, and similar, diff will generate a temp
file to diff against. This is the right thing
to do, but the temp file leaks into the diff.

This patch retains the original file name all
the way through to diff output.
2022-05-30 21:55:39 -04:00
Ori Bernstein 1bb7aa60c4 diff: fix style
remove useless macros, bring formatting closer
to regular 9front formatting, and use the
ARGBEGIN/ARGEND macros. No functional change.
2022-05-30 21:55:39 -04:00
Ori Bernstein 9a1428f41a git: improve error on short read
we don't recover from an invalid packet, so just
sysfatal with a useful message.
2022-05-30 21:55:38 -04:00
Jacob Moody 8fbfba1ecf aux/listen: remove Service struct
An announcing process already knows what port
it announced on, we don't need to derive it
from every connection.
2022-05-30 21:55:38 -04:00
Jacob Moody 1da69597bd aux/listen: remove argument clutter
addr and proto are globals. protodir should be
a global. let's also avoid reading the remote
addr more then once.
2022-05-30 21:55:38 -04:00
Jacob Moody a1e3ba1b6d aux/listen: remove unused cpu global 2022-05-30 21:55:38 -04:00
Jacob Moody 9e414386d4 kernel: remove dead case from devpipe
This code is checking the return of devwalk for
a walk resulting in a clone of an open pipe file. However,
devclone ensures that the chan we are cloning is not
currently open.
2022-05-30 21:55:38 -04:00
Jacob Moody 5f49f8ac9c aux/listen: remove special cases for depreciated datakit
The getserv function has remained mostly unchanged since
1ed. These checks are for handling string local ports
or lack thereof. This was used by datakit at the time,
where 'ports' were service strings. This made the default
datakit service 'login' when a connector did not give
a specific service. The checks for directory traversal also
seemed specifically to guard against a connector from providing
a malicious service string. With datakit gone all current protocols
use numerics as ports so these checks and defaults become uneeded.

1ed reference:
https://github.com/plan9foundation/plan9/tree/1e-1992-09-21
2022-05-30 21:55:38 -04:00
Ori Bernstein b360a7c765 git/merge: correctly preserve permissions when merging
when doing a 3 way merge of a file, we also need to do a
merge of the permission bits to avoid clobberign them.
2022-05-30 21:55:38 -04:00
Sigrid Solveig Haflínudóttir 2bb988b1e2 icanhasvmx: our vmx requires unrestricted guest too 2022-05-30 21:55:38 -04:00
Jacob Moody 2c7f86e0d4 fork(2): fix commas in RFNOMNT references 2022-05-30 21:55:38 -04:00
cinap_lenrek ecb5eab76b imx8: add xhci driver for the soc
This is mostly a copy of port/usbxhci.c with PCIWADDR() replaced
by PADDR() and the pci specific code stripped out.

This could be refactored at a later time.

There is a gpio line for the main hub reset that needs to be
asserted and some power management functions that are currently
done by u-boot (using "usb start" command).

We will do these ourselfs once we have the infrastructure for
it in place.
2022-05-30 21:55:38 -04:00
Sigrid Solveig Haflínudóttir 577a537d65 g: add .ha (Hare) 2022-05-30 21:55:38 -04:00
Jacob Moody 760f18ff4a kernel: disable wstat for devpipe 2022-05-30 21:55:38 -04:00
Jacob Moody 11c0f4e7dd fork(2): fix parens in RFNOMNT references (thanks Amavect) 2022-05-30 21:55:38 -04:00
Xiao-Yong Jin 5eda53a050 vt: increase buffer size
This patch increases the buffer sizes in vt(1) to reduce
the latency from the roundtrip between terminal and cpu
server.
2022-05-30 21:55:38 -04:00
Jacob Moody 32235c2e41 fork(2): Document RFNOMNT edge cases. 2022-05-30 21:55:37 -04:00
Alex Musolino dcbede5281 inst/prepdisk: fix invocations of test(1)
Test(1) was fixed some time ago [1] to properly parse all of its
command line arguments.  As such, we need to be more careful about
using test(1) with globbing patterns.

[1] changeset b562b269ce
2022-05-30 21:55:37 -04:00
qwx fc17fc5151 /rc/bin: amend usage misdirections (thanks umbraticus) 2022-05-30 21:55:37 -04:00
cinap_lenrek 5a7ed2e652 uartimx: fix interrupts
need to turn off transmitter fifo interrupt when we run out of
data to transmit, and set rx fifo ready fifo threshold to one.
2022-05-30 21:55:37 -04:00
cinap_lenrek cb8e638d2a imx8: implement psci calls for system reset and multicore startup 2022-05-30 21:55:37 -04:00