Commit graph

4255 commits

Author SHA1 Message Date
cinap_lenrek bab59e5749 python: HAVE_STDINT_H 1 2015-07-13 02:38:05 +02:00
cinap_lenrek 737c3edeba ape: add stdint.h, fix SSIZE_MAX and add SIZE_MAX to limits.h 2015-07-13 02:36:48 +02:00
cinap_lenrek cd9da74cbc cpp: search source file directory first for quoted #include (thanks Ori_B)
foo.c includes bar/bar.h, which includes "baz.h"; it wants bar/baz.h
meanwhile, it also includes meh/quux.h, which includes "baz.h"; it wants meh/baz.h
2015-07-13 00:54:56 +02:00
cinap_lenrek a5efa0e252 ether82563: fix multicast filter (based on openbsd em(4) driver) 2015-07-12 19:21:53 +02:00
cinap_lenrek cbd1ca6877 page: make lookahead fetch work in backwards direction 2015-07-11 02:42:14 +02:00
cinap_lenrek 1d5a2aa487 tftpd: count only options we understand so we wont send empty oack message 2015-07-11 02:35:49 +02:00
cinap_lenrek 0f5f226ba1 etherrt2860: add multicast stub 2015-07-11 02:34:28 +02:00
cinap_lenrek 2e5e5cde71 etheriwl: add multicast stub 2015-07-11 02:33:57 +02:00
cinap_lenrek b4f9ca6c97 etherwpi: dont enable transmit power for invalid channels, add multicast stub 2015-07-11 02:33:16 +02:00
cinap_lenrek 266057f0da wifi: reflect current transmit rate in mbps 2015-07-10 19:13:15 +02:00
cinap_lenrek 7cf2321ffb etherwpi: afra support 2015-07-10 18:59:57 +02:00
cinap_lenrek 34a0f4660d etheriwl: dont clear descriptors after completion 2015-07-10 18:50:37 +02:00
cinap_lenrek b5655b7247 wifi: adjust transmit rate on error (for etheriwl), small mkfile changes
Wnode gets two new counters: txcount and txerror
and actrate pointer that will be between minrate
and maxrate.

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

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

every 256th packet, we optimistically increase wn->actrate
before transmitting.
2015-07-10 09:04:05 +02:00
cinap_lenrek 4ec93f94c9 kernel: use HDR_MAGIC constant to handle Exec header extension, make rebootcmd() handle AOUT_MAGIC macro 2015-07-10 23:56:39 +02:00
cinap_lenrek 3ca9ac70c4 sysexec(): need () arround AOUT_MAGIC comparsion to handle #define hack on mips 2015-07-09 08:51:38 +02:00
cinap_lenrek e3217c6f6a sysexec(): make the mips compiler happy 2015-07-09 08:34:20 +02:00
cinap_lenrek 9ab096a707 kernel: reject bogus two byte "#!" shell scripts in sysexec()
- reject files smaller or equal to two bytes, they are bogus
- fix out of bounds access in shargs() when n <= 2
- only copy the bytes read into line buffer
- use nil for pointers instead of 0
2015-07-09 08:03:18 +02:00
cinap_lenrek 8ed25f24b7 kernel: various cleanups of imagereclaim(), pagereclaim(), freepages(), putimage()
imagereclaim(), pagereclaim():
- move imagereclaim() and pagereclaim() declarations to portfns.h
- consistently use ulong type for page counts
- name number of pages to free "pages" instead of "min"
- check for pages == 0 on entry

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

