]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
4 years agomake bind(2) error handling consistent
cinap_lenrek [Sat, 2 May 2020 15:32:01 +0000 (17:32 +0200)]
make bind(2) error handling consistent

The mount() and bind() syscalls return -1 on error,
and the mountid sequence number on success.

The manpage states that the mountid sequence number
is a positive integer, but the kernels implementation
currently uses a unsigned 32-bit integer and does not
guarantee that the mountid will not become negative.

Most code just cares about the error, so test for
the -1 error value only.

4 years agolibdraw: fix mount() error handling in newwindow()
cinap_lenrek [Sat, 2 May 2020 15:05:17 +0000 (17:05 +0200)]
libdraw: fix mount() error handling in newwindow()

4 years agosed: accept and ignore -E and -r flags for unix compatibility
cinap_lenrek [Sat, 2 May 2020 14:56:52 +0000 (16:56 +0200)]
sed: accept and ignore -E and -r flags for unix compatibility

4 years agoip/cifsd: implement primitive per-share unix id mapping for wstat()
cinap_lenrek [Sat, 2 May 2020 14:53:52 +0000 (16:53 +0200)]
ip/cifsd: implement primitive per-share unix id mapping for wstat()

4 years agomerge
cinap_lenrek [Sat, 2 May 2020 13:34:00 +0000 (15:34 +0200)]
merge

4 years agoether82543gc, ether82557, ethervirtio: do kproc() call ouside of spinlock
cinap_lenrek [Sat, 2 May 2020 13:32:19 +0000 (15:32 +0200)]
ether82543gc, ether82557, ethervirtio: do kproc() call ouside of spinlock

4 years agouse #error when missing define
Ori Bernstein [Fri, 1 May 2020 20:29:08 +0000 (13:29 -0700)]
use #error when missing define

This makes it easier to figure out what's going wrong when
we forget to define _POSIX_SOURCE.

4 years agomerge
Ori Bernstein [Wed, 29 Apr 2020 03:51:19 +0000 (20:51 -0700)]
merge

4 years agofacelift for mothra: flat ui is in.
Ori Bernstein [Wed, 29 Apr 2020 03:50:10 +0000 (20:50 -0700)]
facelift for mothra: flat ui is in.

Remove false 3d, add borders for visual separation between
content area and navigation area.

4 years agolibsec/base58enc: null-terminate the result
Sigrid [Tue, 28 Apr 2020 10:49:05 +0000 (12:49 +0200)]
libsec/base58enc: null-terminate the result

4 years agomissing headers rate a FATAL.
Ori Bernstein [Tue, 28 Apr 2020 03:13:16 +0000 (20:13 -0700)]
missing headers rate a FATAL.

4 years agolib9p: reject reads on closed fids and writes on directories
cinap_lenrek [Mon, 27 Apr 2020 17:55:42 +0000 (19:55 +0200)]
lib9p: reject reads on closed fids and writes on directories

mischief provided the following test that shows the issue:

ramfs -S crash

aux/9pcon /srv/crash <<EOF
Tversion 8192 9P2000
Tattach 0 -1 $user ''
Tcreate 0 dir 020000000777 0
Tattach 5 -1 $user ''
Twalk 5 6 dir
Tread 6 0 512
EOF

the problem is that lib9p wrongly allowed reads on closed fids,
due to the permission check only considering the lower 2 bits.
a closed fid has fid->omode == -1 and it would pass on read for:

(-1 & 3) == 3 == OEXEC

the following change explicitely checks for for the closed case
and also rejects writes on directories (they are rejected on
open/create, but a broken 9p client could still issue the request).

4 years agomerge
cinap_lenrek [Sun, 26 Apr 2020 17:55:53 +0000 (19:55 +0200)]
merge

4 years agokernel: improve page reclaimation strategy and locking
cinap_lenrek [Sun, 26 Apr 2020 17:54:46 +0000 (19:54 +0200)]
kernel: improve page reclaimation strategy and locking

when reclaiming pages from an image, always reclaim all
the hash chains equally. that way, we avoid being biased
towards the chains at the start of the Image.pghash[] array.

