Commit graph

6986 commits

Author SHA1 Message Date
Ori Bernstein 8ce18a6338 fix double free in acme.
in acmerrorproc():
		sendp(s);
		free(s);

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

	We only want waitthread to free.
2020-01-31 09:25:39 -08:00
rgl efd4eb8933 document common emulator keys 2020-01-29 19:27:07 +01:00
BurnZeZ 2c0ccff286 walk: add D and T fmt characters (fileserver device/type) 2020-01-28 01:27:41 +00:00
BurnZeZ 0f1b442bc0 walk(1): formatting/corrections 2020-01-28 00:53:58 +00:00
BurnZeZ 7facfb5548 walk: remove superfluous newline 2020-01-28 00:44:44 +00:00
cinap_lenrek 023d957e6b kernel: restore old behaviour that kprocs have ther noteid == pid 2020-01-27 02:17:14 +01:00
cinap_lenrek 46a733c328 kernel: fix mistake from previous commit (noteid not being inherited by default) 2020-01-27 01:51:35 +01:00
cinap_lenrek 8d51e7fa1a 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.
2020-01-26 19:01:36 +01:00
cinap_lenrek 60bb408acc ppc: remove old duplicate of devtls.c 2020-01-25 18:37:28 +01:00
aiju 6f80913ac7 add v8e 2020-01-22 13:09:09 +00:00
Alex Musolino 1ecdf09aee page(1): fix troff manual example 2020-01-20 14:59:04 +10:30
cinap_lenrek 09eac381e5 merge 2020-01-19 19:21:10 +01:00
Roberto E. Vargas Caballero 47bae09b33 Apply http://www.9paste.net/qrstuv/patch/acme-movetodelmesg/ 2020-01-19 19:18:12 +01:00
cinap_lenrek 16f11e4cd6 merge 2020-01-19 18:45:04 +01:00
cinap_lenrek a898d31f76 acme: fix off by one in colclose(), make dellist() code consistent 2020-01-19 18:43:51 +01:00
Roberto E. Vargas Caballero b099753597 acme: Restore call to movetodel() in colclose 2020-01-19 18:36:50 +01:00
aiju 639500b748 cycv: support for registers 2020-01-13 23:22:35 +00:00
aiju 561346d07f cyclone v kernel: fpga support, fix CONFADDR 2020-01-12 03:40:42 +00:00
cinap_lenrek 7cf8369411 vnc/devdraw: fix topnwindows() panic when images are not windows (thanks aiju)
see changeset 319be6cfe7ef
2020-01-12 00:19:39 +01:00
cinap_lenrek 16784a2e45 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);
}
2020-01-12 00:07:27 +01:00
cinap_lenrek 5254e41f6b pc64: adapt vgaradeon driver to 64-bit (thanks Robert Ransom)
Not yet tested.
2020-01-11 23:31:54 +01:00
cinap_lenrek 361b65e4df 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.
2020-01-11 21:26:42 +01:00
cinap_lenrek dfda1cc878 bootrc: fix comment typo (thanks Robert Ransom) 2020-01-11 21:25:05 +01:00
cinap_lenrek 0b12020f10 ip/cifsd: implement SMB_SET_FILE_UNIX_BASIC for wstat 2020-01-11 14:50:52 +01:00
Sigrid e55ee7fafd libFLAC: 1.3.1 -> 1.3.3 2020-01-11 13:25:02 +01:00
aiju ffd9c39d1c dont spin on MDIO 2020-01-10 20:43:24 +00:00
aiju 9ab87f6241 merge 2020-01-10 18:49:39 +00:00
aiju d64f76c96c add cycv ethernet driver 2020-01-10 18:49:33 +00:00
Ori Bernstein 8150f68995 show line numbers in dtracy type errors 2020-01-09 11:59:44 -08:00
aiju 17ebe55031 add cycv kernel 2020-01-08 02:35:01 +00:00
aiju 826c76f90d dumb bug 2020-01-08 02:27:09 +00:00
aiju 76ed5d2e4b add aux/aout2uimage 2020-01-08 02:22:20 +00:00
cinap_lenrek f12744b5db 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).
2020-01-05 18:20:47 +01:00
rgl 645b5f8724 /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.
2020-01-04 18:02:54 +01:00
cinap_lenrek c739f57ac2 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.
2020-01-04 11:49:50 +01:00
23hiro 4eee8f13cf rio, kbdfs: increase read buffer for high latency kbdfs support 2019-12-23 01:31:30 +01:00
cinap_lenrek 95c166fc35 9p(2): fix sentence for wstat function (thanks jsmoody) 2019-12-21 15:31:10 +01:00
rgl d00b2c8466 sleep(9): recover comment with the right reference 2019-12-20 23:15:07 +01:00
rgl 6cf9fb7b80 kproc(9) and sleep(9) corrections 2019-12-20 18:01:43 +01:00
Alex Musolino 0bc963f928 thread(2): fix description of when/why procexec(l) functions return 2019-12-19 17:12:15 +10:30
Alex Musolino 8fa9b7d6ff pc, pc64: fix cputemp decimal handling in amd10temprd (thanks Robert Ransom) 2019-12-19 15:19:02 +10:30
Alex Musolino 47c188c0c6 flate(2): fix typos (thanks rgl) 2019-12-18 09:01:38 +10:30
cinap_lenrek b820d892a6 ip(3): document special null-address hack for accepting all incoming connections 2019-12-15 13:59:08 +01:00
cinap_lenrek c3af90c6c7 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.
2019-12-14 17:09:14 +01:00
Ori Bernstein 685670b0dd normalize error messages in yacc, stop writing to closed fd. 2019-12-11 23:26:15 -08:00
cinap_lenrek 80ecdec0ec merge 2019-12-11 23:53:10 +01:00
cinap_lenrek 52e4e51b50 devcons: fix write length of writebintime() (thanks BurnZeZ) 2019-12-11 23:52:05 +01:00
Ori Bernstein 375d8f4370 remove unused code. 2019-12-10 23:13:25 -08:00
Ori Bernstein b038443959 only ensurecache() on doplumb(). 2019-12-10 23:01:06 -08:00
Ori Bernstein 993c7b5fdf merge 2019-12-10 18:21:05 -08:00
Alex Musolino 0f18938914 crop(1): remove duplicate -b option in synopsis 2019-12-10 15:13:44 +10:30
Ori Bernstein f7431283d9 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.
2019-12-09 12:46:27 -08:00
cinap_lenrek 55af35eeeb 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.
2019-12-09 18:08:02 +01:00
cinap_lenrek 57dbe35fb6 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.
2019-12-09 17:44:28 +01:00
cinap_lenrek 1bfde84148 merge 2019-12-09 02:03:10 +01:00
cinap_lenrek 28d864953c hgfs: fix loadrevinfo() breakage on long lines using libbio (thanks deuterion) 2019-12-09 02:01:12 +01:00
Ori Bernstein 2b67ee6312 hack around timezone issues. 2019-12-08 11:58:52 -08:00
Ori Bernstein 36af840552 merge 2019-12-08 11:58:19 -08:00
Ori Bernstein 02e6003fc8 fix filetype detecton by suffix so that multiple dots dont confuse it. (thanks kvik) 2019-12-08 11:54:59 -08:00
cinap_lenrek 13785bbbef 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.
2019-12-07 02:19:14 +01:00
cinap_lenrek 28836f3ff5 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.
2019-12-07 02:13:51 +01:00
Ori Bernstein 480d7b8f5f fix some acme memory leaks
(imported from plan9port 7ca1c90109e17dced4b38fbaadea9d2cf39871b7,
some tag restoration lines not relevant.)
2019-12-06 12:08:00 -08:00
Ori Bernstein 450ec696ee 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)
2019-12-06 11:53:44 -08:00
Ori Bernstein 4ff82fe7a8 delete obsolete comments (replies are flagged elsewhere) 2019-12-05 00:16:15 -08:00
cinap_lenrek f9f13bbd0e merge 2019-12-04 22:04:12 +01:00
cinap_lenrek f48f1a324a 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.
2019-12-04 22:02:51 +01:00
cinap_lenrek c9570c14af 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.
2019-12-04 21:56:13 +01:00
Ori Bernstein 7c55ca5fff 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)
2019-12-04 12:55:03 -08:00
Ori Bernstein 2b5db0d9d4 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)
2019-12-04 12:37:07 -08:00
Ori Bernstein a181f3dd3e acme, sam: handle >1GB files correctly
imported from plan9port, edfe3c016fe6ef10c55f7a17aab668214ec21efc
2019-12-04 11:46:42 -08:00
cinap_lenrek f7db45e628 merge 2019-12-03 20:57:01 +01:00
cinap_lenrek a23b88dc26 cmd(3): fix typo, Close -> Closed (thanks kivik) 2019-12-03 20:55:57 +01:00
Alex Musolino a733f4caa3 rio(4): fix bad cross-reference format 2019-12-03 18:32:30 +10:30
Alex Musolino aa9b6d3597 seconds(1): add SOURCE section 2019-12-03 18:25:24 +10:30
cinap_lenrek 1eca33b48c always zero initialize Tm structure for tm2sec() 2019-12-03 08:22:02 +01:00
Ori Bernstein e624b7ffb8 Remove reply print. 2019-12-02 14:50:53 -08:00
cinap_lenrek 8a0cefb237 merge 2019-12-02 23:33:29 +01:00
cinap_lenrek 5d59a44c21 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.
2019-12-02 23:32:24 +01:00
Ori Bernstein 6a3f1f1bca remove debug print 2019-12-02 13:56:15 -08:00
Ori Bernstein b2526c7d90 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.
2019-12-02 13:53:57 -08:00
Sigrid b62fda7bd1 os(1): fix a typo 2019-12-02 17:55:53 +02:00
cinap_lenrek a815273960 merge 2019-12-02 08:27:49 +01:00
cinap_lenrek d80826d6e5 vgai81x: remove unused mach0 variable 2019-12-02 08:26:34 +01:00
cinap_lenrek a9be1374a0 pc: fix ldt memory leak in procsetup() 2019-12-02 07:43:45 +01:00
cinap_lenrek 70498378cf kernel: add missing FPillegal definition for kw and omap kernels 2019-12-02 07:35:25 +01:00
Ori Bernstein 3681c836ca fix typo: we don't have cache insurance. 2019-12-01 17:24:02 -08:00
Ori Bernstein 3889b249d4 show and update flags in acme mail
now, it's possible to tell whether you've read or replied
to a message.
2019-12-01 17:14:13 -08:00
Ori Bernstein 84c4c81cee 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.
2019-12-01 17:12:19 -08:00
cinap_lenrek 08d6b0f043 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
2019-12-01 17:57:14 +01:00
cinap_lenrek 21a599743e 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
2019-12-01 14:06:30 +01:00
cinap_lenrek 2359389570 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.
2019-11-30 20:10:08 +01:00
cinap_lenrek d32e5d130c sd53c8xx: fix the driver for amd64, fix alignment/padding issues, fix freechain handling 2019-11-24 21:56:54 +01:00
cinap_lenrek 87c8fa5415 upas/fs: remove useless loop in rf822() 2019-11-24 03:46:53 +01:00
Ori Bernstein 6c2017f6a6 fix ref822 again: remove uniqarray(), fix case with many entries in 'n'. 2019-11-23 08:23:21 -08:00
Alex Musolino cac853084c 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 '>'.
2019-11-22 17:29:35 +10:30
Ori Bernstein 543c35deba fix ref882 reference parsing.
we were getting nils in the list when there were many references.
this fixes and simplifies the copying loop and makes the code rhyme.
2019-11-21 17:17:54 -08:00
Ori Bernstein 4cef9b12fd show urls in html messages.
sometimes, I get phishing emails with links that I have an unstoppable
urge to click.
2019-11-21 10:48:13 -08:00
BurnZeZ 29b6ad3330 grep: error if sbrk fails 2019-11-21 16:44:41 +00:00
Ori Bernstein 5510488879 merge 2019-11-20 16:12:21 -08:00
Ori Bernstein 0ff4099a60 improve language in delay(9)
give the reader enough context to know when to use and not
use the delay family of functions.
2019-11-20 16:05:52 -08:00
cinap_lenrek 07e3d1c254 merge 2019-11-21 00:40:15 +01:00
cinap_lenrek 8e20bc7515 vac(1): assimilate manpage additions from plan9port and complete usage lines (thanks joe9)
the usage lines in vac where out of sync with the implementation
and the manpages.

