]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
3 years agovmx: clean up mksegment, memset only if segment existed (devsegment clears new ones)
Sigrid [Thu, 10 Dec 2020 11:19:45 +0000 (12:19 +0100)]
vmx: clean up mksegment, memset only if segment existed (devsegment clears new ones)

3 years agosrc: work on awk scripts too, see "src valley" (thanks phil9)
Sigrid [Thu, 10 Dec 2020 09:33:42 +0000 (10:33 +0100)]
src: work on awk scripts too, see "src valley" (thanks phil9)

3 years agopc, pc64: work around bhyve all uncached MTRR's
cinap_lenrek [Thu, 10 Dec 2020 00:47:19 +0000 (01:47 +0100)]
pc, pc64: work around bhyve all uncached MTRR's

3 years agomerge
cinap_lenrek [Wed, 9 Dec 2020 00:05:14 +0000 (01:05 +0100)]
merge

3 years agobackout OCEXEC changes when potentially opening /srv files
cinap_lenrek [Wed, 9 Dec 2020 00:04:03 +0000 (01:04 +0100)]
backout OCEXEC changes when potentially opening /srv files

Opening a /srv file sets the close-on-exec flag on the
shared channel breaking the exportfs openmount() hack.

The devsrv tries to prevent posting a channel with the
close-on-exec or remove-on-close flags. but nothing
currently prevents this poisoning on open.

Until this gets fixed in eigther exportfs or devsrv,
i'll back out the changes that could have potential side
effects like this.

3 years agosega(1): fix keys (thanks bigato)
kvik [Tue, 8 Dec 2020 20:20:13 +0000 (21:20 +0100)]
sega(1): fix keys (thanks bigato)

3 years agoplan9.ini(8): document *nomtrr= and order the table
cinap_lenrek [Tue, 8 Dec 2020 16:16:12 +0000 (17:16 +0100)]
plan9.ini(8): document *nomtrr= and order the table

3 years agopc, pc64: cleanup cpuidentify() and some comments
cinap_lenrek [Tue, 8 Dec 2020 15:58:41 +0000 (16:58 +0100)]
pc, pc64: cleanup cpuidentify() and some comments

3 years agopc, pc64: add *nomtrr= kernel parameter
cinap_lenrek [Tue, 8 Dec 2020 15:34:36 +0000 (16:34 +0100)]
pc, pc64: add *nomtrr= kernel parameter

3 years agopc64: preserve reserved bits in CR0/CR4 for amd64 in mtrr setstate()
cinap_lenrek [Tue, 8 Dec 2020 15:00:57 +0000 (16:00 +0100)]
pc64: preserve reserved bits in CR0/CR4 for amd64 in mtrr setstate()

On AMD64, CR0/CR4 are 64-bit registers, with
the upper half reserved. So use uintptr type
to store the register values to get 32 bit on 386
and 64 bit on AMD64.

3 years agovncv: backing out previous change, this needs another revision
cinap_lenrek [Tue, 8 Dec 2020 14:15:13 +0000 (15:15 +0100)]
vncv: backing out previous change, this needs another revision

3 years agovncv: do NOT map Kaltgr to meta, introduce Mod4 (Super) as an extra key to use instead
Sigrid [Tue, 8 Dec 2020 13:32:28 +0000 (14:32 +0100)]
vncv: do NOT map Kaltgr to meta, introduce Mod4 (Super) as an extra key to use instead

3 years agovmx(1): build vmxgdb by default, clean it up as well
Sigrid [Tue, 8 Dec 2020 12:18:10 +0000 (13:18 +0100)]
vmx(1): build vmxgdb by default, clean it up as well

3 years agovmx: nanosec(): fix non-interruptable temporary, assign fasthz only once after xstart
cinap_lenrek [Tue, 8 Dec 2020 12:04:52 +0000 (13:04 +0100)]
vmx: nanosec(): fix non-interruptable temporary, assign fasthz only once after xstart

3 years agopc: move ldmxcsr() prototype to fpu.c
cinap_lenrek [Tue, 8 Dec 2020 11:42:36 +0000 (12:42 +0100)]
pc: move ldmxcsr() prototype to fpu.c