images can be in two states: active or inactive. inactive
images are the ones which are not used by program while
active ones aare.

when reclaiming pages, we should try to reclaim pages
from inactive images first and only if that set becomes
exhausted attempt to release text pages and attempt to
reclaim pages from active images.

when we run out of Image structures, it makes only sense
to reclaim pages from inactive images, as reclaiming pages
from active ones will never free any Image structures.

change putimage() to require a image already locked and
make it unlock the image. this avoids many pointless
unlock()/lock() sequences as all callers of putimage()
already had the image locked.

4 years agomothra: fix a few errors in previous patch
qwx [Sun, 26 Apr 2020 17:43:10 +0000 (19:43 +0200)]
mothra: fix a few errors in previous patch

- nil check pl_blue allocation, and don't do it every time pl_rtdraw is called
- fix re-adding previously removed flushimage calls
- correct format for pointer
- sysfatal in pl_drawinit on error

4 years agocopy all the tokens from the tokenrows with a paste.
Ori Bernstein [Sun, 26 Apr 2020 16:32:42 +0000 (09:32 -0700)]
copy all the tokens from the tokenrows with a paste.

if we do 'CAT(foo bar, baz quux)', the resulting token row
should have 3 tokens: 'foo', 'barbaz', 'quux'.

tested by jonasa, rebuilding /sys/src, perl, netsurf, and nuklear.

4 years agoadd missing header change (thanks qwx)
Ori Bernstein [Sun, 26 Apr 2020 16:03:42 +0000 (09:03 -0700)]
add missing header change (thanks qwx)

4 years agoSupport for neo2 keyboard layout
Ori Bernstein [Sun, 26 Apr 2020 03:46:45 +0000 (20:46 -0700)]
Support for neo2 keyboard layout

Modify aux/kbdfs to work with neo2 layout.
- add new modifier, increase limit on layers.
- Add Kaltgr for mod3
- Add mod4

This change only implements the alphanumeric
block of the keyboard in the kbmap, as neo2
is mainly used for blind typing and is not
needed that much anywhere else, this leaves
the numpad like it is.

(Thanks, jstsmthrgk@jstsmthrgk.eu)

4 years agomothra: make user interface monochrome
stanley lieber [Sun, 26 Apr 2020 01:55:43 +0000 (21:55 -0400)]
mothra: make user interface monochrome

4 years agomothra: remove extraneous lines and decoration (fake 3d). patch extracted from my...
stanley lieber [Sun, 26 Apr 2020 01:53:54 +0000 (21:53 -0400)]
mothra: remove extraneous lines and decoration (fake 3d). patch extracted from my forked mess by Ori_B.

4 years agotweak selection criteria
Ori Bernstein [Sat, 25 Apr 2020 22:18:04 +0000 (15:18 -0700)]
tweak selection criteria

grow selection from point of click, not start of selection region.
starting at the beginning of the selection region causes the match
logic to kick in, which is confusing.

4 years agocc: simplify macexpand() and off-by-one error
cinap_lenrek [Sat, 25 Apr 2020 20:16:44 +0000 (22:16 +0200)]
cc: simplify macexpand() and off-by-one error

the caller of macexpand() needs one more byte in
the buffer to append peekc.

make macexpand() actually check for buffer overflow.

just use strdup() to duplicate include file name
instead of the hunk dance.

move GETC() macro in cc.h

4 years agofix typos in time calculation
Ori Bernstein [Sat, 25 Apr 2020 18:00:27 +0000 (11:00 -0700)]
fix typos in time calculation

the results of the time calculation were garbled -- and
apparently negative on my system when testing, so the
test passed when it shouldn't have.

4 years agoBacked out changeset 2737b9af622b
Ori Bernstein [Sat, 25 Apr 2020 17:57:17 +0000 (10:57 -0700)]
Backed out changeset 2737b9af622b

not what I wanted to commit.

4 years agofix typos in time calculation
Ori Bernstein [Sat, 25 Apr 2020 17:43:39 +0000 (10:43 -0700)]
fix typos in time calculation

