Commit graph

3443 commits

Author SHA1 Message Date
ftrvxmtrx
306bee92e1 uniq: use Bsize for buffers 2014-05-03 10:48:13 +02:00
cinap_lenrek
4c639475ce 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.
2014-05-03 00:51:45 +02:00
ftrvxmtrx
72e4d850a4 wc: simplify and avoid buffer overflow on long filenames 2014-05-03 23:38:17 +02:00
cinap_lenrek
bd3e9e4b7c 1l, 2l, 7l, kl, vl: add missing setmalloctag() dummy in compat.c 2014-05-02 05:17:40 +02:00
ftrvxmtrx
f7f3e4780a bio: Brdstr, Bopen: set malloc tag to the caller 2014-05-02 04:27:29 +02:00
cinap_lenrek
beb665051b 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.
2014-05-02 04:23:21 +02:00
ftrvxmtrx
8fea0399b0 bio: on a second thought, make it one line less 2014-05-02 04:03:35 +02:00
ftrvxmtrx
f9b6c4c5a3 bio: do not leak memory if realloc fails 2014-05-02 03:58:38 +02:00
ftrvxmtrx
e610c573d7 samterm: free() after getenv() 2014-05-02 03:47:18 +02:00
cinap_lenrek
405de1e6a2 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.
2014-05-01 17:24:50 +02:00
ftrvxmtrx
a1ee457ebc leak(1): typo 2014-05-01 13:08:43 +02:00
cinap_lenrek
a2d96d47c9 kernel: always reset notepending in eqlock, handle forceclosefgrp in eqlocks 2014-04-29 21:17:07 +02:00
cinap_lenrek
b7d8431036 kernel: stop queue bloat before allocating blocks 2014-04-29 21:15:09 +02:00
ftrvxmtrx
a2f0fdbfa0 aan(8): fix aanuke synopsis 2014-04-29 23:17:06 +02:00
cinap_lenrek
40b6959788 devmnt: make abandoning fid on botched clunk handle flushes
make mntflushfree() return the original rpc and do the
botched clunk check on the original instead of the
current rpc.

so if we get a botched flush of a clunk, we abandon the
fid of the channel as well.
2014-04-28 06:55:06 +02:00
cinap_lenrek
2c2a71cd51 devmnt: abandon fid on botched Tclunk or Tremove
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.
2014-04-28 05:59:10 +02:00
cinap_lenrek
219c312163 libip: use snprint() in myetheraddr() to prevent accidents 2014-04-28 02:32:06 +02:00
cinap_lenrek
391198888a 8c, 6c: fix peephole bug for eleminating CMPL $0,R after shift
the shift instructions does not change the zero flag
when the shift count is 0, so we cannot remove the
compare instruction in this case.

this fixes oggdec under 386.
2014-04-28 22:53:50 +02:00
ftrvxmtrx
7b8f4b25be btc mkfile: mkdir -p 2014-04-28 22:39:12 +02:00
ftrvxmtrx
9f2e627ec6 iwl: support another (broken) variant of centrino ultimate-n 6300 2014-04-27 15:12:15 +02:00
ftrvxmtrx
c0fada1560 merge 2014-04-26 18:24:39 +02:00
ftrvxmtrx
e41893d94f iwl: add Wifi Link 5150 did 2014-04-26 18:22:50 +02:00
cinap_lenrek
f3749669ba pmmc: recognize generic mmc controllers (untested) 2014-04-26 18:22:17 +02:00
cinap_lenrek
28f7f3f9d7 tlshand: cleanup 36 -> MD5dlen+SHA1dlen 2014-04-26 18:09:26 +02:00
cinap_lenrek
3b1a0ab1f3 tlshand: fix memory leaks, fix alloc element size for certs pointer array, error handling 2014-04-26 18:04:04 +02:00
glenda
c8ac5d7eb7 games/geigerstats: fix usage() to exit; games(1): geigerstats args 2014-04-26 15:08:28 +01:00
ftrvxmtrx
6a905b4560 tr: fix 4-byte runes fix (thanks rsc) 2014-04-26 14:26:40 +02:00
ftrvxmtrx
4468438c70 merge 2014-04-26 13:22:48 +02:00
ftrvxmtrx
b4fa1e617b man pages: fix duplicate words 2014-04-26 13:22:15 +02:00
glenda
5e201a7d2e draw(2): fix missing arg of bezspline on page 5 2014-04-26 03:38:07 +01:00
ftrvxmtrx
244bb0038d man pages: the the wich 2014-04-26 01:47:36 +02:00
mischief
3dbc32d794 nusb(4): fix spelling 2014-04-24 20:05:09 -07:00
aiju
bfbe480319 games/snes: mode 5/6; overscan fix 2014-04-24 19:22:50 +02:00
cinap_lenrek
0753d7852d revert previous change, i was confused. 2014-04-24 22:02:47 +02:00
cinap_lenrek
634b40fe27 nusb: use ep->addr instead of ep->id in unstall() library function
this is not a bug, but using ep->addr makes the intend more clear.
2014-04-24 22:00:31 +02:00
ftrvxmtrx
70d7f4c32a nusb/rndis: avoid allocation on each transmission
The slack space for outgoing packets set to 44+16 bytes.
2014-04-23 21:20:11 +02:00
cinap_lenrek
41908149de nusb: resolve endpoint id conflict with different input and output types
ftrvxmtrx repots devices that use the endpoint number for
input and output of different types like:

 nusb/ether:             parsedesc endpoint 5[7]  07 05 81 03 08 00 09	# ep1 in intr
 nusb/ether:             parsedesc endpoint 5[7]  07 05 82 02 00 02 00
 nusb/ether:             parsedesc endpoint 5[7]  07 05 01 02 00 02 00	# ep1 out bulk

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.
2014-04-23 20:03:01 +02:00
ftrvxmtrx
07bf5a24ab merge 2014-04-23 23:47:49 +02:00
ftrvxmtrx
645510e5ce boot/nusbrc: add another rndis device 2014-04-23 23:46:00 +02:00
ftrvxmtrx
2ef8c9ed41 nusb: workaround for endpoints with same index but different types
nusb code assumes endpoint numbers are unique.  It's true in general
case, but it becomes false once the direction bit is ignored.  The
commit adds a check so that two endpoints of different types are not
merged into one with Eboth direction.  It does overwrite endpoint
though, so it shouldn't be considered as a full fix.
2014-04-23 23:45:00 +02:00
ftrvxmtrx
99c0abc76d nusb/ether: add RNDIS support (tested on Nexus 5) 2014-04-22 23:34:52 +02:00
stanley lieber
39d6af1c1f fortunes: i was up at 9am, climbed a mountain, hiked 6 km through 4ft deep slush (the image you are supposed to get is of 12 million overturned slurpee cups, and of geting your groin wet in slurpee), nearly died eating beef vindaloo, wrote some code, talked on the phone, wrote mail, and now it's almost 4am and this is absolutely beyond ridiculous. 2014-04-22 11:49:32 -04:00
cinap_lenrek
0f98415f99 wifi: set ether->mbps to highest supported rate of the associated ap 2014-04-21 16:44:38 +02:00
cinap_lenrek
49825fa795 etheriwl: set msb for all rates
the 802.11 spec only specifies the msb of the rate for
Beacon, Probe Response, Association Response, Reassociation Response,
Mesh Peering Open, and Mesh Peering Confirm management frames
...
The MSB of each Supported Rate octet in other
management frame types is ignored by receiving STAs.

