Commit graph

4771 commits

Author SHA1 Message Date
stanley lieber b241dd1159 fortunes: If you want to do the work, I will review the results. 2015-08-09 00:36:10 -04:00
cinap_lenrek 4b926f4e69 lib9p: make reqqueueflush() use new threadint(), which will also cover channel operations
using "interrupt" ctl message directly doesnt work when the
process is doing libthread channel operations (threadrendezvous)
as it will just repeat a interrupted rendezvous(). threadint()
handles this for us.
2015-08-10 03:52:40 +02:00
cinap_lenrek c235046310 libthread: use "interrupt" proc ctl message instead of posting a note for threadint()
threadint() is called to interrupt channel operation or a system call.
the kernel provides a new "interrupt" procctl message to interrupt a
process commited to or being in a blocking syscall, which is similar,
but not the same. the main difference is that "interrupt" condition
is not cleared before the process actually attempts to block. also
can be cleared with "nointerrupt" ctl message. see proc(3)
2015-08-10 03:48:37 +02:00
cinap_lenrek a98f911a17 libthread: fix mistake, make "all" the default target again 2015-08-10 03:20:08 +02:00
cinap_lenrek 7a97fe132a acid -k: fix intrcount() for amd64 2015-08-09 22:43:53 +02:00
cinap_lenrek cd357a2b8c acid -k: fix procenv() to new data structure 2015-08-09 22:24:50 +02:00
cinap_lenrek 8c9e4efa17 zunq: remove unused variables from devqspi 2015-08-09 22:05:14 +02:00
cinap_lenrek 7ba3be82a7 kernel: move "setargs" field in Proc structure after "nargs" and "args" 2015-08-09 21:48:58 +02:00
cinap_lenrek b4f56f1f4e kernel: mount flag is int not ulong, reduce size of Mount struct by putting mflag field in what would be wasted as padding 2015-08-09 21:35:50 +02:00
cinap_lenrek 9f4eac5292 kernel: pgrpcpy(), simplify Mount structure
instead of ordering the source mount list, order the new destination
list which has the advantage that we do not need to wlock the source
namespace, so copying can be done in parallel and we do not need the
copy forward pointer in the Mount structure.

the Mhead back pointer in the Mount strcture was unused, removed.
2015-08-09 21:16:10 +02:00
cinap_lenrek 3af236b5e3 kernel: fix Mheadache
there was a race between cunmount() and walk() on Mhead.from as Mhead.from was
unconditionally freed when we cunmount(), but findmount might have already
returned the Mhead in walk(). we have to ensure that Mhead.from is not freed
before the Mhead itself (now done in putmhead() once the reference count of the
Mhead drops to zero).

the Mhead struct contained two unused locks, removing.

no need to hold Pgrp.ns lock in closegrp() as nobody can get to it (refcount
droped to zero).

avoid cclose() and freemount() while holding Mhead.lock or Pgrp.ns locks as
it might block on a hung up fileserver.

remove the debug prints...

cleanup: use nil for pointers, remove redundant nil checks before putmhead().
2015-08-09 18:19:47 +02:00
cinap_lenrek eaf42a2c78 rootstub: add spim 2015-08-08 09:20:48 +02:00
cinap_lenrek c8a7747659 cdproto: add spim 2015-08-08 08:56:08 +02:00
cinap_lenrek ff6e15ec3a add /spim 2015-08-08 08:38:25 +02:00
cinap_lenrek 1f8e6c916a python: fix build for objtype=$spim 2015-08-08 08:34:16 +02:00
cinap_lenrek 79213052a2 gs: fix build for objtype=spim 2015-08-08 08:31:49 +02:00
cinap_lenrek acc4d8b8aa libmp: fix build for objtype=spim 2015-08-08 08:25:36 +02:00
cinap_lenrek 4b6506cb57 ape: fix build for objtype=spim 2015-08-08 08:17:54 +02:00
cinap_lenrek ebe88f34cb fix library mkfiles for objtype=spim 2015-08-08 08:04:41 +02:00
mischief 23215e14d0 libmach: remove redundant check for big endian 2015-08-05 06:37:02 -07:00
mischief 8e78804fc0 libmach: remove useless error check from previous commit 2015-08-05 06:30:57 -07:00
mischief 7844dafe62 libmach: set correct endianness with little endian ELF32 mips binaries 2015-08-05 06:26:23 -07:00
cinap_lenrek 8ce456bd19 kernel: remove unused MAXCRYPT constant from portdat.h 2015-08-06 13:35:03 +02:00
cinap_lenrek a87b550183 vgaigfx: remove #define MB, theres a MB enum in portdat.h 2015-08-06 13:33:39 +02:00
cinap_lenrek 87d7a3c875 kernel: have to validate argv[] again when copying to the new stack
we have to validaddr() and vmemchr() all argv[] elements a second
time when we copy to the new stack to deal with the fact that another
process can come in and modify the memory of the process doing the
exec. so the argv[] strings could have changed and increased in
length. we just make sure the data being copied will fit into the
new stack and error when we would overflow.