the results of the time calculation were garbled -- and
apparently negative on my system when testing, so the
test passed when it shouldn't have.

4 years agoBump protocol version for Ttclick
Ori Bernstein [Sat, 25 Apr 2020 16:38:02 +0000 (09:38 -0700)]
Bump protocol version for Ttclick

4 years agotriple click selection in acme
Ori Bernstein [Sat, 25 Apr 2020 15:59:14 +0000 (08:59 -0700)]
triple click selection in acme

see the last 2 commits.

4 years agotriple click selection in rio
Ori Bernstein [Sat, 25 Apr 2020 15:58:24 +0000 (08:58 -0700)]
triple click selection in rio

same as sam and vt, three clicks selects a
whitespace-delimited line.

4 years agotriple click selection in sam
Ori Bernstein [Sat, 25 Apr 2020 15:57:26 +0000 (08:57 -0700)]
triple click selection in sam

three clicks selects a whitespace-delimited line.

4 years agoacme/win: exit winfs once acme shuts down the window
cinap_lenrek [Fri, 24 Apr 2020 19:15:59 +0000 (21:15 +0200)]
acme/win: exit winfs once acme shuts down the window

4 years agopc, pc64: use softscreen double buffering for *bootscreen= framebuffer
cinap_lenrek [Fri, 24 Apr 2020 18:26:38 +0000 (20:26 +0200)]
pc, pc64: use softscreen double buffering for *bootscreen= framebuffer

it is probably almost always a good idea to use
double buffering with a unaccelerated framebuffer.

4 years agobcm, bcm64: dancing to the drum of the linux clowns for device tree memory size detec...
cinap_lenrek [Wed, 22 Apr 2020 17:57:25 +0000 (19:57 +0200)]
bcm, bcm64: dancing to the drum of the linux clowns for device tree memory size detection (thanks kenji)

looks like linux changed the device tree names for
the memory node:

https://github.com/raspberrypi/linux/commit/4b17654f51fd87c42cda3217b0863e6aa1df49b9#diff-ac03c9402b807c11d42edc9e8d03dfc7

this fixes the memory size detection with latest firmware
on raspberry pi4-b (4GB) for kenji.

4 years ago/sys/man/1/mothra: add description of Plumb menu item.
stanley lieber [Wed, 22 Apr 2020 01:14:26 +0000 (21:14 -0400)]
/sys/man/1/mothra: add description of Plumb menu item.

4 years agomothra.c: add Plumb menu item, and update man page. my original changes sanity-checke...
stanley lieber [Wed, 22 Apr 2020 01:12:32 +0000 (21:12 -0400)]
mothra.c: add Plumb menu item, and update man page. my original changes sanity-checked by Ori_B.

4 years agordhtml.c: restore original fonts. dejavusans was my change, my fault. it never looked...
stanley lieber [Wed, 22 Apr 2020 01:09:12 +0000 (21:09 -0400)]
rdhtml.c: restore original fonts. dejavusans was my change, my fault. it never looked right outside of drawterm on osx (mea culpa). this is easy to change for anyone who prefers something else, but it's difficult to imagine native users preferring our very fuzzy dejavusans to anything else.

4 years agoremove unused macro from chan.c
Ori Bernstein [Wed, 22 Apr 2020 00:32:02 +0000 (17:32 -0700)]
remove unused macro from chan.c

4 years agosamterm: don't scroll invisible (command) window (thanks umbraticus)
cinap_lenrek [Tue, 21 Apr 2020 22:55:58 +0000 (00:55 +0200)]
samterm: don't scroll invisible (command) window (thanks umbraticus)

with scroll-wheel scrolling, this case can happen with the
command window:

umbraticus → cinap: create fullscreen file buffer by right-clicking in cmd window

4 years agomerge
cinap_lenrek [Sun, 19 Apr 2020 22:08:35 +0000 (00:08 +0200)]
merge

4 years ago?a, ?c: fix macro debug prints
cinap_lenrek [Sun, 19 Apr 2020 21:57:33 +0000 (23:57 +0200)]
?a, ?c: fix macro debug prints

