Commit graph

2922 commits

Author SHA1 Message Date
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
stanley lieber 0c6a90484c add /lib/uriel; delete fortunes 2014-01-12 13:00:02 -05:00
Matthew Veety aeb49aca9e added a segment for segattach(2) that gives access to the raspberry pi's gpio header. 2014-01-12 11:00:38 -05:00
cinap_lenrek a5525457bd etheryuk: fix lockups (thanks burnzez for testing)
according to a comment in linux driver, reading Isrc2
register caused interrupts to be disabled. we used
to read Isrc2 in ifstat() and it was confirmed that
reading ifstat locks up ethernet. removing the Isrc2
read in ifstats, and also reenable interrupts after
reading Isrc2 when the interrupt was not for us.
(this is from the linux driver)

in replenish(), set ring software write pointer (Sring.wp)
*before* the hardware write index register. otherwise
rx() could get status notification for completed
receive but wont find the rx descriptor in the ring.

handle uint wrap arround when calculating ring fill
count and remaining count.
2014-01-12 12:08:10 +01:00
cinap_lenrek 5d9f0ed326 netif: fix wrong qid in 3rd level stats/ifstats files (thanks burnzez)
the stats and ifstats files in the 3rd level of a netif
are not per connection, but for the interface.

this made fstat fail for /net/ether0/N/*stats where N > 0
as the NETID() bits in the qid didnt compare.
2014-01-11 16:07:35 +01:00
cinap_lenrek 6a83facfb3 rio: properly handle initial wrap arround in wlook() 2014-01-11 10:46:07 +01:00
cinap_lenrek 7c503e6f49 rio: implement "look" (thanks lf94) 2014-01-11 10:14:35 +01:00
cinap_lenrek 784e6ff8cd kernel: fix fairshare formula in comment (thanks erik) 2014-01-10 15:12:28 +01:00
cinap_lenrek fc88896fc1 mixfs: make mixbuffer addition atomic
serialize mixing with spinlock to make the addition
on the mixbuffer samples atomic.
2014-01-10 14:51:29 +01:00
cinap_lenrek f4550c4d6a merge 2014-01-10 01:20:24 +01:00
cinap_lenrek aa8f8d866b libdraw: cleanup string() and stringwidth()
getting rid of the goto at the end of the while
loop by moving the if(subfontnae) case before
the cachechars() call.
2014-01-10 01:19:14 +01:00
mischief a872d5241e winwatch: this is not about sanity. rows might be negative 2014-01-08 21:32:27 -08:00
mischief 8319457a10 winwatch: prevent divide by zero if the window height is too small 2014-01-08 20:52:40 -08:00
cinap_lenrek ce2487c3cc mothra: remove version 2014-01-07 02:57:39 +01:00
cinap_lenrek 720967f984 libframe: fix _frcanfit() for zero width runes, simplify chopframe() 2014-01-07 02:24:16 +01:00
stanley lieber ee4ddd77f7 weather: trim garbage from output 2014-01-06 14:55:42 -05:00
cinap_lenrek cae41c18ff libframe: avoid _frcanfit() call in frdelete()
no need to calculate number of runes to fit in
box when box contains no runes.
2014-01-06 03:56:45 +01:00
cinap_lenrek e3b4950966 libdraw: fix stringwidth problems
cachechars() used to skip over characters on its own when
loadchar() could not find the character or a PJW replacement.
this resulted in wrong width calculation. now we just return
and handle the case inside _string and _stringwidth.

fix subfont leak in stringwidth()

remove annoying prints in stringwidth()
2014-01-06 03:49:14 +01:00
cinap_lenrek b7ab1354e3 merge 2014-01-05 02:39:23 +01:00
cinap_lenrek f912e01854 rio: make scrollwheel handling consistent with sam
scrollwheel now works proportional to y mouse position.
special case is when shift is hold down. then scrollwheel
will work like before and scroll one line up or down.
2014-01-05 02:37:42 +01:00
stanley lieber 473e97869f fortunes: This is Go. 2014-01-04 13:13:38 -05:00
cinap_lenrek 6929f0a986 kernel: simplify procalarm() 2014-01-03 02:16:18 +01:00