Commit graph

3680 commits

Author SHA1 Message Date
stanley lieber
314e23b709 dougfacts: remove html corruption and end file with newline 2014-06-07 15:16:24 -04:00
cinap_lenrek
865368f604 pc64: remove unneeded parens in pmap() 2014-06-07 09:43:37 +02:00
cinap_lenrek
3cc15d2301 merge 2014-06-07 09:28:33 +02:00
cinap_lenrek
7bc8f4d993 pc64: implement checkmmu() debug function 2014-06-07 09:26:57 +02:00
cinap_lenrek
2e713acc2c sdvirtio: experimental support for virtio-scsi 2014-06-07 02:13:57 +02:00
ftrvxmtrx
2739c6514a file: djvu 2014-06-07 23:16:34 +02:00
stanley lieber
20b2f7a38e fortunes: i believe any successful Plan 9 distro will need to provide some transparency in the change review process. -- Skip Tavakkolian 2014-06-06 00:58:36 -04:00
cinap_lenrek
524720a58d file: detect NES and SEGA rom files, fix newline 2014-06-06 01:29:14 +02:00
cinap_lenrek
1b51d46717 merge 2014-06-05 21:56:01 +02:00
cinap_lenrek
91614f582f kernel: dont use atomic increment for Proc.nlocks, maintain Lock.m for lock(), use uintptr intstead of long for pc values
change Proc.nlocks from Ref to int and just use normal increment and decrelemt
as done in erik quanstros 9atom.

It is not clear why we used atomic increment in the fist place as even if we
get preempted by interrupt and scheduled before we write back the incremented
value, it shouldnt be a problem and we'll just continue where we left off as
our process is the only one that can write to it.

Yoann Padioleau found that the Mach pointer Lock.m wasnt maintained
consistently for lock() vs canlock() and ilock(). Fixed.

Use uintptr instead of ulong for maxlockpc, maxilockpc and ilockpc debug variables.
2014-06-05 21:54:32 +02:00
ftrvxmtrx
f815f7273a g: add *.cpp 2014-06-05 12:10:43 +02:00
cinap_lenrek
76db435e3c pc64: dont trap _xinc()/_xdec() overflow/underflow, delete unused atomic functions 2014-06-05 07:57:23 +02:00
cinap_lenrek
863a459691 webfs: explicitely unmount old /mnt/web (thanks BurnZeZ)
webfs forks the namespace to isolate itself from its mount
point which has the side effect that it captures the mount
of previous instances of webfs mounted on /mnt/web.

explicitely unmount the mountpoint in our namespace copy
to drop the reference.
2014-06-04 17:45:08 +02:00
cinap_lenrek
972f60a794 nusbrc: dont fork usb drivers into background
probing needs to run synchronous to avoid races with other
readers of /dev/usbevent.
2014-06-04 23:59:17 +02:00
cinap_lenrek
93d0474f77 nusb/usbd: cleanup 2014-06-03 21:40:30 +02:00
cinap_lenrek
0aa3af0934 kernel: remove wrong and needles mapsize check in newseg() (thanks Yoann Padioleau) 2014-06-03 07:47:09 +02:00
cinap_lenrek
5ab9f9c621 nusb/usbd: serialize /dev/usbevent processing
when there are multiple readers of /dev/usbevent, we have to
serialize the processing to make sure that only one driver
is opening the devices control endpoint at a time.

to do this, we assume the device is busy after reading the
event file until the next read or clunk on the same fid.

to mark a device busy, we set the dev->aux pointer to the
fid processing a event. And the Event structure takes a
reference to the device producing the event.

the problem arised from cdc ethernet and nusb/serial sharing
the same device class, and we need to run the particular driver
to figure out if the device can be used. doing this concurrently
fails because devusb allows only one open per endpoint.
2014-06-03 07:21:48 +02:00
cinap_lenrek
1427ba3126 pc64: fix for unsigned comparsion of (top - base) >= size
the rounding of base can make it above top, so have to
use signed comparsion.
2014-06-01 06:54:55 +02:00
cinap_lenrek
fb97665a14 pc64: use 2MB pages for preallocpages() 2014-06-01 06:31:50 +02:00
cinap_lenrek
c9f91d5015 pc64: allocate palloc.pages from upages
the palloc.pages array takes arround 5% of the upages which
gives us:

16GB = ~0.8GB
32GB = ~1.6GB
64GB = ~3.2GB

we only have 2GB of address space above KZERO so this will not
work for long.

instead, pageinit() was altered to accept a preallocated memory
in palloc.pages. and preallocpages() in pc64/main.c allocates the
in upages memory, mapping it in the VMAP area (which has 512GB).

