Commit graph

4896 commits

Author SHA1 Message Date
cinap_lenrek 18169e03de 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.
2015-07-31 01:10:53 +02:00
cinap_lenrek 9d59fb28cf 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.
2015-07-31 23:03:45 +02:00
cinap_lenrek 34e2e047cc iostats: add -C to usage 2015-07-31 22:51:52 +02:00
cinap_lenrek ee86d3cb52 devmnt: fix mntcache()
make sure mntcache() wont cache data beyond what was read from
the block list.
2015-07-30 21:00:13 +02:00
cinap_lenrek b86a12149a 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().
2015-07-30 20:30:47 +02:00
cinap_lenrek 25396d3ffd 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
2015-07-30 20:02:23 +02:00
cinap_lenrek 5161442171 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.
2015-07-30 20:00:43 +02:00
cinap_lenrek b579acef97 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
2015-07-30 19:55:13 +02:00
cinap_lenrek f899b2fe3c 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.
2015-07-30 19:51:11 +02:00
cinap_lenrek fdb1698791 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.
2015-07-29 14:51:00 +02:00
cinap_lenrek c4ae1a7435 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
2015-07-29 14:17:55 +02:00
cinap_lenrek a8735c02b6 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.
2015-07-29 08:50:53 +02:00
cinap_lenrek 34f3df213c 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.
2015-07-29 05:19:24 +02:00
cinap_lenrek 059c85dd75 ratrace: various improvements
error handling, serialize exits, close reader filedescriptors,
fix channel types, embedd the string buffer in the Msg struct.
2015-07-29 03:53:11 +02:00
cinap_lenrek d48dcf08aa cc: provide fake realloc() for getenv() 2015-07-28 12:06:29 +02:00
cinap_lenrek 20da5094d9 kernel: remove obsolete comment from namec() 2015-07-28 10:01:05 +02:00
cinap_lenrek 4bd9ed80c3 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).
2015-07-28 09:52:21 +02:00
cinap_lenrek 311a99e23b ether79c970: set mbps for proper queue sizes, assume gigabit ethernet for vmware 2015-07-28 03:30:21 +02:00
cinap_lenrek b506c6489b lib9p: return "write prohibited" error as documented in 9p(2) when srv->write is nil (thanks silasm) 2015-07-28 01:24:02 +02:00
cinap_lenrek 652a641704 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.
2015-07-27 06:42:41 +02:00
cinap_lenrek ff494b954f 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.
2015-07-27 04:33:46 +02:00
cinap_lenrek 23f7840056 devmnt: dont reset readahead window when requested offset still has pending rpc 2015-07-26 13:55:51 +02:00
cinap_lenrek 6617c63a37 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.
2015-07-26 05:43:26 +02:00
cinap_lenrek 918cb76040 page: fix deadlock, nil vs 0 for pointer comparsion, cleanup 2015-07-24 11:45:48 +02:00
cinap_lenrek 9e196fd0e2 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
2015-07-24 06:18:59 +02:00
stanley lieber 5635ac3f68 fortunes: go away. 2015-07-22 21:35:50 -04:00
cinap_lenrek ab4b7c2573 ip/httpfile: fix flushes, fix concurrent reads, set error string
Tflush handling was wrong, we cannot respond to the old
request if we have not actually removed the req from the
in progress block queue.

when reads are issued concurrently, we have to set b->len
before the block is inserted into the inprogress list.
otherwise findblock() is unable to find it and no requests
can be queued on the block. this caused the same offset
to be downloaded multiple times.