putimage():
- use long type for refcount
2015-07-09 00:01:50 +02:00
cinap_lenrek fcb9abccbb 5e: enable VFP emulation by default, doubles only need to be 4 byte aligned
this adds -F flag to 5e (same as 5l) to disable VFP emulation
and makes VFP emulation the default.
2015-07-08 02:13:16 +02:00
cinap_lenrek 63879193e7 pc64: use unsigned long for kmapindex and mmu counts avoiding signed integer division 2015-07-07 21:13:36 +02:00
cinap_lenrek cd92790c50 ape: port libc smp tas() for arm 2015-07-07 19:53:26 +02:00
cinap_lenrek 6506147066 libc/arm: implement _tas() with LDREX/STREX, execute memory barrier on smp systems (zynq) 2015-07-07 19:24:10 +02:00
cinap_lenrek 5458506881 all kernels: declare _tas() to prevent pulling in libc version (for libmemdraw) 2015-07-07 19:17:55 +02:00
cinap_lenrek e2a6e622c7 5e: approximate LL/SC with cas() 2015-07-07 06:30:34 +02:00
cinap_lenrek fcfc849dd5 5e: make sure stack base is aligned to avoid unaligned memory trap on arm 2015-07-07 06:26:56 +02:00
stanley lieber 20e255110c open(2): fix typo 2015-07-01 21:46:47 -04:00
cinap_lenrek 562f1b51ee nusb/audio: dont sysfatal on bad endpoint (no altc) 2015-06-29 22:28:23 +02:00
cinap_lenrek 4aee2b803e nusbrc: handle fat formated usb drives without partition table
on some usb drives, there is no dos partition table, so check
the filesystem type and consider the whole drive.
2015-06-28 21:50:30 +02:00
cinap_lenrek 37156fb0b2 etherwpi: remove debug prints, use iprint() in interrupt 2015-06-28 21:13:34 +02:00
cinap_lenrek 8799bf292d wpa: do not prompt for key when there is already one in factotum 2015-06-28 20:40:19 +02:00
cinap_lenrek ed238e7ef8 etherwpi: Intel PRO Wireless 3945abg driver based on openbsd's if_wpi (thanks aap) 2015-06-28 18:32:54 +02:00
cinap_lenrek 00328b5759 pc, pc64: toggle bit 2 in port 0x61 to reset and enable PCI SERR# nmi's, print nmi status 2015-06-28 18:22:36 +02:00
stanley lieber 167ab1f0fa fortunes: No we can't. 2015-06-26 14:10:01 -04:00
cinap_lenrek ee735f1088 wifi: berlin prime bunny hopping
- reduce delay for channel hop to 200ms
- use 1000ms timeout for auth response (dont hop channels while we wait)
- bunny hop sequence is mathematically prooven
2015-06-21 19:35:08 +02:00
cinap_lenrek 6b4a9c5d8d 5e: implement DSB,DMB,ISB and CLREX instructions 2015-06-19 14:43:32 +02:00
cinap_lenrek 575015d2b0 kernel: do not pull in atom.s from libc for arm kernels
- provide our own copy of cas() in l.s
- replace use of libc ainc()/adec() with portable incref()/decref()
2015-06-19 10:27:26 +02:00
cinap_lenrek e6220b39c9 exec(2): return register (R0) contains address of Tos structure. 2015-06-19 09:02:59 +02:00
cinap_lenrek 1bd4c243ad kernel: ignore last page at the top of virtual kernel address space for xalloc()
avoding kernel address -BY2PG because of end pointer wrapping to zero.
2015-06-19 02:45:58 +02:00
stanley lieber cb2a55aeb3 ndb(6): fix typo (thanks, pena) 2015-06-18 15:14:06 -04:00
stanley lieber e6658c55af dhcpd(8): the fs attribute refers to the file server, not the name server (thanks, pena) 2015-06-18 14:28:25 -04:00
cinap_lenrek 1bf5b4ad4e zynq: use KADDR() for kmap() if we can avoiding the mapping 2015-06-18 12:16:54 +02:00
cinap_lenrek 0dab8869ad kernel: ignore memory pages with singular kernel addresses
addresses va's of 0 and -BY2PG cause trouble with some memmove()/memset()
implementations and possibly other code because of the nil pointer
and end pointers wrapping to zero.
2015-06-18 12:15:33 +02:00
cinap_lenrek fd8597ac31 zynq: fix barriers
unlock()/iunlock():

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

cas()/tas():

