]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
8 years agolib9p: make reqqueueflush() use new threadint(), which will also cover channel operations
cinap_lenrek [Mon, 10 Aug 2015 01:52:40 +0000 (03:52 +0200)]
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.

8 years agolibthread: use "interrupt" proc ctl message instead of posting a note for threadint()
cinap_lenrek [Mon, 10 Aug 2015 01:48:37 +0000 (03:48 +0200)]
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)

8 years agolibthread: fix mistake, make "all" the default target again
cinap_lenrek [Mon, 10 Aug 2015 01:20:08 +0000 (03:20 +0200)]
libthread: fix mistake, make "all" the default target again

8 years agoacid -k: fix intrcount() for amd64
cinap_lenrek [Sun, 9 Aug 2015 20:43:53 +0000 (22:43 +0200)]
acid -k: fix intrcount() for amd64

8 years agoacid -k: fix procenv() to new data structure
cinap_lenrek [Sun, 9 Aug 2015 20:24:50 +0000 (22:24 +0200)]
acid -k: fix procenv() to new data structure

8 years agozunq: remove unused variables from devqspi
cinap_lenrek [Sun, 9 Aug 2015 20:05:14 +0000 (22:05 +0200)]
zunq: remove unused variables from devqspi

8 years agokernel: move "setargs" field in Proc structure after "nargs" and "args"
cinap_lenrek [Sun, 9 Aug 2015 19:48:58 +0000 (21:48 +0200)]
kernel: move "setargs" field in Proc structure after "nargs" and "args"

8 years agokernel: mount flag is int not ulong, reduce size of Mount struct by putting mflag...
cinap_lenrek [Sun, 9 Aug 2015 19:35:50 +0000 (21:35 +0200)]
kernel: mount flag is int not ulong, reduce size of Mount struct by putting mflag field in what would be wasted as padding

8 years agokernel: pgrpcpy(), simplify Mount structure
cinap_lenrek [Sun, 9 Aug 2015 19:16:10 +0000 (21:16 +0200)]
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.

8 years agokernel: fix Mheadache
cinap_lenrek [Sun, 9 Aug 2015 16:19:47 +0000 (18:19 +0200)]
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().

8 years agorootstub: add spim
cinap_lenrek [Sat, 8 Aug 2015 07:20:48 +0000 (09:20 +0200)]
rootstub: add spim

8 years agocdproto: add spim
cinap_lenrek [Sat, 8 Aug 2015 06:56:08 +0000 (08:56 +0200)]
cdproto: add spim

8 years agoadd /spim
cinap_lenrek [Sat, 8 Aug 2015 06:38:25 +0000 (08:38 +0200)]
add /spim

8 years agopython: fix build for objtype=$spim
cinap_lenrek [Sat, 8 Aug 2015 06:34:16 +0000 (08:34 +0200)]
python: fix build for objtype=$spim

8 years agogs: fix build for objtype=spim
cinap_lenrek [Sat, 8 Aug 2015 06:31:49 +0000 (08:31 +0200)]
gs: fix build for objtype=spim

8 years agolibmp: fix build for objtype=spim
cinap_lenrek [Sat, 8 Aug 2015 06:25:36 +0000 (08:25 +0200)]
libmp: fix build for objtype=spim

8 years agoape: fix build for objtype=spim
cinap_lenrek [Sat, 8 Aug 2015 06:17:54 +0000 (08:17 +0200)]
ape: fix build for objtype=spim

8 years agofix library mkfiles for objtype=spim
cinap_lenrek [Sat, 8 Aug 2015 06:04:41 +0000 (08:04 +0200)]
fix library mkfiles for objtype=spim

8 years agolibmach: remove redundant check for big endian
mischief [Wed, 5 Aug 2015 13:37:02 +0000 (06:37 -0700)]
libmach: remove redundant check for big endian

8 years agolibmach: remove useless error check from previous commit
mischief [Wed, 5 Aug 2015 13:30:57 +0000 (06:30 -0700)]
libmach: remove useless error check from previous commit

8 years agolibmach: set correct endianness with little endian ELF32 mips binaries
mischief [Wed, 5 Aug 2015 13:26:23 +0000 (06:26 -0700)]
libmach: set correct endianness with little endian ELF32 mips binaries