this should make no difference but on some netgear ap's not
setting this bit seems to ignore these data rates.
2014-04-21 05:22:17 +02:00
cinap_lenrek
3b87d6114d wifi: first attempt on negotiating data rates
driver sets wifi->rates array to tell wifi layer what
rates it supports. when we receive beacon, we determine
the minimum and maximum data rates and set wn->minrate
and wn->maxrate to point to the entries in wifi->rates.

it is the responsibility of the driver to use this
information on transmit.
2014-04-21 03:43:51 +02:00
cinap_lenrek
b94c766fef nusb: dont include <bio.h>, we'r not using it (thanks erik) 2014-04-19 16:18:39 +02:00
cinap_lenrek
8d0e4cf37b wpa support for tcp boot, remove duplicate secstore code from factotum
to run aux/wpa at boot, we need factotum to be running. tho
factotum was started only after the network was configured.

what we do now is start factotum early, not fetching keys
from secstore. once network is available and the auth server
is known, we fetch keys from secstore using auth/secstore in
bootrc.

to pass the authserver for p9 authentication to factotum, we
write it in /net/ndb and the special _authdial() in factotum
will picks it up.

as we are using auth/secstore binary in any case, we remove
the duplicated secstore code from factotum and make it just
exec auth/secstore to fetch the keys on startup (unless -n
or -S is specified).
2014-04-18 20:55:41 +02:00
cinap_lenrek
fc15a01d1d kernel: add secstore and wpa to bootfs 2014-04-18 20:44:40 +02:00
cinap_lenrek
6a7ba3d24a secstore: fix wrong "readnvram %r" error status 2014-04-18 20:41:43 +02:00
ftrvxmtrx
9204ed8910 nusb/kb: fix trackpoint on thinkpad usb keyboard
The trackpoint has no subclass, but it's still a pointer device.
Also close the device while we are here.
2014-04-18 16:43:43 +02:00
cinap_lenrek
d9ea4a71b9 secstore: fix gfile/pfile/rfile array sizes
need to have one more entry for terminating nil
2014-04-17 18:57:58 +02:00
cinap_lenrek
66aa949039 kernel: fix printing wrong memory sizes in pageinit(), overflowed on amd64 (thanks aram) 2014-04-15 21:34:41 +02:00
cinap_lenrek
75079ab18c vga: add support nVidia 7600GS (and possibly 7950) (from kenji okamoto) 2014-04-15 09:40:41 +02:00
stanley lieber
1c3e6a3e5a aan(8): add HISTORY 2014-04-14 19:09:33 -04:00
stanley lieber
0812a26f00 add /rc/bin/aanuke 2014-04-14 19:05:57 -04:00
cinap_lenrek
f02f05ca6a libmach: fix printing of amd64 modrm byte register with rex prefix 2014-04-15 00:37:01 +02:00
cinap_lenrek
81545f346f games/snes: faster scaling
load x-stretched scanline and use image replication bit to let
devdraw do the y-stretching. this reduces slow RGB15 -> display
conversions as devdraw caches small numbers of converted source
scanlines (one in hour case). setting pixels should also be a
bit faster. (only 3 writes instead of 9 for x3 scaling)
2014-04-14 20:44:04 +02:00
cinap_lenrek
96a94c3891 libmemdraw: improve readbyte() and writebyte() routines
remove unused memsetb() routine.

replace foo ? 1 : 0 with foo != 0

avoid double calculation of rgb components in readbyte()

handle byte aligned color components in writebyte()
which lets us avoid the read-modify-write and the shifting.
surprisingly, the branches in the loop are way less important
than avoiding the memory access.

this change makes ganes/snes playable at -3 scaling.
2014-04-12 21:59:52 +02:00
cinap_lenrek
a321204a20 icmp: use snprint, add more unreachable error messages (from erik quanstro) 2014-04-12 18:59:16 +02:00
cinap_lenrek
d2618d03f5 games/snes: upsample audio to 44100 hz instead of setting audio device frequency
used to set audio device frequency thru /dev/volume tho
only ac97 driver supports this. as a quick work arround,
upsample the 32000 hz audio signal to 44100 hz (without
any interpolation).

move the sample buffer room check from audiosample() into
dspstep() so that when the buffer is full (shouldnt happen),
we wont advance dspstate so samples will not get dropped.
2014-04-12 22:25:26 +02:00
stanley lieber
4ae2015d86 newt: add 'kf' command to grep $home/lib/newsgroups for group names 2014-04-11 13:19:18 -04:00
stanley lieber
44c94fbe07 fortunes: Can somebody please include this in the fortunes database? 2014-04-09 21:19:39 -04:00
cinap_lenrek
b7e30ec83d libc: allow announce address of the form #I1/tcp!*!564
we allow protocol path to begin with # for dial, so should
allow this for announce as well. this is primarily usefull
when booting the fileserver to listen on alternate ip stack.
2014-04-09 19:41:25 +02:00
cinap_lenrek
aec3d8022a process acpi interrupt source override entries in a 2nd pass over the madt (APIC) table (thanks erik)
according to erik, virtualbox puts the source overrides
before the ioapic entries so the addirq() call fails
as no ioapics have been declared yet. use a second pass
over the table after we processed the apic entries.
2014-04-08 19:35:29 +02:00
cinap_lenrek
ae3afb12a0 merge 2014-04-03 09:46:18 +02:00
ftrvxmtrx
c3f2448a56 spin(1): fix typo 2014-04-03 23:58:25 +02:00
cinap_lenrek
8515f4ecb7 eqn: fix parallel build (thanks eekee)
dont just mv y.tab.c, this can cause y.tab.c and y.tab.h to
be accidently regenerated breaking parallel build.
2014-04-03 23:20:48 +02:00
cinap_lenrek
7058640179 webfs: do not unescape escape 2014-04-03 09:44:48 +02:00
stanley lieber
95c100a3d6 newt: clean up regexp 2014-04-02 15:49:24 -04:00
stanley lieber
1e1c89001d fortunes: The only document that claims Plan 9 runs in 4 megabytes is the FAQ on our home page. 2014-04-01 19:10:49 -04:00
stanley lieber
8347075fd9 add newt(1): nntp client for use with nntpfs(4) 2014-04-01 14:34:29 -04:00
cinap_lenrek
5d3d085492 devproc: change address format in segment file to %8p (thanks eekee)
the original format for addresses was %8lux which was changed
to %p for amd64. this broke linuxemu which assumes fixed format
in the segment file. as a compromize we change it to %8p and
amd64 port of linuxemu will hopefully use a more robust parser :)
2014-04-01 19:28:10 +02:00
BurnZeZ
d41b6136f5 getfields(2): add missing SOURCE file 2014-04-01 13:12:23 -04:00
cinap_lenrek
50e2c9b4d4 sam, acme: fix character classes quoting for 21-bit runes
quote handling was broken with 21-bit runes. nextrec()
returned quoted rune as long rune | (Runemax+1) to escape
it.