place memory barrier before successfull return to prevent reordering.
2015-06-18 04:35:46 +02:00
cinap_lenrek 58dc03cec0 kernel: do not inherit Proc.dot (current working directory) in kproc()
making sure to close the dot in every kproc appears repetitive,
so instead stop inheriting the dot in kproc() as this is usually
never what you wanted in the first place.
2015-06-18 03:13:50 +02:00
cinap_lenrek b48078c12c kernel: do not inherit current directory channel (dot) to pager
kproc() inherits dot and slash, pager needs to drop these
channels, otherwise it will keep the files open preventing
say, ramfs to exit.
2015-06-18 22:58:56 +02:00
cinap_lenrek 921aa0a6c3 stats: add kernel malloc and kernel draw allocation size graphs 2015-06-16 08:08:42 +02:00
cinap_lenrek 45b79036be devcons: add current pool allocations to #c/swap 2015-06-16 08:05:33 +02:00
cinap_lenrek 6c99d2f028 kernel: remove waserror() arround newpage() in mntcache
newpage() does not raise error().
2015-06-16 06:05:12 +02:00
cinap_lenrek 64ed3658d2 kernel: add pagechaindone() to wakeup processes waiting for memory
we keep the details about palloc in page.c, providing pagechaindone()
for mmu code to be called after a series of pagechainhead() calls.
2015-06-15 17:40:47 +02:00
cinap_lenrek 8a3b388ffe kernel: implement separate wait queues for page allocation
give kernel processes and local disk file servers (procs
having noswap flag set) a clear advantage for page allocation
under starved condition by giving them ther own wait queue so
they get readied as soon as pages become available.
2015-06-15 16:05:00 +02:00
cinap_lenrek 9ab48ee370 hjfs: defer parent directory permission check for wstat
check parent directory permission *after* we determined
that the new name does not exist in the parent, so that
when the new name is the same as old name then no write
permission is required in the parent directory.
2015-06-15 08:28:10 +02:00
cinap_lenrek 13ec55922f hjfs: fix wstat
- rename to same name is ok
- only truncate when file size is different
- check for uid/gid *change*, not if it is specified or not
2015-06-15 01:57:54 +02:00
cinap_lenrek 5adf0606f1 nusb/serial: remove unused channel 2015-06-15 00:30:19 +02:00
cinap_lenrek 584caf6d1c zynq: remove unused PTE typedef
all the mmu code uses ulong, so get rid of the typeded.
2015-06-15 22:32:15 +02:00
cinap_lenrek 13a79fbb72 zynq: remove unused statistics fields from Mach structure 2015-06-15 22:13:55 +02:00
cinap_lenrek 65db705481 ndb/dns: cleanup forwarding code (redistrib())
instead of copying the whole packet, just save the
udp header and restore it aftwards. dont call redistrib()
when there are no forwards (this should be almost always
the case).
2015-06-14 21:31:44 +02:00
ftrvxmtrx a55eed44c6 aux/vga: == is not strncmp 2015-06-13 21:28:33 +02:00
cinap_lenrek 7f4b037b0b htmlroff: fix wrong newline in \name handling (| -> ||) 2015-06-13 20:58:56 +02:00
ftrvxmtrx 453ca8db43 qc, 9/ppc, 9/mtx: fix wrong if statements 2015-06-13 20:21:26 +02:00
cinap_lenrek d6eb7cc71c kernel: dont use smalloc() to allocate pte array in ibrk()
when we'r out of kernel memory, it is probably better to
let that alloc fail instead of hanging while holding the
segment qlock.
2015-06-13 17:50:26 +02:00
cinap_lenrek 27fb90eb6e vblade, cifs, usbuhci: fix parenthesis 2015-06-13 15:03:56 +02:00
cinap_lenrek 9c1dff3fa9 lock: reopen lockfile after changing mode to make lock effective
lock is acquired on open/create when file has DMEXCL set in mode,
so we need to reopen the file after setting the bit with wstat.
2015-06-13 15:01:02 +02:00
cinap_lenrek 1473e5d437 lib9p: fix lib9p wstat qid.type/mode checks (fixes lock(1) for ramfs/hjfs) 2015-06-13 12:43:15 +02:00
cinap_lenrek f92057cc39 ndb/dns: use same buffer size of udp packet in redistrib() as dnudpserver() (fixes assert) 2015-06-13 22:37:26 +02:00
cinap_lenrek cc3abe39aa games/doom: remove Makefile 2015-06-12 17:50:43 +02:00
cinap_lenrek e4c3f92c16 games/doom: fix desyncing demo (thanks qwx)
the code used P_Random()-P_Random() in some places which has
undefined evaluation order resulting in the wrong pseudo random
numbers being returned causing demo playback to desync.

this change adds P_Random2() function which returns the right
delta-random number and uses it in place of P_Random()-P_Random()
expression.
2015-06-12 17:28:09 +02:00
cinap_lenrek 34ae4649cc kernel: fix accounttime() for HZ >= 1000
"milli-CPU's" is too low resolution for the decaying load average
calculation when HZ >= 1000.
2015-06-12 14:28:31 +02:00
cinap_lenrek 2112ad6793 zynq: increase kernel memory for graphics 2015-06-11 21:26:26 +02:00
cinap_lenrek d8bcd6c8e4 zynq: mouse acceleration 2015-06-11 16:44:05 +02:00
cinap_lenrek 36d2504adb zynq: make screen and cursor kprocs exit properly 2015-06-11 16:14:11 +02:00
cinap_lenrek 0dbbe79116 zynq: add support for hardware cursor
to enable hardware cursor, write "addr va" to /dev/mousectl where
va is the virtual address of the cursor position register.
2015-06-11 16:04:24 +02:00
ftrvxmtrx 98640950d7 merge 2015-06-11 22:14:24 +02:00
ftrvxmtrx a25758dce7 fix strncmp/memcmp used with a wrong number 2015-06-11 22:13:55 +02:00
cinap_lenrek 036ae2e397 cifsd: smbrename is still ok when file is readonly (fixed git) 2015-06-10 17:18:31 +02:00
cinap_lenrek c89b0b3c23 zynq: fix flushmemscreen() 2015-06-10 01:27:44 +02:00
ftrvxmtrx be36fab405 remove drawlsetrefresh and convM2Tnoenc: undefined functions 2015-06-09 18:25:09 +02:00
ftrvxmtrx e56e61fed1 addpt(2): put badrect in .SH NAME so that it gets into the searchindex 2015-06-09 12:32:38 +02:00
ftrvxmtrx 86acce7c4d esetcursor(2), alarm(2): fix prototypes 2015-06-09 12:29:57 +02:00
ftrvxmtrx 72a168b5fb event(2): fix estartfn prototype 2015-06-09 11:54:22 +02:00
ftrvxmtrx 3bd0d66686 authsrv.h: remove nonexistent prototypes 2015-06-09 11:46:37 +02:00
ftrvxmtrx a314302e64 libdraw: sync allocimage/allocwindow prototypes with man pages 2015-06-09 10:33:30 +02:00
cinap_lenrek 94333d83ab ip: fix wrong radix for iphash() (thanks yoann padioleau)
yoann padioleaus report on 9fans:

> I think I’ve found a bug in the network stack.
> in 9/ip/ip.h there is
> struct Ipht
> {
> 	Lock;
> 	Iphash	*tab[Nipht];
> };
>
> where Night is 521,
>
> but then in 9/ip/ipaux.c there is
>
> ulong
> iphash(uchar *sa, ushort sp, uchar *da, ushort dp)
> {
> 	return ((sa[IPaddrlen-1]<<24) ^ (sp << 16) ^ (da[IPaddrlen-1]<<8) ^ dp ) % Nhash;
> }
>
> where Nhash is just 64,
2015-06-09 10:04:04 +02:00
cinap_lenrek 90b4fe9cf6 zynq: add /dev/fbctl to attach framebuffer to devdraw 2015-06-09 09:17:55 +02:00
cinap_lenrek cda46731d8 devsegment: fix parsecmd() memory leak 2015-06-09 03:33:37 +02:00
cinap_lenrek e2a5d674d9 libdraw: consistent use of nil for pointers, error handling 2015-06-09 01:42:59 +02:00
ftrvxmtrx 0fc761bc84 unix is BUGGERED. remove it 2015-06-09 00:15:59 +02:00
ftrvxmtrx 7a95bef00e authsrv: remove unused opasstokey 2015-06-09 23:53:07 +02:00
ftrvxmtrx 2c505c160e addpt(2): document badrect function 2015-06-09 23:34:36 +02:00
ftrvxmtrx e77002cdab freeimage(2), readcolmap(2), writecolmap(2): fix prototypes 2015-06-09 23:23:00 +02:00
cinap_lenrek 477f3ce3ea exec(2): exec argument size only limited by user stack size 2015-06-08 21:08:57 +02:00
ftrvxmtrx e89e54d1a3 exec(2): fix prototypes 2015-06-08 12:59:51 +02:00
cinap_lenrek 14a7c237b5 aux/vga: disable nvidiascale() as it broke modeset on kenjis card
this code needs revision, need a list of cards where this actually
works.
2015-06-08 02:43:49 +02:00
cinap_lenrek c5b0edecc9 devfs: remove useless ~OTRUNC mask for openmode 2015-06-07 17:41:43 +02:00
cinap_lenrek b554ad054b zynq: fix /dev/pl
prevent double sleep():
callers to sleep() need to be serialized as there can only
be one process sleeping at a time. plrlock and plwlock do
this.

wait for dma to complete in plwrite():
we have to wait for the dma to complete before touching
plbuf again.

maintain COPEN flag in archopen()/archclose():
when open fails because it was in use, clear the COPEN
flag, so archclose() wont screw stuff up.
2015-06-07 17:33:31 +02:00
stanley lieber 1caaa0318b fortunes: Turning off comments. 2015-06-06 18:20:48 -04:00
cinap_lenrek 9d3bc16469 libsec/tlshand: implement client side ECDHE (many thanks to pr!) 2015-06-07 22:14:01 +02:00
cinap_lenrek 079d3f4002 libsec/ecc: fix memory leak (free() vs mpfree()) 2015-06-07 22:12:46 +02:00
cinap_lenrek 4be3300e98 prep(8): edisk also adds a EFI system partition (esp) when not already exists. 2015-06-06 02:13:01 +02:00
cinap_lenrek 1613fd9f52 disk/edisk: create esp partition in addition to plan9 partition in auto mode 2015-06-05 21:57:08 +02:00
cinap_lenrek bbc35cc01b 9boot: look for plan9.ini in all filesystems accessible to efi to find plan9 partition
try the handle buffer in reverse order looking for plan9.ini
to find plan9 partition (9fat). when that fails, we'll default
to the first handle which should be the esp.
2015-06-05 05:09:22 +02:00
mischief 045530aed2 ape: define long long limits 2015-06-04 17:16:23 -07:00
cinap_lenrek 16b3a688c3 dossrv: maintain file creation date/time on disk, fsinfo sector can be 0 (disabled) 2015-06-04 04:34:08 +02:00
cinap_lenrek e83ef3d1e2 disk/format: create Fatinfo sector for fat32 2015-06-04 03:58:03 +02:00
cinap_lenrek 137a762eca disk/edisk: fix blank mode
there where two problems with blank (-b flag):

we did not update the backup header when there was already a valid
backup header in place. we always want to initialize a new backup header
in blank mode!

we now also check the backup header matches the primary (or the other
way arround depending on which header could be read), reporting any
mismatches and restoring the backup from the data of the primary.