4 years ago?c: get rid of sprint(), strcpy() and strcat()/strncat(), cleanup
cinap_lenrek [Sun, 19 Apr 2020 21:51:18 +0000 (23:51 +0200)]
?c: get rid of sprint(), strcpy() and strcat()/strncat(), cleanup

4 years ago[257]l: cleanup fmt routines, replace sprint()
cinap_lenrek [Sun, 19 Apr 2020 21:47:23 +0000 (23:47 +0200)]
[257]l: cleanup fmt routines, replace sprint()

4 years agocc: cc.h changes needed by previous commit
cinap_lenrek [Sun, 19 Apr 2020 21:42:02 +0000 (23:42 +0200)]
cc: cc.h changes needed by previous commit

4 years ago?a, cc: fix buffer overflows in built-in preprocessor (macbody)
cinap_lenrek [Sun, 19 Apr 2020 21:37:05 +0000 (23:37 +0200)]
?a, cc: fix buffer overflows in built-in preprocessor (macbody)

add a buffer size argument to macexpand() and check for
overflow.

check for overflow when parsing #include directives.

4 years ago?a: catch symb[NSYMB] buffer overflow in lexer, cleanup, assume thechar is a rune
cinap_lenrek [Sun, 19 Apr 2020 20:59:21 +0000 (22:59 +0200)]
?a: catch symb[NSYMB] buffer overflow in lexer, cleanup, assume thechar is a rune

4 years agocc: get rid of sprint() and temporary buffer for type conversion fuction
cinap_lenrek [Sun, 19 Apr 2020 18:44:19 +0000 (20:44 +0200)]
cc: get rid of sprint() and temporary buffer for type conversion fuction

slookup() copies to symb, so use the symb[NSYMB] buffer directly
to declare type conversion functions and get rid of the arbitrary
sized local buffer. replace sprint() with snprint().

4 years agoMake priority array max size explicit.
Ori Bernstein [Sun, 19 Apr 2020 18:26:31 +0000 (11:26 -0700)]
Make priority array max size explicit.

we were implicitly depending on UMINUS being the last entry
in the operator table -- that's fragile.

4 years agofix cpp operator associativity
Ori Bernstein [Sun, 19 Apr 2020 18:15:13 +0000 (11:15 -0700)]
fix cpp operator associativity

We used to treat all operators as right associative,
which means that we would evaluate them incorrecty.
For example, '2 - 1 + 1' would evaluate as '2 - (1 + 2)',
instead of '(2 - 1) + 1'.

This adds an assoc parameter to struct pri, and then uses
it to decide how to evaluate operators.

4 years agomerge
Ori Bernstein [Sun, 19 Apr 2020 16:03:35 +0000 (09:03 -0700)]
merge

4 years agodont overflow the stack
Ori Bernstein [Sun, 19 Apr 2020 16:02:21 +0000 (09:02 -0700)]
dont overflow the stack

when pushing expressions in cpp, particularly complex ones could
overflow the stack and silently corrupt our data structures. add
checks when we push, and bump the stack size up.

4 years agolibmemdraw: remove inexistent build targets
rgl [Sun, 19 Apr 2020 13:30:58 +0000 (15:30 +0200)]
libmemdraw: remove inexistent build targets

4 years agomerge
cinap_lenrek [Sun, 19 Apr 2020 02:34:16 +0000 (04:34 +0200)]
merge

4 years ago?c: fix Bconv() misusage of strncat()
cinap_lenrek [Sun, 19 Apr 2020 02:33:07 +0000 (04:33 +0200)]
?c: fix Bconv() misusage of strncat()

4 years agofortunes: As much as I'd love to I feel I have to let it go -- rminnich
stanley lieber [Sun, 19 Apr 2020 01:37:53 +0000 (21:37 -0400)]
fortunes: As much as I'd love to I feel I have to let it go -- rminnich

4 years ago6c: conserve registers for floating point operations
cinap_lenrek [Sat, 18 Apr 2020 23:25:35 +0000 (01:25 +0200)]
6c: conserve registers for floating point operations