with 16-bit runes, storing that long into 16-bit Rune
would automatically remove the escaping, but with 21-bit
runes, Rune is uint32 so the escaping would remain. we
now use (Runemask+1) instead, and mask the escaping off
explicitely when storing back to Rune.
2014-04-01 06:04:00 +02:00
glenda
5b5eb3b4b4 merge 2014-03-30 22:20:00 +01:00
glenda
67eb30f0ca games/gb: better video scaler from games/nes 2014-03-30 22:18:17 +01:00
cinap_lenrek
0c1dd57544 grep: fix tab2, use int instead of Rune to be compatible to 16bit rune system 2014-03-30 18:11:51 +02:00
cinap_lenrek
4d0a446123 grep: fix wrong rlcass splitting (thanks erik and kenji)
add 0xffff to tab1 as range 0xffff-0x10ffff has 4 byte utf-8 sequence.
use Runemax (0x10ffff) instead of Runemask (0x1fffff) to denote
the last valid rune for inverted [^] match as Runemask is out of the
valid rune space.
2014-03-30 04:29:04 +02:00
cinap_lenrek
cde97a4d5f 6c, 8c: optimize away CMPL/CMPQ reg, $0 instruction in peephole pass
when the previous instruction sets the zero flag,
we can remove the CMPL/CMPQ instruction.
this removes compares for zero/non zero tests only.
it only looks at the previous non-nop instruction
to see if it sets our compare value register.
2014-03-29 19:44:04 +01:00
BurnZeZ
91bed257fa ramfs: fix srvname; postmountsrv() already prepends /srv/ 2014-03-26 16:48:40 -04:00
cinap_lenrek
1641d9908b audio/oggdec: wait for pcmconv child process to exit
we have to wait for the pcmconv process to exit before
exiting yourselfs because otherwise pcmconv could
keep /dev/audio open and prevent further reopens for
a short period of time.
2014-03-26 18:39:58 +01:00
cinap_lenrek
b964e60a49 libauthsrv: recognize amd64 $cputype in readnvram() to look for default locations 2014-03-26 23:47:19 +01:00
cinap_lenrek
d4abe404b4 pc64: prevent dat.h from getting overwritten by ../pc/dat.h
the rule that was used to copy header files from ../pc
accidently overwrote dat.h when ../pc/dat.h was updated
because it matched on all *.h files that was also found
in ../pc directory. change to exact match on $PCHEADERS
to prevent this.
2014-03-24 19:00:34 +01:00
cinap_lenrek
0df733f94b games/snes: fix dspclock signed overflow (music stoping for minute) 2014-03-23 20:16:24 +01:00
cinap_lenrek
e118352324 hget: revert hget -v change, this needs more thought
problems that need to be addressed:

- reads in the whole /proc every second for no reason
- breaks when http server doesnt include Content-Length header
- length is wrong for continued download (-o option)
2014-03-23 18:47:59 +01:00
cinap_lenrek
ffb120199a auth/login: find authdom instead of using hardcoded cs.bell-labs.com (thanks erik) 2014-03-23 18:10:04 +01:00
mischief
226cb14058 hget(1): fix minor formatting error 2014-03-22 23:48:45 -07:00
mischief
a710914b36 hget: add the -v option to produce progress on stderr, like old hget 2014-03-22 23:28:42 -07:00
aiju
0d080855b2 games/snes: cpu timing fix 2014-03-22 12:50:40 +01:00
aiju
b13425e2b0 games/snes: silly bug 2014-03-22 11:11:51 +01:00
aiju
3e9650551e games/snes: improved cpu timing 2014-03-22 10:51:56 +01:00
cinap_lenrek
393dfd1ced 8c, 6c: fix mulgen botch error for handling multiplication by zero constant 2014-03-21 19:05:17 +01:00
cinap_lenrek
294e940f57 pc64: serial console support 2014-03-21 18:59:21 +01:00
cinap_lenrek
4a6939c2ce devfs: fix cclose() crash in devfs error handling 2014-03-21 18:12:06 +01:00
aiju
4abb38f177 games/snes: bug fixes 2014-03-21 16:55:16 +01:00
aiju
49ecfb6689 games/snes: minor cpu bug fix 2014-03-21 14:28:10 +01:00
aiju
26777f4cef games/snes: minor oam bugs 2014-03-21 14:25:08 +01:00
aiju
52cb2d472b games/snes: fixed decimal mode 2014-03-21 13:57:25 +01:00
aiju
24bb136c85 games/snes: added open bus emulation 2014-03-21 13:57:18 +01:00
aiju
feb800ff7c games/snes: address remapping and irq reset bug fix 2014-03-21 12:57:17 +01:00
aiju
46168ec503 games/snes: added state saving 2014-03-21 10:53:33 +01:00
aiju
4b0467ce44 games/snes: made cpu timing slightly more accurate 2014-03-20 16:44:01 +01:00
aiju
3a54967108 games/snes: added offset-per-tile 2014-03-20 15:21:53 +01:00
cinap_lenrek
a6f3ba79c2 audiohda: start playback only when we have a minimum delay buffered 2014-03-19 21:15:43 +01:00
aiju
90148cbe87 games/snes: audio improvements 2014-03-19 20:25:06 +01:00
aiju
5b7ebd7be3 games/snes: fixed large sprite scrolling bug 2014-03-19 09:04:25 +01:00
cinap_lenrek
da62091c07 pc64: port etherbcm
do not store Block* pointer in packet descriptor, assumed
pointer would fit in a long. we use pointer table now to
record the Block* pointer and store index instead.
2014-03-19 09:00:20 +01:00
aiju
f14b49f8bf games/snes: audio support (kind of) 2014-03-17 18:56:00 +01:00
cinap_lenrek
f783587f05 etheriwl: provide shutdown function 2014-03-17 18:21:01 +01:00
aiju
84d5bbc634 games/snes: reset oam address on vblank 2014-03-17 15:48:36 +01:00
aiju
37c8651f98 merge 2014-03-17 14:57:49 +01:00
aiju
656b427bda games/snes: SPC ADDW/SUBW fix 2014-03-17 14:57:37 +01:00
aiju
b1cd72cfef games/snes: BIT #imm does not set NZ flags 2014-03-17 14:54:12 +01:00
cinap_lenrek
f2f46f4a33 pc64: amd64 kernel reboot support 2014-03-16 20:22:59 +01:00
aiju
105625e10b merge 2014-03-16 09:53:14 +01:00
aiju
2fb68b6338 games/snes: bug fixes 2014-03-16 09:52:38 +01:00
cinap_lenrek
38c0dfacab pc64: fix swaped error/flags in dumpregs(), remove misleading comment in apbootstrap 2014-03-16 02:28:04 +01:00
aiju
74778941ed games/snes: small mode 7 fix 2014-03-15 22:27:14 +01:00
aiju
744f038e86 games/snes: mode 7 2014-03-15 21:46:00 +01:00
aiju
55ea9a80b1 games/snes: fix flickering sprite bug 2014-03-15 10:06:18 +01:00
cinap_lenrek
442d17ab18 merge 2014-03-15 04:39:27 +01:00
cinap_lenrek
469dfca25f pc64: add R8-R15 in dumpregs() 2014-03-15 04:38:14 +01:00
cinap_lenrek
428148e421 merge 2014-03-15 01:07:17 +01:00
cinap_lenrek
af13b1a147 plan9.ini(8): document service= boot parameter 2014-03-15 01:06:11 +01:00
aiju
586ab94b05 merge 2014-03-15 00:57:46 +01:00
aiju
77a3391cf3 games/snes: small hdma fix 2014-03-15 00:57:03 +01:00
cinap_lenrek
483f1ba602 merge 2014-03-15 00:56:36 +01:00
cinap_lenrek
a8af25ef81 kernel: interpret service= boot parameter to set "cpuserver" variable 2014-03-15 00:55:02 +01:00
cinap_lenrek
11489407ec games/mkfile: add snes 2014-03-14 21:53:26 +01:00
cinap_lenrek
972ad576fd merge 2014-03-14 21:16:53 +01:00
cinap_lenrek
1c2fc52081 ramfs: replace with new lib9p based implementation
old ramfs had a limit on the number of files it could serve
and file size was limited to maximum allocaiton size.

