Commit graph

3595 commits

Author SHA1 Message Date
cinap_lenrek
99e004c72e efi: convert pixel format to bootscreen color channel 2014-10-18 18:48:56 +02:00
cinap_lenrek
6aa6e9fc8b efi: make clean target virtual 2014-10-18 02:15:40 +02:00
cinap_lenrek
6f3dfb57eb efi: add experimental efi bootloader
this is basically a port of 9boot to EFI. theres
support for IA32 (386) and X64 (amd64).

has been tested only under qemu with OVMF so far.
2014-10-18 02:13:02 +02:00
cinap_lenrek
0a6439a1f5 pc, pc64: allow passing RSDT pointer in *acpi= boot parameter, early bootscreeninit(), fix rampage() usage
rampage() cannot be used after meminit(), so test for
conf.mem[0].npage != 0 and use xalloc()/mallocalign()
instead. this allows us to use vmap() early before
mmuinit() which is needed for bootscreeninit() and
acpi.

to get memory for page tables, pc64 needs a lowraminit().

with EFI, the RSDT pointer is passed in *acpi= parameter
from the efi loader. as the RSDT is ususally at the end of
the physical address space (and not to be found in
bios areas), we cannot KMAP() it so we need to vmap().
2014-10-18 02:01:58 +02:00
cinap_lenrek
b52f0c884e pc: add *bootscreen= variable to pass pre-initialized framebuffer info to kernel
EFI system has no cga or vesa anymore, so it becomes neccesary to
pass GOP framebuffer info to the kernel to get some output on the
screen.
2014-10-13 23:02:53 +02:00
cinap_lenrek
cc6ab31891 pc: sanity check bda value in lowraminit() to avoid overflow with efi 2014-10-12 20:18:59 +02:00
stanley lieber
ca694c51ef pkg: change default repo to http://9front.org/pkg/386 2014-10-12 13:27:53 -04:00
BurnZeZ
748a95266f rio: fix "-cd dir" in mountspec being ignored 2014-10-11 11:47:38 -04:00
stanley lieber
081bbcf0a1 fortunes: You have an agenda. 2014-10-06 21:17:26 -04:00
aiju
5de71b116a games/gba: new faster ppu code, audio support 2014-10-03 16:52:56 +02:00
aiju
74b7abe95c games/gba: fix dma repeat bit and eeprom addresses 2014-09-30 15:48:32 +02:00
aiju
4f264cedfb added crc32 2014-09-30 13:07:36 +02:00
cinap_lenrek
4f4d71b941 hgfs: make data files with meta headers having the right size after open
to get the right data size of a file, the revlog needs to have been
opened and the metaheader parsed. as an optimization, we used to
open revlog only on the first read resulting revlogs with metaheaders
having the wrong size returned by fstat() until the first read().

tar relies on fstat() giving the correct file size, so just open
the revlog on open. reading directories can still yield the wrong
size but it is not that critical.
2014-09-29 21:01:51 +02:00
cinap_lenrek
c1dc5d15c3 snap: change ulong return of stackptr() to uvlong for amd64 2014-09-29 20:11:58 +02:00
aiju
752841fcc1 games/gba: small fixes 2014-09-28 19:41:52 +02:00
cinap_lenrek
15afb9d00b apply ps2mouse corruption fix to omap
the omap ps2mouse driver is currently unused, but
in case of being finished at some point, apply the
fix from the pc driver.
2014-09-28 19:02:25 +02:00
cinap_lenrek
36db1295be pc/pc64: fix ps2mouse memory corruption race
there was a memory corruption bug caused by us enabling the
ps2mouseputc() handler *before* initializing packetsize.

once we enabled the handler, mouse interrupts could come
in and advance the packet buffer index (nb) beyond the
buffer boundaries.

as ps2mouseputc() only checked for ++nb == packetsize, once
nb was advanced beyond the packetsize, it would continue writing
beyond the buffer and corrupt memory with each mouse packet byte.

solution is to initialize packetsize *before* enabling the
handler, and also do a >= check in ps2mouseputc() in case the
packetsize gets changed to a smaller value at runtime.
2014-09-28 18:28:38 +02:00
cinap_lenrek
a494cc74ad ndb/dns: request recursion only for local dns servers
we used to set RD flag in requests unconditionally, which
is fine by the standard but some dns server administrators
seem to use it as a denial of service indicator (for ther
non recursive authoritative nameservers) and ignore the
request.

so only set the RD flag when talking to local dns servers.
2014-09-28 05:15:25 +02:00
cinap_lenrek
eb6a4fc1a4 devcons: avoid division by zero reading Qsysstat
alexchandel got the kernel to crash with divide error
on qemu 2.1.2/macosx at this location. probably
caused by perfticks()/tsc being wrong or accounttime()
not having been called yet from timer interrupt yet for
some reason.
2014-09-28 02:42:33 +02:00
aiju
c8cf0cee47 games/gba: remove bogus file 2014-09-28 22:42:11 +02:00
aiju
05bdd09bc3 merge 2014-09-27 20:51:00 +02:00
aiju
77f3fa19de games/gba: slowly working (no pun intended) 2014-09-27 20:50:20 +02:00
mischief
ee29c17639 pc64: enable rtl8169 driver (thanks awabimakoto for testing) 2014-09-24 14:19:22 -07:00
cinap_lenrek
decc7ec518 6c/8c: eleminate moves by swaping source and destination operands in peephole pass 2014-09-24 20:45:16 +02:00
cinap_lenrek
4cb032442a acid: fix sysr1() stack corruption
the syscall stubs (for amd64) currently have a unconditional
spill of the first (register) argument to the stack.