for floating point operations, reuse the return register
on the right hand side if it has higher complex number
than the left hand side to conserve registers.

this makes the following code compile, that was previously
run out of floating point register:

float
f(float r[15])
{
return (r[0] + (r[1] * (r[2] + r[3] * (r[4] + r[5] * (r[6] + r[7] * (r[8] + r[9] * (r[10] + r[11] * (r[12] + r[13] * r[14]))))))));
}

the downside is that this produces extra move operations.

4 years agoaux/getflags: support named flags
Ori Bernstein [Sat, 18 Apr 2020 22:38:38 +0000 (15:38 -0700)]
aux/getflags: support named flags

When using aux/getflags, it produces unnecessarily obscure
names for the flags. This allows the caller of aux/getflags
to support arbitrary names.

4 years ago7l, ql: dont assume . is in the path for running mkcname (thanks sam-d)
cinap_lenrek [Sat, 18 Apr 2020 17:07:06 +0000 (19:07 +0200)]
7l, ql: dont assume . is in the path for running mkcname (thanks sam-d)

4 years agorc: fix code serialization for PIPEFD (thanks BurnZeZ)
cinap_lenrek [Sat, 18 Apr 2020 16:20:34 +0000 (18:20 +0200)]
rc: fix code serialization for PIPEFD (thanks BurnZeZ)

BurnZeZ reported this the other day. It seems like if we have
a pipeline that looks like:

fn foo{cat < <{echo hi}}

then the '<' will get merged in /env/'fn#foo'. This change
fixes pcmd to add a space. It looks to me like this is the
only token that can get merged this way by pcmd.

4 years agoacme/win: pass on flags to winfs (fix undocumented -e flag)
cinap_lenrek [Fri, 17 Apr 2020 17:18:28 +0000 (19:18 +0200)]
acme/win: pass on flags to winfs (fix undocumented -e flag)

4 years agoip(3): remove outdated maximum ipstack number limit.
cinap_lenrek [Wed, 15 Apr 2020 16:16:22 +0000 (18:16 +0200)]
ip(3): remove outdated maximum ipstack number limit.

the maximum number of ip stacks is a implementation detail
of devip. it is 128 currently, instead of 16 as suggested
in the manpage.

4 years agodraw(3): typo dp
23hiro [Sun, 12 Apr 2020 22:33:26 +0000 (00:33 +0200)]
draw(3): typo dp

4 years agomerge
cinap_lenrek [Sun, 12 Apr 2020 14:12:41 +0000 (16:12 +0200)]
merge

4 years agokernel: remove unused mem2bl() prototype
cinap_lenrek [Sun, 12 Apr 2020 14:11:41 +0000 (16:11 +0200)]
kernel: remove unused mem2bl() prototype

4 years agomerge
Ori Bernstein [Sat, 11 Apr 2020 21:20:53 +0000 (14:20 -0700)]
merge

4 years agotriple-click to select non-whitespace segment
Ori Bernstein [Sat, 11 Apr 2020 21:19:46 +0000 (14:19 -0700)]
triple-click to select non-whitespace segment

The previous patch to plumb non-whitespace segments was
confusing due to lack of visual feedback. This removes
the empty selecton plumb behavior, and instead makes
triple clicking work to get a plumbable selection.

4 years agomerge
cinap_lenrek [Sat, 11 Apr 2020 20:37:30 +0000 (22:37 +0200)]
merge

4 years agoip/ipconfig: ignore default routes targeting ourselfs
cinap_lenrek [Sat, 11 Apr 2020 20:36:19 +0000 (22:36 +0200)]
ip/ipconfig: ignore default routes targeting ourselfs

when running ndb configuration, we might inherit the ipgw=
attribute from the ipnet pointing to our own ip address
(we are the default gateway). ignore such entries.

do not add default routes with gateway equal to our own
local (ip4) or link-local ip address (ipv6).

4 years agovt plumbing: don't require selection
Ori Bernstein [Sat, 11 Apr 2020 18:56:04 +0000 (11:56 -0700)]
vt plumbing: don't require selection

