Commit graph

10370 commits

Author SHA1 Message Date
Jacob Moody
8a234e57b9 libc, libthread, ape: mark exit functions as _Noreturn and clean up new warnings 2024-01-28 03:36:41 +00:00
Jacob Moody
6b0574e27e ndb/dns: DoT support 2024-01-28 00:01:56 +00:00
Jacob Moody
917d0fa9b4 9fs: add iso case for nightly iso box 2024-01-27 22:05:23 +00:00
Igor Böhm
c2a290b8fe acmed(8): fix typos 2024-01-25 07:18:34 +00:00
cinap_lenrek
42ec5a0729 ip/ipconfig: don't add default route for ULA prefix 2024-01-24 20:51:52 +00:00
cinap_lenrek
fc6cc079fe devip: fix isula()
ULA prefix is 0xfc00::/7 not 0xfd00::/8.
2024-01-24 20:51:07 +00:00
Jacob Moody
207cd2812f awk: fix out of bounds write with large fields (thanks kristo)
; dd < /dev/zero -bs 4 -count 8k | tr '\x0' A | awk '{a=$1}'

Solution copied from onetrueawk.
2024-01-23 21:10:41 +00:00
cinap_lenrek
26c21f9b5d kernel: remove unused variables from arm trap() handler 2024-01-21 15:27:11 +00:00
Ori Bernstein
1ac17a5b59 diff(1): include merge3 name in diff manpage 2024-01-21 03:11:27 +00:00
Ori Bernstein
4738d90516 diff(1): docuemnt merge3 2024-01-21 03:07:25 +00:00
Ori Bernstein
c59eb6d117 merge3: make identical changes merge cleanly
when making the same change on both the left and
right fork, this should not be a merge conflict.
Instead, the two changes should merge cleanly.
2024-01-21 02:44:42 +00:00
cinap_lenrek
4364b71ccc kernel: make trap() handlers consistent and check for stack overflow in kenter() for all archs 2024-01-20 17:26:39 +00:00
cinap_lenrek
1a73b594e6 pc: use JMPF instead of indirect jump for going to syscall() 2024-01-20 17:15:26 +00:00
cinap_lenrek
72aa282792 pc64: no need to CLI in noteret() and forkret()
Interrupts are disabled when returning from
trap() or when gotolabel()'ing to forkret().
2024-01-17 19:54:07 +00:00
cinap_lenrek
c2ec061689 pc64: set accessed and dirty bits in PTE to avoid write-back
We do not use the accessed and dirty bits in
page table entries so we can just always set them.
this avoids that the cpu needs to atomically write
back to the page table when setting these bits.
2024-01-17 19:48:39 +00:00
cinap_lenrek
9c2e8e2b13 ndb/dnsdebug: fix dnsserver override (thanks moody) 2024-01-15 03:59:10 +00:00
Igor Böhm
53fe82ee86 nusb/ptp: transaction IDs are sequences of numbers starting with 0 (thanks unobe)
According to 'Digital Camera connectivity solutions using the picture
transfer protocol' [1] Section 2.3: "the PTP is specified using the
transaction model.  A transaction is composed of a request operation,
followed by an optional data transfer and a response.  Each
transaction has an identifier (TransactionID) that is session unique
and comprise of a 32 bit unsigned number.  The transaction IDs are a
sequence of numbers starting with 0x00000000 (for the SessionOpen
transaction) and increasing with every following operation."

[1] https://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/f2012/jmv87/site/files/PTP%20Protocol.pdf
2024-01-15 01:11:18 +00:00
Jacob Moody
c8d87b22d5 ip/torrent: only register note handler in one proc
Before the note handler would be set on all procs
which would cause all threads to try and kill
all other threads on exit. This also adds some
procsetname() calls which makes it easier to see
exactly what is going on in something like pstree(1).
2024-01-09 19:59:34 +00:00
cinap_lenrek
e2978c785a imx8, arm64: fix tbdf argumnt position for intrdisable() (thanks cosa) 2024-01-08 20:25:48 +00:00
Igor Böhm
4d69aacea0 vncv: implement autoscaling via -a flag (thanks unobe)
Add vncv option '-a' to autoscale remote frame buffer to
local screen window size; useful when remote frame buffer
is larger than the local screen.