sysr1 (and _nsec) are exceptional in that they do not
take any arguments, so the stub is writing unconditionally
to ther first argument slot on the stack.

i could avoid emiting the spill in the syscall stubs for
sysr1 but that would also break truss which assumes fixed
instruction sequence from stub start to the syscall number.

i'm not going to complicate the syscall stubs just for
sysr1 (_nsec is not used in 9front), but just add a dummy
argument to sysr1 definition that can receive the bogus
argument spill.
2014-09-22 23:07:59 +02:00
cinap_lenrek
84c40fb226 devip: sanity check Nchan in Fsproto()
devip can only handle Maskconv+1 conversations per
protocol depending on how many bits it uses in the
qid to encode the conversation number.

we check this when the protocol gets registered.

if we do not do this, the kernel will mysteriously
panic when the conversaion numbers collide which
took some time to debug.
2014-09-21 19:24:38 +02:00
cinap_lenrek
c145a2c0aa devip: print protocol name in garbage collection notification 2014-09-21 18:02:53 +02:00
cinap_lenrek
47e52123d0 pc64: print "Plan 9" on boot, cleanup pccpu64 files 2014-09-21 16:06:25 +02:00
cinap_lenrek
2604bc3603 stats: handle /dev/sysstat 32bit overflow in delta calculation
the numbers from /dev/sysstat overflow on 32bit, so have
to do subtraction modulo 2^32 as we calculate with 64bit
integers.

thanks mischief for reporting this.
2014-09-20 18:06:59 +02:00
cinap_lenrek
19a8f66eec pc64: syscallfmt for nsec syscall 2014-09-20 01:37:11 +02:00
cinap_lenrek
acd15f13c4 pc64: put return value of nsec syscall in register on amd64
WHAT WHERE THEY *THINKING*??!?!

unlike seek, the (new) nsec syscall (not used in 9front libc)
returns the time value in register (from nix), so do the same
for compatibility.
2014-09-20 01:07:46 +02:00
cinap_lenrek
f899e55818 libmemdraw: fix byte ordering in memfillcolor()
memfillcolor() used to write longs in host byte
order which is wrong. have to always use little
endian.

to simplify, moved little endian conversion into
memsetl() and memsets() avoiding code duplication.
2014-09-19 17:49:48 +02:00
cinap_lenrek
a1b2b9b126 lib9p: fix nil dereference crash in remove for directory permission check
file->parent can be nil when the file has been previously removed.
removefile() deals with this, so skip the permission check in
that case and let removefile() error out.
2014-09-19 05:22:26 +02:00
cinap_lenrek
5d8300d2eb teg2: fix wrong l2 setshift address in wholecache() (from sources) 2014-09-17 16:34:30 +02:00
cinap_lenrek
ce80c5029e oggdec: recognize "begin of stream" packets and restart decoding 2014-09-16 20:25:01 +02:00
cinap_lenrek
187aad97be merge 2014-09-16 16:42:16 +02:00
cinap_lenrek
e060bc6df6 libauthsrv: allow multiple auth= attributes for backup auth servers, authdial() tries each one in order
some of us run auth servers from home that are used by multiple
servers on the internet. when the home authserver becomes unreachable,
services on the outside servers stop working. so we thought about
specifing a secondary auth servers for backup when the primary
server is not reachable.

this changes authdial() to consult multiple auth= entries in
the authdom= or dom= tuples, trying each one in order until
dial() succeeds.
2014-09-16 16:41:05 +02:00
mischief
e5c47ca18e ramfs: allow changing mtime in wstats 2014-09-15 15:49:39 -07:00
mischief
222018340b hg: make intermediate directories like newer hg does 2014-09-15 13:42:54 -07:00
cinap_lenrek
7011194af1 ramfs: fix directory check in wstat() (thanks mischief) 2014-09-16 22:33:27 +02:00
cinap_lenrek
694597de3b devtls: fix typo in debug print 2014-09-15 08:19:51 +02:00
cinap_lenrek
7f295c2055 telnetd: let the kernel place the shared segment in segattach() (thanks kenji arisawa) 2014-09-14 21:20:13 +02:00
cinap_lenrek
fdf3883ce4 libmemdraw: update drawtest to use same rounding in alpha calculation as libmemdraw 2014-09-14 17:03:56 +02:00
cinap_lenrek
e9fddbaad8 kernel: fix segattach() rounding of va+len (thanks kenji arisawa)
from segattach(2):

          Va and len specify the position of the segment in the
          process's address space.  Va is rounded down to the nearest
          page boundary and va+len is rounded up.  The system does not
          permit segments to overlap.  If va is zero, the system will
          choose a suitable address.

just rounding up len isnt enougth. we have to round up va+len
instead of just len so that the span [va, va+len) is covered
even if va is not page aligned.

kenjis example:

	print("%p\n",ap);	// 206cb0
	ap = segattach(0, "shared", ap, 1024);
	print("%p\n",ap);	// 206000

term% cat /proc/612768/segment
Stack     defff000 dffff000    1
Text   R      1000     6000    1
Data          6000     7000    1
Bss           7000     7000    1
Shared      206000   207000    1
term%