the drawback is that we cannot poke at Page structures now from
/proc/n/mem as the VMAP area is not accessible from it.
2014-06-01 03:13:58 +02:00
ftrvxmtrx
8061f30e55 games/nes: support Battle City two players mode with joypads 2014-06-01 01:21:00 +02:00
Aram Hăvărneanu
bf0d5c8abb 6a, 6c, 6l: fix copy propagation
Without an explicit signal for a truncation, copy propagation will
sometimes propagate a 32-bit truncation and end up overwriting uses of
the original 64-bit value.

This was independently discovered and fixed in Go. See:
	http://golang.org/issue/1315
	https://codereview.appspot.com/6002043/

Thanks Charles Forsyth for tips and advice.
2014-05-30 12:28:01 +02:00
cinap_lenrek
17d0dea87c we look for strings.c, it is broken, this strings.c will make us go. 2014-05-30 04:05:18 +02:00
cinap_lenrek
5246416621 pc, pc64: simplify reboot code
as we do system reset and reboot only from boot processor cpu0 now,
theres no need for active.rebooting conditional variable.
mpshutdown() will unconditionally park application processors and
and cpu0 boots the new kernel or calls mpshutdown() causing system
reset.
2014-05-29 18:50:52 +02:00
cinap_lenrek
215f6cc64a pc: initiate machine reset only from boot processors in mpshutdown()
in vmware, mpshutdown() used to hang in i8042reset() when not
called from the boot processor, so instead of reseting from first
cpu that acquires the shutdown lock, we park all application
processors and let the boot processor do the reset.
2014-05-29 18:24:40 +02:00
aiju
aa125d37e9 games/md: bug fixes 2014-05-29 00:50:06 +02:00
cinap_lenrek
ca35949c20 ape/stdio: set errno to EMFILE when running out of streams 2014-05-29 00:34:47 +02:00
aiju
52153c32dc games/snes: originwindow confuses the cat 2014-05-27 01:01:55 +02:00
cinap_lenrek
527ab6405c page(1): or 2014-05-26 10:00:39 +02:00
cinap_lenrek
c73ade70e3 page(1): minus 2014-05-26 09:59:57 +02:00
cinap_lenrek
97c28a6c80 page(1): theres no -r option, nor multipage restrictions 2014-05-26 09:52:47 +02:00
aiju
a106a19bbf merge 2014-05-26 01:11:08 +02:00
aiju
c124e341b9 games/md: moonwalker! 2014-05-26 01:10:46 +02:00
cinap_lenrek
3dc82dc04b pc64: fix ulongs for address of devarchs realmodemem file 2014-05-26 00:45:10 +02:00
cinap_lenrek
15fc6c1cc0 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.
2014-05-26 00:27:06 +02:00
cinap_lenrek
b672403c6d merge 2014-05-26 22:49:07 +02:00
cinap_lenrek
9ebbfae28b kernel: simplify fdclose() 2014-05-26 22:47:34 +02:00
cinap_lenrek
89acedb9b8 devproc: fix close and closefiles procctl
for the CMclose procctl, the fd number was not
bounds checked before indexing in the Fgrp.fd
array.

for the CMclosefiles, we looped fd from 0..maxfd-1,
but need to loop from 0..maxfd as maxfd is inclusive.
2014-05-26 22:43:21 +02:00
aiju
235cc0747d games/md: small cpu and vdp bug fixes 2014-05-25 21:45:13 +02:00
cinap_lenrek
c5214cd6d9 pc64: cleanup mmuzap 2014-05-25 20:34:26 +02:00
aiju
79355486f7 games/md: first bug fixes 2014-05-25 01:11:21 +02:00
aiju
93cfa1be72 added crude version of games/md 2014-05-25 23:14:23 +02:00
cinap_lenrek
ea480e74bb libauth: dont print blobs in auth_proxy error strings 2014-05-24 19:49:54 +02:00
cinap_lenrek
20883bd7de 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).
2014-05-24 02:09:52 +02:00
cinap_lenrek
2185188f83 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().
2014-05-24 01:27:57 +02:00
cinap_lenrek
eef4565003 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.
2014-05-23 18:56:20 +02:00
cinap_lenrek
440202d029 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.
2014-05-20 07:05:53 +02:00
cinap_lenrek
e7b94ba052 syscall: add missing _nsec() declaration 2014-05-20 05:21:22 +02:00
cinap_lenrek
3207e8b6a4 add _nsec() syscall 53 for binary compatibility with labs distribution
the new syscall is added under the symbol _nsec() for
binary compatibility.

nsec() is still a library function reading /dev/bintime.
2014-05-20 05:06:31 +02:00
cinap_lenrek
7abf926bcf libc: dont cache /dev/bintime filedescriptor for nsec() 2014-05-20 05:01:26 +02:00