If the remote frame buffer is larger than the local screen,
and autoscaling is disabled, only the upper left corner is
accessible.
2024-01-08 01:27:43 +00:00
cinap_lenrek
1efad2d8fb bcm64: fix build caused by added bootargs file in arm64/ 2024-01-08 00:16:27 +00:00
cinap_lenrek
80f875fd92 devip: no more wandering routes
Before, it was possible to add routes before
the interface existed.

The routes would look for their interface lazily
as the route was looked up, but this leads to
all kinds of hard to explain behaviour when
a interface goes away and the routes start
wandering to a different interface on their
own which they will stick to when a new
interface comes up that would match the route
better.

Instead, we have routes always associated
to their desination interface and remove
the routes when the interface gets unbound.

It is no longer possible to add routes for
interfaces that do not exist.

This is easier to reason about behaviour as
well as allows us to get rid of canrlock(ifc)
in findipifc().

All routes inside the routing tree are now
by definition up-to-date (as long as we
hold the routelock).

Callers of v4lookup()/v6lookup() still should
check if the ifcid of the interface still
matches the route once they have acquired
the interface lock.
2024-01-07 23:39:29 +00:00
Keegan Saunders
57fc95de3c arm64/qemu: add xhci usb
To use, add the QEMU XHCI PCI device:

	-device qemu-xhci,id=xhci -device usb-tablet,bus=xhci.0
2024-01-07 21:10:57 +00:00
Keegan Saunders
1fe150f1ed arm64/qemu: detect VM configuration
Now, *maxmem and *ncpu are not required to be provided.
They will be detected automatically from the QEMU device
tree. Further, >4GB memory configurations are also supported.
The maximum number of CPUs is 16 for now, and the maximum
supported memory is 16GB
2024-01-07 19:57:50 +00:00
cinap_lenrek
23f34184d6 ip/ppp: increase echo timeout to 5 periods (25 seconds)
I get every hour a delay of the echo replies for as
long as 20 seconds causing reconnects.

It does recover however and sends all the replies
eventually.
2024-01-07 05:12:08 +00:00
Jacob Moody
74c1f4730b 6?, 8?, libc: add JMPF instruction
In 6? and 8? JMP works a bit uniquely,
when passed a function name it always encodes
as a JMP* instead of a JMP. This means

JMP myfunc(SB)

always assume that myfunc is a function pointer, not
a function itself. The new JMPF instead has the same
semantics as CALL and matches B and JMP in other
assemblers. This allows for a small optimization in
our 386 and amd64 entrypoint by avoiding a jump between
_main and _callmain.
2024-01-07 03:04:35 +00:00
cinap_lenrek
7a503757b1 vncs: bind devswap also for memory(1), this used to be in devcons 2024-01-06 21:14:25 +00:00
cinap_lenrek
dc593372bf nusb/audio: name audio device as audioUxxxx/volumeUxxxx (thanks arne)
This allows having multiple audio devices.
2024-01-06 19:55:38 +00:00
cinap_lenrek
5e370061e0 mixfs: allow switching between audio devices (/dev/audio*)
At startup, look for audio devices like /dev/audio*
and open the first one that shows up.

We allow to later changing the audio device using
the new "new" control message to /dev/audio.

Only devices named /dev/audio*, #u/audio* and #A/audio*
are allowd so far to prevent accidents.
2024-01-06 19:40:00 +00:00
cinap_lenrek
3d706f9621 ip/ppp: lower echo timeout to 2 periods (10 seconds)
it usually never recovers...
2024-01-06 19:32:53 +00:00
cinap_lenrek
8b19c4f273 9nfs: fix rfork() race with shared pid variable 2024-01-05 07:10:58 +00:00
cinap_lenrek
e80c7eb50b cifs: fix rfork() race with shard pid variable 2024-01-05 07:07:53 +00:00
cinap_lenrek
ee2174eb6d telco: fix rfork() race for pid 2024-01-05 07:02:25 +00:00
cinap_lenrek
8d2b84747b ip/ppp: fix race condition with rfork()
ipinprocpid is static so shared with parent and child,
so we need a temporary variable on the local stack
to properly assign ipinprocpid.
2024-01-05 06:46:35 +00:00
cinap_lenrek
2ca3934809 ip/ppp: remove -> del 2024-01-05 05:48:37 +00:00
cinap_lenrek
e48a5c343d imx8: the mpid should not contain other bits from MPIDR_EL1, only the AFF bits
By looking at ATF, it seems only the affinity bits are
expected here, no MT bit.
2024-01-05 02:45:01 +00:00
cinap_lenrek
eaffa1ef55 kernel: fix EDF scheduler double ready() and more robust double-ready detection
Move the "double-ready" check into queueproc() function,
doing it while holding the runq lock, meaning
all transitions to Ready state are serialized.

