]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
4 years agokernel: cleanup makefile for $CONF.$O target
cinap_lenrek [Sun, 2 Feb 2020 19:46:58 +0000 (20:46 +0100)]
kernel: cleanup makefile for $CONF.$O target

4 years agomerge
cinap_lenrek [Sun, 2 Feb 2020 19:33:40 +0000 (20:33 +0100)]
merge

4 years agolisten(1): implement one-shot mode flag for listen1 (thanks kivik)
cinap_lenrek [Sun, 2 Feb 2020 19:31:48 +0000 (20:31 +0100)]
listen(1): implement one-shot mode flag for listen1 (thanks kivik)

4 years agofix double free in acme.
Ori Bernstein [Fri, 31 Jan 2020 17:25:39 +0000 (09:25 -0800)]
fix double free in acme.

in acmerrorproc():
sendp(s);
free(s);

in waitthread():
recv(&err)
free(err)

We only want waitthread to free.

4 years agodocument common emulator keys
rgl [Wed, 29 Jan 2020 18:27:07 +0000 (19:27 +0100)]
document common emulator keys

4 years agowalk: add D and T fmt characters (fileserver device/type)
BurnZeZ [Tue, 28 Jan 2020 01:27:41 +0000 (01:27 +0000)]
walk: add D and T fmt characters (fileserver device/type)

4 years agowalk(1): formatting/corrections
BurnZeZ [Tue, 28 Jan 2020 00:53:58 +0000 (00:53 +0000)]
walk(1): formatting/corrections

4 years agowalk: remove superfluous newline
BurnZeZ [Tue, 28 Jan 2020 00:44:44 +0000 (00:44 +0000)]
walk: remove superfluous newline

4 years agokernel: restore old behaviour that kprocs have ther noteid == pid
cinap_lenrek [Mon, 27 Jan 2020 01:17:14 +0000 (02:17 +0100)]
kernel: restore old behaviour that kprocs have ther noteid == pid

4 years agokernel: fix mistake from previous commit (noteid not being inherited by default)
cinap_lenrek [Mon, 27 Jan 2020 00:51:35 +0000 (01:51 +0100)]
kernel: fix mistake from previous commit (noteid not being inherited by default)

4 years agokernel: implement portable userinit() and simplify process creation
cinap_lenrek [Sun, 26 Jan 2020 18:01:36 +0000 (19:01 +0100)]
kernel: implement portable userinit() and simplify process creation

replace machine specific userinit() by a portable
implemntation that uses kproc() to create the first
process. the initcode text is mapped using kmap(),
so there is no need for machine specific tmpmap()
functions.

initcode stack preparation should be done in init0()
where the stack is mapped and can be accessed directly.

replacing the machine specific userinit() allows some
big simplifications as sysrfork() and kproc() are now
the only callers of newproc() and we can avoid initializing
fields that we know are being initialized by these
callers.

rename autogenerated init.h and reboot.h headers.
the initcode[] and rebootcode[] blobs are now in *.i
files and hex generation was moved to portmkfile. the
machine specific mkfile only needs to specify how to
build rebootcode.out and initcode.out.

4 years agoppc: remove old duplicate of devtls.c
cinap_lenrek [Sat, 25 Jan 2020 17:37:28 +0000 (18:37 +0100)]
ppc: remove old duplicate of devtls.c

4 years agoadd v8e
aiju [Wed, 22 Jan 2020 13:09:09 +0000 (13:09 +0000)]
add v8e

4 years agopage(1): fix troff manual example
Alex Musolino [Mon, 20 Jan 2020 04:29:04 +0000 (14:59 +1030)]
page(1): fix troff manual example

4 years agomerge
cinap_lenrek [Sun, 19 Jan 2020 18:21:10 +0000 (19:21 +0100)]
merge

4 years agoApply http://www.9paste.net/qrstuv/patch/acme-movetodelmesg/
Roberto E. Vargas Caballero [Sun, 19 Jan 2020 18:18:12 +0000 (19:18 +0100)]
Apply http://www.9paste.net/qrstuv/patch/acme-movetodelmesg/

4 years agomerge
cinap_lenrek [Sun, 19 Jan 2020 17:45:04 +0000 (18:45 +0100)]
merge

4 years agoacme: fix off by one in colclose(), make dellist() code consistent
cinap_lenrek [Sun, 19 Jan 2020 17:43:51 +0000 (18:43 +0100)]
acme: fix off by one in colclose(), make dellist() code consistent

4 years agoacme: Restore call to movetodel() in colclose
Roberto E. Vargas Caballero [Sun, 19 Jan 2020 17:36:50 +0000 (18:36 +0100)]
acme: Restore call to movetodel() in colclose

4 years agocycv: support for registers
aiju [Mon, 13 Jan 2020 23:22:35 +0000 (23:22 +0000)]
cycv: support for registers

4 years agocyclone v kernel: fpga support, fix CONFADDR
aiju [Sun, 12 Jan 2020 03:40:42 +0000 (03:40 +0000)]
cyclone v kernel: fpga support, fix CONFADDR

4 years agovnc/devdraw: fix topnwindows() panic when images are not windows (thanks aiju)
cinap_lenrek [Sat, 11 Jan 2020 23:19:39 +0000 (00:19 +0100)]
vnc/devdraw: fix topnwindows() panic when images are not windows (thanks aiju)

see changeset 319be6cfe7ef

4 years agodevdraw: fix topnwindows() panic when images are not windows (thanks aiju)
cinap_lenrek [Sat, 11 Jan 2020 23:07:27 +0000 (00:07 +0100)]
devdraw: fix topnwindows() panic when images are not windows (thanks aiju)

Crashes drawterm and native:

#include <u.h>
#include <libc.h>
#include <draw.h>

void
main(int argc, char **argv)
{
  initdraw(nil, nil, nil);

  Image *a[] = {screen, display->black};

  topnwindows(a, nelem(a));
  flushimage(display, 1);
}

