Commit graph

7662 commits

Author SHA1 Message Date
cinap_lenrek 1fe3143e4c kernel: cleanup the software mouse cursor mess
The swcursor used a 32x32 image for saving/restoring
screen contents for no reason.

Add a doflush argument to swcursorhide(), so that
disabling software cursor with a double buffered
softscreen is properly hidden. The doflush parameter
should be set to 0 in all other cases as swcursordraw()
will flushes both (current and previours) locations.

Make sure swcursorinit() and swcursorhide() clear the
visibility flag, even when gscreen is nil.

Remove the cursor locking and just do everything within
the drawlock. All cursor functions such as curson(),
cursoff() and setcursor() will be called drawlock
locked. This also means &cursor can be read.

Fix devmouse cursor reads and writes. We now have the
global cursor variable that is only modified under
the drawlock. So copy under drawlock.

Move the pc software cursor implementation into vgasoft
driver, so screen.c does not need to handle it as
a special case.

Remove unused functions such as drawhasclients().
2020-04-10 17:12:51 +02:00
cinap_lenrek 7b309d2e28 pc, pc64: remove "got unassigned irq" prints
most pc's are multiprocessors these days, that use apic or
msi interrupts, then the irq does not matter anymore. and
uefi does not even assign irq to pci devices anymore. if
we have a problem enabling an interrupt, we will print.
2020-04-09 13:05:10 +02:00
cinap_lenrek 6041d2048c 9bootpxe: simplify 2020-04-08 23:48:09 +02:00
cinap_lenrek abc5a66c56 9bootpxe: continues the war against random DHCPv6 DUIDs
Some UEFI implementations use random UUID based DUID instead of
ethernet address, but use ethernet derived link-local addresses.
So extract the MAC from our IPv6 address.
2020-04-08 23:37:38 +02:00
Alex Musolino fed50d79d3 /lib/face: add .dict entries for andrew.1 face files 2020-04-08 11:52:06 +09:30
Alex Musolino a3f6976a76 notify(2): fix typo 2020-04-07 12:14:12 +09:30
cinap_lenrek 665b78da23 merge 2020-04-06 01:31:35 +02:00
cinap_lenrek 9e2344a5be pc64: remove rampage() nil check
rampage() never returns nil
2020-04-06 01:29:12 +02:00
cinap_lenrek a35cd0f861 pc: zero rampage() memory (thanks LordCreepity)
memory returned by rampage() is not zeroed, so we have to
zero it ourselfs. apparently, this bug didnt show up as we
where zeroing conventional low memory before the new memory
map code. also rampage() never returns nil.
2020-04-06 01:28:34 +02:00
Alex Musolino 80fdafd1d6 file: try ismp4() before ismp3()
It is possible to find the mp3 sync word near the start of an mp4
file.  As such, file(1) could incorrectly identify some mp4s as mp3s.
2020-04-05 23:26:52 +09:30
cinap_lenrek 0ba0820070 dossrv: fix falloc() for >31 bit sector numbers (thanks sl) 2020-04-05 03:46:47 +02:00
cinap_lenrek ecba7822e3 nusb/usbd: fix portreset error handling
error handling in portreset() was wrong. we called closedev()
on the device without changing the reference.

just call portdetach() when the reset fails.
2020-04-05 03:05:06 +02:00
cinap_lenrek 315f20b9f4 nusb/audio: set frequency only when supported
before setting the sampling rate, check bit D0
"Sampling Frequency" in the audio class specific
endpoint descriptor.
2020-04-05 00:59:47 +02:00
cinap_lenrek f5352eb501 merge 2020-04-04 17:17:15 +02:00
cinap_lenrek 339112abc3 mtx, ppc: use proctab() to index into process table 2020-04-04 16:52:08 +02:00
cinap_lenrek 30cbaa5c48 kernel: remove scheddump() comment for delay() in */fns.h 2020-04-04 16:50:37 +02:00
cinap_lenrek 5f1b70f437 pc, pc64: new memory map code
This replaces the memory map code for both pc and pc64
kernels with a unified implementation using the new
portable memory map code.