3 years agovmx: add fmt checking, fix fmt errors, remove duplication for vmdebug
cinap_lenrek [Tue, 8 Dec 2020 11:40:28 +0000 (12:40 +0100)]
vmx: add fmt checking, fix fmt errors, remove duplication for vmdebug

3 years agonusb/kb: update button state if event was actually received, fix typos (thanks umbrat...
Sigrid [Tue, 8 Dec 2020 10:47:15 +0000 (11:47 +0100)]
nusb/kb: update button state if event was actually received, fix typos (thanks umbraticus)

3 years agodevmouse: remove redundant check
Sigrid [Tue, 8 Dec 2020 10:21:18 +0000 (11:21 +0100)]
devmouse: remove redundant check

3 years agomouse(3): blankS, setS to follow the convention (thanks umbraticus)
Sigrid [Tue, 8 Dec 2020 09:34:10 +0000 (10:34 +0100)]
mouse(3): blankS, setS to follow the convention (thanks umbraticus)

3 years agomouse(3): document "scrollswap" ctl message, fix style a bit (thanks umbraticus)
Sigrid [Tue, 8 Dec 2020 09:21:17 +0000 (10:21 +0100)]
mouse(3): document "scrollswap" ctl message, fix style a bit (thanks umbraticus)

3 years agovesa: make unsupported function not an error, set return status
Sigrid [Tue, 8 Dec 2020 09:08:49 +0000 (10:08 +0100)]
vesa: make unsupported function not an error, set return status

3 years agovmx: add -D option to enable debug messages, use vmdebug for non-fatal "errors"
Sigrid [Tue, 8 Dec 2020 09:01:44 +0000 (10:01 +0100)]
vmx: add -D option to enable debug messages, use vmdebug for non-fatal "errors"

3 years agovmx: add -v|-w flag to control window creation behaviour
cinap_lenrek [Mon, 7 Dec 2020 17:59:54 +0000 (18:59 +0100)]
vmx: add -v|-w flag to control window creation behaviour

The -v flag now does not create a new rio window,
while -w flag does (restores the old behaviour).

This allows vmx to run under vncs and is in general
mode aligned to other emulators and programs.

3 years agolibcomplete: open internal file-descriptor with OCEXEC flag
cinap_lenrek [Mon, 7 Dec 2020 16:18:33 +0000 (17:18 +0100)]
libcomplete: open internal file-descriptor with OCEXEC flag

3 years agolibsec: open internal file-descriptors with OCEXEC flag
cinap_lenrek [Mon, 7 Dec 2020 16:14:34 +0000 (17:14 +0100)]
libsec: open internal file-descriptors with OCEXEC flag

3 years agomerge
cinap_lenrek [Mon, 7 Dec 2020 15:48:19 +0000 (16:48 +0100)]
merge

3 years agolibauthsrv: open internal file-descriptors with OCEXEC flag
cinap_lenrek [Mon, 7 Dec 2020 15:47:06 +0000 (16:47 +0100)]
libauthsrv: open internal file-descriptors with OCEXEC flag

3 years agolibauth: open internal file-descriptors with OCEXEC flag
cinap_lenrek [Mon, 7 Dec 2020 15:46:34 +0000 (16:46 +0100)]
libauth: open internal file-descriptors with OCEXEC flag

3 years agoaux/kbdfs, kbmaps: enable Kmod4 for other layouts, not just neo2
Sigrid [Mon, 7 Dec 2020 15:42:56 +0000 (16:42 +0100)]
aux/kbdfs, kbmaps: enable Kmod4 for other layouts, not just neo2

3 years agolibdraw: open file-descriptor with OCEXEC flag in readcolmap()
cinap_lenrek [Mon, 7 Dec 2020 15:30:27 +0000 (16:30 +0100)]
libdraw: open file-descriptor with OCEXEC flag in readcolmap()

3 years agolibndb: open internal file-descriptors with OCEXEC flag
cinap_lenrek [Mon, 7 Dec 2020 14:15:02 +0000 (15:15 +0100)]
libndb: open internal file-descriptors with OCEXEC flag

3 years agolib9p: open internal file-descriptor with OCEXEC flag in getremotesys()
cinap_lenrek [Mon, 7 Dec 2020 13:54:27 +0000 (14:54 +0100)]
lib9p: open internal file-descriptor with OCEXEC flag in getremotesys()

3 years agolib9p: open /mnt/factotum/rpc with OCEXEC flag in auth9p()
cinap_lenrek [Mon, 7 Dec 2020 13:51:53 +0000 (14:51 +0100)]
lib9p: open /mnt/factotum/rpc with OCEXEC flag in auth9p()

3 years agolib9p: improve reqqueuecreate()
cinap_lenrek [Mon, 7 Dec 2020 13:49:12 +0000 (14:49 +0100)]
lib9p: improve reqqueuecreate()

- open /proc/n/ctl with OCEXEC flag
- format pid as ulong
- don't leak the fd

3 years agomerge
cinap_lenrek [Mon, 7 Dec 2020 13:33:51 +0000 (14:33 +0100)]
merge

3 years agolibdraw: open internal file-descriptors with OCEXEC flag
cinap_lenrek [Mon, 7 Dec 2020 13:32:34 +0000 (14:32 +0100)]
libdraw: open internal file-descriptors with OCEXEC flag

3 years agolibdraw: remove unused Error label in freescreen()
cinap_lenrek [Mon, 7 Dec 2020 13:32:12 +0000 (14:32 +0100)]
libdraw: remove unused Error label in freescreen()

3 years agolibthread: reduce stack usage of threadkill*(), open /proc/n/ctl with OCEXEC flag
cinap_lenrek [Mon, 7 Dec 2020 13:31:02 +0000 (14:31 +0100)]
libthread: reduce stack usage of threadkill*(), open /proc/n/ctl with OCEXEC flag

3 years agolibthread: reduce stack usage for ioprocs, open /proc/n/ctl with OCEXEC flag
cinap_lenrek [Mon, 7 Dec 2020 13:29:45 +0000 (14:29 +0100)]
libthread: reduce stack usage for ioprocs, open /proc/n/ctl with OCEXEC flag

3 years agolibthread: simplify threadsetname()
cinap_lenrek [Mon, 7 Dec 2020 13:27:46 +0000 (14:27 +0100)]
libthread: simplify threadsetname()

- open /proc/n/args with OCEXEC flag
- reduce stack usage by using smaller buffer for path
- format pid as ulong

3 years agolibc: open internal file-descriptor with OCEXEC flag
cinap_lenrek [Mon, 7 Dec 2020 13:24:51 +0000 (14:24 +0100)]
libc: open internal file-descriptor with OCEXEC flag

3 years agorio: format pid's as ulongs
cinap_lenrek [Mon, 7 Dec 2020 13:23:41 +0000 (14:23 +0100)]
rio: format pid's as ulongs

3 years agorio: open /dev/snarf with OCEXEC flag when writing
cinap_lenrek [Mon, 7 Dec 2020 13:23:23 +0000 (14:23 +0100)]
rio: open /dev/snarf with OCEXEC flag when writing

3 years agorio: simplify filsysinit() by using getuser(), format pid's as ulongs
cinap_lenrek [Mon, 7 Dec 2020 13:22:30 +0000 (14:22 +0100)]
rio: simplify filsysinit() by using getuser(), format pid's as ulongs

3 years agolibndb: remove db file size limit
kvik [Sun, 6 Dec 2020 23:36:41 +0000 (00:36 +0100)]
libndb: remove db file size limit

Removes the 128 kB limit for files making up the database.
We used to skip over and complain about files that exceeded
the limit, forcing the user to generate hash files.

This caused things to inexplicably stop working after a file
hit the hidden limit, which is unreasonable behaviour considering
that libndb happily, albeit slowly, works with bigger files.

3 years agomerge
cinap_lenrek [Sun, 6 Dec 2020 21:06:32 +0000 (22:06 +0100)]
merge

3 years agopc64: assign fpsave/fprestore only once in fpuinit()
cinap_lenrek [Sun, 6 Dec 2020 21:05:00 +0000 (22:05 +0100)]
pc64: assign fpsave/fprestore only once in fpuinit()

3 years agoptrap: implement filtering on plumb attributes
kvik [Sun, 6 Dec 2020 20:52:01 +0000 (21:52 +0100)]
ptrap: implement filtering on plumb attributes

3 years agopc64: AMD64 mandates SSE support, remove the check in fpuinit()
cinap_lenrek [Sun, 6 Dec 2020 20:44:26 +0000 (21:44 +0100)]
pc64: AMD64 mandates SSE support, remove the check in fpuinit()

3 years agoxen: use pc/fpu.c
cinap_lenrek [Sun, 6 Dec 2020 20:28:11 +0000 (21:28 +0100)]
xen: use pc/fpu.c

3 years agopc, pc64: move all fpu specific code from main.c to fpu.c
cinap_lenrek [Sun, 6 Dec 2020 20:07:30 +0000 (21:07 +0100)]
pc, pc64: move all fpu specific code from main.c to fpu.c

3 years agoxen: fix for the last avx changes
Sigrid [Sun, 6 Dec 2020 19:28:53 +0000 (20:28 +0100)]
xen: fix for the last avx changes

3 years agoamd64: FP: back to static size for allocation and copying
Sigrid [Sun, 6 Dec 2020 18:40:57 +0000 (19:40 +0100)]
amd64: FP: back to static size for allocation and copying

3 years agoamd64: FP: always use enough to fit AVX state and align to 64 bytes
Sigrid [Sun, 6 Dec 2020 18:31:56 +0000 (19:31 +0100)]
amd64: FP: always use enough to fit AVX state and align to 64 bytes

3 years agoamd64, vmx: support avx/avx2 for host/guest; use *noavx= in plan9.ini to disable
Sigrid [Sun, 6 Dec 2020 17:48:32 +0000 (18:48 +0100)]
amd64, vmx: support avx/avx2 for host/guest; use *noavx= in plan9.ini to disable

3 years agorio: undo previous commit, was a stupid idea
cinap_lenrek [Sun, 6 Dec 2020 14:08:23 +0000 (15:08 +0100)]
rio: undo previous commit, was a stupid idea

3 years agorio: give visual clue during sweep and bandsizing when window is too small
cinap_lenrek [Sun, 6 Dec 2020 13:50:50 +0000 (14:50 +0100)]
rio: give visual clue during sweep and bandsizing when window is too small

We color the window border with a dark red in case the
window is too small.

3 years agorio: use libdraw's badrect() to exclude some extreme cases in goodrect()
cinap_lenrek [Sun, 6 Dec 2020 13:44:23 +0000 (14:44 +0100)]
rio: use libdraw's badrect() to exclude some extreme cases in goodrect()

3 years agorio: rewrite better portion() function
cinap_lenrek [Sun, 6 Dec 2020 12:20:29 +0000 (13:20 +0100)]
rio: rewrite better portion() function

3 years agorio: handle corner selection for resizing better (thanks cinap)
Sigrid [Sun, 6 Dec 2020 12:04:36 +0000 (13:04 +0100)]
rio: handle corner selection for resizing better (thanks cinap)

3 years agorio: goodrect: clarify minimal height and actually use the smallest reasonable value
Sigrid [Sun, 6 Dec 2020 12:02:33 +0000 (13:02 +0100)]
rio: goodrect: clarify minimal height and actually use the smallest reasonable value

3 years agorio: allow windows as small as one line of text, still scrollable
Sigrid [Sun, 6 Dec 2020 11:17:05 +0000 (12:17 +0100)]
rio: allow windows as small as one line of text, still scrollable

3 years agoaux/status^(bar msg): few small fixes (thanks umbraticus)
Sigrid [Sun, 6 Dec 2020 10:55:27 +0000 (11:55 +0100)]
aux/status^(bar msg): few small fixes (thanks umbraticus)

3 years agocwfs: fix interpretation of startdump argument
Alex Musolino [Sun, 6 Dec 2020 03:24:10 +0000 (13:54 +1030)]
cwfs: fix interpretation of startdump argument

3 years agopc/dma, pc/sdide: use uintptr for physical address instead of ulong
cinap_lenrek [Sat, 5 Dec 2020 16:01:24 +0000 (17:01 +0100)]
pc/dma, pc/sdide: use uintptr for physical address instead of ulong

3 years agopc, pc64: allocate dma bounce buffer right after xinit()
cinap_lenrek [Sat, 5 Dec 2020 15:59:30 +0000 (16:59 +0100)]
pc, pc64: allocate dma bounce buffer right after xinit()

3 years agopc, pc64: exclude memory regions with unusual MTRR cache attributes
cinap_lenrek [Sat, 5 Dec 2020 15:57:12 +0000 (16:57 +0100)]
pc, pc64: exclude memory regions with unusual MTRR cache attributes

Use the MTRR registers to exclude memory ranges that
do not have the expected cache attributes:

RAM -> writeback
UMB -> uncached
UPA -> uncached

3 years agofaces: add -c option to remove faces with button 1 click (thanks sirjofri)
Sigrid [Fri, 4 Dec 2020 08:33:55 +0000 (09:33 +0100)]
faces: add -c option to remove faces with button 1 click (thanks sirjofri)

3 years agomerge
cinap_lenrek [Tue, 1 Dec 2020 23:57:21 +0000 (00:57 +0100)]
merge

3 years agolibdraw: do not force flushimage() on freescreen()
cinap_lenrek [Tue, 1 Dec 2020 23:56:21 +0000 (00:56 +0100)]
libdraw: do not force flushimage() on freescreen()

This causes visual flashes of white in rio. If it is
really needed (it is rare) it should be done by the caller.

3 years agorio: properly restore the windows contents on /dev/mouse close
cinap_lenrek [Tue, 1 Dec 2020 23:53:58 +0000 (00:53 +0100)]
rio: properly restore the windows contents on /dev/mouse close

The previous resize optimization now means that the wfill()
is skipped on resize for libdraw programs.

So do it once /dev/mouse is closed and the window processes
the Refresh message.

3 years ago/lib/keyboard: Anführungszeichen uten (danke sirjofri)
Sigrid [Tue, 1 Dec 2020 08:23:16 +0000 (09:23 +0100)]
/lib/keyboard: Anführungszeichen uten (danke sirjofri)

3 years ago/lib/keyboard: add fingers and more arrows (thanks umbraticus)
Sigrid [Tue, 1 Dec 2020 07:44:18 +0000 (08:44 +0100)]
/lib/keyboard: add fingers and more arrows (thanks umbraticus)

3 years agoproof: don't confuse ""(1) (thanks Stuart Morrow)
Ori Bernstein [Mon, 30 Nov 2020 21:13:49 +0000 (13:13 -0800)]
proof: don't confuse ""(1) (thanks Stuart Morrow)

"" looks for patterns in the form 'prompt;' or 'prompt%',
and gets confused when proof emits 'illegal;'. This change
replaces the ';' with a ':', which both matches other
conventional error outputs and prevents "" from getting
confused.

3 years agotmdate(2): remove lies
Ori Bernstein [Mon, 30 Nov 2020 15:41:49 +0000 (07:41 -0800)]
tmdate(2): remove lies

Initially the code tried to guess the date format. This
turned out to be a bit too magical, so the feature was
removed, but the manpage still documented the nonfeature.

3 years agorio: avoid redrawing window text on resize for programs using libdraw
cinap_lenrek [Sun, 29 Nov 2020 16:51:57 +0000 (17:51 +0100)]
rio: avoid redrawing window text on resize for programs using libdraw

As long as the client as the mouse file open
and maintains reading the winname file of the window
after a resize we will avoid drawing the text frame
on a resize as it will be overdrawn by the client.

This reduces flicker on resize somewhat for slow systems.

3 years agopc, pc64, xen: rewrite interrupt handling code
cinap_lenrek [Sun, 29 Nov 2020 16:43:22 +0000 (17:43 +0100)]
pc, pc64, xen: rewrite interrupt handling code

This implements proper intrdisable() support for all
interrupt controllers.

For enable, (*arch->intrassign)(Vctl*) fills in the
Vctl.enable and Vctl.disable pointers with the
appropriate routines and returns the assigned
vector number.

Once the Vctl struct has been linked to its vector
chain, Vctl.enable(Vctl*, shared) gets called with a
flag if the vector has been already enabled (shared).

This order is important here as enabling the interrupt
on the controller before we have linked the chain can
cause spurious interrupts, expecially on mp system
where the interrupt can target a different cpu than
the caller of intrenable().

The intrdisable() case is the other way around.
We first disable the interrupt on the controller
and after that unlink the Vctl from the chain.
On a multiprocessor, the xfree() of the Vctl struct
is delayed to avoid freeing it while it is still
in use by another cpu.

The xen port now also uses pc/irq.c which has been
made generic enougth to handle xen's irq scheme.
Also, archgeneric is now a separate file to avoid
pulling in dependencies from the 8259 interrupt
controller code.

3 years agogames/mix: fix decoding of shift instructions
Alex Musolino [Sat, 28 Nov 2020 12:33:44 +0000 (23:03 +1030)]
games/mix: fix decoding of shift instructions

3 years agogames/mix: fix SLAX and SRAX instructions (thanks nicolagi)
Alex Musolino [Sat, 28 Nov 2020 12:32:28 +0000 (23:02 +1030)]
games/mix: fix SLAX and SRAX instructions (thanks nicolagi)

MIX shift instructions shift by bytes not bits.

3 years agofplot: add hyperbolic functions
Sigrid [Fri, 27 Nov 2020 09:51:16 +0000 (10:51 +0100)]
fplot: add hyperbolic functions

3 years agofplot(1): use abs()
Sigrid [Fri, 27 Nov 2020 09:35:57 +0000 (10:35 +0100)]
fplot(1): use abs()

3 years agofplot: add abs
Sigrid [Fri, 27 Nov 2020 09:34:16 +0000 (10:34 +0100)]
fplot: add abs

3 years agomerge
Alex Musolino [Fri, 27 Nov 2020 00:58:25 +0000 (11:28 +1030)]
merge

3 years agogames/mix: fix implementation of MOVE instruction (thanks nicolagi)
Alex Musolino [Fri, 27 Nov 2020 00:49:49 +0000 (11:19 +1030)]
games/mix: fix implementation of MOVE instruction (thanks nicolagi)

Plan 9 memcpy(2) uses the same implementation as memmove(2) to handle
overlapping ranges.  Hovewer, the MIX MOVE instruction, as described
in TAOCP, specifically does not do this.  It copies words one at a
time starting from the lowest address.

This change also expands the address validation to check that all
addresses within the source and destination ranges are valid before
proceeding.

3 years agokbmap/neo2: add support for neo2 kbmak (thanks jstsmthrgk)
Ori Bernstein [Thu, 26 Nov 2020 19:18:41 +0000 (11:18 -0800)]
kbmap/neo2: add support for neo2 kbmak (thanks jstsmthrgk)

3 years agoupas: fix mk nuke
Alex Musolino [Wed, 25 Nov 2020 09:24:52 +0000 (19:54 +1030)]
upas: fix mk nuke

3 years agog: fix typo in last commit
Ori Bernstein [Mon, 23 Nov 2020 01:42:25 +0000 (17:42 -0800)]
g: fix typo in last commit

3 years agoupas/*: fix mkfile issues (thanks amavect)
Ori Bernstein [Sun, 22 Nov 2020 19:36:23 +0000 (11:36 -0800)]
upas/*: fix mkfile issues (thanks amavect)

Fixes 3 issues in our upas mkfiles:
- mk/mkfile and send/mkfile were rebuilding
  only the rfc822.tab.$O, even though the
  header also needed to be rebuilt.
- CLEANFILES had a pattern that  would not
  get expanded.
- Third, ../upas/mkfile was being included
  in the wrong place and making the wrong
  rule default.

3 years agopc, pc64: move common irq handling code out of trap.c
cinap_lenrek [Sun, 22 Nov 2020 16:44:21 +0000 (17:44 +0100)]
pc, pc64: move common irq handling code out of trap.c

Move the common irq handling code out of trap.c
into pc/irq.c so that it can be shared between 386
and amd64 ports.

3 years agog: filter directory arguments
Ori Bernstein [Sun, 22 Nov 2020 05:23:46 +0000 (21:23 -0800)]
g: filter directory arguments

When searching directories recursively, it's still
desirable to filter the contents by the file pattern,
so that 'g foo /sys/src' doesn't end up searching for
foo within .$O files.

Files passed explicitly are still searched, so for the
old behavior, just use walk:

g foo `{walk -f $dir}

3 years ago9boot(8): update manual to reflect efi loader search order changes
mischief [Sat, 21 Nov 2020 22:55:33 +0000 (14:55 -0800)]
9boot(8): update manual to reflect efi loader search order changes

the efi loader now looks for plan9.ini and the kernel in the ESP
first, before looking elsewhere.

3 years agoefi: prefer plan9.ini from ESP we loaded from
mischief [Sat, 21 Nov 2020 22:18:52 +0000 (14:18 -0800)]
efi: prefer plan9.ini from ESP we loaded from

currently the EFI loader's behavior is to search all disks in a
firmware-defined order.  we search the list returned by the firmware
in reverse order in the hopes of searching the first 9FAT instead of
the ESP, but this results in unintuitive behavior when there are
multiple FAT partitions (possibly in multiple disks), such as loading
a plan9.ini and kernel from a different disk than the one you executed
the EFI loader from.

to resolve this, we change the EFI loader to instead prefer read
plan9.ini and the kernel from the same disk as the EFI loader was read
from, and then fall back to the old behavior, since the old behavior
is relied on by current installations.

3 years agodc: fix crashes with : operator (thanks istvan bak)
Ori Bernstein [Sun, 22 Nov 2020 01:56:34 +0000 (17:56 -0800)]
dc: fix crashes with : operator (thanks istvan bak)

dc crashes because a Blk* sometimes ends getting double freed.
To make it crash, any of these lines will do:
(each line is a separate input to dc):

1 sa 2 :a le d sa v :a
1 sa 2 :a le d sa :a
1 sa 2 :a le d sa c

Fix by assigning p to sptr->val before EMTPY causes a jump.

Additionally, dcgetwd() can return 0. all other uses check for
0 ptr; Also fix a buffer overflow.

3 years agoupas: make 'all' the default target
Ori Bernstein [Sun, 22 Nov 2020 00:13:20 +0000 (16:13 -0800)]
upas: make 'all' the default target

When consolidating the duplicated targets, the
one that actually got built ended up arbitrary.
Put in a 'default' target that runs 'mk all'.

3 years agopc, pc64: fix grub multiboot
cinap_lenrek [Sat, 21 Nov 2020 22:15:19 +0000 (23:15 +0100)]
pc, pc64: fix grub multiboot

It appears that our IDT overlaps with the data structures
passed from grub in multiboot load.

So defer setup of the interrupt table after the multiboot
parameters have been processed.

3 years agomerge
cinap_lenrek [Sat, 21 Nov 2020 21:04:15 +0000 (22:04 +0100)]
merge

3 years agoether8169: fix interrupt panic before init, defer initialization until attach
cinap_lenrek [Sat, 21 Nov 2020 21:03:13 +0000 (22:03 +0100)]
ether8169: fix interrupt panic before init, defer initialization until attach

The driver used to register the interrupt handler just
after reset, tho the Ctlr struct, including the buffer
descriptor arrays where only allocated on attach.

This moves most of the reset/init out of pnp
function and into attach. This also means we can
error out and even retry on the next attach.

The logic of the reseter kproc has been changed:
now it is only started once the first initialization
completely succeeded. This avoids the strange qlock
passing.

Implement a shutdown function so the device gets
halted for /dev/reboot.

Assume 64 bit physical addresses for dma.

Check that pci bar0 is actually I/O.

3 years agopc, pc64: implement disabling of msi interrupts
cinap_lenrek [Sat, 21 Nov 2020 20:48:25 +0000 (21:48 +0100)]
pc, pc64: implement disabling of msi interrupts

3 years agonusb/kb, nusb/joy: dont try to set protocol on nonboot devices
mischief [Sat, 21 Nov 2020 20:31:54 +0000 (12:31 -0800)]
nusb/kb, nusb/joy: dont try to set protocol on nonboot devices

the hid 1.11 specification says that for hid devices which arent in
the boot subclass (subclass 1), it is only optional to support the set
protocol command.  for my devices, trying to set protocol results in a
stall error and unusable devices.

fixes my Tex Shinobi keyboard and Playstation 4 controller.

3 years agopc, pc64: new MTRR code supporting AMD TOM2 MSR and fixed mtrr ranges
cinap_lenrek [Sat, 21 Nov 2020 15:26:46 +0000 (16:26 +0100)]
pc, pc64: new MTRR code supporting AMD TOM2 MSR and fixed mtrr ranges

The new MTRR code handles overlapping ranges
and supports AMD specific TOM2 MSR.

The format in /dev/archctl now only shows
the effective cache ranges only, without
exposing the low level registers.