Commit graph

10542 commits

Author SHA1 Message Date
Jacob Moody
0ab44a0062 9c: copy warning from other compilers regarding pointer -> int truncation 2024-04-29 21:31:05 +00:00
Jacob Moody
bac935c71f 9a: mkfile was pointing to wrong header 2024-04-29 21:30:27 +00:00
Jacob Moody
418f36d7eb libc/libap: update power64 entrypoints to new _callmain standard 2024-04-07 01:27:08 +00:00
Jacob Moody
37e65b331b 9c/9l: do not have the linker rewrite OSUB to negative OADD
POWER does not provided subtract immediate functions and
instead rely on negative addition. It was such that the linker
was the one who would go through and rewrite these to be negative
but it really should be done in the compiler while we still have
the width information.
2024-04-07 00:13:41 +00:00
Jacob Moody
0c6fd079ce 9l: do consize check for SB relative as well 2024-04-07 00:01:30 +00:00
Jacob Moody
5390130426 9c: avoid generating immediates that make the linker use REGTMP 2024-04-06 22:13:54 +00:00
Jacob Moody
8483799d4a 9c/9l/libmach: handle 64 bit constants
* Add a handful of 64 bit classifications to 9l, along with instruction generation for each.
* 9c should avoid generating immediate instructions for 64 constants.
* libmach should know about 9l's generation to present a better disassembly.
* libmach now properly displays MOVD for moves between registers on 64 bit.
2024-04-01 05:20:20 +00:00
Jacob Moody
7f8bd35954 9l: add -H6 for elf targeting kexec 2024-03-27 15:54:10 +00:00
Jacob Moody
5fe33fb808 /sys/src: power64 target 2024-03-30 18:58:36 +00:00
Jacob Moody
0ec381a846 libmach: power64 vector mov and cleanup 2023-11-07 14:45:29 +00:00
Jacob Moody
39c021fbc1 /sys/lib/acid: add power64 2023-11-04 20:52:35 +00:00
Jacob Moody
4cdad07b98 9c: mind which CMP is used when handling constants 2023-11-04 20:51:19 +00:00
Jacob Moody
fe53c0930e libmach: power64 catch up 2023-11-03 15:34:48 +00:00
Jacob Moody
7b63c05b21 9c: allow switches on 64bit values 2023-10-01 23:18:23 +00:00
Jacob Moody
ceba67bc06 9l: fix ELF generation 2023-10-01 21:08:38 +00:00
Jacob Moody
29ce934c91 9a, 9c, 9l: import from 9legacy 2024-04-01 20:46:41 +00:00
Jacob Moody
7628681f83 libmach: remove unused 6c subdirectory
This was leftover from before 6c was
in /sys/src/cmd, as the mkfile adds this
to the include path. Now that we have 6c,
this subdirectory is never used.
2024-05-04 17:13:41 +00:00
cinap_lenrek
0273db0792 ip/torrent: support compact peers6 list 2024-05-04 14:49:03 +00:00
cinap_lenrek
3ba68527b3 ip/torrent: fix wrong interval check 2024-05-04 14:48:27 +00:00
cinap_lenrek
217d2f751c ip/torrent: fix webseed
Commit 9f755671fb broke
webseeding with the last block.

The haveiece() call at the end was because the inner
is not calling havepiece() on the last block as it
does not take the piece length into account.

Now, instead, fix the inner loop, making the code
more setright foward so we call havepiece() on the
last block.
2024-04-28 16:37:29 +00:00
Jacob Moody
86e3e0791c inst: remove net install support 2024-04-28 00:20:45 +00:00
Sigrid Solveig Haflínudóttir
9ebd6f860e ext4srv: reduce the number of options, align more with existing filesystems
Also provide saner defaults (block size 4k instead of 1k).
Cache write back is always enabled now as well.
2024-04-27 16:26:55 +00:00
Ori Bernstein
ce86e64ee0 libc: correct dst transition times
The transition time in the timezone info file is,
confusingly, in local time and not UTC, so we need
to translate it before we do the comparison.