note that 0x206cb0 + 0x400 > 0x20700.
2014-09-14 16:04:22 +02:00
mischief
8348a233ae vi: implement _nsec syscall 2014-09-13 06:07:57 -07:00
cinap_lenrek
c8008e1ffd libsec: experimental DHE client support for tls and cleanups 2014-09-14 02:30:46 +02:00
cinap_lenrek
6c68876db6 libsec: add diffie-hellman functions 2014-09-14 02:29:18 +02:00
cinap_lenrek
4cf00ca6cb libsec: fix hmac for keys bigger then 64 byte block size
RFC2104 defines HMAC for keys bigger than the 64 byte block
size as follows:

Applications that use keys longer than B (64) bytes will
first hash the key using H (the hash function) and then
use the resultant L byte string as the actual key to HMAC.
2014-09-14 02:26:26 +02:00
aiju
69fab298be libsec: ecgen() and ecdsasign() fix 2014-09-13 19:46:41 +02:00
BurnZeZ
62a8bf1846 acme: remove unused #include 2014-09-11 12:47:04 -04:00
aiju
418ce96ca2 games/gb: minor goof 2014-09-11 11:36:35 +02:00
aiju
d63850570c games/nes: reduce volume, causes overflow and confuses ac97 2014-09-11 11:20:57 +02:00
cinap_lenrek
a49ddece8b ip/ayiya: experimental anything in anything tunnel protocol client
this is a work in progress implementation of the ayiya (anything
in anything) protocol as used by sixxs.net. hiro tested it and it
worked for him, but progress has stalled as sixxs.net rejected my
request for an account and ignored my emails since.
2014-09-06 22:59:58 +02:00
cinap_lenrek
460f482ad0 doom: fix alignment issues for arm 2014-09-04 23:02:37 +02:00
cinap_lenrek
3a322e9f32 5e: fix signed long multiply 2014-09-04 22:53:54 +02:00
cinap_lenrek
e890c3d943 5e: push ERRMAX for note message on stack avoiding unaligned stack pointer 2014-09-03 19:23:55 +02:00
cinap_lenrek
b864727723 ether8139: fix pointer to smaller int tuncation warning on amd64 2014-09-02 16:20:43 +02:00
stanley lieber
585ab698de /sys/lib/dist/ndb/common: add auth=fs.stanleylieber.com authdom=inri 2014-08-28 20:46:56 -04:00
stanley lieber
935e8472d1 fortunes: $75K Prosthetic Arm Is Bricked When Paired iPod Is Stolen 2014-08-27 01:13:11 -04:00
cinap_lenrek
7996878864 ipconfig: remove sleep() left over from debug :-) 2014-08-27 01:41:02 +02:00
cinap_lenrek
46b8a0ac00 ipconfig: fix readipifc() memory leaks in recvra6 and sendra6 processes
to avoid continuously leaking memory in recvra6 and sendra6
processes, pass the previous Ipifc* pointer to readipifc().
2014-08-27 01:12:42 +02:00
cinap_lenrek
acb49987e6 ip: set arp entry for own v6 address when not tentative
after running ip/ipconfig -6, we are unable to ping our
own link-local address and the arp daemon sends out useless
neighbor solicitation requests to itself. this change
adds an arp entry for our ipv6 address. however, this
must not be done for tentative interface configuration.
2014-08-26 21:29:37 +02:00
cinap_lenrek
7ad08a8515 ipconfig: cleanup code duplication in ip6cfg() 2014-08-26 21:09:57 +02:00
cinap_lenrek
dbf165e1bd ping: don't spin when we get error reading icmp connection, print error and sleep 2014-08-26 21:07:59 +02:00
cinap_lenrek
6031dd83b6 pc64: enable ether8139 in kernel config (thanks hiro) 2014-08-22 00:00:06 +02:00
cinap_lenrek
15755a5f83 ether8139: fix pointer truncation by ulong cast, use mallocalign() 2014-08-21 10:56:15 +02:00
cinap_lenrek
2161885034 secstore: improve error messages, newSConn() can't fail 2014-08-21 01:18:36 +02:00
cinap_lenrek
2ec9006e9e ip: fix memory leak in ipicadd6()
allocate the Iplifc structure on the stack instead.
i assuming that it was allocated on heap in fear of
causing stack oveflow. on 386, this adds arround
88 bytes on the stack but it doesnt seem to cause
any trouble. (checked with poolcheck after ctl write)
2014-08-21 00:30:13 +02:00
cinap_lenrek
0d5491fb08 pc, pc64: fix off by one error in _multibootentry 2014-08-18 03:16:11 +02:00
cinap_lenrek
f128c6eab0 boot: dont print errors if ethernet has no ifstats file, can happen with usb ethernet 2014-08-17 06:08:06 +02:00
cinap_lenrek
98e3e12d92 5a: revert MOVM .S and .W are exclusive (broke bcm build) 2014-08-17 04:26:28 +02:00
cinap_lenrek
3b661a96ef kernel: make noswap flag exclude processes from killbig() if not eve, reset noswap flag on exec 2014-08-17 00:50:20 +02:00
iru
0bc51a90b0 Fix acme crash: Get D in a new window with D being an existing directory 2014-08-16 18:50:42 -03:00
cinap_lenrek
773b57b676 kernel: fix todfix() race
we have to recheck the condition under tod lock, otherwise
another process can come in and updated tod.last and
tod.off and once we have the lock, we would make time
jump backwards.
2014-08-16 21:04:41 +02:00
cinap_lenrek
ce0b77e2b9 kernel: xinit() use ulong for page counts, cleanup 2014-08-16 17:26:12 +02:00
cinap_lenrek
a5bce84600 nusb/kb: delete code for keyboard boot protocol handling, just use hid parser
unify the keyboard and mouse readers into one using the hid
report parser for both. remove the keyboard protocol handling,
as it is now handled by hid parser and all we get is a sequence
of keycodes in Hiddev.k[] which we diff for up/down and translate
to pc scancodes.
2014-08-16 23:34:28 +02:00
aiju
74a276d076 spred: command window improvements 2014-08-14 10:42:39 +02:00
cinap_lenrek
a67d18ccf1 import: make aan (-p flag) work in ``backwards mode'' (-B)
in backwards mode, the roles of the aan filters need to be
reversed. add "-n address" option to import to override the
announce address for the aan server part (default tcp!*!0).
2014-08-14 00:11:14 +02:00
cinap_lenrek
d8d26c7001 nusb/ptp: do maxpkt reads to avoid babble error with usb 2.0 devices (thanks mischief!)
mischief got babble error with his mobile phone as we used to
read at max 64 bytes for the data response phase. his device
has 512 byte packet size.