the new implementation uses multiple memory chunks to back file data
in a private compactable memory pool to overcome these limits.
files can be sparse. file metadata is maintained by 9pfile data
structures of lib9p.
2014-03-14 21:15:16 +01:00
aiju
f6a79e0acb games/snes: cpu bug fix and bg cleanup 2014-03-14 21:03:25 +01:00
aiju
d54a795c80 games/snes: bg 3 2014-03-14 19:39:20 +01:00
aiju
08e433f31d games/snes: hirom support and register 2180 fix 2014-03-14 18:20:13 +01:00
aiju
8d11fd6d27 games/snes: mouse support 2014-03-14 16:49:52 +01:00
aiju
e8e0428140 games/snes: performance improvements and scaling 2014-03-14 15:06:25 +01:00
aiju
289fb207c9 games/snes: added decimal mode and wai 2014-03-14 15:06:21 +01:00
mischief
d1822db187 nm(2): clarify that U is an undefined symbol 2014-03-13 22:51:22 -07:00
aiju
e5a6ebecd2 games/snes: bug fixes 2014-03-14 22:34:47 +01:00
cinap_lenrek
ff677a1cb4 cpu: make -p work with explicit service in dialstring (same as import) 2014-03-14 03:54:08 +01:00
cinap_lenrek
8fb212515d import: make import -p work with explicit service in dialstring (thanks mischief)
mischief → ; import -p tcp!9.offblast.org!17007 / /n/9
mischief → -> import: can't mount /: EOF receiving fversion reply
mischief → on the console
mischief → bmo Mar 13 18:55:30 dialing tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 reconnected to tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 connected from 199.191.58.44
mischief → bmo Mar 13 18:55:34 exiting...bmo Mar 13 18:55:30 dialing tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 reconnected to tcp!9.offblast.org!17007
mischief → bmo Mar 13 18:55:30 connected from 199.191.58.44
mischief → bmo Mar 13 18:55:34 exiting...
mischief → aan is dialing the *exportfs* port because i explicitly specified it
2014-03-14 03:48:26 +01:00
aiju
85a414751a added games/snes 2014-03-13 20:07:36 +01:00
cinap_lenrek
eed4871674 exportfs: avoid closing netfd in filter()
netfd is initially zero (stdin), when filter() closes fd0,
fd0 is free to be reused. this causes problems with openmount()
that assumes sfd being >2.

instead, we dup the our pipe end over netfd, and close the pipe.
2014-03-11 07:03:15 +01:00
cinap_lenrek
2c0490a26e libdraw: fix zero stringwidth() bug
stringwidth() and string() sometimes failed spuriously due
to the wrong assumption that cachechars() will only fail
when a different subfont is needed. in fact, cachechars()
can fail for other reasons like when it resizes the fontcache
(or fails todo so).

theres also the case when loadchar() is unable to translate
a character and returns 0. this case needs to be differentiated
from such temporary conditions like fontcache resize or subfont
load to stop the retry loop in string() and stringwidth().

now cachechars() returns -1 to indicate that it cannot
proceed and we test this in string() and stringwidth()
to skip over untranslatable characters to make progress
instead of retrying.
2014-03-10 06:41:45 +01:00
cinap_lenrek
760b3d0667 5e: remove newline from suicide string 2014-03-10 23:20:01 +01:00
cinap_lenrek
3aeca15d3c 5e: trap unaligned memory access 2014-03-10 23:16:47 +01:00
aiju
26a8accad2 nusb: added joy 2014-03-09 18:03:07 +01:00
cinap_lenrek
62ffb9c16e libmach: pragma pack 32bit Ureg structs for amd64
when libmach is compiled with 6c, unions in the 32bit Uregs
cause fields to be wronly aligned. use #pragma pack arround
the #include "/$objtype/include/ureg.h" statement.
2014-03-09 02:04:08 +01:00
stanley lieber
beb7827425 5e(1): add HISTORY 2014-03-08 19:12:00 -05:00
cinap_lenrek
9743c2752c merge 2014-03-08 21:09:59 +01:00
cinap_lenrek
f05af31f36 5e: fix amd64 2014-03-08 21:07:57 +01:00
stanley lieber
f459c5133a fortunes: it would be nice to be able to try the plan 9 go port without a plan 9 system. 2014-03-07 22:32:58 -05:00
stanley lieber
0c005b5105 mothra: handle blank lines inside <pre> tags 2014-03-07 11:44:05 -05:00
cinap_lenrek
f88d0c372d nusb: fix loaddevstr() (thanks erik quanstro and richard miller)
loaddevstr() should request 256 bytes, as per standard and
respect the length embedded in the string.
2014-03-06 22:53:20 +01:00
cinap_lenrek
7cdd1c46c5 wifi: remove misleading packet header length check in wifidecrypt()
we do not need to check block length in wifidecrypt()
again as wifiiq() already filters out truncated frames.
2014-03-06 22:09:17 +01:00
cinap_lenrek
8e924edeeb wifi: decode AP->AP (WDS / bridge) data frames. 2014-03-06 21:36:14 +01:00
cinap_lenrek
bbe797c3d0 ndb(8): the truth is too hard to explain, so theres a nice lie. 2014-03-05 20:13:03 +01:00
cinap_lenrek
f894ab740f ndb(8): document -x option of ndb/dnsquery (thanks mischief) 2014-03-05 19:50:34 +01:00
mischief
077a4dbe48 cpu: remove unused connection directory buffer 2014-03-04 07:46:16 -08:00
cinap_lenrek
c904d5bfa6 nintendo(1): add SOURCE section 2014-03-05 00:05:43 +01:00
aiju
8dfc237a57 updated nintendo manpage 2014-03-04 23:10:31 +01:00
cinap_lenrek
316d8ad76b pc64: fix segattach
the comment about Physseg.size being in pages is wrong,
change type to uintptr and correct the comment.

change the length parameter of segattach() and isoverlap()
to uintptr as well. segments can grow over 4GB in pc64 now
and globalsegattach() in devsegment calculates len argument
of isoverlap() by s->top - s->bot. note that the syscall
still takes 32bit ulong argument for the length!

check for integer overflow in segattach(), make sure segment
goes not beyond USTKTOP.

change PTEMAPMEM constant to uvlong as it is used to calculate
SEGMAXSIZE.
2014-03-04 22:37:15 +01:00
stanley lieber
06c8a5b391 games(1), nintendo(1): re-organize nintendo emulators into separate man page; add HISTORY 2014-03-03 01:06:40 -05:00
stanley lieber
ffbfbe270f fortunes: If you start your own successfull project, you also can develop your own set of reasons for doing any of a variety of operational things at any point in time. 2014-03-03 00:26:35 -05:00
aiju
c92edc1de5 games/nes: fix buffer overrun 2014-03-03 20:13:56 +01:00
cinap_lenrek
f7ab9fb52a pcmconv: revert previous change, fix dither clipping
previous change had forgot how dithering works... m(

we *really* add a random signal when *reducing* the number
of bits. just make sure we do not overflow like in
mixin().
2014-03-03 14:45:14 +01:00
cinap_lenrek
7fc7802358 pcmconv: fix dither clipping
the check in dither() was inverted. we should only
add noise when the output bit count is greater
than input bit count (samples shifted up) to
fill the lower zero bits produced by the shift.
2014-03-03 09:00:59 +01:00
cinap_lenrek
2750062701 cc: correct out-of-bounds references in funct.c (thanks charles forsyth) 2014-03-02 21:08:48 +01:00
cinap_lenrek
9405f4c95f kernel: getting rid of duppage() (thanks charles)
simplifying paging code by getting rid of duppage(). instead,
fixfault() now always makes a copy of the shared/cached page
and leaves the cache alone. newpage() uncaches pages as
neccesary.

thanks charles forsyth for the suggestion.

from http://9fans.net/archive/2014/03/26:

> It isn't needed at all. When a cached page is written, it's trying hard to
> replace the page in the cache by a new copy,
> to return the previously cached page. Instead, I copy the cached page and
> return the copy, which is what it already
> does in another instance. ...
2014-03-02 20:55:26 +01:00
aiju
142858b176 games/nes: SUROM support, subtle NMI timing bug fixed 2014-03-02 12:24:07 +01:00
cinap_lenrek
88405371b1 merge 2014-03-01 19:36:45 +01:00
cinap_lenrek
2e6234da0f pc64: multiboot support 2014-03-01 19:35:40 +01:00
aiju
1112601048 merge 2014-03-01 19:23:55 +01:00
aiju
3d01ec2f25 games/nes: fix ppu off-by-one and sprite display bug 2014-03-01 19:23:14 +01:00
stanley lieber
d8035a86f7 bcm kernel: add *kernelpercent option for cmdline.txt 2014-02-28 00:27:32 -05:00
cinap_lenrek
fd112b949f pc64: enable pmmc driver 2014-03-01 05:50:20 +01:00
cinap_lenrek
bc137696be libsec: fix memory leaks in seq_decode() and octet_decode() of asn1 parser 2014-02-28 18:54:56 +01:00
cinap_lenrek
6354bd0728 libsec: skip missing thumbprint files; not an error 2014-02-28 02:08:59 +01:00
cinap_lenrek
dd076567a4 libsec: improve thumbprint code
1) handle errors when loading thumbprint file.
initThumbprints() now returns nil and sets errstr
on error. a syntax error in a thumbprint file
should be reported instead of silently ignored!
(have to check users)