8 years agokernel: remove unused MAXCRYPT constant from portdat.h
cinap_lenrek [Thu, 6 Aug 2015 11:35:03 +0000 (13:35 +0200)]
kernel: remove unused MAXCRYPT constant from portdat.h

8 years agovgaigfx: remove #define MB, theres a MB enum in portdat.h
cinap_lenrek [Thu, 6 Aug 2015 11:33:39 +0000 (13:33 +0200)]
vgaigfx: remove #define MB, theres a MB enum in portdat.h

8 years agokernel: have to validate argv[] again when copying to the new stack
cinap_lenrek [Thu, 6 Aug 2015 11:20:41 +0000 (13:20 +0200)]
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.

8 years agokernel: limit argv[] strings to the USTKSIZE to avoid overflow
cinap_lenrek [Thu, 6 Aug 2015 09:51:23 +0000 (11:51 +0200)]
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.

8 years agokernel: validnamedup() the name argument for segattach()
cinap_lenrek [Thu, 6 Aug 2015 09:48:51 +0000 (11:48 +0200)]
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.

8 years agokernel: fix indention in validname0()
cinap_lenrek [Thu, 6 Aug 2015 09:43:22 +0000 (11:43 +0200)]
kernel: fix indention in validname0()

8 years agokernel: limit syscallfmt user strings to 64K (as in validname)
cinap_lenrek [Thu, 6 Aug 2015 09:42:05 +0000 (11:42 +0200)]
kernel: limit syscallfmt user strings to 64K (as in validname)

8 years agokernel: change vmemchr() length argument to ulong and simplify
cinap_lenrek [Thu, 6 Aug 2015 08:15:07 +0000 (10:15 +0200)]
kernel: change vmemchr() length argument to ulong and simplify

8 years agokernel: use Etoolong[] constant instead of string literal in validname0()
cinap_lenrek [Thu, 6 Aug 2015 08:01:45 +0000 (10:01 +0200)]
kernel: use Etoolong[] constant instead of string literal in validname0()

8 years agokernel: make shargs() function static in sysproc.c
cinap_lenrek [Thu, 6 Aug 2015 07:09:57 +0000 (09:09 +0200)]
kernel: make shargs() function static in sysproc.c

8 years agokernel: reject empty argv (argv[0] == nil) in sysexec()
cinap_lenrek [Thu, 6 Aug 2015 06:47:38 +0000 (08:47 +0200)]
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"

8 years agoinit: do not run $home/lib/profile when cd $home failed
cinap_lenrek [Wed, 5 Aug 2015 12:09:02 +0000 (14:09 +0200)]
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.

8 years agokfs: set permission of / to 0775 on ream
cinap_lenrek [Wed, 5 Aug 2015 11:13:40 +0000 (13:13 +0200)]
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.

8 years agocwfs: set permission of / to 0775 on ream
cinap_lenrek [Wed, 5 Aug 2015 11:06:11 +0000 (13:06 +0200)]
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.

8 years agopc, pc64: remove unused psaux driver, cleanup devkbd
cinap_lenrek [Wed, 5 Aug 2015 08:44:03 +0000 (10:44 +0200)]
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.

8 years agodevkbd: disable mosue/keyboard on shutdown, disable ps2 mouse on init, remove kbdenab...
cinap_lenrek [Wed, 5 Aug 2015 07:22:07 +0000 (09:22 +0200)]
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.

8 years agokernel: remove unused qstate() function
cinap_lenrek [Tue, 4 Aug 2015 11:52:29 +0000 (13:52 +0200)]
kernel: remove unused qstate() function

8 years agodevkbd: poll pc keyboard before blocking on kbd.q
cinap_lenrek [Tue, 4 Aug 2015 11:43:35 +0000 (13:43 +0200)]
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.

8 years agopython: use altzone
cinap_lenrek [Tue, 4 Aug 2015 00:03:38 +0000 (02:03 +0200)]
python: use altzone

8 years agoape: implement altzone for tzset()
cinap_lenrek [Tue, 4 Aug 2015 00:01:41 +0000 (02:01 +0200)]
ape: implement altzone for tzset()