thans to mischief for the patience.
2014-08-13 01:10:59 +02:00
cinap_lenrek
bedffdd8c3 devenv: prevent non-hostowner from creating or removing variables in '#ec', cleanup 2014-08-13 23:09:47 +02:00
cinap_lenrek
55bf3d6399 ip: fix missed unlocks and waserror handlers
ipifcunbind() could error out from ipifcremlifc() and Medium.unbind()
*after* decrementing ifc->conv->inuse! move the decrement after
calling these functions.

make ipifcremlifc() never raise error but return error string.
the only places where it could error is when it calls into
medium functions like Medium.remroute() and Medium.remmulti().
Ignore these errors as they could happen when the ethernet driver
crashed (think imported ethernet device or usb ethernet
in userspace), so we will be able to unbind.

add waserror() handlers as neccesary to deal with errors from
Medium.addmulti(), Medium.areg() and arpenter() to properly
unlock the data structures.
2014-08-12 21:35:31 +02:00
mischief
53619de428 aux/8prefix: fix usage 2014-08-12 10:33:47 -07:00
mischief
b0d7ade423 secstore(1): clarify how the server is dialed and add new $secstore environment variable 2014-08-10 20:38:59 -07:00
mischief
a0b7cabe3a secstore: read server from $secstore environment variable
this allows setting the secstore server with secstore=tcp!example.com!secstore or secstore='$secstore' to read from ndb.
2014-08-10 18:05:57 -07:00
stanley lieber
e17025174a fortunes: it´s easy but you are complicated 2014-08-10 19:04:20 -04:00
stanley lieber
443b046bff fs(8): correct spelling 2014-08-10 19:00:55 -04:00
cinap_lenrek
427e925eea cwfs: add optional uid argument to allow command, unify permission override code
the allow command now takes an optional uid argument for the user
to be granted temporary god status on the fileserver for maintenance.

this was kenji okomotos idea, so thanks :)

remove wstatallow and writeallow flags. instead, we have global:

int allowed;

that contains the uid of the currently allowed user id or -1
if permission checking is globally disabled for the fileserver.
when zero, normal permission checking takes place.

added int isallowed(File*) function that returns non-zero when the
context is the console, or the allowed user. this is also used internally
by iaccess(), so all the extra code of in the callers of iaccess()
is gone now.

dont conflate allowed user with noauth flag and auto-allow on ream.
the installer already knows about noauth and allow flags so theres no
problem with bootstraping.
2014-08-11 22:36:59 +02:00
cinap_lenrek
30d4d8984b 5a: MOVM.IA.W.S ..., [R15] is exception return and needs to be allowed (thanks aiju) 2014-08-09 18:23:14 +02:00
cinap_lenrek
760063ab57 cwfs: fix 32bit multiplication overflows for allocation sizes (thanks kenji okomoto) 2014-08-09 17:37:02 +02:00
cinap_lenrek
3472f91129 5a: reject MOVM instruction with .S and .W bits both set (aijus idea) 2014-08-09 22:47:46 +02:00
cinap_lenrek
daa15d1edb kernel: more nil vs 0 cleanup in chan.c 2014-08-08 17:02:10 +02:00
cinap_lenrek
ee6409366e kernel: use nil for pointers instead of 0, zero channel umc and dirrock in newchan() 2014-08-08 16:44:41 +02:00
cinap_lenrek
0ceeee4c8b ndb/dns: fix nil dereference crash with convM2DNS() returning reqmsg.qd == nil 2014-08-08 02:06:03 +02:00
cinap_lenrek
45333cdc92 devmnt: fix potential race with mntflushfree(), remove mntstats, 0 vs nil cleanup
when mountmux() completes a request for another process, enforce odering
of the loads and stores to the request prior to writing q->done = 1
so mntflushfree() sees q->done != 0 only when the request has actually
completed. otherwise, the q->done = 1 store could have been reordered
before the load from q->z, reading from already freed request and causing
spurious wakeups.

removing unused mntstats callback.

