Commit graph

56 commits

Author SHA1 Message Date
cinap_lenrek 729c9c39d9 devether: mux bridges, portable netconsole 2018-02-18 19:56:01 +01:00
cinap_lenrek d6e0e9c402 kernel: move devether and wifi to port/
the only architecture dependence of devether was enabling interrupts,
which is now done at the end of the driver's reset() function now.

the wifi stack and dummy ethersink also go to port/.

do the IRQ2->IRQ9 hack for pc kernels in intrenabale(), so not
every caller of intrenable() has to be aware of it.
2018-02-11 18:08:03 +01:00
cinap_lenrek c1eb4b8d68 devether: dont forward loopback packets on bridges 2017-12-18 20:47:55 +01:00
cinap_lenrek 9fd8894fec ether: allow spoofing of source mac address for bridges; used by vmx
to implement layer 2 bridges in userspace, we disable to auto filling
of the source mac address when bridge mode is enabled on the
connection.
2017-12-15 22:22:29 +01:00
cinap_lenrek 35bc3ac573 devether: remove duplicated parseether() implementation (pull from libip) 2017-12-09 22:07:32 +01:00
cinap_lenrek e3736b8887 kernel: make isaconfig() consistent, not inplace tokenizing the conf string 2017-11-19 17:17:04 +01:00
cinap_lenrek 24057fd4f4 kernel: introduce per process FPU struct (PFPU) for more flexible machine specific fpu handling
introducing the PFPU structue which allows the machine specific
code some flexibility on how to handle the FPU process state.

for example, in the pc and pc64 kernel, the FPsave structure is
arround 512 bytes. with avx512, it could grow up to 2K. instead
of embedding that into the Proc strucutre, it is more effective
to allocate it on first use of the fpu, as most processes do not
use simd or floating point in the first place. also, the FPsave
structure has special 16 byte alignment constraint, which further
favours dynamic allocation.

this gets rid of the memmoves in pc/pc64 kernels for the aligment.

there is also devproc, which is now checking if the fpsave area
is actually valid before reading it, avoiding debuggers to see
garbage data.

the Notsave structure is gone now, as it was not used on any
machine.
2017-11-04 20:08:22 +01:00
cinap_lenrek f3f9392517 kernel: introduce devswap #¶ to serve /dev/swap and handle swapfile encryption 2017-10-29 23:09:54 +01:00
cinap_lenrek ffb28698bf kernel: fix bounds check in screenputc() 2017-07-20 21:03:00 +02:00
aiju 773be02aa1 kernel: add support for hardware watchpoints 2017-06-12 19:03:07 +00:00
cinap_lenrek 1a2aefcf11 devmouse: refactor screen blanking logic
devmouse controls the screen blanking timeout, so move the
code there avoiding cross calls between modules. the only
function that needs to be provided is blankscreen(), which
gets called with drawlock locked.

the blank timeout is set thru /dev/mousectl now, so kernels
without devvga can set it.

blanking now only happens while /dev/mouse is read. so this
avoids accidentally blanking the screen on cpu servers that
do not have a mouse to unblank it.
2017-03-18 16:58:27 +01:00
cinap_lenrek 8177d20fb2 kernel: get rid of active.Lock and active.thunderbirdsargo 2017-03-11 16:30:51 +01:00
cinap_lenrek b3c1fa9ecf devmouse: change msec argument of *mousetrack() to ulong 2016-12-10 16:12:18 +01:00
cinap_lenrek 3dc64de2e4 omap: cleanup mouse.c, just a dummy for mousectl() 2016-11-29 20:54:17 +01:00
cinap_lenrek 807019d6eb omap: fix format string warning %d for long 2016-11-29 20:51:08 +01:00
cinap_lenrek 41383ad012 kernel: change active.machs from bitmap to char array to support up to 64 cpus on pc64 2016-01-05 05:32:40 +01:00
cinap_lenrek 7f3659e78f kernel: cleanup exit()/shutdown()/reboot() code
introduce cpushutdown() function that does the common
operation of initiating shutdown, returning once all
cpu's got the message and are about to shutdown. this
avoids duplicated code which isnt really machine specific.