document the -a and -x options, from:

https://github.com/9fans/plan9port/blob/master/man/man1/vac.1
2019-11-21 00:39:07 +01:00
Alex Musolino 48a804e3fd mail(1): fix typo 2019-11-20 17:46:29 +10:30
Ori Bernstein eca7cac908 merge 2019-11-19 12:31:42 -08:00
Ori Bernstein 0b6f0c70db add start of section 9 manpages (thanks rgl)
this change adds some of the kernel manpages from 9legacy,
fixed and updated to match the changes in 9front.
2019-11-19 12:30:40 -08:00
cinap_lenrek 2c9e3861a5 rio: fix cons read breakage from previous commit 2019-11-19 09:03:45 +01:00
Alex Musolino 37d6ddd8f3 rio(4): update description of wctl file format
State strings are now padded to 12-characters.  Remove ambiguous
reference to "12-character style", instead referring the reader to
image(6).
2019-11-19 12:43:53 +10:30
Alex Musolino 59115ba407 rio: pad window status strings in wctl files
This makes it possible to read the entire initial contents of the wctl
files without blocking.
2019-11-19 12:40:53 +10:30
Alex Musolino 4d4107b385 rio: fix bug causing short reads of wctl files
Previously, reads of wctl files would return one byte less than
requested as the returned string must be null terminated.  Now we pass
the actual size of the allocated buffer to the handler, which is large
enough to accommodate a trailing partial rune and terminating null
byte.
2019-11-19 12:38:13 +10:30
Ori Bernstein f32148b290 document 'T' flag misbehavior (thanks rgl) 2019-11-18 01:06:02 -08:00
Ori Bernstein b2e29cf315 Specifiy the restrictions on 9boot file names more clearly. 2019-11-17 16:17:15 -08:00
Ori Bernstein 3e1a75d08f Document 9bootfat limitation. 2019-11-17 16:08:48 -08:00
cinap_lenrek 44615fba43 sdiahci: implement reset timeout for ahciencreset(), make blink() never block, fix map[] access in ledkproc()
Ori_B reports that his controller gets stuck in the ahciencreset()
wait loop. so we implement a 1000 ms timeout. we replace delay()
with esleep() as we are always called from the ledkproc().