the protective mbr needs to start at sector 1 not 0 (apparently, this
matters for ovmf).
2015-06-03 23:19:13 +02:00
cinap_lenrek 8caf4d3bcb authsrv: use plan9 key for http authentication
in addition to /sys/lib/httppasswords, allow http authentication
to use the plan9 password, which can be changed by the user.
2015-06-02 01:15:43 +02:00
cinap_lenrek 0afac04530 hgweb.cgi: +x 2015-06-02 23:44:39 +02:00
cinap_lenrek cfd0698dbd hgweb.cgi: take REPO_ROOT and REPO_NAME from env, so can be used out of the box 2015-06-02 23:41:16 +02:00
cinap_lenrek 5c6357de8b devtls: ignore UnrecogniedName (112) alert message (for SNI) 2015-06-01 01:32:57 +02:00
cinap_lenrek 42484b6ef2 disk/fdisk: learn about EFI system partition (type 0xEF), honor protective mbr (type 0xEE)
efi systems may use traditional dos partition table
with an esp (efi system partition). otherwise, honor
the protective mbr partition (0xEE) and exit when we
encounter it.
2015-05-31 19:30:38 +02:00
cinap_lenrek 8278f6e34c prep(8): document disk/edisk 2015-05-31 14:15:49 +02:00
cinap_lenrek 82aa1d5c78 integrate disk/edisk with diskparts, bootfs and installer (gpt support) 2015-05-31 13:06:18 +02:00
cinap_lenrek 3e124e1f13 libdisk: error handling, sanity checks
- make sure disk file is an actual file and not a directory, log or empty file
- sanity check: file has to be at least one sector to be a disk
- simplify error handling using freedisk()
2015-05-31 12:58:13 +02:00
cinap_lenrek ce76af64fe disk/edisk: little improvements
- make UU() shorter by using long long constant to encode node field
- store Flag as a mask, not as a shift count
- put the attributes before the name in cmdsum() as it is fixed length
2015-05-31 11:19:22 +02:00
cinap_lenrek c770b09f43 test: use libc.h constants for access() mode (thanks qrstuv) 2015-05-31 09:37:59 +02:00
cinap_lenrek 460c598430 io.h: fis comment PciSID (alphapc, kw, mtx, teg2) (thanks qeed!) 2015-05-30 16:50:02 +02:00
cinap_lenrek b137420eff pc/io.h: fix comment for PciSID 2015-05-30 16:45:02 +02:00
cinap_lenrek 1376d559ed disk/edisk: fix usage (was disk/gdisk) 2015-05-30 03:36:58 +02:00
cinap_lenrek 4a4575bd4e disk/edisk: gpt partition table editor (no manpage, work in progress) 2015-05-30 03:22:08 +02:00
cinap_lenrek 09b6a92145 disk/partfs: adding identical partition is no-op 2015-05-30 22:37:46 +02:00
cinap_lenrek b5cbd0bebd disk/fdisk: fix help text 2015-05-30 22:26:18 +02:00
cinap_lenrek 3ceedfd1e1 nusb/disk: adding identical partition is a no-op 2015-05-30 22:24:55 +02:00
cinap_lenrek de3c058efb cputime(2): fix prototype for cycles() (thanks qrstuv) 2015-05-28 18:11:45 +02:00
cinap_lenrek e333a07ded tcs: fix swaped alias mapping gb <-> gb2312 2015-05-28 16:39:04 +02:00
cinap_lenrek 3d1e12363d uhtml: check if document is valid utf8 even with charset specified
often, documents specify charsets but are really utf-8 encoded.
we now try to decode as utf-8 and only if that fails assume
the charset specified in the document.
2015-05-28 16:37:55 +02:00
cinap_lenrek e601e1605b libsec: cleanup x509 and tlshand
- add overflow checks for newbytes(), newbits(), newints()
- remove suspicious nil check from estrdup()
- remove useless nil checks before free
2015-05-28 00:31:36 +02:00
cinap_lenrek 16bbaa2014 ape: include <sys/types.h> in <sys/wait.h> for pid_t (thanks jens staal) 2015-05-27 21:48:42 +02:00
cinap_lenrek a788f2000d libsec/x509: fix verify_signature(), digest_certinfo(), X509dump()
make digest_certinfo() return the digest length, otherwise
return -1 as an error and handle it in the callers.

pass expected digest length to verify_signature() and
check digest length from certificate! make sure we wont
run off the buffer.

fix newlines in error prints of X509dump().
2015-05-27 19:52:06 +02:00
cinap_lenrek 5f7d769a02 libsec/x509: use SHA2-256 digest algorithm instead of MD5
this implements SHA2 (224, 256, 384, 512) signature algorithms and
uses sha256WithRSAEncryption for X509req() and X509gen() instead
of oid_md5WithRSAEncryption.
2015-05-27 18:35:37 +02:00
cinap_lenrek 5ef922959a pci: map pci bars for devices with base class codes (ccrb) 0x00 and 0x0D-0x11 (thanks qeed)
there are a few more device base class codes defined 0x0D-0x11, and
qemu appears to use base class code 0x00 for some of its fake
devices.
2015-05-27 00:23:13 +02:00
cinap_lenrek d6a91e0ae4 cc: set unspecified elements to zero in local variable initializers
the compiler used to skip zero initialization when initializer
list was given not covering unspecified elements. now we zero
all non explicitely initialized elements. for example:

typedef struct F F;
struct F
{
	int a;
	int b;
	int c;
};