The main motivation is to be robust against broken
e820 memory maps by the bios and delay the Conf.mem[]
allocation after archinit(), so mp and acpi tables
can be reserved and excluded from user memory.

There are a few changes:

new memreserve() function has been added for archinit()
to reserve bios and acpi tables.

upareserve() has been replaced by upaalloc(), which now
has an address argument.

umbrwmalloc() and umbmalloc() have been replaced by
umballoc().

both upaalloc() and umballoc() return physical addresses
or -1 on error. the physical address -1 is now used as
a sentinel value instead of 0 when dealing with physical
addresses.

archmp and archacpi now always use vmap() to access
the bios tables and reserve the ranges. more overflow
checks have been added.

ramscan() has been rewritten using vmap().

to handle the population of kernel memory, pc and pc64
now have pmap() and punmap() functions to do permanent
mappings.
2020-04-04 16:48:37 +02:00
cinap_lenrek 8debb0736e kernel: add portable memory map code (port/memmap.c)
This is a generic memory map for physical addresses. Entries
can be added with memmapadd() giving a range and a type.
Ranges can be allocated and freed from the map. The code
automatically resolves overlapping ranges by type priority.
2020-04-04 16:04:27 +02:00
cinap_lenrek 7451bb405d ether8390: remove unused variables 2020-04-04 15:55:48 +02:00
cinap_lenrek 6498ce3bf2 ether8003: use physical addresses for ISAConfig ether->mem
Fix the inconsistent use of ether->mem. Always use physical
addresses. Let ether8390 convert to virtual addresses using
KADDR() when we have to copy data in/out.
2020-04-04 15:47:50 +02:00
Alex Musolino ad3da2fac2 merge 2020-04-01 22:57:15 +10:30
Alex Musolino c393806718 upas/fs: fix sending of "delete" plumb messages
Broken by changeset 2cc069392228.
2020-04-01 22:49:19 +10:30
Sigrid 55033d9aed kbd(1): revert repeat/delay change 2020-04-01 11:42:35 +02:00
Sigrid 4756cf549a devkbd: bits bad! revert repeat/delay, better patches welcome 2020-04-01 11:31:19 +02:00
cinap_lenrek d3512f60df ip/dhcp6d: work arround non-ethernet based client duid
in ndb, we use the ethernet mac to identify the client.
in dhcpv6, there is just a uniqueue device id that
might even be generated randomly. to find the ethernet
address of a client, check the duid type and only use
it when the dudid is of type 1 (link layer) or 3 (link
layer address + time) and the link layer address type
is 1 (ethernet). otherwise, assume the source ip is
a link local address and extract it from that.

this hack works for thinkpad t495, which uses random
uuid based client duid.
2020-03-31 21:57:53 +02:00
cinap_lenrek 480ce0314e audiohda: add pci vid/did for AMD Raven HD Audio Controller (T495) 2020-03-31 19:00:32 +02:00
Sigrid ddaaf65efe kbd(3): fix a typo (thanks Alex Musolino) 2020-03-31 10:04:24 +02:00
cinap_lenrek 4dcb3ce2ab xen: fix rebootcode linkage
need to strip the a.out header, just like with the pc
kernel.
2020-03-29 22:47:42 +02:00
BurnZeZ 11025d6f4a lib9p: fix re-use of root Qid when using createfile(); remove unused dirqidgen 2020-03-29 17:39:30 +00:00
Sigrid f5f37ba5eb pc64: enable uartpci (thanks taw9 for testing) 2020-03-29 19:28:39 +02:00
Ori Bernstein 7ae64cec10 merge 2020-03-28 20:33:47 -07:00
Ori Bernstein 8589a591de we prefer nil over 0, make the example show it. 2020-03-28 20:32:53 -07:00
cinap_lenrek 1b8d87555a pc, pc64: ignore the 64-bit bar flag when reserving membar
a bar with bit 3 set means the bar is the low half of
a 64-bit wide bar.
2020-03-29 00:49:07 +01:00
cinap_lenrek 3c36cadefd pc: fix mp boot regression due mistake in mkfile
the previous mkfile had a sneaky hack that would use
sed to delete the first 2 lines of hex output to strip
the 32 byte long a.out header for apbootstrap and rebootcode.