8 years agoape: fix mktime() again
cinap_lenrek [Tue, 4 Aug 2015 00:00:37 +0000 (02:00 +0200)]
ape: fix mktime() again

8 years agoresample: simplify getint()
cinap_lenrek [Mon, 3 Aug 2015 16:30:02 +0000 (18:30 +0200)]
resample: simplify getint()

8 years agolibc: make atoi() not parse c-style octal and hex numbers
cinap_lenrek [Mon, 3 Aug 2015 16:10:53 +0000 (18:10 +0200)]
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.

8 years agocrop: use strtol() instead of atoi()
cinap_lenrek [Mon, 3 Aug 2015 15:29:30 +0000 (17:29 +0200)]
crop: use strtol() instead of atoi()

8 years agobitsy: replace atoi() calls with strtol() when hex can be expcted
cinap_lenrek [Mon, 3 Aug 2015 15:08:33 +0000 (17:08 +0200)]
bitsy: replace atoi() calls with strtol() when hex can be expcted

8 years agopc, pc64: replace atoi() calls with strtol() when hex can be expcte
cinap_lenrek [Mon, 3 Aug 2015 15:07:40 +0000 (17:07 +0200)]
pc, pc64: replace atoi() calls with strtol() when hex can be expcte

8 years agokernel: dont rely on atoi() parsing hex for netif/devbridge
cinap_lenrek [Mon, 3 Aug 2015 14:24:14 +0000 (16:24 +0200)]
kernel: dont rely on atoi() parsing hex for netif/devbridge

8 years agowebcookies: fix typo
cinap_lenrek [Mon, 3 Aug 2015 13:52:03 +0000 (15:52 +0200)]
webcookies: fix typo

8 years ago9pcon: use strtol() to parse integers
cinap_lenrek [Mon, 3 Aug 2015 13:48:01 +0000 (15:48 +0200)]
9pcon: use strtol() to parse integers

8 years agolibcontrol: use strtol() to parse integer arguments
cinap_lenrek [Mon, 3 Aug 2015 13:32:16 +0000 (15:32 +0200)]
libcontrol: use strtol() to parse integer arguments

8 years agolibhttpd: use strtol to parse decimal character references in httpunesc()
cinap_lenrek [Mon, 3 Aug 2015 13:26:33 +0000 (15:26 +0200)]
libhttpd: use strtol to parse decimal character references in httpunesc()

8 years agosnoopy: dont rely on atoi() being able to parse hex
cinap_lenrek [Mon, 3 Aug 2015 12:58:41 +0000 (14:58 +0200)]
snoopy: dont rely on atoi() being able to parse hex

8 years agobitsy/keyboard: do not rely on atoi() being able to parse hex
cinap_lenrek [Mon, 3 Aug 2015 12:52:07 +0000 (14:52 +0200)]
bitsy/keyboard: do not rely on atoi() being able to parse hex

8 years agolibauthsrv: readnvram() use vlong for nvroff, parse $nvlen/$nvoff with strtol() inste...
cinap_lenrek [Mon, 3 Aug 2015 12:45:23 +0000 (14:45 +0200)]
libauthsrv: readnvram() use vlong for nvroff, parse $nvlen/$nvoff with strtol() instead of atoi()

8 years agowebcookies: use strtol() to parse HH:MM:SS
cinap_lenrek [Mon, 3 Aug 2015 12:28:16 +0000 (14:28 +0200)]
webcookies: use strtol() to parse HH:MM:SS

atoi() currently interprets leading zeros as octal (BUG!),
so use strtol with explicit base 10 avoiding the issue.

8 years agoaux/vga: dont rely on atoi() being able to parse hex
cinap_lenrek [Mon, 3 Aug 2015 12:24:29 +0000 (14:24 +0200)]
aux/vga: dont rely on atoi() being able to parse hex

8 years agodevenv: simplify envremove(), cleanup
cinap_lenrek [Mon, 3 Aug 2015 20:08:10 +0000 (22:08 +0200)]
devenv: simplify envremove(), cleanup