void
main(void)
{
	char a[16] = { 1, 2, 3 };	/* a[3..15] initialized to zero */
	F f = { .b = 1 };			/* f.a, f.c initialized to zero */
}
2015-05-26 19:25:06 +02:00
stanley lieber cfafa67640 rootstub: do not create pkg directories 2015-05-25 15:04:30 -04:00
stanley lieber 0853e2cc3b remove pkg(1): we regret the error 2015-05-25 15:03:44 -04:00
cinap_lenrek ff2e8f308d thread(2): fix prototype for threadint() and threadkillgrp() (thanks qwx!) 2015-05-25 13:03:45 +02:00
cinap_lenrek 0d87019a9b cc: handle unaligned data in = {0} local initializer
the emited code that initializes local variables did not handle
unaligned data causing stack corruption, affecting code like:

void main(void)
{
	char a[9] = {0};
}

this change will emit code that does byte stores for the unaligned
bytes and also handles small objects (<= 16 bytes) without branches.
2015-05-25 01:57:18 +02:00
mischief c727d2ae8a cdproto: /sys/log/httpd should be a directory 2015-05-20 18:25:53 -07:00
mischief a94a8a06de revert httpd log file goof 2015-05-20 18:16:54 -07:00
cinap_lenrek 890c459567 webfs: send servername in tls client hello (SNI) 2015-05-21 02:28:06 +02:00
cinap_lenrek 40360a992d libsec: implement tlsClient support for RFC6066 server name identification (SNI)
tlsClient() now can optionally send the server_name in the ClientHello
message by setting the TLSconn.serverName. This is required for some
https sites.
2015-05-21 02:26:57 +02:00
mischief a1bbf39c34 ip/httpd: fix syslog file 2015-05-20 15:38:56 -07:00
mischief 5d2253af99 libhttpd: declare hvprint 2015-05-20 15:09:34 -07:00
cinap_lenrek d8487e98c6 etherigbe: spi eeprom support (thanks echoline) 2015-05-20 09:49:27 +02:00
cinap_lenrek 6198954859 libdraw: don't loop forever when getting eof on /dev/cons in keyboard ioproc 2015-05-19 20:04:47 +02:00
cinap_lenrek 8f8c2d6779 aux/vga: dont use /proc/$pid/mem to access vga bios
using /proc/$pid/mem to access vga bios is not portable and crashes
sgi machines when aux/vga is run. instead, try /dev/realmodemem
first (provided by realemu), then #v/vgabios.
2015-05-19 14:02:02 +02:00
cinap_lenrek 041d732be7 tar, tarfs: implement longname support
this allows extracting tar archives that use longnames extension,
where the real filename is stored in a special entry with
linkflag == 'L' before the file entry. also skip longlink entries
with linkflag == 'K'.
2015-05-19 12:39:45 +02:00
cinap_lenrek 76ee4c3988 usbd: set device info for control file (see usb(3), thanks qeed) 2015-05-18 01:26:29 +02:00
cinap_lenrek c8c65f183d merge 2015-05-18 00:32:19 +02:00
cinap_lenrek 8183f0ec85 cdproto: /sys/log/pop3 2015-05-18 00:29:12 +02:00
stanley lieber 86f22d3c08 colors(1), who(1): add missing SOURCE entries 2015-05-17 12:53:05 -04:00
cinap_lenrek dfdc52ea7a libc: use Runemax instead of hardcoded 0x65536 for fmtchar check (thanks qrstuv) 2015-05-17 07:02:44 +02:00
cinap_lenrek bf74dfbc7a kbdfs: Runemax is inclusive. 2015-05-17 06:59:09 +02:00
stanley lieber 45384b0026 fortunes: What's wrong with the obvious? 2015-05-15 21:08:37 -04:00
cinap_lenrek 0d701b7759 gunzip: the extra length field (XLEN) is two bytes instead of one
example file:
https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R50f.tgz
2015-05-15 07:53:22 +02:00
cinap_lenrek 21f97338f8 tcp: fix loopback slowness issue / set tcb->mss for incoming connections (thanks David du Colombier)
David du Colombier wrote:
> The slowness issue only appears on the loopback, because
> it provides a 16384 MTU.
>
> There is an old bug in the Plan 9 TCP stack, were the TCP
> MSS doesn't take account the MTU for incoming connections.
>
> I originally fixed this issue in January 2015 for the Plan 9
> port on Google Compute Engine. On GCE, there is an unusual
> 1460 MTU.
>
> The Plan 9 TCP stack defines a default 1460 MSS corresponding
> to a 1500 MTU. Then, the MSS is fixed according to the MTU
> for outgoing connections, but not incoming connections.
>
> On GCE, this issue leads to IP fragmentation, but GCE didn't
> handle IP fragmentation properly, so the connections
> were dropped.
>
> On the loopback medium, I suppose this is the opposite issue.
> Since the TCP stack didn't fix the MSS in the incoming
> connection, the programs sent multiple small 1500 bytes
> IP packets instead of large 16384 IP packets, but I don't
> know why it leads to such a slowdown.
2015-05-14 21:09:12 +02:00
Matthew Veety 2b4a488762 fixed by fuck up 2015-05-13 00:15:18 -04:00
Matthew Veety 80845af98b removed ukill. 2015-05-13 00:11:59 -04:00
cinap_lenrek aa0a20ed6e boot/zynq: use ./boothead.$cputype to invoke helper 2015-05-13 04:22:21 +02:00
cinap_lenrek 2d564a5004 boot/zynq: add jtagload utility 2015-05-13 04:12:49 +02:00
cinap_lenrek d57f23fb87 boot/zynq: implement sdmmc boot (fat) 2015-05-13 01:07:35 +02:00
stanley lieber bc4f14e015 fortunes: Feature requests will be ignored. 2015-05-11 11:52:44 -04:00
cinap_lenrek fb9a4ac610 emmc/pmmc: make all symbols static 2015-05-11 05:27:05 +02:00
cinap_lenrek 646062da1c kernel: state errstr.h dependency for proc.acid target (fixes acid kinit() on cleaned kernel source tree) 2015-05-11 05:09:31 +02:00
cinap_lenrek 4bfd4122d9 nusb/serial: recognize aijuboard jtag interface 2015-05-11 02:34:54 +02:00
cinap_lenrek 5275d49d8f webfs: fix proxy authentication 2015-05-10 07:46:53 +02:00
cinap_lenrek 0da5888901 realemu: ignore access to CMOS/RTC address/data registers
the kernel wont allow access to i/o ports 0x70/0x71, so
ignore the access. reads return 0xFF. this fixes vesa on
lenovo e540.
2015-05-09 07:50:05 +02:00
stanley lieber 4547b5070c passwd(1): passwd no longer needs to be run on a terminal; netkey is more stubborn. 2015-05-03 17:37:54 -04:00
stanley lieber bafadebc19 audio(1): explain mp3enc wants raw data in the opposite byte order to /dev/audio (thanks, eekee) 2015-05-01 14:03:29 -04:00
stanley lieber 14ebbcb75b audio(1): fix example 2015-05-01 12:05:30 -04:00
cinap_lenrek 35c9648ee1 pass Ureg* argument to note handler in R0 register on arm
userspace note handlers, like any function, expect ther
first argument in R0 register on arm.
2015-04-30 16:29:40 +02:00
cinap_lenrek 12bb7bcfff libsec: remove aesCTRencrypt()/aesCTRdecrypt() (thanks mischief and qrstuv)
as mischief and qrstuv point out, these functions are not very usefull
and are even implemented wrong (incrementCTR()), so deleting the code.
2015-04-29 02:58:10 +02:00
cinap_lenrek e9c9ea4235 sam: don't make scroll-wheel-up change focus (thanks clsmith) 2015-04-28 19:32:21 +02:00
cinap_lenrek da689241d0 sam: prevent array overflow with multiple -i and -a arguments (thanks clsmith) 2015-04-28 19:30:52 +02:00
cinap_lenrek e20d7c4aad etheriwl: make rxon() static (thanks aap) 2015-04-27 21:32:17 +02:00
cinap_lenrek 64849ab5f3 etheriwl: check the bluetooth co-existance errors (thanks qeed) 2015-04-26 18:02:49 +02:00
cinap_lenrek e10287042e etheriwl: support for Centrino Wireless-N 2230 from freebsd driver (thanks qeed)
big thanks to qeed for porting support for Wireless-N 2230 from
freebsd driver!
2015-04-24 04:13:19 +02:00
cinap_lenrek 99718a581b bzfs: handle erealloc(..., 0) 2015-04-23 18:40:00 +02:00
cinap_lenrek a645a2f83d lib9p: handle erealloc9p(..., 0) 2015-04-23 18:25:19 +02:00
cinap_lenrek 4e7efadf12 hjfs: fix erealloc(..., 0) crash when removing member from group array makes it empty (thanks 9dan) 2015-04-23 18:19:48 +02:00
cinap_lenrek c1ff805e23 cc: fix non constant pointer initializer for other compilers than 8c/6c
i made a mistake here as this change breaks the arm and mips compilers
which lack an optimiation in xcom() that folds constant pointer arithmetic
into the offset. on arm, the a node is a complex expression with op OADD of
type TIND but the test rejected the (valid) pointer arithmetic.