blink() could enter infinite delay loop as well, so instead of
waiting for the message to get transmitted we exit making it
non-blocking (we will get called again anyway).

the access to the controller map[] was wrong in ledkproc(). the
index is the controller number, not the drive number!
2019-11-17 21:19:55 +01:00
cinap_lenrek 521a0b336c bootrc: for wireless netbooting, set the WPA/WPA2 preshard key with wpapsk=password boot parameter
this allows automatic netbooting without password prompt
for the wirelss network.
2019-11-17 19:04:38 +01:00
Ori Bernstein b31e965ea3 Parse global pax header in the right place. 2019-11-15 13:26:25 -08:00
Ori Bernstein a68bee44d3 Add pax extended header support to tar.
Support for 'path=', 'uname=', 'gname=', 'size=', and 'atime=' pax
headers is useful.  Others are ignored, possibly with a warning.

We were running into missing support with the 'go' extraction.

At the same time, this cleans up the way that we handle paths,
getting rid of static buffers with hidden space at the front.
2019-11-14 13:52:41 -08:00
Ori Bernstein 4dab28b14f thread(2): fix manpage typos (thanks rgl) 2019-11-12 13:01:38 -08:00
Ori Bernstein 52e92163a6 draw(2): fix manpage typo (thanks rgl) 2019-11-11 13:35:47 -08:00
cinap_lenrek b638c7753d devip: use the routing table for local source ip address selection
when making outgoing connections, the source ip was selected
by just iterating from the first to the last interface and
trying each local address until a route was found. the result
was kind of hard to predict as it depends on the interface
order.

