]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
9 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.

9 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

9 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.

9 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.

9 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.

9 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()

9 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()

9 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).

9 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

9 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)

9 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.

9 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.

9 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

9 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.

9 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

9 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

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

9 years agoip/httpfile: fix flushes, fix concurrent reads, set error string
cinap_lenrek [Thu, 23 Jul 2015 01:24:39 +0000 (03:24 +0200)]
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.

9 years agokernel: make sure fd is in range in fdclose()
cinap_lenrek [Thu, 23 Jul 2015 20:56:49 +0000 (22:56 +0200)]
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.

9 years agokernel: simplify syspipe()
cinap_lenrek [Thu, 23 Jul 2015 20:34:58 +0000 (22:34 +0200)]
kernel: simplify syspipe()

9 years agodevaoe: more nil vs. 0
cinap_lenrek [Thu, 23 Jul 2015 20:05:46 +0000 (22:05 +0200)]
devaoe: more nil vs. 0

9 years agodevaoe: fix off by one in aoeerror(), consistent use of nil for pointers, error handling
cinap_lenrek [Wed, 22 Jul 2015 19:56:11 +0000 (21:56 +0200)]
devaoe: fix off by one in aoeerror(), consistent use of nil for pointers, error handling

9 years agokernel: consistent use of nil for pointer in sysfile.c
cinap_lenrek [Wed, 22 Jul 2015 19:54:07 +0000 (21:54 +0200)]
kernel: consistent use of nil for pointer in sysfile.c

9 years agokernel: cleanup chan.c to consistenly use nil instead of 0 for pointers
cinap_lenrek [Wed, 22 Jul 2015 17:17:10 +0000 (19:17 +0200)]
kernel: cleanup chan.c to consistenly use nil instead of 0 for pointers

9 years agokernel: make sure the swap device has a reasonable capacity in setswapchan()
cinap_lenrek [Wed, 22 Jul 2015 17:15:51 +0000 (19:15 +0200)]
kernel: make sure the swap device has a reasonable capacity in setswapchan()

9 years agodevmnt: do not use user buffer to update the mount cache
cinap_lenrek [Sun, 19 Jul 2015 18:25:42 +0000 (20:25 +0200)]
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.

9 years agodevstream: fix mistake
cinap_lenrek [Sun, 19 Jul 2015 01:36:53 +0000 (03:36 +0200)]
devstream: fix mistake

9 years agostream(3): fix reference
cinap_lenrek [Sun, 19 Jul 2015 01:34:08 +0000 (03:34 +0200)]
stream(3): fix reference

9 years agofcp: use iounit() to determine buffer size, reduce number of worker procs to 8
cinap_lenrek [Sun, 19 Jul 2015 01:32:38 +0000 (03:32 +0200)]
fcp: use iounit() to determine buffer size, reduce number of worker procs to 8

9 years agocp: experimental stream support
cinap_lenrek [Sun, 19 Jul 2015 01:32:09 +0000 (03:32 +0200)]
cp: experimental stream support

9 years agodevstream: fast sequential file access with 9p pipelining experiment
cinap_lenrek [Sun, 19 Jul 2015 01:31:17 +0000 (03:31 +0200)]
devstream: fast sequential file access with 9p pipelining experiment