also make sure to free the ESEG in case the copy pass errors.
2015-08-06 13:20:41 +02:00
cinap_lenrek 281729551f kernel: limit argv[] strings to the USTKSIZE to avoid overflow
argv[] strings get copied to the new processes stack segment, which
has a maximum size of USTKSIZE, so limit the size of the strings to
that and check early for overflow.
2015-08-06 11:51:23 +02:00
cinap_lenrek b09cd67860 kernel: validnamedup() the name argument for segattach()
this moves the name validation out of segattach() to syssegattach()
to make sure the segment name cannot be changed by the user while
segattach looks at it.
2015-08-06 11:48:51 +02:00
cinap_lenrek d275add1a8 kernel: fix indention in validname0() 2015-08-06 11:43:22 +02:00
cinap_lenrek 9585e9b7f8 kernel: limit syscallfmt user strings to 64K (as in validname) 2015-08-06 11:42:05 +02:00
cinap_lenrek 86eb8ea6bb kernel: change vmemchr() length argument to ulong and simplify 2015-08-06 10:15:07 +02:00
cinap_lenrek 8d196aeec7 kernel: use Etoolong[] constant instead of string literal in validname0() 2015-08-06 10:01:45 +02:00
cinap_lenrek 9110ae6eae kernel: make shargs() function static in sysproc.c 2015-08-06 09:09:57 +02:00
cinap_lenrek 2acb02f29b kernel: reject empty argv (argv[0] == nil) in sysexec()
when executing a script, we did advance argp0 unconditionally
to replace argv[0] with the script name. this fails when
argv[] is empty, then we'd advance argp0 past the nil terminator.

the alternative would be to *not* advance if *argp0 == nil, but that
would require another validaddr() check for a case that is unlikely
to have been anticipated in most programs being invoked as
libc's ARGBEGIN macro assumes argv[0] being non-nil as it also
unconditionally advances the argv pointer.

to keep us sane, we now reject an empty argv[]. on entry, we
verify that argv[] is valid for at least two elements:
- the program name argv[0], has to be non-nil
- the first potential nil terminator in argv[1]

when argv[0] == nil, we throw Ebadarg "bad arg in system call"
2015-08-06 08:47:38 +02:00
cinap_lenrek b89fcf2fe3 init: do not run $home/lib/profile when cd $home failed
avoiding follow up error messages, which is annoying and
quite common when running a terminal as "none" for testing.
2015-08-05 14:09:02 +02:00
cinap_lenrek 00eb2fa448 kfs: set permission of / to 0775 on ream
this allows members of the -1 group to create new directories in /
without having to fiddle with the fileserver console. this also
makes it consistent to hjfs and cwfs.
2015-08-05 13:13:40 +02:00
cinap_lenrek ad91dc7ffb cwfs: set permission of / to 0775 on ream
this allows members of the -1 group to create new directories in /
without having to fiddle with the fileserver console. this also
makes it consistent to hjfs.
2015-08-05 13:06:11 +02:00
cinap_lenrek 7304deaec1 pc, pc64: remove unused psaux driver, cleanup devkbd
the psaux driver is not used in any kernel configuration and theres
no userspace mouse daemon. i8042auxcmds() is wrong as access
to the user buffer can fault and we are holding an ilocks.

little cleanups in devkbd.
2015-08-05 10:44:03 +02:00
cinap_lenrek f7514acc95 devkbd: disable mosue/keyboard on shutdown, disable ps2 mouse on init, remove kbdenable()/kbdinit()
on vmware, loading a new kernel sometimes reboots when
wiggling the mouse. disabling keyboard and mouse on
shutdown fixes the issue.
make sure ps2 mouse is disabled on init, will get re-enabled
in i8042auxenable().
keyboard isnt special anymore, we can just use the devreset
entry point in the device to do the keyboard initialization,
so kbdinit()/kbdenable() are not needed anymore.
2015-08-05 09:22:07 +02:00
cinap_lenrek 145624eec2 kernel: remove unused qstate() function 2015-08-04 13:52:29 +02:00
cinap_lenrek dcb5f4212b devkbd: poll pc keyboard before blocking on kbd.q
the keyboard stops sending interrupts when its fifo gets full,
which can happen on boot when keys get mashed while interrupts
are still disabled. to work arround this, call the keyboard
interrupt handler when kbd.q is starved before blocking.
2015-08-04 13:43:35 +02:00
cinap_lenrek 1f0057c5fd python: use altzone 2015-08-04 02:03:38 +02:00
cinap_lenrek 63759d2efb ape: implement altzone for tzset() 2015-08-04 02:01:41 +02:00
cinap_lenrek 333812ca38 ape: fix mktime() again 2015-08-04 02:00:37 +02:00
cinap_lenrek 402741bc01 resample: simplify getint() 2015-08-03 18:30:02 +02:00
cinap_lenrek d457a43461 libc: make atoi() not parse c-style octal and hex numbers
interpreting octal breaks parsing of decimal numbers with
leading zeros. the manpage listed this in the BUGS section,
so we'r going to fix it as this just causes confusion as
most callers of atoi() do not expect it.
2015-08-03 18:10:53 +02:00
cinap_lenrek 2513946536 crop: use strtol() instead of atoi() 2015-08-03 17:29:30 +02:00
cinap_lenrek 953387d7ba bitsy: replace atoi() calls with strtol() when hex can be expcted 2015-08-03 17:08:33 +02:00
cinap_lenrek 2ef29e10f4 pc, pc64: replace atoi() calls with strtol() when hex can be expcte 2015-08-03 17:07:40 +02:00
cinap_lenrek 1b7e120c09 kernel: dont rely on atoi() parsing hex for netif/devbridge 2015-08-03 16:24:14 +02:00
cinap_lenrek 887ae1a17b webcookies: fix typo 2015-08-03 15:52:03 +02:00