this change replaces the algorithm with the route lookup algorithm
that we already have which takes more specific desination and
source prefixes into account. so the order of interfaces does
not matter anymore.
2019-11-10 19:50:46 +01:00
Ori Bernstein d72a404399 Fix directory heuristic for long file names.
Tar specifies that a filename ending with '/' is a directory. We were
incorrectly looking at the short name. This meant that when we have long
filenames with a '/' at the 100th character, we would decide it was a
directory.

This change uses the long name when deciding the size for extraction,
and trusts the header size when just skipping forward in the stream.
2019-11-05 10:48:51 -08:00
cinap_lenrek 8b79ad59f1 games/turtle: do exit instead of crash in redraw() when there where no lines drawn 2019-11-03 15:20:57 +01:00
aiju 528936156f add games/linden and turtle to mkfile 2019-11-03 13:54:26 +00:00
aiju ae61eb9381 add games/linden and games/turtle 2019-11-03 13:49:23 +00:00
cinap_lenrek 37827f533b tar: fix memory corruption in extract1 (thanks petter)
extract1() expects two extra bytes to be avilabe before
fname buffer so it can prepend ./ before the name. this
used to be the case with name(), but was violated when
long name support was added and getname() was used in
place of name() which did not reserve the 2 extra bytes.

this change reserves two extra bytes in the getname()'s
static buffer and also removes the extra copy as name()
already makes a copy.
2019-11-02 14:17:34 +01:00
cinap_lenrek 638f860791 upasfs(4): fix manpage typo (thanks rgl) 2019-11-02 12:52:39 +01:00
Alex Musolino 7fbd3fd4fe file: add (very) basic support for detecting mpeg4 formats 2019-11-01 12:05:11 +10:30
Alex Musolino 06786f2a71 upas/fs: fix handling of numeric timezone offsets in strtotm
Since numeric timezone offsets are relative to GMT, initialise zone to
GMT so tm2sec(2) does not assume local time.