9 years agopc: check Sse (bit 25) in cpuiddx before enabling fxsr in cr4 (fixes crash on the...
cinap_lenrek [Thu, 16 Jul 2015 06:51:06 +0000 (08:51 +0200)]
pc: check Sse (bit 25) in cpuiddx before enabling fxsr in cr4 (fixes crash on the pentium II)

9 years agoaux/cpuid: make sure extended feature bits are available (fixes crash on the pentium II)
cinap_lenrek [Thu, 16 Jul 2015 06:49:24 +0000 (08:49 +0200)]
aux/cpuid: make sure extended feature bits are available (fixes crash on the pentium II)

9 years agodevproc: make sure statbufread offset wont turn negative
cinap_lenrek [Wed, 15 Jul 2015 15:09:05 +0000 (17:09 +0200)]
devproc: make sure statbufread offset wont turn negative

9 years agofcp: fix wrong write pointer offset when read returns less than DEFB bytes
cinap_lenrek [Tue, 14 Jul 2015 18:44:34 +0000 (20:44 +0200)]
fcp: fix wrong write pointer offset when read returns less than DEFB bytes

9 years agokernel: remove debugalloc.c
cinap_lenrek [Tue, 14 Jul 2015 04:51:02 +0000 (06:51 +0200)]
kernel: remove debugalloc.c

9 years agomk9660: write data in alphabetical order
cinap_lenrek [Tue, 14 Jul 2015 20:33:27 +0000 (22:33 +0200)]
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.

9 years ago9660srv: keep data and metadata separate in the cache with a tag
cinap_lenrek [Tue, 14 Jul 2015 20:23:16 +0000 (22:23 +0200)]
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.

9 years ago9660srv: go back to 128k clusters
cinap_lenrek [Mon, 13 Jul 2015 16:37:56 +0000 (18:37 +0200)]
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.

9 years agoinst: fix download task using ip/httpfile to mount a iso over http and prompt for...
cinap_lenrek [Mon, 13 Jul 2015 04:28:46 +0000 (06:28 +0200)]
inst: fix download task using ip/httpfile to mount a iso over http and prompt for installurl

9 years agohttpfile: fix evictblock() so we wont consume all the memory
cinap_lenrek [Mon, 13 Jul 2015 03:51:04 +0000 (05:51 +0200)]
httpfile: fix evictblock() so we wont consume all the memory

9 years agolibFLAC: fix compiler warnings by properly declaring void function arguments
cinap_lenrek [Mon, 13 Jul 2015 00:56:51 +0000 (02:56 +0200)]
libFLAC: fix compiler warnings by properly declaring void function arguments

9 years agopython: HAVE_STDINT_H 1
cinap_lenrek [Mon, 13 Jul 2015 00:38:05 +0000 (02:38 +0200)]
python: HAVE_STDINT_H 1

9 years agoape: add stdint.h, fix SSIZE_MAX and add SIZE_MAX to limits.h
cinap_lenrek [Mon, 13 Jul 2015 00:36:48 +0000 (02:36 +0200)]
ape: add stdint.h, fix SSIZE_MAX and add SIZE_MAX to limits.h

9 years agocpp: search source file directory first for quoted #include (thanks Ori_B)
cinap_lenrek [Sun, 12 Jul 2015 22:54:56 +0000 (00:54 +0200)]
cpp: search source file directory first for quoted #include (thanks Ori_B)

foo.c includes bar/bar.h, which includes "baz.h"; it wants bar/baz.h
meanwhile, it also includes meh/quux.h, which includes "baz.h"; it wants meh/baz.h

9 years agoether82563: fix multicast filter (based on openbsd em(4) driver)
cinap_lenrek [Sun, 12 Jul 2015 17:21:53 +0000 (19:21 +0200)]
ether82563: fix multicast filter (based on openbsd em(4) driver)

9 years agopage: make lookahead fetch work in backwards direction
cinap_lenrek [Sat, 11 Jul 2015 00:42:14 +0000 (02:42 +0200)]
page: make lookahead fetch work in backwards direction

9 years agotftpd: count only options we understand so we wont send empty oack message
cinap_lenrek [Sat, 11 Jul 2015 00:35:49 +0000 (02:35 +0200)]
tftpd: count only options we understand so we wont send empty oack message

9 years agoetherrt2860: add multicast stub
cinap_lenrek [Sat, 11 Jul 2015 00:34:28 +0000 (02:34 +0200)]
etherrt2860: add multicast stub

9 years agoetheriwl: add multicast stub
cinap_lenrek [Sat, 11 Jul 2015 00:33:57 +0000 (02:33 +0200)]
etheriwl: add multicast stub

9 years agoetherwpi: dont enable transmit power for invalid channels, add multicast stub
cinap_lenrek [Sat, 11 Jul 2015 00:33:16 +0000 (02:33 +0200)]
etherwpi: dont enable transmit power for invalid channels, add multicast stub

9 years agowifi: reflect current transmit rate in mbps
cinap_lenrek [Fri, 10 Jul 2015 17:13:15 +0000 (19:13 +0200)]
wifi: reflect current transmit rate in mbps

9 years agoetherwpi: afra support
cinap_lenrek [Fri, 10 Jul 2015 16:59:57 +0000 (18:59 +0200)]
etherwpi: afra support

9 years agoetheriwl: dont clear descriptors after completion
cinap_lenrek [Fri, 10 Jul 2015 16:50:37 +0000 (18:50 +0200)]
etheriwl: dont clear descriptors after completion

9 years agowifi: adjust transmit rate on error (for etheriwl), small mkfile changes
cinap_lenrek [Fri, 10 Jul 2015 07:04:05 +0000 (09:04 +0200)]
wifi: adjust transmit rate on error (for etheriwl), small mkfile changes

Wnode gets two new counters: txcount and txerror
and actrate pointer that will be between minrate
and maxrate.

driver should use actrate instead of maxrate for
transmission when it can provide error feedback.

when a driver detects a transmission failed, it calls
wifitxfail() with the original packet. wifitxfail() then
reduces wn->actrate.

every 256th packet, we optimistically increase wn->actrate
before transmitting.

9 years agokernel: use HDR_MAGIC constant to handle Exec header extension, make rebootcmd()...
cinap_lenrek [Fri, 10 Jul 2015 21:56:39 +0000 (23:56 +0200)]
kernel: use HDR_MAGIC constant to handle Exec header extension, make rebootcmd() handle AOUT_MAGIC macro

9 years agosysexec(): need () arround AOUT_MAGIC comparsion to handle #define hack on mips
cinap_lenrek [Thu, 9 Jul 2015 06:51:38 +0000 (08:51 +0200)]
sysexec(): need () arround AOUT_MAGIC comparsion to handle #define hack on mips

9 years agosysexec(): make the mips compiler happy
cinap_lenrek [Thu, 9 Jul 2015 06:34:20 +0000 (08:34 +0200)]
sysexec(): make the mips compiler happy

9 years agokernel: reject bogus two byte "#!" shell scripts in sysexec()
cinap_lenrek [Thu, 9 Jul 2015 06:03:18 +0000 (08:03 +0200)]
kernel: reject bogus two byte "#!" shell scripts in sysexec()

- reject files smaller or equal to two bytes, they are bogus
- fix out of bounds access in shargs() when n <= 2
- only copy the bytes read into line buffer
- use nil for pointers instead of 0

9 years agokernel: various cleanups of imagereclaim(), pagereclaim(), freepages(), putimage()
cinap_lenrek [Wed, 8 Jul 2015 22:01:50 +0000 (00:01 +0200)]
kernel: various cleanups of imagereclaim(), pagereclaim(), freepages(), putimage()

imagereclaim(), pagereclaim():
- move imagereclaim() and pagereclaim() declarations to portfns.h
- consistently use ulong type for page counts
- name number of pages to free "pages" instead of "min"
- check for pages == 0 on entry

freepages():
- move pagechaindone() call to wakeup newpage() consumers inside
  palloc critical section.

putimage():
- use long type for refcount

9 years ago5e: enable VFP emulation by default, doubles only need to be 4 byte aligned
cinap_lenrek [Wed, 8 Jul 2015 00:13:16 +0000 (02:13 +0200)]
5e: enable VFP emulation by default, doubles only need to be 4 byte aligned

this adds -F flag to 5e (same as 5l) to disable VFP emulation
and makes VFP emulation the default.

9 years agopc64: use unsigned long for kmapindex and mmu counts avoiding signed integer division
cinap_lenrek [Tue, 7 Jul 2015 19:13:36 +0000 (21:13 +0200)]
pc64: use unsigned long for kmapindex and mmu counts avoiding signed integer division

9 years agoape: port libc smp tas() for arm
cinap_lenrek [Tue, 7 Jul 2015 17:53:26 +0000 (19:53 +0200)]
ape: port libc smp tas() for arm

9 years agolibc/arm: implement _tas() with LDREX/STREX, execute memory barrier on smp systems...
cinap_lenrek [Tue, 7 Jul 2015 17:24:10 +0000 (19:24 +0200)]
libc/arm: implement _tas() with LDREX/STREX, execute memory barrier on smp systems (zynq)

9 years agoall kernels: declare _tas() to prevent pulling in libc version (for libmemdraw)
cinap_lenrek [Tue, 7 Jul 2015 17:17:55 +0000 (19:17 +0200)]
all kernels: declare _tas() to prevent pulling in libc version (for libmemdraw)

9 years ago5e: approximate LL/SC with cas()
cinap_lenrek [Tue, 7 Jul 2015 04:30:34 +0000 (06:30 +0200)]
5e: approximate LL/SC with cas()

9 years ago5e: make sure stack base is aligned to avoid unaligned memory trap on arm
cinap_lenrek [Tue, 7 Jul 2015 04:26:56 +0000 (06:26 +0200)]
5e: make sure stack base is aligned to avoid unaligned memory trap on arm

9 years agoopen(2): fix typo
stanley lieber [Thu, 2 Jul 2015 01:46:47 +0000 (21:46 -0400)]
open(2): fix typo

9 years agonusb/audio: dont sysfatal on bad endpoint (no altc)
cinap_lenrek [Mon, 29 Jun 2015 20:28:23 +0000 (22:28 +0200)]
nusb/audio: dont sysfatal on bad endpoint (no altc)

9 years agonusbrc: handle fat formated usb drives without partition table
cinap_lenrek [Sun, 28 Jun 2015 19:50:30 +0000 (21:50 +0200)]
nusbrc: handle fat formated usb drives without partition table

on some usb drives, there is no dos partition table, so check
the filesystem type and consider the whole drive.

9 years agoetherwpi: remove debug prints, use iprint() in interrupt
cinap_lenrek [Sun, 28 Jun 2015 19:13:34 +0000 (21:13 +0200)]
etherwpi: remove debug prints, use iprint() in interrupt

9 years agowpa: do not prompt for key when there is already one in factotum
cinap_lenrek [Sun, 28 Jun 2015 18:40:19 +0000 (20:40 +0200)]
wpa: do not prompt for key when there is already one in factotum

9 years agoetherwpi: Intel PRO Wireless 3945abg driver based on openbsd's if_wpi (thanks aap)
cinap_lenrek [Sun, 28 Jun 2015 16:32:54 +0000 (18:32 +0200)]
etherwpi: Intel PRO Wireless 3945abg driver based on openbsd's if_wpi (thanks aap)

9 years agopc, pc64: toggle bit 2 in port 0x61 to reset and enable PCI SERR# nmi's, print nmi...
cinap_lenrek [Sun, 28 Jun 2015 16:22:36 +0000 (18:22 +0200)]
pc, pc64: toggle bit 2 in port 0x61 to reset and enable PCI SERR# nmi's, print nmi status

9 years agoapprox: chmod 775
stanley lieber [Sat, 27 Jun 2015 23:45:24 +0000 (19:45 -0400)]
approx: chmod 775

9 years agoadded approx(1)
aiju [Sat, 27 Jun 2015 20:00:33 +0000 (22:00 +0200)]
added approx(1)

9 years agofortunes: No we can't.
stanley lieber [Fri, 26 Jun 2015 18:10:01 +0000 (14:10 -0400)]
fortunes: No we can't.

9 years agowifi: berlin prime bunny hopping
cinap_lenrek [Sun, 21 Jun 2015 17:35:08 +0000 (19:35 +0200)]
wifi: berlin prime bunny hopping

- reduce delay for channel hop to 200ms
- use 1000ms timeout for auth response (dont hop channels while we wait)
- bunny hop sequence is mathematically prooven

9 years ago5e: implement DSB,DMB,ISB and CLREX instructions
cinap_lenrek [Fri, 19 Jun 2015 12:43:32 +0000 (14:43 +0200)]
5e: implement DSB,DMB,ISB and CLREX instructions

9 years agokernel: do not pull in atom.s from libc for arm kernels
cinap_lenrek [Fri, 19 Jun 2015 08:27:26 +0000 (10:27 +0200)]
kernel: do not pull in atom.s from libc for arm kernels

- provide our own copy of cas() in l.s
- replace use of libc ainc()/adec() with portable incref()/decref()

9 years agoexec(2): return register (R0) contains address of Tos structure.
cinap_lenrek [Fri, 19 Jun 2015 07:02:59 +0000 (09:02 +0200)]
exec(2): return register (R0) contains address of Tos structure.

9 years agokernel: ignore last page at the top of virtual kernel address space for xalloc()
cinap_lenrek [Fri, 19 Jun 2015 00:45:58 +0000 (02:45 +0200)]
kernel: ignore last page at the top of virtual kernel address space for xalloc()

avoding kernel address -BY2PG because of end pointer wrapping to zero.

9 years agondb(6): fix typo (thanks, pena)
stanley lieber [Thu, 18 Jun 2015 19:14:06 +0000 (15:14 -0400)]
ndb(6): fix typo (thanks, pena)

9 years agodhcpd(8): the fs attribute refers to the file server, not the name server (thanks...
stanley lieber [Thu, 18 Jun 2015 18:28:25 +0000 (14:28 -0400)]
dhcpd(8): the fs attribute refers to the file server, not the name server (thanks, pena)

9 years agozynq: use KADDR() for kmap() if we can avoiding the mapping
cinap_lenrek [Thu, 18 Jun 2015 10:16:54 +0000 (12:16 +0200)]
zynq: use KADDR() for kmap() if we can avoiding the mapping

9 years agokernel: ignore memory pages with singular kernel addresses
cinap_lenrek [Thu, 18 Jun 2015 10:15:33 +0000 (12:15 +0200)]
kernel: ignore memory pages with singular kernel addresses

addresses va's of 0 and -BY2PG cause trouble with some memmove()/memset()
implementations and possibly other code because of the nil pointer
and end pointers wrapping to zero.

9 years agozynq: fix barriers
cinap_lenrek [Thu, 18 Jun 2015 02:35:46 +0000 (04:35 +0200)]
zynq: fix barriers

unlock()/iunlock():

we need to place the coherence() *before* "l->key = 0", so that any
stores that where done while holding the lock become observable
*before* other processors see the lock released.

cas()/tas():

place memory barrier before successfull return to prevent reordering.

9 years agokernel: do not inherit Proc.dot (current working directory) in kproc()
cinap_lenrek [Thu, 18 Jun 2015 01:13:50 +0000 (03:13 +0200)]
kernel: do not inherit Proc.dot (current working directory) in kproc()

making sure to close the dot in every kproc appears repetitive,
so instead stop inheriting the dot in kproc() as this is usually
never what you wanted in the first place.

9 years agokernel: do not inherit current directory channel (dot) to pager
cinap_lenrek [Thu, 18 Jun 2015 20:58:56 +0000 (22:58 +0200)]
kernel: do not inherit current directory channel (dot) to pager

kproc() inherits dot and slash, pager needs to drop these
channels, otherwise it will keep the files open preventing
say, ramfs to exit.

9 years agousps: cut the useless part
ftrvxmtrx [Wed, 17 Jun 2015 16:07:32 +0000 (18:07 +0200)]
usps: cut the useless part

9 years agostats: add kernel malloc and kernel draw allocation size graphs
cinap_lenrek [Tue, 16 Jun 2015 06:08:42 +0000 (08:08 +0200)]
stats: add kernel malloc and kernel draw allocation size graphs

9 years agodevcons: add current pool allocations to #c/swap
cinap_lenrek [Tue, 16 Jun 2015 06:05:33 +0000 (08:05 +0200)]
devcons: add current pool allocations to #c/swap

9 years agokernel: remove waserror() arround newpage() in mntcache
cinap_lenrek [Tue, 16 Jun 2015 04:05:12 +0000 (06:05 +0200)]
kernel: remove waserror() arround newpage() in mntcache

newpage() does not raise error().

9 years agokernel: add pagechaindone() to wakeup processes waiting for memory
cinap_lenrek [Mon, 15 Jun 2015 15:40:47 +0000 (17:40 +0200)]
kernel: add pagechaindone() to wakeup processes waiting for memory

we keep the details about palloc in page.c, providing pagechaindone()
for mmu code to be called after a series of pagechainhead() calls.

9 years agodontkill: only use noswap flag to mark processes as not to be terminated on oom
cinap_lenrek [Mon, 15 Jun 2015 15:13:19 +0000 (17:13 +0200)]
dontkill: only use noswap flag to mark processes as not to be terminated on oom

changing procmode has the nasty side effect that notes cannot
be posted to them, prventing sysfatal() and threadexitsall()
to cleanup properly.

recent kernels also check the noswap flag to void killing them
in out of memory condition, so this is really all we need now.

9 years agothere's plenty of room in /lib
aiju [Mon, 15 Jun 2015 14:27:27 +0000 (16:27 +0200)]
there's plenty of room in /lib

9 years agokernel: implement separate wait queues for page allocation
cinap_lenrek [Mon, 15 Jun 2015 14:05:00 +0000 (16:05 +0200)]
kernel: implement separate wait queues for page allocation

give kernel processes and local disk file servers (procs
having noswap flag set) a clear advantage for page allocation
under starved condition by giving them ther own wait queue so
they get readied as soon as pages become available.

9 years agohjfs: defer parent directory permission check for wstat
cinap_lenrek [Mon, 15 Jun 2015 06:28:10 +0000 (08:28 +0200)]
hjfs: defer parent directory permission check for wstat

check parent directory permission *after* we determined
that the new name does not exist in the parent, so that
when the new name is the same as old name then no write
permission is required in the parent directory.

9 years agohjfs: fix wstat
cinap_lenrek [Sun, 14 Jun 2015 23:57:54 +0000 (01:57 +0200)]
hjfs: fix wstat

- rename to same name is ok
- only truncate when file size is different
- check for uid/gid *change*, not if it is specified or not

9 years agonusb/serial: remove unused channel
cinap_lenrek [Sun, 14 Jun 2015 22:30:19 +0000 (00:30 +0200)]
nusb/serial: remove unused channel