8 years agodevenv: avoid indirection, keep Evalue's allocated in an array
cinap_lenrek [Sun, 2 Aug 2015 19:39:33 +0000 (21:39 +0200)]
devenv: avoid indirection, keep Evalue's allocated in an array

avoid the indirection for envlookup() by allocating Evalue structs
together in an array. remove unused link field in Evalue.

8 years ago1c,2c,7c,kc,vc: honor suppress condition for outstring() in swt.c
cinap_lenrek [Sun, 2 Aug 2015 12:52:54 +0000 (14:52 +0200)]
1c,2c,7c,kc,vc: honor suppress condition for outstring() in swt.c

8 years agoipv6on: fix search for ip attribute (thanks kenji arisawa)
cinap_lenrek [Sun, 2 Aug 2015 12:48:53 +0000 (14:48 +0200)]
ipv6on: fix search for ip attribute (thanks kenji arisawa)

8 years agopc, pc64: set *bootscreen= when framebuffer changes
cinap_lenrek [Sun, 2 Aug 2015 05:32:49 +0000 (07:32 +0200)]
pc, pc64: set *bootscreen= when framebuffer changes

add bootscreenconf(VGAscr *) function, that is called whenever
the framebuffer configuration is changed by devvga. that way, we
can pass the current setting of the framebuffer to the new
kernel when using /dev/reboot.

8 years agokernel: cleanup qlock.c to use nil instead of 0 for pointers
cinap_lenrek [Sun, 2 Aug 2015 03:36:35 +0000 (05:36 +0200)]
kernel: cleanup qlock.c to use nil instead of 0 for pointers

8 years agomothra: show <source> tag within <video>/<audio> tags
cinap_lenrek [Sat, 1 Aug 2015 14:38:55 +0000 (16:38 +0200)]
mothra: show <source> tag within <video>/<audio> tags

8 years agomothra: fix nil crash on missing name/src attributes for source/video/audio/embed...
cinap_lenrek [Sat, 1 Aug 2015 14:18:02 +0000 (16:18 +0200)]
mothra: fix nil crash on missing name/src attributes for source/video/audio/embed/frame/iframe

8 years agomothra: enable compiler warnings and type checking, cleanup
cinap_lenrek [Sat, 1 Aug 2015 12:55:33 +0000 (14:55 +0200)]
mothra: enable compiler warnings and type checking, cleanup

8 years agomothra: fix double button hit
cinap_lenrek [Sat, 1 Aug 2015 11:53:16 +0000 (13:53 +0200)]
mothra: fix double button hit

dolink() was hitting the button a second time!

8 years agomothra: cleanup url handling
cinap_lenrek [Sat, 1 Aug 2015 11:06:24 +0000 (13:06 +0200)]
mothra: cleanup url handling

8 years agomothra: fix selurl()
cinap_lenrek [Sat, 1 Aug 2015 10:51:52 +0000 (12:51 +0200)]
mothra: fix selurl()

8 years agojpg/ico: fix mkfile
cinap_lenrek [Sat, 1 Aug 2015 09:56:01 +0000 (11:56 +0200)]
jpg/ico: fix mkfile

8 years agomothra: support for inline images and <image> tag
cinap_lenrek [Sat, 1 Aug 2015 09:20:28 +0000 (11:20 +0200)]
mothra: support for inline images and <image> tag

8 years agowebcookies: create lockfile with 0600 permission, always use create() with perm 0600...
cinap_lenrek [Sat, 1 Aug 2015 01:18:44 +0000 (03:18 +0200)]
webcookies: create lockfile with 0600 permission, always use create() with perm 0600 for rewriting jar

8 years agobio(2): Bterm() closes filedescriptor for Bfdopen() allocated buffer
cinap_lenrek [Sat, 1 Aug 2015 01:16:35 +0000 (03:16 +0200)]
bio(2): Bterm() closes filedescriptor for Bfdopen() allocated buffer

8 years agojpg/ico: support for embedded png icons
cinap_lenrek [Fri, 31 Jul 2015 10:58:58 +0000 (12:58 +0200)]
jpg/ico: support for embedded png icons