We do not just check for double-ready but for any
"illegal" transisions:

ready() on Dead, Moribund, New, Ready, Running and Waitrelease
is not allowed.

ready() on Queueing*, Wakeme, Broken, Stopped and Rendez
is only valid when done from another process.

For rescheduling, we have to go to Scheding state
before calling ready(). (rebalance(), schedinit()...)

The EDF scheduler had this bug where it could ready() multiple
times as it was staying in Waitrelease state after releasing
the edflock. Now it transitions thru Scheding avoiding
the issue.
2024-01-05 02:12:42 +00:00
cinap_lenrek
39321d74d8 kernel: never do sched() in unlock() when not in "Running" state.
Some callers of unlock change the process state
(such as qlock()) which means they are committed
to calling sched() anyway, so no ned to call it
internally.
2024-01-05 01:58:37 +00:00
cinap_lenrek
381da3192f kernel: fix typo in sema assert= vs == (thanks moody) 2024-01-04 05:07:52 +00:00
cinap_lenrek
e38d42b4a7 kernel: handle errors in semacquire
Move waserror()/poperror() out of the loop,
so we can also catch errors from canacquire().

This is theoretically possible if memory has
been paged out and we get I/O errors when
trying to page it back in.
2024-01-04 04:49:33 +00:00
cinap_lenrek
16c1cc99ec kernel: .... aaand devswap :) 2024-01-04 04:46:30 +00:00
cinap_lenrek
feda4b1ed2 kernel: add extra "New" process state to catch invalid state transitions
For ready() to check invalid state transitions,
we want to ensure that ready() is never called
on a dead proc (or one that is currently dying),
however when we create a new process,
its initial state was "Dead" until is is ready()d.

Instead, introduce the state "New", which is
set when the proc is removed from the freelist
by newproc(), making New -> Ready -> Running
state transition valid.

Also make sure we never leave notes to deadly
processes or ones that are in "Broken" state.
2024-01-04 04:45:56 +00:00
cinap_lenrek
f16547d604 kernel: forgot portfns.h from last change 2024-01-04 04:35:12 +00:00
cinap_lenrek
29e9c7bf01 kernel: don't sched() for clock interrupt when up->state != Running
When we get a clock interrupt, we should not
call sched() when the process is not in "Running" state
as it is already committed to call sched() itself.

(An example is qlock(), just after the unlock() call).

As this is basically the same check as done in
preempted(), unify both and add a "clockintr"
argument to preempted().

Then most trap handlers just become:

preempted(irq());

Also, we do not want to call preempted() for traps,
as the trap handler has just setup some machine
state to resolve the trap. We can wait for the
clock interrupt if we really need the preempt.
2024-01-04 04:33:29 +00:00
cinap_lenrek
02015f69f6 kernel: make sure process is in Queueing state in qunlock() 2024-01-04 04:22:04 +00:00
cinap_lenrek
692023ee08 etherseeq: defer enabling controller until attach(), provide shutdown() function
On pnp(), just allocate descriptors and bring the controller
in a halted state.

Start the controller and dma in attach().

This prevents MAME from locking up when there is ethernet
traffic during bootup.
2024-01-02 23:51:22 +00:00
adventuresin9
5de941cbcf mt7688/uarti8250.c; fixed interrupts 2024-01-02 04:54:30 +00:00
cinap_lenrek
f62e54b13d sgi: make newport graphics work in MAME
MAME doesnt support RGB Map 1 mode so use RGB Map 0 instead.

Hardware cursor is screwed up too, so just implement
software cursor for now.
2024-01-02 02:06:08 +00:00
cinap_lenrek
59d4a6261f ip/dhcpd: don't override local address for gateway case 2024-01-01 21:14:28 +00:00
cinap_lenrek
f0ac2d0176 sgi: fix botched conversion to stacks below Proc. 2024-01-01 02:35:13 +00:00