set the errstr in getrange() so in case of an error, we dont
get some random previous error string.
2015-07-23 03:24:39 +02:00
cinap_lenrek 497daed116 kernel: make sure fd is in range in fdclose()
as the Fgrp can be shared with other processes, we have to
recheck the fd index after locking the Fgrp in fdclose()
to make sure not to read beyond the bounds of the fd array.
2015-07-23 22:56:49 +02:00
cinap_lenrek 323184d775 kernel: simplify syspipe() 2015-07-23 22:34:58 +02:00
cinap_lenrek ff03b72ed5 devaoe: more nil vs. 0 2015-07-23 22:05:46 +02:00
cinap_lenrek 0b3fd7c052 devaoe: fix off by one in aoeerror(), consistent use of nil for pointers, error handling 2015-07-22 21:56:11 +02:00
cinap_lenrek 769b3f1c2f kernel: consistent use of nil for pointer in sysfile.c 2015-07-22 21:54:07 +02:00
cinap_lenrek 1fcc84d072 kernel: cleanup chan.c to consistenly use nil instead of 0 for pointers 2015-07-22 19:17:10 +02:00
cinap_lenrek 8db5af02d8 kernel: make sure the swap device has a reasonable capacity in setswapchan() 2015-07-22 19:15:51 +02:00
cinap_lenrek 47bb311d39 devmnt: do not use user buffer to update the mount cache
using the user buffer has a race where the user can modify
the buffer from another process before it is copied into the cache.
this allows poisoning the cache for every file where the user
has read access.

instead, we update the cache from kernel memory.
2015-07-19 20:25:42 +02:00
cinap_lenrek 157b7751e7 devstream: fix mistake 2015-07-19 03:36:53 +02:00
cinap_lenrek 64136bfd16 stream(3): fix reference 2015-07-19 03:34:08 +02:00
cinap_lenrek 9150d2773f fcp: use iounit() to determine buffer size, reduce number of worker procs to 8 2015-07-19 03:32:38 +02:00
cinap_lenrek 1d93677070 cp: experimental stream support 2015-07-19 03:32:09 +02:00
cinap_lenrek 71cda09d1e devstream: fast sequential file access with 9p pipelining experiment 2015-07-19 03:31:17 +02:00
cinap_lenrek 0bdfa3699d pc: check Sse (bit 25) in cpuiddx before enabling fxsr in cr4 (fixes crash on the pentium II) 2015-07-16 08:51:06 +02:00
cinap_lenrek e6d84a3fa6 aux/cpuid: make sure extended feature bits are available (fixes crash on the pentium II) 2015-07-16 08:49:24 +02:00
cinap_lenrek bae3ac29fc devproc: make sure statbufread offset wont turn negative 2015-07-15 17:09:05 +02:00
cinap_lenrek ea7bca1829 fcp: fix wrong write pointer offset when read returns less than DEFB bytes 2015-07-14 20:44:34 +02:00
cinap_lenrek 2aa2f9f359 kernel: remove debugalloc.c 2015-07-14 06:51:02 +02:00
cinap_lenrek 90bd02d5af mk9660: write data in alphabetical order
*after* writing, the directory tree gets alphabetically sorted for
path table. this causes data to not be in the same order as it was
written causing seeks when taring up the filesystem.

so instead write the files in alphabetical order as well to better
match the directory sorting.
2015-07-14 22:33:27 +02:00
cinap_lenrek 2e85e32886 9660srv: keep data and metadata separate in the cache with a tag
data on the disk is layed out sequentially and directory information
is at the end of the disk. we want to keep data and metadata separated
so that reading large sequential files will not evict the directory
information from the cache causing long seeks.

for that, we tag the clusters (an 8th for metadata, and the rest
for data) and getbuf() will only evict clusters of the same tag.
2015-07-14 22:23:16 +02:00
cinap_lenrek f5688dd6c9 9660srv: go back to 128k clusters
doing tests taring up 9front.iso shows the following:

lowering the cluster size back to 128k avoids over half the
reads. 837888 sectors read for 512k vs. 347712 sectors with
128k cluster size.
2015-07-13 18:37:56 +02:00
cinap_lenrek 2559f92a83 inst: fix download task using ip/httpfile to mount a iso over http and prompt for installurl 2015-07-13 06:28:46 +02:00
cinap_lenrek 41372f346a httpfile: fix evictblock() so we wont consume all the memory 2015-07-13 05:51:04 +02:00