While we're here, revert the Australian timezone
change that made the offsets UTC, and add some test
to make sure we get this right.
2024-04-27 02:19:11 +00:00
cinap_lenrek
498f4f15b5 usbtree(8): document usbtree 2024-04-24 20:31:45 +00:00
cinap_lenrek
b7da224d10 nusb(4): document usbhubctl command format for PPPS 2024-04-24 20:09:57 +00:00
cinap_lenrek
03a52c7cf7 tcp: remove "MaxSegment" MIB stat, add InLimbo stat
This global "Mss" MIB element does not really exists,
and it makes no sense as the MSS is negotiated
per connection.

Put the InLimbo in the statistics table.
2024-04-24 09:06:22 +00:00
Jacob Moody
0320813091 /sys/lib/dist/ndb/common: remove old random auth domains 2024-04-23 00:55:07 +00:00
cinap_lenrek
0298949dd2 tcp: fix limbo entry leaks from hell
In limbo() function, once tpriv->nlimbo
reaches Maxlimbo, we'd try to re-use
Limbo entries from the head of the hash
chain. However, theres a special case
where our current chain contains only
a single entry. Then Limbo **l; points
to its next pointer, and writing:
*l = lp; would just yield in the entry
being linked to itself, leaking it.

The for(;;) loop in limborexmit() was wrong,
as the "continue" case would not advance
the lp pointer at all, (such as when
tpriv->nlimbo reaches > 100), we'd stop
cleaning out entries.

Handle Fsnewcall() returning nil case,
have to free Limbo *lp as we just removed
it from the hash table.

Add tpriv->nlimbo as "InLimbo" at the
end of /net/tcp/stats.
2024-04-22 18:44:53 +00:00
cinap_lenrek
b43c416083 pc: fix link order, libc.a *after* libsec.a (for rand()) 2024-04-22 07:19:58 +00:00
Jacob Moody
4745cae5bc g: search .S files
Useful for searching unix-y assembly files
2024-04-21 18:51:39 +00:00
Jacob Moody
567b1b912a rio: fix memory leak with closed kbdtap (thanks aap) 2024-04-21 18:40:08 +00:00
Jacob Moody
ff30a7743b stats: use a high water mark for maximum on graphs 2024-04-21 18:21:54 +00:00
Jacob Moody
46b4b99997 /sys/lib/dist/ndb: update root servers and add script to keep them updated
Also remove dnsdump as that feature is dead now.
2024-04-21 18:20:30 +00:00
cinap_lenrek
a70280308a rudp: better newgen() function, avoiding the lock 2024-04-21 13:16:22 +00:00
cinap_lenrek
a54fcac016 devsdp: fix randomization of dial and acceptid
We where allocating the dialid and acceptid using:

rand()<<16 + rand()

this gives a biased values as rand() retuns a 15-bit
number. Instead, use two calls to nrand() to get
the full 32-bit unsigned range.
2024-04-21 13:10:39 +00:00
cinap_lenrek
314faec394 rudp: fix start generation randomization and cleanup
the start generation was allocated by calling rand(),
which gives a value between 0 and 2^15.

Instead, make a newgen() function that returns a new
generation id in the full 32-bit range, but also
avoids 0 and Hangupgen special values.

Cleanup and make all helper functions static.
2024-04-21 13:08:19 +00:00
cinap_lenrek
e4509d40cc snoopy: teach gre about ethernet and ip6 payloads (thanks arne meyer)
teach snoopy about ethernet and ip6 encapsulated in GRE.
2024-04-20 12:01:37 +00:00
cinap_lenrek
a288db973c keyboard(6): use >> instead of > for caps example (thanks moody)
Using > causes the kbmap file to get truncated,
which resets to the default keymap and *THEN*
applies the new change. Which is probably not
what was intended.
2024-04-19 16:17:41 +00:00
Roberto E. Vargas Caballero
dd820435e9 Fix minor typos and error redirections 2024-04-19 14:06:38 +00:00
Roberto E. Vargas Caballero
c655b6552c Add caps kbmap
The default behaviour of the key labelled as Caps Lock is
to be a Ctrl key, but in some cases in can be desirable
to have it like an actual Caps Lock. A new kbmap file is
added and the keyboard documentation is updated.