Plumbing text in vt requires selecting the text that you
want to plumb precisely. This patch makes plumbing behave
the same way that it does in rio.

4 years agoip/ipconfig: resolve ipgw to an ip address as neccesary (thanks k0ga)
cinap_lenrek [Sat, 11 Apr 2020 16:09:48 +0000 (18:09 +0200)]
ip/ipconfig: resolve ipgw to an ip address as neccesary (thanks k0ga)

ndb(6) states that ipgw needs to be an ip address,
however, attempting to resolve ipgw is not difficult
and already done by ip/dhcpd.

4 years agovl: remove unused mysbrk() prototype
cinap_lenrek [Sat, 11 Apr 2020 12:20:41 +0000 (14:20 +0200)]
vl: remove unused mysbrk() prototype

4 years agoqa: remove ALLOC() and ALLOCN() macros
cinap_lenrek [Sat, 11 Apr 2020 12:20:13 +0000 (14:20 +0200)]
qa: remove ALLOC() and ALLOCN() macros

4 years agocc: remove mysbrk(), exponentially increase gethunk() allocation delta
cinap_lenrek [Sat, 11 Apr 2020 12:19:35 +0000 (14:19 +0200)]
cc: remove mysbrk(), exponentially increase gethunk() allocation delta

mysbrk() was only used in gethunk() and should not be
called by anyone, so dont export the symbol.

simplify gethunk() using brk().

double allocation size on each call until we reach
1000*NHUNK.

use signed long for nhunk as alignment rountin might
make it negative and handle that case.

4 years ago6c: remove mystery sys.c file
cinap_lenrek [Sat, 11 Apr 2020 03:19:11 +0000 (05:19 +0200)]
6c: remove mystery sys.c file

4 years agocc, ?[acl]: fix gethunk() and move common memory allocator code to cc/compat
cinap_lenrek [Sat, 11 Apr 2020 03:03:49 +0000 (05:03 +0200)]
cc, ?[acl]: fix gethunk() and move common memory allocator code to cc/compat

for gethunk() to work, all allocators have to use it,
including allocations done by libc thru malloc(),
so the fake allocation functions are mandatory for
everyone.

to avoid duplication the code is moved to cc/compat
and prototypes provided in new cc/compat.h header.

4 years agobackout the gethunk() again, as that breaks the assemblers
cinap_lenrek [Fri, 10 Apr 2020 23:26:36 +0000 (01:26 +0200)]
backout the gethunk() again, as that breaks the assemblers

the assemblers share gethunk() cc/macbody but are compiled
without compat.c, so calls such as getenv() trigger malloc()
which does its own sbrk() calls, breaking the continuity
of the hunk.

so this change needs another revision. until then, this is
backed out.

4 years agocc, ?l: fix gethunk() to actually grow allocation
cinap_lenrek [Fri, 10 Apr 2020 21:11:25 +0000 (23:11 +0200)]
cc, ?l: fix gethunk() to actually grow allocation

the compilers and linkers use ther own memory allocator.
free memory is between hunk and hunk+nhunk. allocation
works by checking if nhunk is bigger or equal to the
amount needed, and if not, repeatedly call gethunk()
until there is. after that, the allocated amount is added
from hunk and subtracted from nhunk by the user.

the problem was when the needed amount was bigger than
the default NHUNK size gethunk() allocates per call.
gethunk() would not actually grow nhunk, but instead
just set hunk and nhunk variables to the last allocated
block. this resulted in a infinite loop of calls to
gethunk() until sbrk() would hit the maximum size for
the BSS segment.

this change makes gethunk() actually grow the hunk space,
increasing nhunk, and only updating hunk when nhunk was
previously zero. we assume that mysbrk() retuns increasing
addresses and that the space between the previous hunk+nhunk
and the new block base returned by mysbrk() is usable.

4 years agomerge
cinap_lenrek [Fri, 10 Apr 2020 20:26:37 +0000 (22:26 +0200)]
merge

4 years agocc: backout gethunk() change
cinap_lenrek [Fri, 10 Apr 2020 20:25:29 +0000 (22:25 +0200)]
cc: backout gethunk() change