Note that if strtotm encounters a timezone *string* and consequently
overwrites zone then we will end up in the same mess since tm2sec(2)
only deals with GMT or local time.
2019-10-31 09:41:03 +10:30
Ori Bernstein 6c43477492 Check if 'm' is null when updating messages. 2019-10-28 14:12:44 -07:00
cinap_lenrek 82d04a4e63 bcm: fix software cursor avoidance for loadimage() case (thanks bitmapper) 2019-10-27 23:51:11 +01:00
cinap_lenrek ff44b92c96 ip/dhcpd: prevent client from increasing max reply size beyond the reply buffer capacity 2019-10-22 06:53:50 +02:00
Ori Bernstein 9314883aff Make ctrl+g focus text windows and cycle zeroxed copies (thanks kvik) 2019-10-21 15:29:07 -07:00
Alex Musolino 7682a24bc5 /sys/lib/plumb/basic: open nedmail windows with -noscroll
This preserves the desired behaviour of *not* scrolling to the bottom
of plumbed messages even when rio(1) is invoked with the -s flag.
2019-10-22 08:18:20 +10:30
cinap_lenrek e168ea045f ndb/dns: handle empty $DNSSERVER
when $DNSSERVER is empty, query ndb for local dns servers
instead of not using any at all.
2019-10-13 09:02:04 +02:00
Roberto E. Vargas Caballero c0280c607f backup: Set execution bits in backup scripts 2019-10-13 10:20:10 +02:00
cinap_lenrek e38f75fc45 ether82563: fix multicast for i210
MTA has 128 entries, according to section 8.10.15 in the datasheet.
this fixes ipv6 in apu2 which has 3x i210 (8086/157b).
2019-10-11 21:38:12 +02:00
Ori Bernstein 7367b8d2e7 Fetch IMAP flags from server. This makes us sync read/answered/... flags with unix. 2019-10-10 11:52:22 -07:00
Ori Bernstein e3a43c4f2b awk: make empty FS unicodely-correct. 2019-10-09 17:36:02 -07:00
cinap_lenrek db911d4fef sdiahci: force Hudson SATA Controller to AHCI mode 2019-10-08 13:53:57 +02:00
cinap_lenrek 6716e9ba20 sshfs: fix dir2attrib() memory leak in wstat error case (thanks BurnZeZ) 2019-10-07 12:51:21 +02:00
cinap_lenrek f763dc1640 sshfs: fix race condition between sendproc() and recvproc()
there was a race between the sendproc putting the request on
the sreqrd[] id and the recvproc handling the response, and
potentially freeing the request before the sendproc() was
finished with the request (or the fid).