automatic reboot on panic only when *debug= is not set
and the machine is a cpu server or has no display,
otherwise just hang.
2015-11-30 14:56:00 +01: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 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 49fe7b0dd0 kernel: move arrow cursor definition to port/devmouse.c 2015-04-07 22:05:48 +02:00
cinap_lenrek 995379e388 usbehci: initial support for usb on zynq, remove uncached.h
the following hooks have been added to the ehci Ctlr
structore to handle cache coherency (on arm):

	void*	(*tdalloc)(ulong,int,ulong);
	void*	(*dmaalloc)(ulong);
	void	(*dmafree)(void*);
	void	(*dmaflush)(int,void*,ulong);

tdalloc() is used to allocate descriptors and the periodic
frame schedule array. on arm, this needs to return uncached
memory. tdalloc()ed memory is never freed.

dmaalloc()/dmafree() is used for io buffers. this can return
cached memory when when hardware maintains cache coherency (pc)
or dmaflush() is provided to flush/invalidate the cache (zynq),
otherwise needs to return uncached memory.

dmaflush() is used to flush/invalidate the cache. the first
argument tells us if we need to flush (non zero) or
invalidate (zero).

uncached.h is gone now. this change makes the handling explicit.
2015-02-14 03:00:31 +01:00
cinap_lenrek b8cf3cb879 kernel: reduce Page structure size by changing Page.cachectl[]
there are no kernels currently that do page coloring,
so the only use of cachectl[] is flushing the icache
(on arm and ppc).

on pc64, cachectl consumes 32 bytes in each page resulting
in over 200 megabytes of overhead for 32gb of ram with 4K
pages.

this change removes cachectl[] and adds txtflush ulong
that is set to ~0 by pio() to instruct putmmu() to flush
the icache.
2015-02-07 02:52:23 +01:00
cinap_lenrek 5c29603f50 kernel: remove obsolete comment regarding Mntcache size in */main.c 2014-12-16 08:11:21 +01:00
cinap_lenrek 67bed722f2 kernel: get rid of /boot/boot parametrization
there is no use for "bootdisk" variable parametrization
of /boot/boot and no point for the boot section with its
boot methods in the kernel configuration anymore. so
mkboot and boot$CONF.out are gone.

move the rules for bootfs.paq creation in 9/boot/bootmkfile.
location of bootfs.proto is now in 9/boot/bootfs.proto.
our /boot/boot target is now just "boot".
2014-12-14 22:10:34 +01:00
cinap_lenrek b18a641397 kernel: remove implicit Proc* argument from procctl()
procctl() is always called with up and it would not
work correctly if passed a different process, so
remove the Proc* argument and use up directly.
2014-11-09 08:19:28 +01:00
cinap_lenrek 15afb9d00b apply ps2mouse corruption fix to omap
the omap ps2mouse driver is currently unused, but
in case of being finished at some point, apply the
fix from the pc driver.
2014-09-28 19:02:25 +02:00
cinap_lenrek 72ba3571a3 kernel: remove _xinc()/_xdec()
as with the Block refcount changes, _xinc() and _xdec() arent
used anymore, so remove them.

architecure can still define ainc()/adec() when it needs them.
2014-06-08 01:35:22 +02:00
cinap_lenrek ce38380b8f omap: move syscall.$O target from config to mkfile 2014-06-08 00:26:39 +02:00
cinap_lenrek 3d20da3f8b omap: remove Block refcounting 2014-06-08 00:26:23 +02:00
cinap_lenrek ad1eefb355 kernel: various cleanups 2014-01-20 02:16:42 +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 42074003ca kernel: dont call pprint() while holding up->debug qlock
pprint() might block or even (maliciously) call into
devproc write which will corrupt the qlock chain on attempt
to qlock up->debug again.
2013-12-29 07:48:19 +01:00
cinap_lenrek ea6fea596b devether: remove qfull prints and fix loopback packet handling of etheroq()
dont spam the console with qfull warnings. this makes things worse.

handle loopback packets as stated in the comment. we call etheriq()
with fromwire=1 for loopback packets so etheriq() can pass the packet
on (without copying) or free it. dont inhibit interrupts while calling
etheriq(). etheriq() can safely be called from process and interrupt
context. it is unclear what this was supposed to fix and testing didnt
seem to have any odd effects.
2013-12-16 19:19:15 +01:00
jpathy 166da952f4 fpiarm: condok() verfiy before specialop() omap/kw 2013-06-14 23:42:30 +05:30
jpathy 4b79c8f86f Remove unused fpemu function in omap, kw 2013-06-12 01:17:49 +05:30
jpathy 9f949e3cd3 ARM: kernel: add vfp emulator to bcm, teg2, omap, kw 2013-06-12 01:11:41 +05:30
cinap_lenrek d94ffb4808 kernel: do all fp state fork from procfork() (like pc kernel)
this simplifies the arm ports and keeps all the stuff in one place
instead of spreading it thru notify(), trap() and syscall() functions
and prevents useless fp state copying for kernel procs.