use nil for pointers instead of 0.
2014-08-08 23:28:47 +02:00
cinap_lenrek
bc306a5a63 8c, 6c: generate enam.c file, just like 5c 2014-08-07 21:35:52 +02:00
cinap_lenrek
0a101736b8 pc, pc64: make pc kaddr() check reject -KZERO address (thanks aiju) 2014-08-07 21:11:11 +02:00
cinap_lenrek
d304dc8119 5a, 5l: add LDREX/STREX/CLREX instructions 2014-08-07 20:22:00 +02:00
cinap_lenrek
ca4f815cfc pc64: fix wrong Ureg* argument on note handler (thanks _sl!)
_sl reported crash:

stats 593: suicide: sys: trap: fault write addr=0xffffffff8258d1b0 pc=0x204cc7

; acid 593
/proc/593/text:amd64 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/amd64
acid: lstk()
notejmp(ret=0x1,j=0x40ac90)+0x13 /sys/src/libc/amd64/notejmp.c:10
alarmed(a=0xffffffff8258d1b0,s=0x7ffffeffea58)+0x3f /sys/src/cmd/stats.c:718
notifier+0x3e /sys/src/libc/port/atnotify.c:15
acid:

note how a in alarmed is a kernel address!

the first Ureg* argument is passed to the note handler in the
RARG (BX) register, which was not loaded when returning to
userspace from syscall() thru forkret(). fix by returning thru
noteret() from syscall().
2014-08-07 19:55:25 +02:00
cinap_lenrek
7c1ae2ead3 samterm: fix ctrl-b crash when cmd window resized (thanks revex)
for reference:

On IRC revex reported that samterm crashes on Ctrl-b if the command window has
been resized. I was able to reproduce:

http://plan9.stanleylieber.com/sam/bugs/ctrl-b.png

; acid 831213
/proc/831213/text:amd64 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/amd64
acid: lstk()
abort()+0x0 /sys/src/libc/9sys/abort.c:6
panic1(s=0x400448)+0x27 /sys/src/cmd/samterm/main.c:692
panic()+0x19 /sys/src/cmd/samterm/main.c:684
lldelete()+0x71 /sys/src/cmd/samterm/flayer.c:221
flupfront(l=0x40eac0)+0x18 /sys/src/cmd/samterm/flayer.c:139
	v=0x20062900000001
current(nw=0x40eac0)+0x49 /sys/src/cmd/samterm/main.c:156
type(l=0x40eac0,res=0x15300000001)+0x37c /sys/src/cmd/samterm/main.c:658
	t=0x40eaa8
	buf=0x419ec0
	p=0x41dd48
	a=0x0
	backspacing=0x200000000
	c=0x41dd4800000002
	cursor=0x0
	a0=0x0
threadmain(argv=0x7ffffeffefa0)+0x21c /sys/src/cmd/samterm/main.c:75
	r=0xb0000001b1
	got=0xfefefefe00000002
	chord=0x0
	nwhich=0x43c310
	scr=0x200000000
	t=0xfefefefefefefefe
	w=0x43c310fefefefe
mainlauncher()+0x18 /sys/src/libthread/main.c:59
launcheramd64(arg=0x4194a0,f=0x221673)+0x10 /sys/src/libthread/amd64.c:11
0xfefefefefefefefe ?file?:0
acid:
2014-08-04 09:33:23 +02:00
cinap_lenrek
15b5a980d7 iostats: properly distribute exit status and give usefull error messages 2014-08-03 17:09:28 +02:00
cinap_lenrek
718f3358bb iostats: remove unused fcallfmt, dont leak our mount pipe end into exportfs proc 2014-08-03 16:28:07 +02:00
cinap_lenrek
d63734eb53 iostats: bring back standard filedescriptor spying 2014-08-03 16:02:47 +02:00
cinap_lenrek
5302e88796 exportfs: simplify freefile() code
remove impossible checks, rewrite as while loop.
2014-08-02 19:22:10 +02:00
cinap_lenrek
b185d2fe5c exportfs: remove getsbuf() nil check, can't happen 2014-08-02 19:04:33 +02:00
cinap_lenrek
686cf0b0f3 iostats: isolate fs from interrupt notes
interrupt notes go to the child process, not the filesystem
and filter process.
2014-08-02 18:45:19 +02:00
cinap_lenrek
4f45a40334 iostats: cannot spy on fd 0,1,2 as /fd is per process 2014-08-02 15:47:24 +02:00
cinap_lenrek
73d35f9c7d exportfs: cleanup 2014-08-02 15:07:29 +02:00
cinap_lenrek
7ae4e473da ftpfs: dont convert names to latin when string is valid utf-8 2014-08-02 14:37:16 +02:00
cinap_lenrek
7cc757c3c0 python: disable symlink and readlink compile options, ape has no reasonable way emulating it 2014-08-02 14:28:19 +02:00
cinap_lenrek
dc501ae1e3 iostats: dont prefix /bin to argv[0] when already absolute or relative path 2014-08-02 03:06:09 +02:00
cinap_lenrek
4e42b9996f iostats: cleanup, remove bogus Maxrpc constant 2014-08-02 02:41:57 +02:00
cinap_lenrek
23aaa0c59c iostats: reimplement iostats as a 9p filter instead of duplicating exportfs
old iostats failed to work when builidng the kernel due to old bugs
that where already fixed in exportfs. instead of backporting the fixes,
reimplement iostats as a filter that sits between exportfs and the
process mount. from users perspective, theres no difference.