git/commit /sys/lib/kbmap/caps /sys/man/6/keybo
2024-04-19 11:55:01 +00:00
Sigrid Solveig Haflínudóttir
ec73849b69 nusb/usbd: fix typos 2024-04-16 14:07:18 +00:00
cinap_lenrek
fe5d1976a0 snoopy: add igmp protocol 2024-04-14 13:29:22 +00:00
cinap_lenrek
9861f1a92b igmp: maintain timeout per group per interface
We used to only allow a single report per interface,
ignoring queries if a interfce already had a report
in flight.

However, this is not correct. Imagine if there is
a query specific query for a group, we add the
report and then we will ignore all further
queries (general or specific) until that
report times out.

Instead, we should maintain the timeout (report)
for each group (and interface) individually.

This means, Report.multi must point to a *single*
Ipmulti. When we handle general queries,
we must create individual Reports for
each of our multicast addresses, but check if
such a report already exists (for that interface).

Because the individual check is basically
quadratic, organise the reports in a hash table
to make finding the existing reports per group
per interface cheaper.
2024-04-13 17:34:28 +00:00
cinap_lenrek
7144ff2694 kernel: do nlocks && delayshed check only for Running state
If the process called sched to do a procswitch(),
skip the delaysched logic, we definitely do not
want to return here unless we'r in running state.
2024-04-08 16:47:30 +00:00
cinap_lenrek
b3a26fb633 kernel: fix the semacquire stack corruption on interrupt
The semacquire allocates a Rendez struct on its stack,
and publishes it on the semaphore linked list in the
segment.

Before returning, it removes it again, properly taking
the locks protecting the linked list, so whats the issue?

The issue happens when procinterrupt() does the wakeup,
which does not care about the spinlock of the segment
lined list, and it does it in the following way:

 			p->r = nil;
 			r->p = nil;
			ready(p);
 			unlock(r);

Note that the unlock happens *after* the ready.
So the process could'v already run on another core, remove
itself from the segment list and get out of semacquire()
alltogether, but we still have one line to execute here,
which is the unlock() of the now free'd Rendez.

And that was causing the stack corruption!

So wakeup() and procinterrupt() always had this issue.
If the Rendez memory stays valid after the wakeup,
here is no issue. Most code just uses &up->sleep,
which will stay valid as Proc's are never freed.

The solution for now is to do the ready() as the
last step, not touching the resource after the final
unlock.
2024-04-08 16:45:23 +00:00
Sigrid Solveig Haflínudóttir
a6ccb66d9c audio(1): mention mixfs resampling audio 2024-04-08 15:57:29 +00:00
Sigrid Solveig Haflínudóttir
0a28dcd218 ext4srv(4): fshalt works with ext4srv now, update; add SOURCE section 2024-04-08 14:50:45 +00:00
Sigrid Solveig Haflínudóttir
354a970bc1 ext4srv: fix ext4_bmap_bit_find_clr returning the wrong bit index 2024-04-08 14:00:38 +00:00
Sigrid Solveig Haflínudóttir
b17ce0d9ae ext4srv: remove mbr scanning and writing 2024-04-08 13:48:50 +00:00
Sigrid Solveig Haflínudóttir
733c5d6645 ext4srv: revisit "fix meta csum producing garbage" in a better way
The entry's inode wasn't set *before* calculating the checksum.
There is no reason to clear the whole block.
2024-04-07 23:22:48 +00:00