2) fix memory leak in initThumbprints(); we have to use
freeThumbprints() instead of free to release crltab.

3) use the actual head entries for thumbprint
storage in the thumbprints array. most thumbprint
files are rather sparse.

4) remove private emalloc() function. we shouldnt
just exit the calling process on allocation error,
instead handle error properly. this is a library!
2014-02-28 01:23:11 +01:00
aiju
ff5ac0c5cb games/nes: improved time synchronization
games/gb: added some games/nes improvements
2014-02-27 19:52:02 +01:00
mischief
99f9a60178 libsec: add aes_128_cbc and aes_256_cbc ciphers 2014-02-25 17:37:59 -08:00
mischief
774ccb19e4 devtls: spelling 2014-02-25 16:57:22 -08:00
mischief
de4db6745e libsec: move static sendbuf into TlsConnection and give receive buffer a better name 2014-02-25 12:48:17 -08:00
glenda
8c65872285 scribble(2): quashed false claims of quick-reference decadance. 2014-02-25 20:05:34 +00:00
cinap_lenrek
b4d13efc1e csdial: avoid useless werrstr() call on success (thanks mischief) 2014-02-25 20:14:08 +01:00
cinap_lenrek
c4fec93ab9 python: add buffer length check in sock_recvfrom_into() 2014-02-25 18:51:03 +01:00
mischief
ec37e34f07 acid: fix errstr syscall data offset for truss library 2014-02-25 09:31:58 -08:00
mischief
26af562313 mp(2): spelling 2014-02-24 01:10:40 -08:00
aiju
28c3c2bea7 games/nes: mmc3 chr inversion fixed 2014-02-25 09:39:30 +01:00
aiju
1df8b3d2c1 games/nes: it's too late to write code 2014-02-25 23:25:28 +01:00
aiju
1a67cd2c44 games/nes: fixed reload flags 2014-02-25 23:18:26 +01:00
aiju
d8489586ec merge 2014-02-24 22:50:29 +01:00
aiju
76b51dc816 games/nes: added dmc, fixed envelope, added cnrom 2014-02-24 22:50:05 +01:00
cinap_lenrek
5e353e17c6 acid: add some debugging aid function for counting kernel image cache page refs 2014-02-24 22:45:38 +01:00
cinap_lenrek
c29719ce84 merge 2014-02-24 22:43:21 +01:00
cinap_lenrek
521a34d33b kernel: keep cached pages continuous at the end of the page list on imagereclaim()
imagereclaim() sabotaged itself by breaking the invariant
that cached pages are kept at the end of the page list.

once we made a hole of uncached pages, we would stop
reclaiming cached pages before it as the loop breaks
once it hits a uncached page. (we iterate backwards from
the tail to the head of the pagelist until pages have been
reclaimed or we hit a uncached page).

the solution is to move pages to the head of the pagelist
after removing them from the image cache.
2014-02-24 22:42:22 +01:00
mischief
1d1fafc892 control(2): spelling 2014-02-24 13:02:54 -08:00
aiju
60c3c3b3db games/nes: added uxrom (mapper 2) 2014-02-24 19:50:02 +01:00
aiju
9486df09c2 games/nes: best commit (fixed audio and timing) 2014-02-24 19:33:26 +01:00
aiju
ad9047ab2c games/nes: basic audio support, battery backup, bug fixes 2014-02-23 21:46:16 +01:00
cinap_lenrek
f82e3e8657 merge 2014-02-23 18:42:01 +01:00
cinap_lenrek
ef1ec09cf7 pc64: fix mmu leak 2014-02-23 18:40:43 +01:00
aiju
662fff51f0 games/nes: added oflag 2014-02-23 11:55:29 +01:00
aiju
ca7f016c7b games/nes: minor ppu improvements 2014-02-22 20:10:54 +01:00
aiju
88fbe05ee9 games/nes: mapper 7 fix 2014-02-22 19:50:31 +01:00
aiju
af8c91cf6d games/nes: mmc3 and bugfixes 2014-02-22 17:43:15 +01:00
stanley lieber
2bfcea9197 games(1): english 2014-02-21 21:06:57 -05:00
cinap_lenrek
8593d20b8f games(1): add some of the new games, not all have full description tho 2014-02-22 02:46:46 +01:00
cinap_lenrek
f001c8c8f4 add games/nes to mkfile 2014-02-22 01:11:42 +01:00
stanley lieber
8dcaceb875 fortunes: 445b546003 2014-02-21 16:14:16 -05:00
aiju
830a9b59c9 games/nes: added state saving & bug fixes 2014-02-21 20:48:23 +01:00
cinap_lenrek
0181117b5f fork filter procs with RFREND in various programs 2014-02-21 05:32:20 +01:00
cinap_lenrek
fef5c8e4ca aux/listen: rfork with RFREND
child processes handling the connection should be all
independent of each another and not share rendezvous
group. the rendezvous group sharing caused a bug in
exportfs when we switched from using pid to memory
address as rendezvous tag.
2014-02-21 05:29:43 +01:00
cinap_lenrek
40d71baf7f exportfs: bring back the changes, bug was due to rendezvous group being shared by listen
exportfs used pid of slave proc as rendezvous tag. when we
changed it to use Proc* memory address, there where tag
collisions because listen didnt fork the rendezvous group (bug!).

for now, just do rfork(RFREND) in main just in case.

will fix aux/listen in a follow up changeset.

--
cinap
2014-02-21 05:23:21 +01:00
cinap_lenrek
d7378c10d8 merge 2014-02-21 01:03:31 +01:00
cinap_lenrek
1281b234e8 exportfs: reverting previous changes
getting strange tag mismatches on some machines. needs
to be debugged. until then, reverting the change.
2014-02-21 01:02:32 +01:00
aiju
ce5f4ff032 merge 2014-02-20 22:14:41 +01:00
aiju
29491679b8 games/nes: cleanup and resize handling 2014-02-20 22:13:59 +01:00
aiju
eeac553c36 games/nes: bug fixing 2014-02-20 23:22:14 +01:00
cinap_lenrek
a6d5f9ccae fix blowfish endianess confusion (thanks erik)
from /n/sources/patch/blowfish/readme:

Blowfish is broken. The order of the bytes in the ciphertext
is wrong. The problem is the conversion from the ciphertext
plaintext block to the array of u32int used by the core funcions
and vice versa.