so we defer allocating a request id and putting it on the
sreqrd[] stage after we have completely generated the
request in vpack(). this prevents the handling of the request
before it is even sent.

this also means that the SReq should not be touched after
calling sendpkt(), submitreq(), submitsreq().

secondly, putsfid() needs to acquire the RWLock to make sure
sendproc() is finished with the request. the scenario is that
recvproc() can call respond() on the request before sendproc()
has unlocked the SFid.
2019-10-07 11:52:14 +02:00
cinap_lenrek af23bb343a cwfs: fix listen filedescriptor leaks 2019-10-04 18:54:01 +02:00
cinap_lenrek dea2905783 lib9p: fix listensrv() filedescriptor leaks 2019-10-04 18:52:53 +02:00
cinap_lenrek 2401794cff sshfs: use threadexits() instead of exits() 2019-10-04 18:51:44 +02:00
cinap_lenrek ff16079e49 upas/fs: speedup mtree and henter()
move digest pointer into Mtree structrue and embed it into Idx struct
(which is embedded in Message) to avoid one level of indirection
during mtreecmp().

get rid of mtreeisdup(). instead we have mtreeadd() return the old
message in case of a collision. this avoids double lookup.

increase the hash table size for henter() and make it a prime.
2019-10-03 15:49:53 +02:00
cinap_lenrek c0f464b98f pc: move low-level allocation details out of mmu.c into memory.c rampage() function 2019-10-02 01:01:34 +02:00
cinap_lenrek 0ee738ef8c vgai81x: use vmap() for uncached access to cursor data instead of manipulating kernel page table
on 386, the kernel memory region is mapped using huge 4MB pages
(when supported by the cpu). so the uncached pte manipulation
does not work to map the cursor data with uncached attribute.

instead, we allocate a memory page using newpage() and map
it globally using vmap(), which maps it uncached.
2019-10-02 00:58:46 +02:00
cinap_lenrek d15008fdef ape/cc: add spim 2019-09-22 20:35:16 +02:00
cinap_lenrek d559cd005c 2c(1): document 7c (arm64) 2019-09-22 19:09:25 +02:00
cinap_lenrek 490c3d87cb usbxhci: fix endpoint stall recovery, handle Ep.clrhalt flag
after issuing CR_RESETEP command, we have to invalidate
the endpoints output context buffer so that the halted/error
status reflects the new state. not doing so resulted in
the halted state to be stuck and we continued issuing
endpoint reset commands when we where already recovered.

handle the devusb Ep.clrhalt flag from devusb that userspace
uses to force a endpoint reset on the next transaction.
2019-09-22 18:51:41 +02:00
cinap_lenrek 71a1d11a81 cmd/ip/*: chown the network connection after authentication
for servers that handle incoming network connections and authentication,
change the owner of the network connection file to the authenticated user
after successfull authentication.

note that we set the permissions as well to 0660 because old devip used
to unconditionally set the bits.
2019-09-21 23:36:44 +02:00