the real problem is that gethunk() does not grow the allocation
but just allocates a new hunk, so repeated calls to gethunk()
wont make nhunk grow to satisfy the allocation.

this will be fixed in a upcoming commit.

4 years agocc, ?a, ?l: change thunk type to uintptr
Sigrid [Fri, 10 Apr 2020 18:38:45 +0000 (20:38 +0200)]
cc, ?a, ?l: change thunk type to uintptr

4 years agocc: sbrk in bigger chunks as it grows, so it gets a chance to use the ram/swap available
Sigrid [Fri, 10 Apr 2020 15:19:44 +0000 (17:19 +0200)]
cc: sbrk in bigger chunks as it grows, so it gets a chance to use the ram/swap available

4 years agokernel: cleanup the software mouse cursor mess
cinap_lenrek [Fri, 10 Apr 2020 15:12:51 +0000 (17:12 +0200)]
kernel: cleanup the software mouse cursor mess

The swcursor used a 32x32 image for saving/restoring
screen contents for no reason.

Add a doflush argument to swcursorhide(), so that
disabling software cursor with a double buffered
softscreen is properly hidden. The doflush parameter
should be set to 0 in all other cases as swcursordraw()
will flushes both (current and previours) locations.

Make sure swcursorinit() and swcursorhide() clear the
visibility flag, even when gscreen is nil.

Remove the cursor locking and just do everything within
the drawlock. All cursor functions such as curson(),
cursoff() and setcursor() will be called drawlock
locked. This also means &cursor can be read.

Fix devmouse cursor reads and writes. We now have the
global cursor variable that is only modified under
the drawlock. So copy under drawlock.

Move the pc software cursor implementation into vgasoft
driver, so screen.c does not need to handle it as
a special case.

Remove unused functions such as drawhasclients().

4 years agopc, pc64: remove "got unassigned irq" prints
cinap_lenrek [Thu, 9 Apr 2020 11:05:10 +0000 (13:05 +0200)]
pc, pc64: remove "got unassigned irq" prints

most pc's are multiprocessors these days, that use apic or
msi interrupts, then the irq does not matter anymore. and
uefi does not even assign irq to pci devices anymore. if
we have a problem enabling an interrupt, we will print.

4 years ago9bootpxe: simplify
cinap_lenrek [Wed, 8 Apr 2020 21:48:09 +0000 (23:48 +0200)]
9bootpxe: simplify

4 years ago9bootpxe: continues the war against random DHCPv6 DUIDs
cinap_lenrek [Wed, 8 Apr 2020 21:37:38 +0000 (23:37 +0200)]
9bootpxe: continues the war against random DHCPv6 DUIDs

Some UEFI implementations use random UUID based DUID instead of
ethernet address, but use ethernet derived link-local addresses.
So extract the MAC from our IPv6 address.

4 years ago/lib/face: add .dict entries for andrew.1 face files
Alex Musolino [Wed, 8 Apr 2020 02:22:06 +0000 (11:52 +0930)]
/lib/face: add .dict entries for andrew.1 face files

4 years agonotify(2): fix typo
Alex Musolino [Tue, 7 Apr 2020 02:44:12 +0000 (12:14 +0930)]
notify(2): fix typo

4 years agomerge
cinap_lenrek [Sun, 5 Apr 2020 23:31:35 +0000 (01:31 +0200)]
merge

4 years agopc64: remove rampage() nil check
cinap_lenrek [Sun, 5 Apr 2020 23:29:12 +0000 (01:29 +0200)]
pc64: remove rampage() nil check

rampage() never returns nil

4 years agopc: zero rampage() memory (thanks LordCreepity)
cinap_lenrek [Sun, 5 Apr 2020 23:28:34 +0000 (01:28 +0200)]
pc: zero rampage() memory (thanks LordCreepity)

memory returned by rampage() is not zeroed, so we have to
zero it ourselfs. apparently, this bug didnt show up as we
where zeroing conventional low memory before the new memory
map code. also rampage() never returns nil.