4 years agopc64: adapt vgaradeon driver to 64-bit (thanks Robert Ransom)
cinap_lenrek [Sat, 11 Jan 2020 22:31:54 +0000 (23:31 +0100)]
pc64: adapt vgaradeon driver to 64-bit (thanks Robert Ransom)

Not yet tested.

4 years agokernel: remove relics of CPU 'load balancing' policy in scheduler (thanks Robert...
cinap_lenrek [Sat, 11 Jan 2020 20:26:42 +0000 (21:26 +0100)]
kernel: remove relics of CPU 'load balancing' policy in scheduler (thanks Robert Ransom)

This code was deleted from Plan 9 before the 9front repo began.
Proc.movetime was used by it, but has never been referenced in 9front.

4 years agobootrc: fix comment typo (thanks Robert Ransom)
cinap_lenrek [Sat, 11 Jan 2020 20:25:05 +0000 (21:25 +0100)]
bootrc: fix comment typo (thanks Robert Ransom)

4 years agoip/cifsd: implement SMB_SET_FILE_UNIX_BASIC for wstat
cinap_lenrek [Sat, 11 Jan 2020 13:50:52 +0000 (14:50 +0100)]
ip/cifsd: implement SMB_SET_FILE_UNIX_BASIC for wstat

4 years agolibFLAC: 1.3.1 -> 1.3.3
Sigrid [Sat, 11 Jan 2020 12:25:02 +0000 (13:25 +0100)]
libFLAC: 1.3.1 -> 1.3.3

4 years agodont spin on MDIO
aiju [Fri, 10 Jan 2020 20:43:24 +0000 (20:43 +0000)]
dont spin on MDIO

4 years agomerge
aiju [Fri, 10 Jan 2020 18:49:39 +0000 (18:49 +0000)]
merge

4 years agoadd cycv ethernet driver
aiju [Fri, 10 Jan 2020 18:49:33 +0000 (18:49 +0000)]
add cycv ethernet driver

4 years agoshow line numbers in dtracy type errors
Ori Bernstein [Thu, 9 Jan 2020 19:59:44 +0000 (11:59 -0800)]
show line numbers in dtracy type errors

4 years agoadd cycv kernel
aiju [Wed, 8 Jan 2020 02:35:01 +0000 (02:35 +0000)]
add cycv kernel

4 years agodumb bug
aiju [Wed, 8 Jan 2020 02:27:09 +0000 (02:27 +0000)]
dumb bug

4 years agoadd aux/aout2uimage
aiju [Wed, 8 Jan 2020 02:22:20 +0000 (02:22 +0000)]
add aux/aout2uimage

4 years agorc-httpd: append carriage return to content-length header
Alex Musolino [Tue, 7 Jan 2020 06:58:59 +0000 (17:28 +1030)]
rc-httpd: append carriage return to content-length header

4 years agodevip: fix packet loss when interface is wlocked
cinap_lenrek [Sun, 5 Jan 2020 17:20:47 +0000 (18:20 +0100)]
devip: fix packet loss when interface is wlocked

to prevent deadlock on media unbind (which is called with
the interface wlock()'ed), the medias reader processes
that unbind was waiting for used to discard packets when
the interface could not be rlocked.

this has the unfortunate side effect that when we change
addresses on a interface that packets are getting lost.
this is problematic for the processing of ipv6 router
advertisements when multiple RA's are getting received
in quick succession.

this change removes that packet dropping behaviour and
instead changes the unbind process to avoid the deadlock
by wunlock()ing the interface temporarily while waiting
for the reader processes to finish. the interface media
is also changed to the mullmedium before unlocking (see
the comment).

4 years ago/sys/man/9: more pages added
rgl [Sat, 4 Jan 2020 17:02:54 +0000 (18:02 +0100)]
/sys/man/9: more pages added

in addition to the pages, there's also changes to the mkfile
to generate the index for the new section.

4 years agoip/ipconfig: keep on sending router solicitation after initial RA
cinap_lenrek [Sat, 4 Jan 2020 10:49:50 +0000 (11:49 +0100)]
ip/ipconfig: keep on sending router solicitation after initial RA

avm fritzbox uses very long RA period so it effectively only
responds after a router solicitation. when there are multiple
fritzbox routers on the lan, then while configuring one prefix
of the first RA, the ip stack can drop the second router
advertisement and we would never get the second route.

packets can always get lost. so we just keep on sending router
solicitations (up to 3 times) to make sure we got all the RA's.

4 years agorio, kbdfs: increase read buffer for high latency kbdfs support
23hiro [Mon, 23 Dec 2019 00:31:30 +0000 (01:31 +0100)]
rio, kbdfs: increase read buffer for high latency kbdfs support

4 years ago9p(2): fix sentence for wstat function (thanks jsmoody)
cinap_lenrek [Sat, 21 Dec 2019 14:31:10 +0000 (15:31 +0100)]
9p(2): fix sentence for wstat function (thanks jsmoody)

4 years agosleep(9): recover comment with the right reference
rgl [Fri, 20 Dec 2019 22:15:07 +0000 (23:15 +0100)]
sleep(9): recover comment with the right reference

4 years agokproc(9) and sleep(9) corrections
rgl [Fri, 20 Dec 2019 17:01:43 +0000 (18:01 +0100)]
kproc(9) and sleep(9) corrections

4 years agothread(2): fix description of when/why procexec(l) functions return
Alex Musolino [Thu, 19 Dec 2019 06:42:15 +0000 (17:12 +1030)]
thread(2): fix description of when/why procexec(l) functions return

4 years agopc, pc64: fix cputemp decimal handling in amd10temprd (thanks Robert Ransom)
Alex Musolino [Thu, 19 Dec 2019 04:49:02 +0000 (15:19 +1030)]
pc, pc64: fix cputemp decimal handling in amd10temprd (thanks Robert Ransom)

4 years agoflate(2): fix typos (thanks rgl)
Alex Musolino [Tue, 17 Dec 2019 22:31:38 +0000 (09:01 +1030)]
flate(2): fix typos (thanks rgl)

4 years agoip(3): document special null-address hack for accepting all incoming connections
cinap_lenrek [Sun, 15 Dec 2019 12:59:08 +0000 (13:59 +0100)]
ip(3): document special null-address hack for accepting all incoming connections

4 years agodate: make ISO 8601 time output compatible to RFC3339
cinap_lenrek [Sat, 14 Dec 2019 16:09:14 +0000 (17:09 +0100)]
date: make ISO 8601 time output compatible to RFC3339

RFC3339 is a stricter subset of ISO 8601, in particular
the timezone offset needs to be specified as +HH:MM while
in ISO 8601 the colon is optional.

4 years agonormalize error messages in yacc, stop writing to closed fd.
Ori Bernstein [Thu, 12 Dec 2019 07:26:15 +0000 (23:26 -0800)]
normalize error messages in yacc, stop writing to closed fd.

4 years agomerge
cinap_lenrek [Wed, 11 Dec 2019 22:53:10 +0000 (23:53 +0100)]
merge

4 years agodevcons: fix write length of writebintime() (thanks BurnZeZ)
cinap_lenrek [Wed, 11 Dec 2019 22:52:05 +0000 (23:52 +0100)]
devcons: fix write length of writebintime() (thanks BurnZeZ)

4 years agoremove unused code.
Ori Bernstein [Wed, 11 Dec 2019 07:13:25 +0000 (23:13 -0800)]
remove unused code.

4 years agoonly ensurecache() on doplumb().
Ori Bernstein [Wed, 11 Dec 2019 07:01:06 +0000 (23:01 -0800)]
only ensurecache() on doplumb().

4 years agomerge
Ori Bernstein [Wed, 11 Dec 2019 02:21:05 +0000 (18:21 -0800)]
merge

4 years agocrop(1): remove duplicate -b option in synopsis
Alex Musolino [Tue, 10 Dec 2019 04:43:44 +0000 (15:13 +1030)]
crop(1): remove duplicate -b option in synopsis

4 years agoupas/fs plumb flag changes.
Ori Bernstein [Mon, 9 Dec 2019 20:46:27 +0000 (12:46 -0800)]
upas/fs plumb flag changes.

This patch makes 3 changes:

- It makes upas/fs send plumb messages when a message
  changes in the background (eg, someone on another imap
  connection opens a message and sets the read flag)
- It makes faces not complain when it gets one of these
  new modify messages.
- It makes acme/Mail update the flags in the display
  when it gets one of these messages.

4 years agoriostart: when system uses serial console, provide a system shell on it
cinap_lenrek [Mon, 9 Dec 2019 17:08:02 +0000 (18:08 +0100)]
riostart: when system uses serial console, provide a system shell on it

on systems with serial console and graphics such as the raspberry pi,
it is nice to get a system shell on the serial console even when no
monitor is connected.

4 years agoconsole(8): add console command and manpage
cinap_lenrek [Mon, 9 Dec 2019 16:44:28 +0000 (17:44 +0100)]
console(8): add console command and manpage

the console command runs a command or the system shell under
a new instance of kbdfs, optionally providing a serial console
when $console environment variable is set.

4 years agomerge
cinap_lenrek [Mon, 9 Dec 2019 01:03:10 +0000 (02:03 +0100)]
merge

4 years agohgfs: fix loadrevinfo() breakage on long lines using libbio (thanks deuterion)
cinap_lenrek [Mon, 9 Dec 2019 01:01:12 +0000 (02:01 +0100)]
hgfs: fix loadrevinfo() breakage on long lines using libbio (thanks deuterion)

4 years agohack around timezone issues.
Ori Bernstein [Sun, 8 Dec 2019 19:58:52 +0000 (11:58 -0800)]
hack around timezone issues.

4 years agomerge
Ori Bernstein [Sun, 8 Dec 2019 19:58:19 +0000 (11:58 -0800)]
merge

4 years agofix filetype detecton by suffix so that multiple dots dont confuse it. (thanks kvik)
Ori Bernstein [Sun, 8 Dec 2019 19:54:59 +0000 (11:54 -0800)]
fix filetype detecton by suffix so that multiple dots dont confuse it. (thanks kvik)

4 years agopc: replace duplicated and broken mmu flush code in vunmap()
cinap_lenrek [Sat, 7 Dec 2019 01:19:14 +0000 (02:19 +0100)]
pc: replace duplicated and broken mmu flush code in vunmap()

comparing m with MACHP() is wrong as m is a constant on 386.

add procflushothers(), which flushes all processes except up
using common procflushmmu() routine.

4 years agokernel: avoid useless mmu flushes, implement better wait condition for procflushmmu()
cinap_lenrek [Sat, 7 Dec 2019 01:13:51 +0000 (02:13 +0100)]
kernel: avoid useless mmu flushes, implement better wait condition for procflushmmu()

procflushmmu() returns once all *OTHER* processors that had
matching processes running on them flushed ther tlb/mmu state.
the caller of procflush...() takes care of flushing "up" by
calling flushmmu() later.

if the current process matched, then that means m->flushmmu
would be set, and hzclock() would call flushmmu() again.

to avoid this, we now check up->newtlb in addition to m->flushmmu
in hzclock() before calling flushmmu().

we also maintain information on which process on what processor
to wait for locally, which helps making progress when multiple
procflushmmu()'s are running concurrently.

in addition, this makes the wait condition for procflushmmu()
more sophisticated, by validating if the processor still runs
the selected process and only if it matchatches, considers
the MACHP(nm)->flushmmu flag.

4 years agofix some acme memory leaks
Ori Bernstein [Fri, 6 Dec 2019 20:08:00 +0000 (12:08 -0800)]
fix some acme memory leaks

(imported from plan9port 7ca1c90109e17dced4b38fbaadea9d2cf39871b7,
some tag restoration lines not relevant.)

4 years agohoc: don't nest calls to follow() when lexing ++/+= and --/-= (#287)
Ori Bernstein [Fri, 6 Dec 2019 19:53:44 +0000 (11:53 -0800)]
hoc: don't nest calls to follow() when lexing ++/+= and --/-= (#287)

The code had a nested use of the follow() function that could cause +=+
and -=- to register as ++ and --.  The first follow() to execute could
consume a character and match and then the second follow() could consume
another character and match.  For example i-=-10 would result in a syntax
error and i-=- would decrement i.

(imported from plan9port commit f1dd3f065a97f57bf59db2e3284868e181734159)

4 years agowords: transgender
Sigrid [Fri, 6 Dec 2019 14:20:35 +0000 (15:20 +0100)]
words: transgender

4 years agodelete obsolete comments (replies are flagged elsewhere)
Ori Bernstein [Thu, 5 Dec 2019 08:16:15 +0000 (00:16 -0800)]
delete obsolete comments (replies are flagged elsewhere)

4 years agomerge
cinap_lenrek [Wed, 4 Dec 2019 21:04:12 +0000 (22:04 +0100)]
merge

4 years agobcm: use extended small pages so XN bit can work
cinap_lenrek [Wed, 4 Dec 2019 21:02:51 +0000 (22:02 +0100)]
bcm: use extended small pages so XN bit can work

the change to support no-execute bits broke the original
raspberry pi1, as it uses backwards compatible page table
format.

to use the XN bit, subpage AP bits have to be disabled
using the XP bit in CP15 Control Register c1 Bit 23.

4 years ago9/boot/net.rc: suppress error from grep if ethernet ifstats file is not found
cinap_lenrek [Wed, 4 Dec 2019 20:56:13 +0000 (21:56 +0100)]
9/boot/net.rc: suppress error from grep if ethernet ifstats file is not found

this can happen with nusb/ether, which does not implement ifstats file.

4 years agoacme: Apply each -/+ only once (#156)
Ori Bernstein [Wed, 4 Dec 2019 20:55:03 +0000 (12:55 -0800)]
acme: Apply each -/+ only once (#156)

When plumbing an address like `3-`, Acme selects line 1,
and similarly `3+` selects line 5.
The same problem can be observed for character addresses (`#123+`)
but _not_ for ones like `+`, `.+` or `/foo/+`:
The problem only occurs when a number is followed by a direction (`-`/`+`).

Following along with the example `3-` through `address` (in addr.c):
We read `3` into `c` and match the `case` on line 239.
The `while` loop on line 242ff reads additional digits into `c`
and puts the first non-digit back by decrementing the index `q`.
Then we find the range for line 3 on line 251 and continue.

On the next iteration, we set `prevc` to the last `c`,
but since that part read ahead _into `c`_,
`c` is currently the _next_ character we will read, `-`,
and now `prevc` is too.

Then in the case block (line 210) the condition on line 211 holds
and Acme believes that it has read two `-` in sequence
and modifies the range to account for the “first” `-`.
The “second” `-` gets applied after the loop is done, on line 292.

So the general problem is:
While reading numbers, Acme reads the next character after the number into `c`.
It decrements the counter to ensure it will read it again on the next iteration,
but it still uses it to update `prevc`.

This change solves the problem by reading digits into `nc` instead.
This variable is used to similar effect in the block for directions (line 212)
and fills the role of “local `c` that we can safely use to read ahead” nicely.

(imported from plan9front a82a8b6368274d77d42f526e379b74e79c137e26)

4 years agoacme: avoid division by zero when resizing col (#189)
Ori Bernstein [Wed, 4 Dec 2019 20:37:07 +0000 (12:37 -0800)]
acme: avoid division by zero when resizing col (#189)

To reproduce, create a column with at least two windows and resize
acme to have almost zero height.

(imported from plan9port commit 76b9347a5fa3a0970527c6ee1b97ef1c714f636b)

4 years agoacme, sam: handle >1GB files correctly
Ori Bernstein [Wed, 4 Dec 2019 19:46:42 +0000 (11:46 -0800)]
acme, sam: handle >1GB files correctly

imported from plan9port, edfe3c016fe6ef10c55f7a17aab668214ec21efc

4 years agomerge
cinap_lenrek [Tue, 3 Dec 2019 19:57:01 +0000 (20:57 +0100)]
merge

4 years agocmd(3): fix typo, Close -> Closed (thanks kivik)
cinap_lenrek [Tue, 3 Dec 2019 19:55:57 +0000 (20:55 +0100)]
cmd(3): fix typo, Close -> Closed (thanks kivik)

4 years agorio(4): fix bad cross-reference format
Alex Musolino [Tue, 3 Dec 2019 08:02:30 +0000 (18:32 +1030)]
rio(4): fix bad cross-reference format

4 years agoseconds(1): add SOURCE section
Alex Musolino [Tue, 3 Dec 2019 07:55:24 +0000 (18:25 +1030)]
seconds(1): add SOURCE section

4 years agoalways zero initialize Tm structure for tm2sec()
cinap_lenrek [Tue, 3 Dec 2019 07:22:02 +0000 (08:22 +0100)]
always zero initialize Tm structure for tm2sec()

4 years agoRemove reply print.
Ori Bernstein [Mon, 2 Dec 2019 22:50:53 +0000 (14:50 -0800)]
Remove reply print.

4 years agomerge
cinap_lenrek [Mon, 2 Dec 2019 22:33:29 +0000 (23:33 +0100)]
merge

4 years agopc, pc64: clear debug watchpoint registers on exec and exit
cinap_lenrek [Mon, 2 Dec 2019 22:32:24 +0000 (23:32 +0100)]
pc, pc64: clear debug watchpoint registers on exec and exit

when a process does an exec syscall, procsetup() is called and
we have to disable the debug watchpoint registers. just clearing
p->dr is not enougth as we are not going thru a procsave() and
procrestore() cycle which would disable and reload the saved
debug registers.

instead of clearing debug registers in procfork(), we should
clear the saved debug registers before a process goes to die
(pexit() calls sched() with up->state = Moribund) as the Proc
structure can get reused for kernel processes (kproc) which
never call procfork() and would therefore have debug registers
loaded.

4 years agoremove debug print
Ori Bernstein [Mon, 2 Dec 2019 21:56:15 +0000 (13:56 -0800)]
remove debug print

4 years agosimplify flag parsing.
Ori Bernstein [Mon, 2 Dec 2019 21:53:57 +0000 (13:53 -0800)]
simplify flag parsing.

we've only got a few flags, a linear search is good enough,
and is obviously correct; the old search wasn't.

4 years agoos(1): fix a typo
Sigrid [Mon, 2 Dec 2019 15:55:53 +0000 (17:55 +0200)]
os(1): fix a typo

4 years agomerge
cinap_lenrek [Mon, 2 Dec 2019 07:27:49 +0000 (08:27 +0100)]
merge

4 years agovgai81x: remove unused mach0 variable
cinap_lenrek [Mon, 2 Dec 2019 07:26:34 +0000 (08:26 +0100)]
vgai81x: remove unused mach0 variable

4 years agopc: fix ldt memory leak in procsetup()
cinap_lenrek [Mon, 2 Dec 2019 06:43:45 +0000 (07:43 +0100)]
pc: fix ldt memory leak in procsetup()

4 years agokernel: add missing FPillegal definition for kw and omap kernels
cinap_lenrek [Mon, 2 Dec 2019 06:35:25 +0000 (07:35 +0100)]
kernel: add missing FPillegal definition for kw and omap kernels

4 years agofix typo: we don't have cache insurance.
Ori Bernstein [Mon, 2 Dec 2019 01:24:02 +0000 (17:24 -0800)]
fix typo: we don't have cache insurance.

4 years agoshow and update flags in acme mail
Ori Bernstein [Mon, 2 Dec 2019 01:14:13 +0000 (17:14 -0800)]
show and update flags in acme mail

now, it's possible to tell whether you've read or replied
to a message.

4 years agoupas/fs imap fixes and improvements
Ori Bernstein [Mon, 2 Dec 2019 01:12:19 +0000 (17:12 -0800)]
upas/fs imap fixes and improvements

do incremental imap fetches after startup, fixes validity handling,
record flags correctly when we aren't in the process of directly
updating a message, fixes off by one in flag parsing, fixes
mis-indexing messages in sync when we get an unsolicited fetch
response.

4 years agokernel: improve diagnostics by reversing the roles of Proc.parentpid and Proc.parent
cinap_lenrek [Sun, 1 Dec 2019 16:57:14 +0000 (17:57 +0100)]
kernel: improve diagnostics by reversing the roles of Proc.parentpid and Proc.parent

for better system diagnostics, we *ALWAYS* want to record the parent
pid of a user process, regardless of if the child will post a wait
record on exit or not.

for that, we reverse the roles of Proc.parent and Proc.parentpid so
Proc.parentpid will always be set on rfork() and the Proc.parent
pointer will point to the parent's Proc structure or is set to nil
when no wait record should be posted on exit (RFNOWAIT flag).

this means that we can get the pid of the original parent process
from /proc, regardless of the the child having rforked with the
RFNOWAIT flag. this improves the output of pstree(1) somewhat if
the parent is still alive. note that theres no guarantee that the
parent pid is still valid.

the conditions are unchanged:

a user process that will post wait record has:

up->kp == 0 && up->parent != nil && up->parent->pid == up->parentpid

the boot process is:

up->kp == 0 && up->parent == nil && up->parentpid == 0

and kproc's have:

up->kp != 0 && up->parent == nil && up->parentpid == 0

4 years agopc, pc64: merge adjacent e820 map entries of same type
cinap_lenrek [Sun, 1 Dec 2019 13:06:30 +0000 (14:06 +0100)]
pc, pc64: merge adjacent e820 map entries of same type

some machines give us over 300 e820 ram entries that are
all adjacent to each other causing us to run out of Map
end Emap entries.

this change adds e820clean() function, which sorts the
current e820 map and discards unusable entries and merges
adjacent entries. e820clean() is called after we parsed
the *e820= boot parameter or when we run out of entries.

an example of such a broken e820 map (thanks mischief):

*e820=1 0000000000000000 0000000000008000 1 0000000000008000 000000000000c000 1 000000000000c000 000000000003f000 1 000000000003f000 0000000000040000 1 0000000000040000 00000000000a0000 1 0000000000100000 0000000001000000 1 0000000001000000 0000000001020000 1 0000000001020000 0000000009d82000 2 0000000009d82000 000000000a000000 1 000000000a000000 000000000a200000 4 000000000a200000 000000000a20b000 1 000000000a20b000 000000000b000000 2 000000000b000000 000000000b020000 1 000000000b020000 0000000010000000 1 0000000010000000 000000001000b000 1 000000001000b000 00000000d9634000 1 00000000d9634000 00000000d96be000 1 00000000d96be000 00000000d96cc000 1 00000000d96cc000 00000000d96db000 1 00000000d96db000 00000000d97df000 1 00000000d97df000 00000000d97ed000 1 00000000d97ed000 00000000d9837000 1 00000000d9837000 00000000d9844000 1 00000000d9844000 00000000d985e000 1 00000000d985e000 00000000d9865000 1 00000000d9865000 00000000d9897000 1 00000000d9897000 00000000d98d7000 1 00000000d98d7000 00000000d98db000 1 00000000d98db000 00000000d98dd000 1 00000000d98dd000 00000000d999d000 1 00000000d999d000 00000000d9a8e000 1 00000000d9a8e000 00000000d9add000 1 00000000d9add000 00000000d9ae2000 1 00000000d9ae2000 00000000d9af3000 1 00000000d9af3000 00000000d9af4000 1 00000000d9af4000 00000000d9af6000 1 00000000d9af6000 00000000d9af7000 1 00000000d9af7000 00000000d9af8000 1 00000000d9af8000 00000000d9af9000 1 00000000d9af9000 00000000d9b5e000 1 00000000d9b5e000 00000000d9b60000 1 00000000d9b60000 00000000d9b8c000 1 00000000d9b8c000 00000000d9b8d000 1 00000000d9b8d000 00000000d9c85000 1 00000000d9c85000 00000000d9c8a000 1 00000000d9c8a000 00000000d9caf000 1 00000000d9caf000 00000000d9cb5000 1 00000000d9cb5000 00000000d9cc1000 1 00000000d9cc1000 00000000d9cc2000 1 00000000d9cc2000 00000000da986000 1 00000000da986000 00000000daeb6000 1 00000000daeb6000 00000000daed7000 1 00000000daed7000 00000000daed8000 1 00000000daed8000 00000000daf61000 1 00000000daf61000 00000000daf7c000 1 00000000daf7c000 00000000db3e6000 1 00000000db3e6000 00000000db4ea000 1 00000000db4ea000 00000000db57d000 1 00000000db57d000 00000000db587000 1 00000000db587000 00000000db58a000 1 00000000db58a000 00000000db58b000 1 00000000db58b000 00000000db591000 1 00000000db591000 00000000db5a7000 1 00000000db5a7000 00000000db5b2000 1 00000000db5b2000 00000000db5ba000 1 00000000db5ba000 00000000db5bb000 1 00000000db5bb000 00000000db5c6000 1 00000000db5c6000 00000000db5c7000 1 00000000db5c7000 00000000db5c8000 1 00000000db5c8000 00000000db5c9000 1 00000000db5c9000 00000000db5cb000 1 00000000db5cb000 00000000db5d0000 1 00000000db5d0000 00000000db5e8000 1 00000000db5e8000 00000000db5ea000 1 00000000db5ea000 00000000db5eb000 1 00000000db5eb000 00000000db5ee000 1 00000000db5ee000 00000000db601000 1 00000000db601000 00000000db602000 1 00000000db602000 00000000db60e000 1 00000000db60e000 00000000db610000 1 00000000db610000 00000000db612000 1 00000000db612000 00000000db614000 1 00000000db614000 00000000db61d000 1 00000000db61d000 00000000db645000 1 00000000db645000 00000000db64c000 1 00000000db64c000 00000000db650000 1 00000000db650000 00000000db651000 1 00000000db651000 00000000db653000 1 00000000db653000 00000000db658000 1 00000000db658000 00000000db659000 1 00000000db659000 00000000db661000 1 00000000db661000 00000000db662000 1 00000000db662000 00000000db665000 1 00000000db665000 00000000db677000 1 00000000db677000 00000000db69d000 1 00000000db69d000 00000000db6a0000 1 00000000db6a0000 00000000db6a8000 1 00000000db6a8000 00000000db6ae000 1 00000000db6ae000 00000000db6c2000 1 00000000db6c2000 00000000db6d4000 1 00000000db6d4000 00000000db6de000 1 00000000db6de000 00000000db6e0000 1 00000000db6e0000 00000000db6e2000 1 00000000db6e2000 00000000db6ef000 1 00000000db6ef000 00000000db6f0000 1 00000000db6f0000 00000000db6f2000 1 00000000db6f2000 00000000db6f3000 1 00000000db6f3000 00000000db810000 1 00000000db810000 00000000db815000 1 00000000db815000 00000000db81f000 1 00000000db81f000 00000000db821000 1 00000000db821000 00000000db85d000 1 00000000db85d000 00000000db869000 1 00000000db869000 00000000db881000 1 00000000db881000 00000000db889000 1 00000000db889000 00000000db88e000 1 00000000db88e000 00000000db88f000 1 00000000db88f000 00000000db891000 1 00000000db891000 00000000db899000 1 00000000db899000 00000000db8a9000 1 00000000db8a9000 00000000db8ab000 1 00000000db8ab000 00000000db8af000 1 00000000db8af000 00000000db8b1000 1 00000000db8b1000 00000000db8b5000 1 00000000db8b5000 00000000db8b7000 1 00000000db8b7000 00000000db8be000 1 00000000db8be000 00000000db8c2000 1 00000000db8c2000 00000000db8c7000 1 00000000db8c7000 00000000db8cf000 1 00000000db8cf000 00000000db8e0000 1 00000000db8e0000 00000000db8e1000 1 00000000db8e1000 00000000db8e2000 1 00000000db8e2000 00000000db8e6000 1 00000000db8e6000 00000000db8e8000 1 00000000db8e8000 00000000db8f4000 1 00000000db8f4000 00000000db904000 1 00000000db904000 00000000db90c000 1 00000000db90c000 00000000db91c000 1 00000000db91c000 00000000db91d000 1 00000000db91d000 00000000db922000 1 00000000db922000 00000000db923000 1 00000000db923000 00000000db929000 1 00000000db929000 00000000db92b000 1 00000000db92b000 00000000db92d000 1 00000000db92d000 00000000db92f000 1 00000000db92f000 00000000db933000 1 00000000db933000 00000000db934000 1 00000000db934000 00000000db936000 1 00000000db936000 00000000db937000 1 00000000db937000 00000000db952000 1 00000000db952000 00000000db96b000 1 00000000db96b000 00000000db998000 1 00000000db998000 00000000db9a1000 1 00000000db9a1000 00000000db9a2000 1 00000000db9a2000 00000000db9a3000 1 00000000db9a3000 00000000db9a4000 1 00000000db9a4000 00000000db9a5000 1 00000000db9a5000 00000000db9a7000 1 00000000db9a7000 00000000db9a8000 1 00000000db9a8000 00000000db9aa000 1 00000000db9aa000 00000000db9ba000 1 00000000db9ba000 00000000db9da000 1 00000000db9da000 00000000db9f7000 1 00000000db9f7000 00000000dba00000 1 00000000dba00000 00000000dba0a000 1 00000000dba0a000 00000000dba11000 1 00000000dba11000 00000000dba12000 1 00000000dba12000 00000000dba51000 1 00000000dba51000 00000000dba5d000 1 00000000dba5d000 00000000dba6c000 1 00000000dba6c000 00000000dba88000 1 00000000dba88000 00000000dba92000 1 00000000dba92000 00000000dba94000 1 00000000dba94000 00000000dbac0000 1 00000000dbac0000 00000000dbac6000 1 00000000dbac6000 00000000dbad2000 1 00000000dbad2000 00000000dbad9000 1 00000000dbad9000 00000000dbae0000 1 00000000dbae0000 00000000dbaeb000 1 00000000dbaeb000 00000000dbaf6000 1 00000000dbaf6000 00000000dbb01000 1 00000000dbb01000 00000000dbb17000 1 00000000dbb17000 00000000dbb1f000 1 00000000dbb1f000 00000000dbb20000 1 00000000dbb20000 00000000dbb23000 1 00000000dbb23000 00000000dbb24000 1 00000000dbb24000 00000000dbb25000 1 00000000dbb25000 00000000dbb3a000 1 00000000dbb3a000 00000000dbb3d000 1 00000000dbb3d000 00000000dbb43000 1 00000000dbb43000 00000000dbb45000 1 00000000dbb45000 00000000dbb49000 1 00000000dbb49000 00000000dbb4c000 1 00000000dbb4c000 00000000dbb4e000 1 00000000dbb4e000 00000000dbb51000 1 00000000dbb51000 00000000dbb54000 1 00000000dbb54000 00000000dbb5a000 1 00000000dbb5a000 00000000dbb5e000 1 00000000dbb5e000 00000000dbb62000 1 00000000dbb62000 00000000dbb67000 1 00000000dbb67000 00000000dbb91000 1 00000000dbb91000 00000000dbb93000 1 00000000dbb93000 00000000dbb94000 1 00000000dbb94000 00000000dbb9d000 1 00000000dbb9d000 00000000dbb9f000 1 00000000dbb9f000 00000000dbbcf000 1 00000000dbbcf000 00000000dbbd0000 1 00000000dbbd0000 00000000dbbd1000 1 00000000dbbd1000 00000000dbbd5000 1 00000000dbbd5000 00000000dbbd6000 1 00000000dbbd6000 00000000dbbd7000 1 00000000dbbd7000 00000000dbbd8000 1 00000000dbbd8000 00000000dbbd9000 1 00000000dbbd9000 00000000dbbdd000 1 00000000dbbdd000 00000000dbbdf000 1 00000000dbbdf000 00000000dbbe1000 1 00000000dbbe1000 00000000dbbeb000 1 00000000dbbeb000 00000000dbbec000 1 00000000dbbec000 00000000dbbef000 1 00000000dbbef000 00000000dbbff000 1 00000000dbbff000 00000000dbc01000 1 00000000dbc01000 00000000dbc05000 1 00000000dbc05000 00000000dbc0f000 1 00000000dbc0f000 00000000dbc11000 1 00000000dbc11000 00000000dbc12000 1 00000000dbc12000 00000000dbc14000 1 00000000dbc14000 00000000dbc15000 1 00000000dbc15000 00000000dbc20000 1 00000000dbc20000 00000000dbc21000 1 00000000dbc21000 00000000dbc22000 1 00000000dbc22000 00000000dbc2a000 1 00000000dbc2a000 00000000dbc2c000 1 00000000dbc2c000 00000000dbc2d000 1 00000000dbc2d000 00000000dbc2f000 1 00000000dbc2f000 00000000dbc30000 1 00000000dbc30000 00000000dbc42000 1 00000000dbc42000 00000000dbc44000 1 00000000dbc44000 00000000dbc54000 1 00000000dbc54000 00000000dbc5c000 1 00000000dbc5c000 00000000dbc5e000 1 00000000dbc5e000 00000000dbc60000 1 00000000dbc60000 00000000dbc64000 1 00000000dbc64000 00000000dbc6d000 1 00000000dbc6d000 00000000dbc7f000 1 00000000dbc7f000 00000000dbc85000 1 00000000dbc85000 00000000dbca3000 1 00000000dbca3000 00000000dbca6000 1 00000000dbca6000 00000000dbcb9000 1 00000000dbcb9000 00000000dbcba000 1 00000000dbcba000 00000000dbcbb000 1 00000000dbcbb000 00000000dbcbc000 1 00000000dbcbc000 00000000dbcbd000 1 00000000dbcbd000 00000000dbcd5000 1 00000000dbcd5000 00000000dbcd8000 1 00000000dbcd8000 00000000dbcd9000 1 00000000dbcd9000 00000000dbcda000 1 00000000dbcda000 00000000dbce1000 1 00000000dbce1000 00000000dbce3000 1 00000000dbce3000 00000000dbce4000 1 00000000dbce4000 00000000dbd06000 1 00000000dbd06000 00000000dbd07000 1 00000000dbd07000 00000000dbd0a000 1 00000000dbd0a000 00000000dbd0b000 1 00000000dbd0b000 00000000dbd0c000 1 00000000dbd0c000 00000000dbd0e000 1 00000000dbd0e000 00000000dbd10000 1 00000000dbd10000 00000000dbd12000 1 00000000dbd12000 00000000dbd15000 1 00000000dbd15000 00000000dbd17000 1 00000000dbd17000 00000000dbd19000 1 00000000dbd19000 00000000dbd1b000 1 00000000dbd1b000 00000000dbd44000 1 00000000dbd44000 00000000dbd46000 1 00000000dbd46000 00000000dbd60000 1 00000000dbd60000 00000000dbd70000 1 00000000dbd70000 00000000dbd79000 1 00000000dbd79000 00000000dbd7a000 1 00000000dbd7a000 00000000dbd7c000 1 00000000dbd7c000 00000000dbd7d000 1 00000000dbd7d000 00000000dbd90000 1 00000000dbd90000 00000000dbd93000 1 00000000dbd93000 00000000dbd97000 1 00000000dbd97000 00000000dbd9a000 1 00000000dbd9a000 00000000dbd9b000 1 00000000dbd9b000 00000000dbd9e000 1 00000000dbd9e000 00000000dbda1000 1 00000000dbda1000 00000000dbda5000 1 00000000dbda5000 00000000dbda9000 1 00000000dbda9000 00000000dbdaf000 1 00000000dbdaf000 00000000dbdb3000 1 00000000dbdb3000 00000000dbdb4000 1 00000000dbdb4000 00000000dbdbe000 1 00000000dbdbe000 00000000dbdbf000 1 00000000dbdbf000 00000000dbdc0000 1 00000000dbdc0000 00000000dbdc1000 1 00000000dbdc1000 00000000dbdc2000 1 00000000dbdc2000 00000000dbdc5000 1 00000000dbdc5000 00000000dbdc6000 1 00000000dbdc6000 00000000dbdc7000 1 00000000dbdc7000 00000000dbdcb000 1 00000000dbdcb000 00000000dbdcf000 1 00000000dbdcf000 00000000dbdd5000 1 00000000dbdd5000 00000000dbdd8000 1 00000000dbdd8000 00000000dbddf000 1 00000000dbddf000 00000000dbde1000 1 00000000dbde1000 00000000dbde5000 1 00000000dbde5000 00000000dbde8000 1 00000000dbde8000 00000000dbded000 1 00000000dbded000 00000000dbdf0000 1 00000000dbdf0000 00000000dbdf4000 1 00000000dbdf4000 00000000dbdf7000 1 00000000dbdf7000 00000000dbdfb000 1 00000000dbdfb000 00000000dbe1e000 1 00000000dbe1e000 00000000dbe20000 1 00000000dbe20000 00000000dbe23000 1 00000000dbe23000 00000000dbe27000 1 00000000dbe27000 00000000dbe28000 1 00000000dbe28000 00000000dbe2a000 1 00000000dbe2a000 00000000dbe2b000 1 00000000dbe2b000 00000000dc24d000 1 00000000dc24d000 00000000dc25c000 1 00000000dc25c000 00000000dc25d000 1 00000000dc25d000 00000000dc25e000 1 00000000dc25e000 00000000dc273000 1 00000000dc273000 00000000dc274000 1 00000000dc274000 00000000dc275000 1 00000000dc275000 00000000dc276000 1 00000000dc276000 00000000dc27a000 1 00000000dc27a000 00000000dc27e000 1 00000000dc27e000 00000000dc283000 1 00000000dc283000 00000000dc284000 1 00000000dc284000 00000000dc2a2000 1 00000000dc2a2000 00000000dc2a6000 1 00000000dc2a6000 00000000dd163000 2 00000000dd163000 00000000dd2a8000 1 00000000dd2a8000 00000000dd42a000 4 00000000dd42a000 00000000dd83e000 1 00000000dd83e000 00000000de38b000 1 00000000de38b000 00000000de430000 1 00000000de430000 00000000de733000 1 00000000de733000 00000000de74f000 1 00000000de74f000 00000000de770000 1 00000000de770000 00000000de77d000 1 00000000de77d000 00000000de783000 1 00000000de783000 00000000de78b000 1 00000000de78b000 00000000de7a4000 1 00000000de7a4000 00000000de7b4000 1 00000000de7b4000 00000000de7c9000 1 00000000de7c9000 00000000de7e0000 1 00000000de7e0000 00000000deff9000 1 00000000deff9000 00000000df000000 1 0000000100000000 000000021f380000 2 00000000000a0000 0000000000100000 2 00000000df000000 00000000e0000000 2 00000000f8000000 00000000fc000000 2 00000000fd000000 0000000100000000

4 years agoos(1): add c implementation of inferno os command and cmd(3) device manpages
cinap_lenrek [Sat, 30 Nov 2019 19:10:08 +0000 (20:10 +0100)]
os(1): add c implementation of inferno os command and cmd(3) device manpages

this is a reimplementation of infernos os(1) command, which
allows running commands in the underhying host operating
system when inferno runs in hosted mode (emu). but unlike
inferno, we want to use it to run commands on the client
side of a inferno or drawterm session from the plan9 cpu
server, so it defaults to /mnt/term/cmd for the mountpoint.

4 years agosd53c8xx: fix the driver for amd64, fix alignment/padding issues, fix freechain handling
cinap_lenrek [Sun, 24 Nov 2019 20:56:54 +0000 (21:56 +0100)]
sd53c8xx: fix the driver for amd64, fix alignment/padding issues, fix freechain handling

4 years agoupas/fs: remove useless loop in rf822()
cinap_lenrek [Sun, 24 Nov 2019 02:46:53 +0000 (03:46 +0100)]
upas/fs: remove useless loop in rf822()

4 years agofix ref822 again: remove uniqarray(), fix case with many entries in 'n'.
Ori Bernstein [Sat, 23 Nov 2019 16:23:21 +0000 (08:23 -0800)]
fix ref822 again: remove uniqarray(), fix case with many entries in 'n'.

4 years agoupas/marshal: fix printinreplyto function
Alex Musolino [Fri, 22 Nov 2019 06:59:35 +0000 (17:29 +1030)]
upas/marshal: fix printinreplyto function

According to RFC822, the message identifier (msg-id) in a
"In-Reply-To" header must start with a '<' and end with a '>'.