This code has been tested on big endian and little endian
machines.

A test program is also included, bftets.c. It uses the
test vectors of blowfish available at
https://www.schneier.com/code/vectors.txt
2014-02-20 18:32:47 +01:00
cinap_lenrek
9c40e15ba8 exportfs: fix flush races, proc sweeping 2014-02-18 22:15:06 +01:00
cinap_lenrek
152c9d525b aux/cpuid: hack for amd64 2014-02-17 19:50:02 +01:00
cinap_lenrek
2c5c784255 prof: properly save and restore RARG for amd64
amd64 passes first argument in RARG (BP) register
which has the be preserved duing _profin() and
_profout() calls. to handle this we introduce
_saveret() and _savearg(). _saveret() returns
AX, _savearg() returns RARG (BP). for archs other
and amd64, _saveret() and _savearg() are the
same function, doing nothing.

restoing works with dummy function:

uintptr
_restore(uintptr, uintptr ret)
{
	return ret;
}

...

ret = _saveret();
arg = _savearg();
...
return _restore(arg, ret);

as we pass arg as the first argument, RARG (BP) is
restored.
2014-02-17 13:25:24 +01:00
cinap_lenrek
87fcb107ef games/nes: add mapper 7 support 2014-02-16 21:40:33 +01:00
aap
cd27c0cca2 xd: changed -s option to switch to little-endian units 2014-02-16 21:32:14 +01:00
aiju
1225ebec71 added games/nes 2014-02-16 20:51:11 +01:00
cinap_lenrek
ae41f49f09 mothra: remove unused local variables from pl_nextc() 2014-02-16 19:40:50 +01:00
cinap_lenrek
3df2b18398 truss: use A instead of X as address format for data dump 2014-02-16 19:20:57 +01:00
cinap_lenrek
c44cbf3165 truss: fix syscall address formats 2014-02-16 19:08:49 +01:00
cinap_lenrek
218e1b4b3e mothra: fix unicode rendering for plaintext
we did the utf-8 to unicode conversion in pl_nextc(),
but the plaintext handler uses pl_readc() which only
translates newlines but otherwise returns bytes.

move unicode conversion in pl_readc() fixes it.
2014-02-16 18:50:30 +01:00
Matthew Veety
c54271a588 documented usbwait in plan9.ini(8) 2014-02-15 17:18:58 -05:00
cinap_lenrek
e42981dfcf factotum/authsrv: fix padding for mschap on amd64, use constants for structure sizes 2014-02-15 19:57:13 +01:00
cinap_lenrek
240ba73770 pc64: fix mistake 2014-02-15 16:58:35 +01:00
cinap_lenrek
25189924db pc64: simplify mmuwalk by factoring out mmu page table creation into separate function 2014-02-15 16:43:55 +01:00
cinap_lenrek
c6f6396faa merge 2014-02-15 06:19:25 +01:00
cinap_lenrek
ebeb501cff pc64: support for vmware PCnet ethernet 2014-02-15 06:17:38 +01:00
cinap_lenrek
32604cd830 pc64: move VMAP into its own PDP (for vmware)
modifying the kernel pdp (CPU0PDP) hangs vmware. so
we initialize the pdp with KZERO and KZERO+1GB map
in l.s and never change it. (except when removing
the zero double map which seems to work).

VMAP has its own pdp now allowing to map 512GB of
physical address space. this simplifies the code
a bit and gives nice virtual addresses.
2014-02-15 06:17:05 +01:00
Matthew Veety
1d64be1984 added in a way to make net.rc wait for the network hardware to come up before running ip/ipconfig. This fixes the issue with the Raspberry Pi where ip/ipconfig tried running prior to /net/etherU3 exists 2014-02-14 22:05:25 -05:00
cinap_lenrek
de4aec9fbd libc: remove malloc.acid and pool.acid 2014-02-14 15:20:34 +01:00
cinap_lenrek
14770ad188 page: fix compiler warning 2014-02-14 15:01:14 +01:00
cinap_lenrek
82cec6f585 socksd: close inside udp server one we get a connection (udprelay) 2014-02-14 14:57:05 +01:00
cinap_lenrek
81ea3f24fa cifsd: fix compiler warning 2014-02-14 14:21:07 +01:00
cinap_lenrek
fc78640118 nusb/ether: fix pointer truncation 2014-02-14 14:18:09 +01:00
cinap_lenrek
dd4a487b0e webfs: fix compiler warning 2014-02-14 14:14:17 +01:00
cinap_lenrek
80deec0a7b ip/torrent: remove unneeded assignment 2014-02-14 14:12:02 +01:00
cinap_lenrek
38c35d6195 acid: add semacquire/semrelease/tsemacquire syscalls, handle _seek hack for amd64 (thanks erik) 2014-02-14 14:02:33 +01:00
Matthew Veety
3f9d92c1a8 similar to my last commit, but combined the two waits for the usb devices. still configurable, but with usbwait. If usbwait is not defined then it defaults to the original 2 seconds. 2014-02-14 00:11:11 -05:00
mischief
7d73312def pc64: add ahci.h to PCHEADERS so it will be removed on mk clean 2014-02-12 03:02:23 -08:00
mischief
6edd7255c7 pc64: remove ethermii.h and copy it from pc instead 2014-02-12 03:00:12 -08:00
Matthew Veety
6a12aef885 added pccpu64 for cpuservers. also enabled etherigbe in pc64 and pccpu64 2014-02-12 21:05:04 -05:00
cinap_lenrek
b7b68668cf acid: fix acid/network, fix address formats from X to A 2014-02-12 20:04:07 +01:00
cinap_lenrek
cd17077749 truss: support for amd64 2014-02-12 19:27:08 +01:00
cinap_lenrek
ad38f0eb1c pool(2): fix ulong -> uintptr 2014-02-12 18:53:03 +01:00
cinap_lenrek
872f83cebe ramfs: remove mainmem pool limit when called with -u flag 2014-02-10 04:04:51 +01:00
cinap_lenrek
7f73792ef9 pc64: limit memory of per processor mmu freelist to 1MB 2014-02-10 02:37:45 +01:00
cinap_lenrek
e37ff43eb6 acid: remove objchar, prefering foobar.$objtype.acid
acid already sets up objtype for us.
2014-02-10 01:53:26 +01:00
cinap_lenrek
c4679d743a pc64: return up in RUSER (BP) for devproc kregs file 2014-02-10 23:12:52 +01:00
cinap_lenrek
37de63aec3 cc: emit right acid format for address
we could use 'A' here but then it would require the new acid.
2014-02-10 23:10:47 +01:00
cinap_lenrek
de356dd855 acid: update acid libraries for amd64 2014-02-10 23:07:37 +01:00
cinap_lenrek
16acf605e2 acid: make 'a' and 'A' format to have the same size as mach->szaddr
to make it easier to write portable acid code, we
introduce 'A' format in the same meaning as in db(1):

A    Print the value of dot in hexadecimal.  Dot is
     unaffected.

both 'a' (symbolic) and 'A' will both have 64 or 32 bit
size depending on the mach, so pointer array indexing
works the same.
2014-02-09 22:43:09 +01:00
cinap_lenrek
9bdf602ebb pc64: pass Ureg* argument in BP to userspace note handler 2014-02-09 02:23:33 +01:00
cinap_lenrek
9d8f5a1466 acid: fix memory corruption due to gc
we cannot call gc() in execute() because it will gc
anonyous intermediate results which happens when we
construct a list and the elements are calculated by
calling a function thru ocall() which calls execute().

also, the _thiscmd symbol; which is used to keep
a reference to a statement so it wont get garbage
collected; does not work as yyparse() is recursive
(include statements).