instead, we now test for the operations which cannot be constant instead
of using the type as a proxy.
2015-04-23 05:12:57 +02:00
cinap_lenrek 7f0728b7f4 aux/listen: removing service script sholud kill listener (thanks mischief)
mischief spotted that the only way for listeners to go away was
truncating (but not removing) a service script. this is wrong and
not as described in the manpage.

this change makes removing (or truncating) a listen script stop
the listener.

scandir() first marks all current announces, then reads the service
directory adding announces which will clear the marks for the ones
already there or add a new unmarked one. finally, we shoot down and
remove all still marked announces.
2015-04-23 03:17:25 +02:00
cinap_lenrek 8cb7211a42 secstore(1): add DIAGNOSTICS section 2015-04-22 20:18:11 +02:00
cinap_lenrek 07faf720c9 secstore: don't print errors for dial() and readnvram() when not in verbose mode
when no secstore server has been configured or no nvram is
setup, exit silently with error status.
2015-04-22 20:08:50 +02:00
cinap_lenrek fd80dde429 hjfs: preserve newlines in commit message (thanks BurnZeZ) 2015-04-22 19:54:13 +02:00
cinap_lenrek 81cbff917f gs: avoid 6c type propagation / constant folding issue for set_cb_end()
6c changed "- cmd_lagest_size + 1" into a *unsigned* 32bit constant. which
got added to 64bit pointer making pcb->limit > pcb->end resulting
in errors for partial commands in the buffer. removing the parentesis
propagates the operation to 64bit.
2015-04-17 06:18:43 +02:00
cinap_lenrek 57ad566dfc games/doom: fix mips 2015-04-17 22:19:23 +02:00
cinap_lenrek 82a797da70 kernel: leave shared, physical and fixed segments alone in killbig() 2015-04-16 16:30:14 +02:00
cinap_lenrek ef647a54c0 kernel: cannot interrupt segmentio commands
once we submit a command to segmentio process, we have to wait
for it to complete even if we got interrupted.
2015-04-16 16:07:36 +02:00
cinap_lenrek 39cf6b34e3 kernel: avoid posting note to kernel process in faulterror()
the intend of posting a note to the faulting process is to
interrupt the syscall to give the note handler a chance
to handle it. kernel processes however, have no note handlers
and all the postnote() does is set up->notepending which will
make the next attempt to sleep raise an Eintr[] error. this
is harmless, but usually not what we want.
2015-04-16 15:31:51 +02:00
cinap_lenrek 433b18ec2b cc: catch non constant pointer initializers
char	FOO[] = "abc";	/* ok */
char	*BAR = FOO;		/* ok */
char	*BAZ = BAR;		/* wrong */
2015-04-16 14:32:42 +02:00
cinap_lenrek 3d4fcc6c8a sokoban: fix non constant inializer 2015-04-16 14:29:13 +02:00
cinap_lenrek bcf54c0bfb kernel: pass segio error string by pointer
there's no need to waste space for a error buffer in the Segio
structure, as the segmentio kproc will be waiting for the next
command after an error and will not overwite it until we issue
another command.
2015-04-16 01:20:30 +02:00
cinap_lenrek 46070c3122 kernel: add segio() function for reading/writing segments
devproc's procctlmemio() did not handle physical segment
types correctly, as it assumed it can just kmap() the page
in question and write to it. physical segments however
need to be mapped uncached but kmap() will always map
cached as it assumes normal memory. on some machines with
aliasing memory with different cache attributes
leads to undefined behaviour!