8 years agowebcookies: fix implicit path cookie handling
cinap_lenrek [Thu, 30 Jul 2015 23:10:53 +0000 (01:10 +0200)]
webcookies: fix implicit path cookie handling

parsecookie() used to inplace modify the request path
for implicit path (to get the directory from path) and
also did it wrong. now have a static copy and do not
remove the last slash.

8 years agoaux/vga: sandybridge support for igfx (unfinished)
cinap_lenrek [Fri, 31 Jul 2015 21:03:45 +0000 (23:03 +0200)]
aux/vga: sandybridge support for igfx (unfinished)

as usual, the dude with the hardware vanished so i cannot
develop this further. setting mode worked the last time
but only when using vesa before, so some bits are still
missing. commiting this as it is so i dont have to start
from scratch once we have hardware again.

8 years agoiostats: add -C to usage
cinap_lenrek [Fri, 31 Jul 2015 20:51:52 +0000 (22:51 +0200)]
iostats: add -C to usage

8 years agodevmnt: fix mntcache()
cinap_lenrek [Thu, 30 Jul 2015 19:00:13 +0000 (21:00 +0200)]
devmnt: fix mntcache()

make sure mntcache() wont cache data beyond what was read from
the block list.

8 years agogames/doom: fix config file never being loaded or saved (thanks qu7uux)
cinap_lenrek [Thu, 30 Jul 2015 18:30:47 +0000 (20:30 +0200)]
games/doom: fix config file never being loaded or saved (thanks qu7uux)

basedefault[], the default path to the config file, is never set and remains
blank, unless -config %s is used (cd d_main.c). when games/doom attempts to
open the file, it silently fails and no config file is ever read or written.
this patch sets basedefault to a file in whatever directory a valid wad is
found in I_IdentifyWAD().

8 years agogames/doom: display correct message on medkit pickup when health low (thanks qu7uux)
cinap_lenrek [Thu, 30 Jul 2015 18:02:23 +0000 (20:02 +0200)]
games/doom: display correct message on medkit pickup when health low (thanks qu7uux)

due to a typo in p_inter.c:P_TouchSpecialThing(), a message that is supposed
to show up when the player picks up a medikit while low on health (< 25), is
never displayed. the check for low health is done after the health is already
increased, so the condition is never true.
a cosmetic bug in all old doom executables that also seems interesting to fix.
to test: compare message displayed when picking up a medikit with and without
the patch

8 years agogames/doom: fix ouchface not being shown when it should be (thanks qu7uux)
cinap_lenrek [Thu, 30 Jul 2015 18:00:43 +0000 (20:00 +0200)]
games/doom: fix ouchface not being shown when it should be (thanks qu7uux)

due to a typo in st_stuff.c:ST_updateFaceWidget(), doomguy mistakenly never
looks shocked when taking more than 20 damage, but rather when he gains more
than 20 health while being hit.
this is a cosmetic bug in all old versions of doom's executables, but it seems
appropriate to fix.
simple test: fire a rocket at a nearby wall, taking enough damage.

8 years agogames/doom: add bug compatibility switches (thanks qu7uux)
cinap_lenrek [Thu, 30 Jul 2015 17:55:13 +0000 (19:55 +0200)]
games/doom: add bug compatibility switches (thanks qu7uux)

these emulate bugs present in select versions of the released doom executables.
they are required to correctly play demos recorded with these but affect the
gameplay, so should be otherwise disabled.

-nobounce: lost souls don't bounce off floors and ceilings like intended due
to a misplaced check; this is fixed from ultimate doom on, but doom and doom2
are still affected.

-noztele: in final doom 1.9, things' altitude was erroneously not set to the
floor's height after teleporting. this was fixed in later versions of the
executables.

examples of desyncing demos:
(plutonia.wad, without -noztele) http://doomedsda.us/lmps/946/2/30pl2646.zip
(doom2.wad, without -nobounce) http://doomedsda.us/lmps/945/3/30nm2939.zip

8 years agogames/doom: fix switch textures swapping in ultimate doom (thansk qu7uux)
cinap_lenrek [Thu, 30 Jul 2015 17:51:11 +0000 (19:51 +0200)]
games/doom: fix switch textures swapping in ultimate doom (thansk qu7uux)