we add execrec() function which *only* gets called from
yyparse() when evaluating a statement. it will
keep a stack on the _thiscmd symbol handling the yyparse()
recursion.

we also only call gc() in execrec() before calling
execute(). so execute() will never gc() while evaluating
a statement which prevents the intermediate results
from getting collected.
2014-02-09 01:37:05 +01:00
cinap_lenrek
6b146c70c2 pc64: handle negative file offsets when accessing kernel memory with devproc
file offset is 64 bit signed integer, negative offsets
are invalid and rejected by the kernel. to still access
kernel memory on amd64, we unconditionally clear the sign
bit of the 64 bit offset in libmach and devproc sign
extends the offset back to a 64 bit address.
2014-02-08 03:50:41 +01:00
cinap_lenrek
43212f6432 mtrr: fix mistake 2014-02-08 03:40:17 +01:00
cinap_lenrek
7af85b9e74 jpg: center image in screen
when using the jpg(1) programs interactively, draw the
image in the center of it. this avoids wasting space
with always on borders on small windows and looks better
when used in fullscreen.
2014-02-08 02:33:29 +01:00
cinap_lenrek
b3df8945bd reuse mtrr slots with default memory type 2014-02-08 01:01:26 +01:00
cinap_lenrek
9c99675c1c aux/vga: fix format string error with 6c 2014-02-08 00:29:06 +01:00
cinap_lenrek
eaafcf2187 pc64: bump segment limit to 64GB 2014-02-08 00:23:18 +01:00
cinap_lenrek
2b4706b662 pc64: dont reuse mtrr slots that are above 4GB
we used to override/reuse mtrr slots over 4GB as the
kernel wasnt able to use that memory. pc64 can.
2014-02-07 20:04:19 +01:00
mischief
fc7f6f8e99 pc64: ensure user pc is never set to a non-canonical address through setregisters
on intel processors, a general protection exception is fired if a non-canonical address is loaded into PC during SYSRET. this will cause the kernel to panic.

see http://www.kb.cert.org/vuls/id/649219 and the intel software developer manual for more information.
2014-02-06 18:03:17 -08:00
cinap_lenrek
0fdb1578ef pc64: fix devcons format strings for memory sizes 2014-02-07 23:35:27 +01:00
cinap_lenrek
88cc09a580 cwfs: limit memsize() to 1GB until pool can handle huge allocations 2014-02-07 23:33:34 +01:00
cinap_lenrek
c3917ec566 pc64: fix poolsummary() string format 2014-02-07 23:02:56 +01:00
cinap_lenrek
e836796365 pool: use uintptr for pool size
note, arenas and blocks still use ulong for sizes. so
we have to check for overflow when attempting to merge
arenas.
2014-02-06 22:47:05 +01:00
cinap_lenrek
c065eadb53 pc64: fix note handling 2014-02-06 22:43:33 +01:00
cinap_lenrek
bfbc5ab197 pc64: fix kmap()
kmapindex has to be per process, not per mach, as the process
can be switched to another processor while the mapping is
established.

to bootstrap the first process, we have to temporarily set up
so the kmap MMU's can be attached to the process. previously
we assumed that the first two pages for the initial process
where below 2GB and could be accessed with KADDR() directly.
with 16GB machine, all the 2GB above KZERO are dedicated to
the kernel so the user pages returned by newpage() need to
be mapped.
2014-02-06 22:41:42 +01:00
cinap_lenrek
f029ea1694 have to use NULL instead of nil for ape programs... 2014-02-05 19:52:09 +01:00
cinap_lenrek
868a262bb8 pc64: dont 4 byte align stack pointer for amd64 in sysexec() 2014-02-05 19:48:36 +01:00
cinap_lenrek
c76243e7e5 fix wrong type for terminating nil argument for execl()
we have to use (void*)0 instead of (int)0 otherwise the
upper bits are uninitialized on amd64.
2014-02-05 19:25:24 +01:00
mischief
492958f08e libpanel: remove pointless pointer casts 2014-02-04 00:16:36 -08:00
cinap_lenrek
8c4a02a29b merge 2014-02-05 08:58:53 +01:00
cinap_lenrek
9f99edda55 mothra: better handling of malformed search regex 2014-02-05 08:43:31 +01:00
mischief
ffcac11a5a libpanel: fix pointer casts and format strings 2014-02-04 23:34:19 -08:00
cinap_lenrek
0b1c655160 mothra: dont panic on invalid regular expression in searchbox 2014-02-05 08:25:01 +01:00
mischief
1eef373152 pc64: fix up pointer calculations and enable sdvirtio disk driver 2014-02-03 01:22:26 -08:00
cinap_lenrek
34f7e4ef9a pc64: remove cinaps cga screen interrupt debugger, was experiment... 2014-02-04 02:08:26 +01:00
cinap_lenrek
de0712c0b5 pc64: dont dump user registers on exception, was experiment... 2014-02-04 02:06:11 +01:00
cinap_lenrek
b7be695d5c hjfs: fix wrong channel size for syncb (fixes amd64 crash) 2014-02-04 01:58:17 +01:00
cinap_lenrek
3f522c745a doom: port to amd64 2014-02-04 01:09:46 +01:00
cinap_lenrek
88505bff06 realemu: cleanup opidiv
no need for switch here, just calculate the values. also fixes
6l warning about uninitialized min/max (compiler assumes none
of the case statements could match).
2014-02-03 22:55:45 +01:00
cinap_lenrek
fefc7b526d libmach: change mach pgsize back from 4K to 2MB for amd64
the Mach page size is used to calculate segment alignment. its
not the real effective page size used by the kernel.

this fixes acid.
2014-02-03 22:39:07 +01:00
cinap_lenrek
bfbb68a712 ipmux: fix 6c complaints 2014-02-03 20:14:19 +01:00
cinap_lenrek
94282847ec merge 2014-02-03 20:06:12 +01:00
cinap_lenrek
ccfb6168c8 kernel: dont double ptemap size in newseg()
this doubling affects all segment types, not just bss.
(tho text/data are usually small...)

and theres no telling if the segment will actually
grow in the future justifying the reduction of memmove
overhead in ibrk().

some ape programs are approaching the 16mb ssegmap size
so that code might trigger.

removing the smarts...
2014-02-03 20:04:43 +01:00
cinap_lenrek
6a55790197 pc/pc64: move common code to pc/devarch.c 2014-02-03 06:24:31 +01:00
cinap_lenrek
c3028fb924 pc64: implement shutdown and idlehands
just copies from pc kernel. should refactor into common
pc code.
2014-02-03 05:29:53 +01:00
mischief
35d19fc6fb merge 2014-02-02 07:41:56 -08:00
mischief
d082e3a5ae pc64: enable sdide driver 2014-02-02 07:34:54 -08:00
mischief
ddd51650d8 acid: fix memory leak in fundefs (from 9atom) 2014-02-02 03:17:48 -08:00
cinap_lenrek
b5d47d6deb libdraw: fix typo: 0xfffff -> 0xffff 2014-02-03 03:56:01 +01:00
cinap_lenrek
5fd52f6241 libdraw: work arround devdraw truncating screenid as 16bit 2014-02-03 03:53:18 +01:00
cinap_lenrek
f556fd2437 devdraw: screenid is BGLONG, not BGSHORT 2014-02-03 03:52:27 +01:00
cinap_lenrek
bfee76e5d3 pc64: track per process kmap page tables in separate MMU list.
we have to keep kmap page tables in ther own list
because user tables are subject to (virtual) tlb flushing.