we borrow the code from devsegment and provide a generic
segio() function to read and write user segments which
handles all the cases without using kmap by just spawning
a kproc that attaches the segment that needs to be read
from or written to. fault() will setup the right mmu
attributes for us. it will also properly flush pages for
segments that maintain instruction cache when written.
however, tlb's have to be flushed separately.

segio() is used for devsegment and devproc now, which
also allows for simplification of fixfault() as there is no
special error handling case anymore as fixfault() is now
called from faulting process *only*.

reads from /proc/$pid/mem can now span multiple pages.
2015-04-16 00:45:25 +02:00
cinap_lenrek 88d7d8428a upas/smtp: cleanup mkfile
no need to list headers explicitely as they are implied by $HFILES.
2015-04-15 01:59:17 +02:00
cinap_lenrek 35e1aa1bfa segment: don't store pointers in a long 2015-04-13 23:35:36 +02:00
cinap_lenrek 656dd953a8 segment: fix read/write g->dlen race, avoid copying kernel memory, qlock
code like "return g->dlen;" is wrong as we do not hold the
qlock of the global segment. another process could come in
and override g->dlen making us return the wrong byte count.

avoid copying when we already got a kernel address (kernel memory
is the same on processes) which is the case with bread()/bwrite().
this is the same optimization that devsd does.

also avoid allocating/freeing and copying while holding the qlock.
when we copy to/from user memory, we might fault preventing
others from accessing the segment while fault handling is in
progress.
2015-04-13 23:18:56 +02:00
cinap_lenrek 85e144dcb0 zynq: invalidate cache before booting cpu1
sometimes, machine would crash on boot because
of data cache inconsistency. invalidating the
cache before booting cpu1 fixes it.
2015-04-13 23:04:53 +02:00
cinap_lenrek a43321946e segment: speed up fixedseg() doing single pass over freelist
walking the freelist for every page is too slow. as we
are freeing a range, we can do a single pass unlinking all
pages in our range and at the end, check if all pages
where freed, if not put the pages that we did free back
and retry, otherwise we'r done.
2015-04-12 18:08:06 +02:00
cinap_lenrek 98a7eae9c0 segment(3): document fixed segment creation 2015-04-12 16:38:39 +02:00
aiju d9880518f0 merge 2015-04-12 16:16:19 +02:00
cinap_lenrek a079cd1a3a merge 2015-04-12 16:06:28 +02:00
cinap_lenrek 647a1da108 segment: fix print buffer overflow, map fixed segments uncached, add to zynq kernel 2015-04-12 16:05:05 +02:00