gamemode is set according to the name of the main wad (cf. d_main.c), i.e.:
- doom1.wad: (shareware doom1, ep1 only) gamemode == shareware
- doom.wad: (registered doom1, ep1-3) gamemode == registered
- doomu.wad: (ultimate doom, ep1-4) gamemode == retail
- doom2.wad, plutonia.wad, tnt.wad: gamemode == commercial
most doom.wad's distributed online are, in fact, ultimate doom.
if your ultimate doom wad is correctly named doomu.wad, some switches in
episodes 2-4 won't swap their texture when toggled, because
p_switch.c:P_InitSwitchList() is only checking for registered doom1.

easy way to test: demo2 in either registered or ultimate doom: the player flips
a switch right at the beginning of the demo; if the main wad is called
doomu.wad, the switch won't change its texture.
% games/doom -playdemo demo2
if you rename the wad to doom.wad or alter d_main.c:IdentifyVersion, the switch
will swap its texture like it should.

8 years agogames/doom: implement filelength() (thanks quux)
cinap_lenrek [Wed, 29 Jul 2015 12:51:00 +0000 (14:51 +0200)]
games/doom: implement filelength() (thanks quux)

this function is used when playing demos from external lumps. the game just
exits without this patch.
to test this, download a demo lump from somewhere, and play it with -playdemo %s
where %s is the file's name, without the .lmp extension:

(note that this one is a doom 2 demo, so it requires doom2.wad)
% hget http://doomedsda.us/lmps/945/3/30nm2939.zip | unzip -sv
extracting 30nm2939.LMP
extracting 30nm2939.txt
% mv 30nm2939.LMP 30nm2939.lmp # checking for a lump filename is case sensitive
% games/doom -playdemo 30nm2939