4 years agofile: try ismp4() before ismp3()
Alex Musolino [Sun, 5 Apr 2020 13:56:52 +0000 (23:26 +0930)]
file: try ismp4() before ismp3()

It is possible to find the mp3 sync word near the start of an mp4
file.  As such, file(1) could incorrectly identify some mp4s as mp3s.

4 years agodossrv: fix falloc() for >31 bit sector numbers (thanks sl)
cinap_lenrek [Sun, 5 Apr 2020 01:46:47 +0000 (03:46 +0200)]
dossrv: fix falloc() for >31 bit sector numbers (thanks sl)

4 years agonusb/usbd: fix portreset error handling
cinap_lenrek [Sun, 5 Apr 2020 01:05:06 +0000 (03:05 +0200)]
nusb/usbd: fix portreset error handling

error handling in portreset() was wrong. we called closedev()
on the device without changing the reference.

just call portdetach() when the reset fails.

4 years agonusb/audio: set frequency only when supported
cinap_lenrek [Sat, 4 Apr 2020 22:59:47 +0000 (00:59 +0200)]
nusb/audio: set frequency only when supported

before setting the sampling rate, check bit D0
"Sampling Frequency" in the audio class specific
endpoint descriptor.

4 years agomerge
cinap_lenrek [Sat, 4 Apr 2020 15:17:15 +0000 (17:17 +0200)]
merge

4 years agomtx, ppc: use proctab() to index into process table
cinap_lenrek [Sat, 4 Apr 2020 14:52:08 +0000 (16:52 +0200)]
mtx, ppc: use proctab() to index into process table

4 years agokernel: remove scheddump() comment for delay() in */fns.h
cinap_lenrek [Sat, 4 Apr 2020 14:50:37 +0000 (16:50 +0200)]
kernel: remove scheddump() comment for delay() in */fns.h

4 years agopc, pc64: new memory map code
cinap_lenrek [Sat, 4 Apr 2020 14:48:37 +0000 (16:48 +0200)]
pc, pc64: new memory map code

This replaces the memory map code for both pc and pc64
kernels with a unified implementation using the new
portable memory map code.

The main motivation is to be robust against broken
e820 memory maps by the bios and delay the Conf.mem[]
allocation after archinit(), so mp and acpi tables
can be reserved and excluded from user memory.

There are a few changes:

new memreserve() function has been added for archinit()
to reserve bios and acpi tables.

upareserve() has been replaced by upaalloc(), which now
has an address argument.

umbrwmalloc() and umbmalloc() have been replaced by
umballoc().

both upaalloc() and umballoc() return physical addresses
or -1 on error. the physical address -1 is now used as
a sentinel value instead of 0 when dealing with physical
addresses.

archmp and archacpi now always use vmap() to access
the bios tables and reserve the ranges. more overflow
checks have been added.

ramscan() has been rewritten using vmap().

to handle the population of kernel memory, pc and pc64
now have pmap() and punmap() functions to do permanent
mappings.

4 years agokernel: add portable memory map code (port/memmap.c)
cinap_lenrek [Sat, 4 Apr 2020 14:04:27 +0000 (16:04 +0200)]
kernel: add portable memory map code (port/memmap.c)

This is a generic memory map for physical addresses. Entries
can be added with memmapadd() giving a range and a type.
Ranges can be allocated and freed from the map. The code
automatically resolves overlapping ranges by type priority.

4 years agoether8390: remove unused variables
cinap_lenrek [Sat, 4 Apr 2020 13:55:48 +0000 (15:55 +0200)]
ether8390: remove unused variables

4 years agoether8003: use physical addresses for ISAConfig ether->mem
cinap_lenrek [Sat, 4 Apr 2020 13:47:50 +0000 (15:47 +0200)]
ether8003: use physical addresses for ISAConfig ether->mem

Fix the inconsistent use of ether->mem. Always use physical
addresses. Let ether8390 convert to virtual addresses using
KADDR() when we have to copy data in/out.

4 years agomerge
Alex Musolino [Wed, 1 Apr 2020 12:27:15 +0000 (22:57 +1030)]
merge