the result is much smaller and can handle everything that exportfs
can like /srv.
2014-08-02 02:30:19 +02:00
cinap_lenrek
1b70ab5979 exportfs: use argv0 instead of hardcoding "/bin/exportfs" in openmount(), dont use 0 for nil 2014-08-01 16:57:39 +02:00
aiju
709e78b9f9 spred: scrolling and other bugfixes 2014-07-31 11:36:24 +02:00
stanley lieber
a39ce6a934 fortunes: From: urielc@cantv.net 2014-07-30 12:11:58 -04:00
stanley lieber
e7a3cd0fd0 spred(1): fix troff 2014-07-30 12:09:35 -04:00
aiju
712fd30652 added sprite editor spred 2014-07-30 15:57:14 +02:00
stanley lieber
555a05018b fstype(1): document hjfs 2014-07-29 22:32:16 -04:00
cinap_lenrek
a2f7d03d4e rc: fix slow Xqdol(), avoid recursion in conclist(), estrdup(), avoid copying
Xqdol() used to take quadratic time because of strcat(),
the code isnt really needed as list2str() aready does the
same thing in linear time without the strcat().

add estrdup() which uses emalloc() so allocation error are
catched.

move strdups() of name from callers into newvar().

avoid recursion of conclist(), and avoid copying of word
strings by providing Newword() function which doesnt copy
the word string.
2014-07-23 15:28:37 +02:00
mischief
2bdd2663db ratrace(1): uses syscall not syscalltrace file 2014-07-22 23:40:53 -07:00
stanley lieber
e42d8492c6 fortunes: I wanted to do something that didn't involve arguing online about trivia. -- jwz 2014-07-22 18:41:36 -04:00
stanley lieber
de8752e45e sega(1): add man page for games/md (and potential future sega emulators) 2014-07-22 18:29:33 -04:00
stanley lieber
0d909ae6ab nintendo(1): document snes 2014-07-22 17:44:46 -04:00
stanley lieber
33592e9d7c games/md: add -2 -3 -a and trailing newline to usage 2014-07-22 17:38:44 -04:00
stanley lieber
69eb0cd713 games/snes: add -a -h -m -T to usage 2014-07-22 17:00:32 -04:00
cinap_lenrek
6273bad12d ratrace: make multithreaded ratraces less confusing (for mischief) 2014-07-22 21:54:26 +02:00
cinap_lenrek
168b9f3de4 libdraw: add missing borderop() (thanks aiju) 2014-07-21 18:10:58 +02:00
cinap_lenrek
1021caa395 pc64: cleanup syscallentry()
avoid the stack shuffeling and make syscallentry() and
forkret() use the same stack offsets.
2014-07-21 18:02:14 +02:00
cinap_lenrek
c78c6e349a pc64: dont save/restore DS/ES/FS/GS segment registers on syscall or interrupt, they are ignored in long mode.
we do not support 32 bit processes and DS, ES, FS and GS segment
registers are ignored in long mode, so theres no point in saving
and restoring them.
2014-07-20 02:59:45 +02:00
cinap_lenrek
20b7a19c58 pc64: preserve user extern registers R14 and R15 across syscalls, use Ureg.bp (RARG) for syscall number
the 6c compiler reserves R14 and R15 for extern register variables,
which is used by the kernel to hold the m and up pointers. until
now, the meaning of R14 and R15 was undefined for userspace and
extern register would not work as the kernel trashes R14 and R15
on syscalls. with this change, user extern registers R14 and R15
are zeroed on exec and otherwise preserved across syscalls. so
userspace *could* use them for per process variables like the
kernel does.

use Ureg.bp (RARG) for syscall number instead of Ureg.ax. this is
less confusing and mirrors the amd64 calling convention.
2014-07-20 22:49:02 +02:00
mischief
b603991593 a.out(6): sync definitions 2014-07-17 23:22:48 -07:00
cinap_lenrek
4a7d29dd5f libframe: use correct text color on frinsert depending on selection (thanks sl)
frinsert() used cols[TEXT] for drawing selected text instead of the
HTEXT color. this was discovered with rio -b.
2014-07-17 23:29:55 +02:00
cinap_lenrek
e4436ec0bb page: fix deadlock with addpage (thanks BurnZeZ for the stacktraces)
addpage() should not be called with the display locked as it
calls showpage1() which sleeps when there are too many
processes active.

the bug was triggered by plumbing to trigger the addpage().
2014-07-15 20:45:00 +02:00
cinap_lenrek
4f3724e6e1 devproc: nil 2014-07-15 18:51:58 +02:00
cinap_lenrek
3d3a29cd84 devproc: fix syscalltrace error handling, conistent use of nil for pointers 2014-07-15 07:54:22 +02:00
cinap_lenrek
e4db040bcf devproc: fix mistake 2014-07-14 06:45:23 +02:00
cinap_lenrek
655ec332a7 devproc: fix proccrlmemio bugs
dont kill the calling process when demand load fails if fixfault()
is called from devproc. this happens when you delete the binary
of a running process and try to debug the process accessing uncached
pages thru /proc/$pid/mem file.

fixes to procctlmemio():

- fix missed unlock as txt2data() can error
- make sure the segment isnt freed by taking a reference (under p->seglock)
- access the page with segment locked (see comment)
- get rid of the segment stealer lock

other stuff:

- move txt2data() and data2txt() to segment.c
- add procpagecount() function
- make return type mcounseg() to ulong
2014-07-14 06:02:21 +02:00
cinap_lenrek
e53511ef4c libmach: fix break point instruction for little endian MIPS (from sources)
fix break point instruction for little endian MIPS in
libmach. (patch /n/sources/patch/libmach-mipsle-bpinst)
2014-07-13 01:24:55 +02:00
cinap_lenrek
cc001c31a7 tftpfs: make sure path is null terminated 2014-07-13 01:17:48 +02:00
cinap_lenrek
4b7b1218bf ftpd: dont skip unmountnet() and return proper error string from dialdata() 2014-07-13 01:03:17 +02:00
cinap_lenrek
e14eaacce6 tftpd: fix error string packet overflow in nak(), fix syslog reporting 2014-07-13 01:00:02 +02:00
cinap_lenrek
fafc17b049 expr: fix missing type declarations for match(), which broke on amd64 as pointers dont fit into a long 2014-07-12 03:02:21 +02:00
cinap_lenrek
03f68c49f6 kernel: only complain about no images when theres nothing more to reclaim
uncaching a thousand pages (arround 4MB) might not be
enougth. so keep on reclaiming pages and only complain
once theres nothing more to reclaim.
2014-07-11 03:57:21 +02:00
stanley lieber
3cfdae9787 pkg(1): add mischief's repositories 2014-07-09 19:48:59 -04:00
cinap_lenrek
e89ca39e53 Add AHCI support for Intel 8 Series/C220 Series Chipset Family SATA Controller. (from sources) 2014-07-10 00:07:51 +02:00
cinap_lenrek
d0895186a1 Add Intel C226 chipset PCI support. (from sources) 2014-07-10 00:07:09 +02:00
cinap_lenrek
6bfff754a8 abaco: fix double free race of p->status string (thanks BurnZeZ for the proc snap) 2014-07-09 23:55:54 +02:00
cinap_lenrek
3a6a754051 pc, pc64: initial machine check architecture support 2014-07-09 22:45:51 +02:00
cinap_lenrek
3fe38f7001 bcm: apply richards fix for mmukmap (from /n/sources/patch/bcm-mmukmap-bug) 2014-07-08 21:57:35 +02:00
cinap_lenrek
8677db333a nusb/serial: implement flushes
handle reads and writes with 9pqueue(2) so they can
be flushed and wont hang the filesystem. this also
lets us get rid of the timeouts.

ftdi is still full of braindamage that should be
rewritten, but i dont have a device to test.
2014-07-05 08:17:37 +02:00
cinap_lenrek
502247bf92 nusb/serial: more cleanup 2014-07-05 06:01:03 +02:00
cinap_lenrek
336e605a11 support for huawei e220 g3 modem, cleanup nusb/serial 2014-07-05 23:19:13 +02:00
stanley lieber
c20bab6fe0 ndb/common: add ipv6-icmp, ipv6-nonxt, ipv6-opts, bootps 2014-07-03 12:03:40 -04:00
cinap_lenrek
013054ef6f merge 2014-07-03 01:11:05 +02:00
stanley lieber
5814e66560 9pqueue(2): english 2014-07-02 19:01:20 -04:00
cinap_lenrek
2dc3180f98 9p(2): add reference to 9pqueue(2) 2014-07-03 00:57:40 +02:00
cinap_lenrek
fa56753ed8 add 9pqueue(2), medium to low quality manpage. 2014-07-03 00:47:10 +02:00
cinap_lenrek
51cb8f50d8 remove executable bit from /sys/src/lib9p/ramfs.c 2014-07-03 00:17:28 +02:00
Aram Hăvărneanu
0577d20890 merge 2014-07-01 11:21:47 +02:00
Aram Hăvărneanu
889afd97de acid: fix notestk() on amd64
Use Ureg->pc instead of Ureg->ir.
2014-07-01 11:20:55 +02:00
cinap_lenrek
92e43acb1c authsrv(6): fix typos (from /n/sources/patch/authsrv-6-typos) 2014-06-30 08:27:51 +02:00
stanley lieber
114a5bdce6 fortunes: Subject: ftp(1) User-Agent 2014-06-29 15:01:44 -04:00
stanley lieber
6a182d56b7 nusbrc: ensure rpi ethernet always appears as /net/etherU0 2014-06-29 14:58:03 -04:00
cinap_lenrek
4ad63a4c56 nusb: fix spelling, sorry 2014-06-28 19:55:14 +02:00
cinap_lenrek
7d9339f75e merge 2014-06-28 18:11:04 +02:00
cinap_lenrek
4275c49e72 nusb: implement aijus stable uniqueue device names
instead of naming devices by ther dynamically assigned device address,
we hash device uniqueue fields from the device descriptor and produce
a 5 digit hex string that will identify the device across machines.

when there is a collision (less than 1% chance with 100 devices),
usbd will append the device address to the name to make it uniqueue
for this machine.

the hname is passed to drivers in the devid argument, which now has
the form addr:hname, where the colon and hname can be omited (for backwards
compatibility).