also make sure to save fp in notify while still splhi().
2013-05-30 23:26:21 +02:00
cinap_lenrek b325475fc8 Fix double-free fault when isaconfig returns nothing for "etherN". (from richard millers devether-doublefree patch) 2013-04-29 18:39:44 +02:00
cinap_lenrek 3045d63969 reduce software cursor flickering
the software cursor starts flickering and reacts bumby if a process
spends most of its time with drawlock acquired because the timer interrupt
thats supposed to redraw the cursor fails to acquire the lock at the time
the timer fires.

instead of trying to draw the cursor on the screen from a timer interrupt
30 times per second, devmouse now creates a process calling cursoron() and
cursoroff() when the cursor needs to be redrawn. this allows the swcursor
to schedule a redraw while holding the drawlock in swcursoravoid() and
cursoron()/cursoroff() are now able to wait for a qlock (drawlock) because
they get called from process context.

the overall responsiveness is also improved with this change as the cursor
redraw rate isnt limited to 30 times a second anymore.
2013-04-14 16:28:54 +02:00
cinap_lenrek f37465fd7f sysexec: fix possible segment overlap with temporary stack
the kernel uses fixed area (TSTKTOP, TSTKSIZ) of the address
space to temporarily map the new stack segment for exec. for
386 and arm, this area was right below the stack segment which
has the problem that the program can map arbitrary segments
there (even readonly).

alpha and ppc dont have this problem as they map the temporary
exec stack *above* the user reachable stack segement and segattach
prevents one from mapping anything above or overlaping the stack.

lots of arch code assumes USTKTOP being the end of userspace
address space and changing this to TSTKTOP would work, but results
in lots of hard to test changes.

instead, we'r going to map the temporary stack programmatically
finding a hole in the address space where to map it. we also lift
the size limitation for arguments and allow arguments to fill
the whole new stack segement.

the TSTKTOP and TSTKSIZ are not used anymore so they where removed.

references:

http://9fans.net/archive/2013/03/203
http://9fans.net/archive/2013/03/202
http://9fans.net/archive/2013/03/197
http://9fans.net/archive/2013/03/195
http://9fans.net/archive/2013/03/181
2013-03-16 02:37:07 +01:00
cinap_lenrek 43e09c468b omap: update omap kernel (from sources)
refactors of the usb ehci code and adds vfp support
2013-01-26 17:32:08 +01:00
cinap_lenrek 180e04ee41 omap: fix breakpoint instruction trap handling (from sources) 2013-01-25 14:48:57 +01:00
cinap_lenrek aa0627162b remove non standard COM3 (eia2) serial port from i8250 uart.
access to non standard serial port COM3 at i/o port 0x200 causes
kernel panic on some machines (Toshiba Sattelite 1415-S115). also,
some machines have gameport at 0x200.

i readded uartisa to the pcf and pccpuf kernel configurations so
one can use plan9.ini to add non standard uarts like:

uart2=type=isa port=0x200 irq=5
2013-01-13 10:23:31 +01:00
cinap_lenrek 5a138029db move devusb to port
moved devusb to port, shifting the responsibility of how
to enable interrupts to the arch specific hci driver.
2012-12-06 18:53:17 +01:00
cinap_lenrek 336df4d4ae Qcoalesce patch to satisfy full read length 2012-09-14 03:35:15 +02:00
cinap_lenrek 7f04d86dfb kernel: move duplicated random.c to port 2012-05-03 08:49:25 +02:00
cinap_lenrek f2b6ec3140 correcting unicode superscripts for 1 2 and 3 2012-02-23 16:58:53 +01:00
cinap_lenrek 861713765b kernel: fix wrong calculation of swap iolist size 2011-12-14 00:10:33 +01:00
cinap_lenrek 3fce94e785 fix _tos->pcycles, make _tos->kcycles actually count cycles executing kernel code on behalf of the process 2011-10-25 20:17:39 +02:00
cinap_lenrek c44b78f739 change definition of Chan.create to return a chan like open 2011-08-17 23:27:31 +02:00