we never free kmap page tables except in mmurelease()
where we just link the kmap mmu list in front of the user
mmus and call mmufree() which will free all the mmu's
of the process.
2014-02-02 18:01:13 +01:00
cinap_lenrek
b7b3406657 malloctag: only store lower 32bit of malloc tag, fix getrealloctag
as erik quanstro suggests, theres not much of a point in
storing the full 64bit pc as one cannot get a code segment
bigger than 4G and amd64 makes it hard to use a pc that
isnt 64bit sign extension of 32bit.

instead, we only store ulong (as originally), but sign
extend back when returning in getmalloctag() and
getrealloctag().

getrealloctag() used to be broken. its now fixed.
2014-02-02 16:03:59 +01:00
cinap_lenrek
0cdb32cc18 kernel: fix bogus free in sysexec.
we free the wrong pointer in the waserror() block.
2014-02-02 15:11:19 +01:00
cinap_lenrek
269788514c newuser: dont bark when we cannot bind $home/bin/$objtype after /bin, create $home/bin/amd64 2014-02-02 10:59:05 +01:00
cinap_lenrek
29eea45931 kernel: do not pass user address of fd[2] array to newfd2()
access to user memory can pagefault and newfd2() holds
fgrp spinlock while writing to it. make temporary copy
on the stack in syspipe().
2014-02-02 10:41:51 +01:00
cinap_lenrek
0b95485db7 kernel: use uintptr when appropriate in syssegflush() 2014-02-02 09:59:54 +01:00
cinap_lenrek
02fef73b8f pc64: dont dump registers for user process on pagefault error, was experiment 2014-02-02 09:39:58 +01:00
cinap_lenrek
2a4f7a1eb1 pc64: no need to flush tlb in kunmap(), was experiment 2014-02-02 09:22:23 +01:00
cinap_lenrek
4c97cb34ac add acid library for amd64 2014-02-02 08:41:13 +01:00
cinap_lenrek
db2e22aebe pc64: fix mmu structure leakage, implement global pool 2014-02-02 08:12:08 +01:00
cinap_lenrek
47f551bcea pc64: print only 8 hex chars dumpstack sp/pc
kernel addresses are sign extended to 64 bit. upper bits
are not really helpfull.
2014-02-02 05:49:30 +01:00
cinap_lenrek
a6fd3cc8e3 mallocalign: make sure alignptr offset is modulo align when -offset > align 2014-02-02 05:47:13 +01:00
cinap_lenrek
e289fd8ccd pc64: fix vmap
VMAP address calculation was all wrong resulting
in vmaps get mapped into KZERO map.
2014-02-02 05:10:58 +01:00
cinap_lenrek
0850718033 pc64: enable iahci support 2014-02-01 20:27:54 +01:00
cinap_lenrek
03d26f8087 cwfs: use pragma pack for on disk structures for amd64 2014-02-01 20:26:36 +01:00
cinap_lenrek
42f4cdc3fd rootstub: create amd64 directories for acme 2014-02-01 20:19:06 +01:00
mischief
4092bdbb2e realemu: actually mark 0xE0000 writeable 2014-02-01 12:56:59 -08:00
mischief
1fe36bf849 realemu: implement IDIV, mark 0xE0000 writeable, fix DIV overfow trap 2014-02-01 12:27:07 -08:00
mischief
08bb4afb52 acid: use correct print flags and casts for shorts in fmt 2014-02-01 12:14:30 -08:00
mischief
abb4bad701 ip/torrent: print tracker errors/warnings in debug mode and allow setting peerid 2014-02-01 12:04:30 -08:00
cinap_lenrek
ed9e9f98e9 libc and ape support for amd64 2014-02-01 10:31:41 +01:00
cinap_lenrek
cc24222672 fixes for new setmalloctag() prototype 2014-02-01 10:29:14 +01:00
cinap_lenrek
8006695405 gs: amd64 support 2014-02-01 10:28:33 +01:00
cinap_lenrek
2dbdfe8ac7 python: amd64 support 2014-02-01 10:27:57 +01:00
cinap_lenrek
56343cafcf add experimental pc64 kernel 2014-02-01 10:25:10 +01:00
cinap_lenrek
28ad4e6616 pc kernel: split mpstartap() and squidboy into separate file... stuff for amd64 2014-02-01 10:23:17 +01:00
cinap_lenrek
06bc19c28f kernel: usb fixes for amd64 2014-02-01 10:20:43 +01:00
cinap_lenrek
dcea714680 kernel: fix pointer truncation in xspanalloc(), fix format prints 2014-02-01 10:17:53 +01:00
cinap_lenrek
7613608b23 kernel: handle amd64 40 byte headers in exec() 2014-02-01 10:16:55 +01:00
cinap_lenrek
88476df541 vesa: explicitely use /386/include/ureg.h 2014-02-01 10:14:41 +01:00
cinap_lenrek
090fd6ec0c libmach: pc64 uses 4K pages, IP -> PC 2014-02-01 09:55:34 +01:00
cinap_lenrek
9a52340313 libmemdraw: apply erik quanstros fix for sign preserving in byteaddr() 2014-02-01 09:54:09 +01:00
cinap_lenrek
d77455ab2d libdraw: use pid as initial screenid so one can have more than 25 windows. 2014-02-01 09:53:08 +01:00
cinap_lenrek
010af9ba12 6l: fix warning, setmalloctag declaration, missing header type cases 2014-02-01 09:52:06 +01:00
stanley lieber
0efcfcc60c fortunes: undelete 2014-01-22 01:19:50 -05:00
cinap_lenrek
ca7c413ff1 sdiahci: fix hardcoded 512 byte sector size 2014-01-22 20:12:19 +01:00
cinap_lenrek
520957e254 kernel: fix ulong abuse in xalloc 2014-01-21 22:12:25 +01:00
cinap_lenrek
ebfb4fdf29 kernel: convert putmmu() to uintptr for va and pa 2014-01-20 03:17:55 +01:00
cinap_lenrek
ad1eefb355 kernel: various cleanups 2014-01-20 02:16:42 +01:00
cinap_lenrek
cb0393181a malloc(2): update alloctag types 2014-01-20 00:54:36 +01:00
cinap_lenrek
6c2e983d32 kernel: apply uintptr for ulong when a pointer is stored
this change is in preparation for amd64. the systab calling
convention was also changed to return uintptr (as segattach
returns a pointer) and the arguments are now passed as
va_list which handles amd64 arguments properly (all arguments
are passed in 64bit quantities on the stack, tho the upper
part will not be initialized when the element is smaller
than 8 bytes).

this is partial. xalloc needs to be converted in the future.
2014-01-20 00:47:55 +01:00
cinap_lenrek
b99ecee6cd malloc: change malloc and realloc tag types to uintptr 2014-01-20 00:09:53 +01:00
cinap_lenrek
43ae553195 ape: remove local copy of memccpy() 2014-01-20 00:05:19 +01:00
cinap_lenrek
8a72dc1c6b kernel: fix declaration of getcallerpc() 2014-01-19 03:32:50 +01:00
cinap_lenrek
ba787cc587 kernel: replace BY2WD in scanline width calculation to sizeof(ulong) like libmemdraw 2014-01-19 03:29:52 +01:00
cinap_lenrek
02a2eb6676 libmach: fix wrong operand order of MOVLQSX instruction disassembly 2014-01-17 21:09:17 +01:00
aap
7e1b43a53a Corrected some man pages. 2014-01-17 19:15:24 +01:00
cinap_lenrek
79e8f53e89 devdraw: fix memory corruption reading draw ctl file
when user does read of exactly 12*12 bytes on draw
ctl file, the snprint() adds one more \0 byte writing
beyond the user buffer and corrupting memory.

fix this by not snprint()ing the final space and add
it manually.
2014-01-14 00:22:13 +01:00