when the new behaviour isnt desired, nousbhname= environment variable
can be defined giving the old behaviour.
2014-06-28 18:09:43 +02:00
cinap_lenrek
d8c75e45de iostats: more procs 2014-06-28 17:53:57 +02:00
mischief
9d30b0f32d merge 2014-06-27 23:51:14 -07:00
mischief
5aee1a997f unzip: fix usage 2014-06-27 23:50:42 -07:00
cinap_lenrek
ec572a53a9 ptp: fix alignment assumptions for amd64 2014-06-28 01:36:37 +02:00
mischief
a1dad87446 upas/fs: disable imap mail fetch pipeline due to race
pipeline = 1 with a dovecot imap server causes FETCH and OK responses
get interleaved so some message bodies accidentally get merged together.
disabling it will make fetching mail over imap slower, but it works.
2014-06-25 22:06:29 -07:00
mischief
072c45d463 xen: delete screen.h from pc that accidentally snuck in. a screen.h for xen framebuffer will be added later. 2014-06-25 16:56:39 -07:00
mischief
3812a4bf41 xen: fix boot argv0 2014-06-25 16:03:08 -07:00
mischief
500a91e7a3 xen: gotta go fast
use smaller timeouts for sleeps while waiting for xen ether and sd devices to come online. in practice they come up very quickly.
2014-06-25 15:47:31 -07:00
mischief
3f230d717d xen: correct print format for long 2014-06-25 15:45:04 -07:00
mischief
46cc1c444b sam: mark samsave executable
sam generates $home/sam.save for modified files. it expects /sys/lib/samsave to be executable to restore the modified files.
2014-06-25 03:13:52 -07:00
mischief
2060daf3b0 xen: fix early console 2014-06-24 19:37:03 -07:00
mischief
5ba95fdb07 import xen 32 bit paravirtual kernel from /n/sources/xen. 2014-06-24 18:02:25 -07:00
cinap_lenrek
fa03455b50 kernel: more proc.c cleanup 2014-06-23 21:51:34 +02:00
cinap_lenrek
6a05751132 kernel: make use of nil and 0 consistent in proc.c
always explicitely compare with nil if pointer.
sorry for the noise. :(
2014-06-23 21:24:12 +02:00
cinap_lenrek
650d794cbf merge 2014-06-23 20:30:18 +02:00
cinap_lenrek
7cf6a35486 kernel: fix cooperative scheduling for wired processes 2014-06-23 20:29:10 +02:00
stanley lieber
c87e7ffe2b newt(1): minor man page clarifications 2014-06-22 18:10:04 -04:00
cinap_lenrek
87d5626af0 ether8169: use u16int instead of u8int for C+ command register (thanks pavel / erik) 2014-06-22 19:01:37 +02:00
cinap_lenrek
e7bfa556ad pc64: fix comment for preallocpages() 2014-06-22 16:05:53 +02:00
cinap_lenrek
3c41f98e0c remove imagepagerefs() acid function 2014-06-22 15:40:36 +02:00
cinap_lenrek
d4d86df2ab kernel: new pagecache, remove Lock from page, use cmpswap for Ref instead of Lock
make the Page stucture less than half its original size by getting rid of
the Lock and the lru.

The Lock was required to coordinate the unchaining of pages that where
both cached and on the lru freelist.

now pages have a single next pointer that is used for palloc.head
freelist xor for page cache hash chains in Image.pghash[].

cached pages are not on the freelist anymore, but will be reclaimed
from images by the pager when the freelist runs out of pages.

each Image has its own 512 hash chains for cached page lookup. That is
2MB worth of pages and there should be no collisions for most text images.

page reclaiming can be done without holding palloc.lock as the Image is
the owner of the page hash chains protected by the Image's lock.

reclaiming Image structures can be done quickly by only reclaiming pages from
inactive images, that is images which are not currently in use by segments.

the Ref structure has no Lock anymore. Only a single long that is atomically
incremented or decremnted using cmpswap().

there are various other changes as a consequence code. and lots of pikeshedding,
sorry.
2014-06-22 15:12:45 +02:00
cinap_lenrek
4f95d75098 ed: dont pass string constants to mktemp() 2014-06-22 01:48:02 +02:00
aiju
f65d27b0fc games/md: small bug fixes 2014-06-15 20:11:24 +02:00
aiju
1bacbf5651 games/md: add shadow/hilight support 2014-06-15 19:02:06 +02:00
aiju
838163670c games/md: add save game support, fix cpu bug 2014-06-15 15:52:29 +02:00
aiju
e30fc1fbdf games/md: small fixes 2014-06-14 20:18:57 +02:00
aiju
37a5b4e9c3 games/snes: fix -T 2014-06-13 19:54:33 +02:00
aiju
f0ed9ed9f0 games/md: vdp window fix, added ym2612 timers 2014-06-13 18:06:44 +02:00
aiju
7c25ae8a34 games/md: add z80, audio support 2014-06-13 17:21:25 +02:00
cinap_lenrek
e6f37cf64e pc64: fix MS2HZ (thanks Anthony Martin) 2014-06-13 10:19:46 +02:00
cinap_lenrek
63ac70281a libstdio: avoid issues with aliasing in dtoa() on amd64 (from 9atom, thanks to erik and charles) 2014-06-12 20:14:12 +02:00
cinap_lenrek
d4e66accaa libsec: use u32int instead of uint when we need 32 bit (thanks erik) 2014-06-12 14:05:10 +02:00
cinap_lenrek
fa09758a73 samterm: use 4K stacks for amd64 (thanks burnzez)
we got a stack overflow on the hostproc on amd64 overflowing
by arround 200 byte. so just use 4K stacks for everything.
2014-06-11 19:31:14 +02:00
cinap_lenrek
3a5b2189ed revert ramfs example
the code was correct. erealloc9p() terminates the process
on error, but the code was handling realloc() error explicitely
and responded the request with Enomem error.
2014-06-11 18:01:20 +02:00