cinap_lenrek [Sun, 25 May 2014 22:27:06 +0000 (00:27 +0200)]
devproc: handle 64bit address writes to /proc/n/mem files
procwrite() did truncate the offset to 32bit ulong.
introduce off2addr() function that does the sign
extension hack and use it conststently for Qmem
reads and writes.
cinap_lenrek [Sat, 24 May 2014 00:09:52 +0000 (02:09 +0200)]
cpu: remove duplicate environment and chdir($home) code (thanks qrstuv)
newns() (called by auth_chuid()) already prepares the
environment variables and puts us in a sane working
directory (as specified by the namespace file).
cinap_lenrek [Fri, 23 May 2014 23:27:57 +0000 (01:27 +0200)]
kernel: fix read size calculation in pio() demand load
on amd64, the text segment is aligned and padded to
2MB, but segment granularity is 4K which can give
us page faults that are beyond the highest file
offset. this is perfectly valid, but was not handled
correctly in pio().
cinap_lenrek [Fri, 23 May 2014 16:56:20 +0000 (18:56 +0200)]
libc: avoid static table and supurious reads in nsec()
use two per process memory slots, one for the
pid and one for the fd instead of a global table
avoiding the case when the table gets full.
instead of calling pread() on the cached fd
(dangerous as it has side effects when the
fd was not closed), we check if the cached fd
is still good using fd2path() when called
the first time in this process.
cinap_lenrek [Tue, 20 May 2014 05:05:53 +0000 (07:05 +0200)]
libc: revert nsec() change, bring back filedescriptor caching
theres big performance regression with this using
cwfs. cwfs calls time() to update atime on every
read/write which now causes walks on /dev.
reverting to the previous version for now. in the
long run, we'll use new _nsec() syscall but this
has to wait for a later release once new kernels
are established.
cinap_lenrek [Mon, 19 May 2014 21:23:08 +0000 (23:23 +0200)]
ip/torrent: fix usage, add -A option to set user-agent
trackers do like the new default Mozilla/5.0 (compatible)
user agent. so force useragent to hjdicks and give option
to override it in case trackers get even more clever in
the future.
cinap_lenrek [Fri, 16 May 2014 19:33:49 +0000 (21:33 +0200)]
sdiahci: fix (unused) hba reset function (thanks erik quanstro)
from the specification:
software may reset the entire HBA by setting GHC.HR to '1'.
When software sets the GHC.HR bit to '1', the HBA shall perform
an internal reset action. The bit shall be cleared to '0'
by the HBA when the reset is complete.
Matthew Veety [Fri, 16 May 2014 14:56:23 +0000 (10:56 -0400)]
added devgpio (thanks Krystian!). Also added getrevision() to vcore which allows you to get the raspberry pi board revision. I kept in the segment that allows direct access to the gpio memory
cinap_lenrek [Fri, 9 May 2014 16:22:51 +0000 (18:22 +0200)]
webfs: use mozilla compatible user agent as default
sites like google return the wrong characterset when
they do not recognize the user-agent. so setting default
user agent to something thats likely to pass these
idiotic browser tests.
compiler handles scope by overwritin and reverting
symbols while parsing. in the ccom phase, the nodes symbol
(n->sym) is not in the right scope and we wrongly think r
is uint instead of int.
it is not clear to me what this code tried to accomplish in
the first place nor could anyone answer me this question.
the risk is small as this change doesnt affect the compiled
program, only the warning, so removing the offending code.
cinap_lenrek [Fri, 2 May 2014 22:51:45 +0000 (00:51 +0200)]
cwfs: fix 1GB memsize limitation
the malloc pool allocator is limited in its allocation
size. as almost all data structures in cwfs are never
freed, use brk() in ialloc() instead of mallocalign().
this means memory returned by ialloc() cannot be freed!
to make sure we do not call free by accident, remove
the #define malloc(n) ialloc(n, 0) macro and use ialloc()
directly as in the original code to show the intend
of permanent allocations.
cinap_lenrek [Fri, 2 May 2014 02:23:21 +0000 (04:23 +0200)]
sdide: never timeout or retry scsi commands from the controller driver
this was a big mistake. we should never attempt to
timeout or retry a scsi command from the controller
driver because theres no way to tell how long a
command would take or if a command has side effects
when being retried.
cinap_lenrek [Thu, 1 May 2014 15:24:50 +0000 (17:24 +0200)]
pc64: increase sizes of physical memory bank maps
number of bank slots in Conf.mem[4] was too small
for kenjis machine, set it to maximum 16 (the
size of the RAM map in pc64/memory.c).
also increasing the UPA memory map to 64. the
e820 map on my x200s has 31 entries and many
holes. this gets rid of the "mapfree: ... losing"
messages on boot.
if theres an error transmitting a Tclunk or Tremove request,
we cannot assume the fid to be clunked. in case this was
a transient error, reusing the fid on further requests
will fail.
as a work arround, we zero the channels fid and allocate
a new fid before the chan is reused.
this is not correct as we essentially leak the fid
on the fileserver, but we will still be able to use
the mount.
the previous change tried to work arround this but had the
concequence that only the lastly defined endpoint was
usable.
this change addresses the issue by allowing up to 32 endpoints
per device (16 output + 16 input endpoints) in devusb. the
hci driver will ignore the 4th bit and will only use the
lower 4 bits as endpoint address when talking to the usb
device.
when we encounter a conflict, we map the input endpoint
to the upper id range 16..31 and the output endpoint
to id 0..15 so two distinct endpoints are created.