use 8l -H3 flag to strip the header from the output file.
2020-03-29 00:44:09 +01:00
Sigrid 9014360921 kbd: add "repeat" file to set typematic repeat rate/delay on PS/2 keyboards 2020-03-28 15:37:48 +01:00
Alex Musolino 47e3c088c9 grep: fix handling of -b flag
Output buffering is automatically disabled when reading from stdin.
In this case, supplying the -b flag ought to be redundant.  However,
since Bflag was being XORed into the flag set - rather than simply
ORed - supplying -b would actually enable output buffering.
2020-03-26 18:24:39 +10:30
Ori Bernstein 2f67e21393 turn ptrdiff_t into a 64 bit type
while technically a 32 bit ptrdiff_t is in spec on
systems with 64 bit ponters as long as we guarantee
that individual objects are small enough, this can
confuse legitimate code, so lets fix this.
2020-03-24 14:45:15 -07:00
Ori Bernstein 0e1fec841e add intmax_t/uintmax_t as required by c99 7.18.1.5 2020-03-24 14:41:31 -07:00
Ori Bernstein 3fe2924287 evaluate #if expressions using vlong
#if expressions are expected to be evaluated using intmax_t,
according to the C99 spec, 6.10.1 p3. On plan9, intmax_t maps
to vlong.
2020-03-23 09:18:44 -07:00
Ori Bernstein 9a4b5f2e61 merge 2020-03-22 17:34:22 -07:00
Ori Bernstein a654b94db8 add va_copy macro, conforming to c99 7.15.1.2 2020-03-22 17:31:39 -07:00
Sigrid 87e437a856 update colemak kbmap, simpler version with scroll working (thanks jeremy) 2020-03-21 01:50:11 +01:00
Sigrid 3377b78cd3 add colemak kbmap (thanks Silas McCroskey) 2020-03-21 01:40:03 +01:00
Sigrid 5da2b91989 add swiss german kbmap (thanks mike) 2020-03-21 01:07:40 +01:00
Ori Bernstein 7364a96b28 bell labs is dead, man
remove the last reference from 9fs.
2020-03-20 14:12:23 -07:00
BurnZeZ aa5e86a8ca kbdfs: fix kbmapread() not accounting for reads smaller than the size of the line 2020-03-20 18:08:34 +00:00
Ori Bernstein 37b86df09f Improve the posix preprocessor.
This fixes token pasting, making it expand when
it should expand, and paste before expansion when
it should paste before expanding.

	#define CAT(a, b) a ## b
	#define BAR	3
	#define FOO	CAT(BAR, 3)
	FOO

now produces 33, while

	#define CAT(a, b) a ## b
	#define EOF	(-1)
	#define NOP(x)	x
	NOP(CAT(foo, EOF))
	CAT(,EOF)
	CAT(,)

produces

	fooEOF
	(-1)
	<empty>

respectively.
2020-03-17 22:03:25 -07:00
Ori Bernstein 52dc943702 fix ccom idempotency
ccom may be called multiple times on the same
node, via 'goto loop' calls from the commute
label, OADD, and a few other places.

Casts to void could null out the LHS of the
node, which would cause the compiler to crash
if the cast was revisited due to one of these
cases, because we tried frobbing n->left.

Now, if n->left is nil, we just return.w
2020-03-15 15:08:04 -07:00
Ori Bernstein 5bc9b0c3ca improve usage messages (thanks henesy)
Fix inconsistencies between programs and their usage
messages,  correct instances where information seems
to be missing or lost. This  includes missing arguments,
making usage consistent with manuals, and so on.
2020-03-10 10:09:34 -07:00
Ori Bernstein 06ea44c895 fix -T option for doctype
We used to set $dev to -T, and leave the device type
in the argument list. Now, we set it to -T$2, and shift
it out of the list.
2020-03-10 09:35:06 -07:00