the game exits when the demo ends. also, note that this demo will desync on
map06 (the crusher), because of an unrelated bug (that's another patch :>)

note: filelength() returns vlong, but file lengths for doom lumps are ints.
however, this might be used elsewhere (networking), so i'd leave it this way.

8 years agoetheriwl: add pciid for Centrino Wireless-N 1000 (thanks qu7uux)
cinap_lenrek [Wed, 29 Jul 2015 12:17:55 +0000 (14:17 +0200)]
etheriwl: add pciid for Centrino Wireless-N 1000 (thanks qu7uux)

card seems to work fine with just this.
http://sysinfo.9front.org/src/125/body

8 years agowebcookies: fix isdomainmatch() (fixes livejournal.com login)
cinap_lenrek [Wed, 29 Jul 2015 06:50:53 +0000 (08:50 +0200)]
webcookies: fix isdomainmatch() (fixes livejournal.com login)

when cookie is domain=example.com, then we implicitely add
dot to the domain name, which made us reject the cookie as the
request domain "example.com" != ".example.com". fix by making
isdomainmatch() skip the implicit dot in pattern before string
comparsion.

8 years agoratrace: avoid blank line prints, make writer the parent
cinap_lenrek [Wed, 29 Jul 2015 03:19:24 +0000 (05:19 +0200)]
ratrace: avoid blank line prints, make writer the parent

when there where multiple syscalls returning out of order,
it would print blank lines between the exits. avoid this
by remembering if the last char written was a newline and
conditionally insert newline on out of order return.

sometimes, ratrace would return before all messages have
been printed. make the writer process the parent so ratrace
wont exit until all readers are finished avoiding the
problem.

8 years agoratrace: various improvements
cinap_lenrek [Wed, 29 Jul 2015 01:53:11 +0000 (03:53 +0200)]
ratrace: various improvements

error handling, serialize exits, close reader filedescriptors,
fix channel types, embedd the string buffer in the Msg struct.

8 years agocc: provide fake realloc() for getenv()
cinap_lenrek [Tue, 28 Jul 2015 10:06:29 +0000 (12:06 +0200)]
cc: provide fake realloc() for getenv()

8 years agokernel: remove obsolete comment from namec()
cinap_lenrek [Tue, 28 Jul 2015 08:01:05 +0000 (10:01 +0200)]
kernel: remove obsolete comment from namec()

8 years agokernel: export mntattach() from devmnt.c avoiding bogus struct passing and special...
cinap_lenrek [Tue, 28 Jul 2015 07:52:21 +0000 (09:52 +0200)]
kernel: export mntattach() from devmnt.c avoiding bogus struct passing and special case in namec()

we already export mntauth() and mntversion(), so why not stop
being sneaky and just export mntattach() so bindmount() and
devshr can just call it directly with proper arguments being
checked.

we can also avoid handling #M attach specially in namec()
by having the devmnt's attach function do error(Enoattach).

8 years agoether79c970: set mbps for proper queue sizes, assume gigabit ethernet for vmware
cinap_lenrek [Tue, 28 Jul 2015 01:30:21 +0000 (03:30 +0200)]
ether79c970: set mbps for proper queue sizes, assume gigabit ethernet for vmware

8 years agolib9p: return "write prohibited" error as documented in 9p(2) when srv->write is...
cinap_lenrek [Mon, 27 Jul 2015 23:24:02 +0000 (01:24 +0200)]
lib9p: return "write prohibited" error as documented in 9p(2) when srv->write is nil (thanks silasm)

8 years agokernel: clunk the cache when removing cache flag on a channel, only call cread()...
cinap_lenrek [Mon, 27 Jul 2015 04:42:41 +0000 (06:42 +0200)]
kernel: clunk the cache when removing cache flag on a channel, only call cread() chen CCACHE flag is set

to avoid double caching, attachimage() and setswapchan() clear
the CCACHE flag on the channel but this keeps the read ahread
state of the cache arround (until the chan gets closed), so also
call cclunk() to detach the mcp and free the read ahead state.

avoid the call to cread() when CCACHE flag is clear.

8 years agodevmnt: use c->iounit instead of msize-IOHDRSZ to chunk reads and writes, reduce...
cinap_lenrek [Mon, 27 Jul 2015 02:33:46 +0000 (04:33 +0200)]
devmnt: use c->iounit instead of msize-IOHDRSZ to chunk reads and writes, reduce memory overhead for Mntrpc, mntalloc lock

use the actual iounit returned from Ropen/Rcreate to chunk reads and writes
instead of c->mux->msize-IOHDRSZ.

dont preallocate the rpc buffers to msize, most 9p requests are rather small
(except Twrite of course). so we allocate the buffer on demand in mountio()
with some rounding to avoid frequent reallocations.

avoid malloc()/free() while holding mntalloc lock.

8 years agodevmnt: dont reset readahead window when requested offset still has pending rpc
cinap_lenrek [Sun, 26 Jul 2015 11:55:51 +0000 (13:55 +0200)]
devmnt: dont reset readahead window when requested offset still has pending rpc

8 years agokernel: pipelined read ahead for the mount cache
cinap_lenrek [Sun, 26 Jul 2015 03:43:26 +0000 (05:43 +0200)]
kernel: pipelined read ahead for the mount cache

this changes devmnt adding mntrahread() function and some helpers
for it to do pipelined sequential read ahead for the mount cache.

basically, cread() calls mntrahread() with Mntrah structure and it
figures out if we where reading sequentially and if thats the case
issues reads of c->iounit size in advance.

the read ahead state (Mntrah) is kept in the mount cache so we can
handle (read ahead) cache invalidation in the presence of writes.

8 years agopage: fix deadlock, nil vs 0 for pointer comparsion, cleanup
cinap_lenrek [Fri, 24 Jul 2015 09:45:48 +0000 (11:45 +0200)]
page: fix deadlock, nil vs 0 for pointer comparsion, cleanup

8 years agolibsec: increase handshake message buffer size (MaxChunk) to 32K (thanks sl)
cinap_lenrek [Fri, 24 Jul 2015 04:18:59 +0000 (06:18 +0200)]
libsec: increase handshake message buffer size (MaxChunk) to 32K (thanks sl)

_sl → webfs doesn't like packetfire.org: '/mnt/web/body' 0 No status tls: local handshake message too long 30781 16384

8 years agofortunes: go away.
stanley lieber [Thu, 23 Jul 2015 01:35:50 +0000 (21:35 -0400)]
fortunes: go away.