summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-02-27B, Bfn: fix invocation with multiple files, improve manual pagemoody
2021-02-27ramfs: fix truncfile() for non multiple of extend size (64k)cinap_lenrek
The calculation of the last block size is wrong and we can only shrink the size of the last data block, not extend it.
2021-02-23vmx: reduce cpu load by eliminating nop-loopSigrid
Sacrifice some of the sub-millisecond timer precision in favor of less cpu load when the timer is about to be kicked a bit early. Result is visible *especially* when the guest idling. Timer proc *still* has to send to the channel (in order to kick PIT and RTC logic), which takes time, and compensates a bit for possibly early runs.
2021-02-23html2ms: 0xFFFD → RuneerrorSigrid
2021-02-23ip/tftpd: add -n namespace-file flag (thanks sam-d)cinap_lenrek
tftpd currently unconditionally sets its namespace via /lib/namespace (newns("none", nil)), which stymied my attempts to pxe boot the openbsd installer without creating a real /etc dir on 9front, which would've been gross. I tried working around this with -h (and -r for good measure), but again hit issues because the namespace is rebuilt from scratch -- any binds of /386, /amd64, /cfg/pxe, etc. into the tftp-specific directory disappeared from tftpd's namespace and rendered my *9front* boxes unable to boot. I could maintain copies of the needed files in the tftp-specific directory, but that'd be kind of a drag. The following patch adds a -n flag to allow the specification of a namespace file in place of /lib/namespace; similar to ip/ftpd. I thought about setting up a /lib/namespace.tftp to act as a default rather than continuing to use /lib/namespace by default (which security-wise is about the same as allowing 9p mounts by user none, which I also have disabled), but I had trouble coming up with a sane default. Maybe someone more experienced would like to try that out. - sam-d
2021-02-23ip/tftpd: use procsetuser() instead of writing #c/usercinap_lenrek
2021-02-22boot/bcm: download dtb files for rpi-400 and rpi-cm4cinap_lenrek
2021-02-22libaml: fix IndexField and BankField implementations (thanks Michael Forney)cinap_lenrek
IndexField is supposed to increment the index value when an access is done with a bigger size than the data field. The index value is always a byte offset. Now that we always calculate the offset for each field unit access for IndexField, rename the indexv to bank (the bank value), as it is only used for that. Also, do not compare it with nil, as it is a integer constant which can be encoded as nil to mean zero. For BankField, the banking field was written using store(), which does nothing when the destination is a Field*. Use rwfield() to fix it in the new rwfieldunit(). Resolve all the Name*'s when IndexField, BankField and Field are created. Now, Field.reg points to eigther Buffer object, Region or Field (data Field of an IndexField). PS: initial bug report by Michael Forney follows below: In /dev/kmesg on my T14, I saw a message amlmapio: [0xffffff18-0x100000018] overlaps usable memory amlmapio: mapping \_SB.FRTP failed Here is the relevant snippet from my DSDT: Scope (_SB) { ... OperationRegion (ECMC, SystemIO, 0x72, 0x02) Field (ECMC, AnyAcc, NoLock, Preserve) { ECMI, 8, ECMD, 8 } IndexField (ECMI, ECMD, ByteAcc, NoLock, Preserve) { Offset (0x08), FRTB, 32 } OperationRegion (FRTP, SystemMemory, FRTB, 0x0100) Field (FRTP, AnyAcc, NoLock, Preserve) { ... } } With some debugging output: amlmapio(\_SB.ECMC): Io 72 - 74 rwreg(\_SB.ECMC): Io [72+0]/1 <- 8 rwreg(\_SB.ECMC): Io [72+1]/1 -> 18 amlmapio(\_SB.FRTP): Mem ffffff18 - 100000018 amlmapio: [0xffffff18-0x100000018) overlaps usable memory amlmapio: mapping \_SB.FRTP failed It seems that libaml does not handle IndexField correctly and just did a single read from ECMD after setting ECMI to 8, causing the FRTP region to be evaluated as 0xffffff18-0x100000018. Instead, it should be reading 4 bytes [18 c0 22 cc], evaluating it as 0xcc22c018-0xcc22118: amlmapio(\_SB.ECMC): Io 72 - 74 rwreg(\_SB.ECMC): Io [72+0]/1 <- 8 rwreg(\_SB.ECMC): Io [72+1]/1 -> 18 rwreg(\_SB.ECMC): Io [72+0]/1 <- 9 rwreg(\_SB.ECMC): Io [72+1]/1 -> c0 rwreg(\_SB.ECMC): Io [72+0]/1 <- a rwreg(\_SB.ECMC): Io [72+1]/1 -> 22 rwreg(\_SB.ECMC): Io [72+0]/1 <- b rwreg(\_SB.ECMC): Io [72+1]/1 -> cc amlmapio(\_SB.FRTP): Mem cc22c018 - cc22c118 I wrote a patch (attached) to fix this, and it seems to work. Though, it's not clear to me when things should be dereferenced. Previously, the data field was dereferenced at evalfield, but the region and index field were not until rwfield. After the patch, the index field is also dereferenced in evalfield. For BankField, the index *is* dereferenced in evalfield. I'm pretty sure that this means that BankField does not work currently, since store() just returns nil for 'f' objects. The bank selector will never get set. Anyway, I don't know if this solves any real problems; it's just something I noticed and thought I'd try to fix.
2021-02-22games/snes: use 4-point hermite interpolation to resampleMichael Forney
This is noticeably better than nearest-neighbor.
2021-02-22theo: wrong.Sigrid
2021-02-20ape/lib9: expose fd2path (thanks phil9)Ori Bernstein
Fd2path is a useful call for the netsurf plan9 frontend, so we should expose it.
2021-02-20upas/send: add \n to error in refuse() (thanks josuah)Ori Bernstein
2021-02-20marshal: remove debug junk.Ori Bernstein
Oops.
2021-02-20upas/marshal: use login instead of user (thanks sirjofri)Ori Bernstein
User is the upasname, and is unlikely to exist when we save the message to the outbox. We should use the login name instead.
2021-02-20upas/marshal: handle nonexistent save folder correctly (thanks sirjofri)Ori Bernstein
When the save folder did not exist, and we could not create it, we would handle up to one Biobuf worth of message, and then fail, due to a failed tee. The sequence of events leading up to this was: openfolder() -> error tee(0, fd, -1) -> wait for read write(0, data) -> write(fd, data) -> ok write(-1, data) -> error, tee terminates write(0, attachment) -> error This change prevents us from writing to a closed fd, and therefore from erroring out when sending. We also warn the user.
2021-02-20ether82563: add pci id for i219-LM on thinkcenter (easypeasy, thanks hiro)cinap_lenrek
2021-02-20pc/devarch: use m->cpumhz instead of recalculatin itcinap_lenrek
2021-02-209boot: handle automatic length for 64-bit values in hexfmt() for framebuffer ↵cinap_lenrek
address (thanks Michael Forney)
2021-02-19/sys/src/cmd/ndb/dns.h:sl
--- To: 9front@9front.org Date: Sun, 07 Feb 2021 14:56:39 +0100 From: kvik@a-b.xyz Subject: Re: [9front] transient dns errors cause smtp failure Reply-To: 9front@9front.org I think I found a reason for DNS failing on known good domains. /sys/src/cmd/ndb/dns.h:156,157 /* tune; was 60*1000; keep it short */ Maxreqtm= 8*1000, /* max. ms to process a request */ So, 8 seconds is how much the resolver will bother with a request it has been handed, before dropping it on the floor with little explanation. It seems quite possible that this is too short a timeout on a machine during a spam queue run, which predictably stresses the compute and network resources. In turn, negative response caching might explain why a particular unlucky domain would basically stop receiveing any mail for a while. I'm dying to know if bumping this limit would clear up the queue of such DNS errors. --- [narrator: it did.]
2021-02-19sam/{address.c, sam.h}: bump STRSIZE to 512MB (thanks, Ori_B)sl
2021-02-19libstdio: sync bits of vfprintf from APEkvik
* Add the %ll length modifier, * Convert nil to "<nil>" under %s (not in APE), * Cast void* to uintptr under %p, * Use "0x" hex prefix under %p, * Fix manual page mentions of %P to %p, * Fix empty result for fp conversions, * Fix zero padding of left-aligned fp conversions, * Remove deprecated #pragma ref uses. Most of these were introduced in APE prior to 9front. I've omitted the %z conversion specifier since Plan 9 code rarely uses the usize type. This may need to be added later for the benefit of native ports of alien code.
2021-02-18nan(2): document isInf(x, 0) matching +∞ and -∞kvik
2021-02-18audio/flacenc: fix usageSigrid
2021-02-17games/snes: use enum constants KON and ENDX instead of their valuesMichael Forney
2021-02-17games/snes: implement DSP echoMichael Forney
2021-02-17games/snes: implement DSP noiseMichael Forney
I'm not sure if this LFSR is the same one used by the hardware or is arbitrary, but it matches the noise sequence used by all other snes emulators I looked at.
2021-02-17games/snes: fix BRR decoding with filters 2 and 3Michael Forney
s1 and s2 should store the last and next to last output, but were set in the wrong order, causing them both to be the last output. This breaks filters 2 and 3, which both utilize s2.
2021-02-16mothra: tune up entry control logic for easier text editingSigrid
2021-02-159boot: mark efi boot and runtime service regions as reservedcinap_lenrek
despite the kernel never doing any efi runtime service calls, overriding the runtime service regions makes some machines lock up. so consider them reserved. the boot service regions should also, in theory, be usable by the os, but linux says otherwise...
2021-02-14ndb/dns: implement RFC6844 certificate authority authorization record typecinap_lenrek
2021-02-11[9front] audio/flacenc: fix error check for fseekoMichael Forney
fseeko returns 0 on success, not the new stream position. This allows flacenc to update the streaminfo block when it is finished (for example to set the number of samples and checksum).
2021-02-10font/terminus: you can't run a font, sillyOri Bernstein
Remove the execute bit from the fonts.
2021-02-10nusb: don't create rw iso endpoints (by Michael Forney)cinap_lenrek
There may be two iso endpoints with the same ID if it is asynchronous or adaptive (one for data, one for feedback), and rw iso endpoints are unusable (error out with "iso i/o is half-duplex").
2021-02-10nusb: don't create rw iso endpoints (by Michael Forney)cinap_lenrek
There may be two iso endpoints with the same ID if it is asynchronous or adaptive (one for data, one for feedback), and rw iso endpoints are unusable (error out with "iso i/o is half-duplex").
2021-02-10mergeOri Bernstein
2021-02-09fortunes: That depends on how you define native. -- Andre Garziasl
2021-02-09newt: remove fn f, replace with walksl
2021-02-09stdio: remove erronous assert in dtoaOri Bernstein
The value of `k` in dtoa() is an estimate of floor(log10(d)), where `d` is the number being converted. The code was asserting that 'k' was less than 100, but the full range of a double goes to 10^308 or so. This means that the majority of the range of a double would trigger that assert.
2021-02-08[9front] mimetype: add entry for .patch extensionMichael Forney
This way, upas/vf won't flag .patch files as suspicious by default.
2021-02-08[9front] upas/vf: exclude mime boundary from temporary attachment filesMichael Forney
validateattachment has no business with the mime boundary; it is not part of the attachment itself. Also, it causes the boundary to be dropped in the message output from upas/vf, effectively dropping the following attachment (though the content is still present after the last boundary of the wrapped first attachment part). Consider the following sequence of events: 1. upas/vf is run on a message containing two attachments. 2. The first attachment does not have a known extension, so is saved to a temporary file *including* the following mime boundary. 3. This file is opened as p->tmpbuf, which is used for subsequent reads until switching back to stdin. 4. The attachment fails validateattachment, so upas/vf wraps it in a multipart with a warning message. 5. problemchild() calls passbody(p, 0), which copies from p->tmpbuf until it hits the outer boundary line, which it excludes, seeks back one line, then returns the outer multipart. 6. problemchild() then writes its own boundary, and then copies one line from *stdin* to stdout, expecting the outer boundary. However, this boundary was already read from stdin in 2, so it ends up reading the first line of the subsequent part instead. To fix this, pass 0 to passbody() in save() to exclude it from the attachment file and make it available in stdin when expected.
2021-02-08ape/lib9: sync arm getfcr.s implementationOri Bernstein
The arm assembler supports movw to handle getfcr and setfcr now, no need to hack it with macros; sync from plan9 libc.
2021-02-08ape: sync flaot.h macros with u.hOri Bernstein
The float.h macros got out of sync with u.h, some of them missing and some of them being incorrect. This change brings them back in line.
2021-02-07Mail: correct rendering of nested multipart messagesOri Bernstein
Reading nested subparts of messages into the root message array allows deeply nested multipart trees of messages to show correctly in the message view.
2021-02-07[9front] upas/vf: remove debugging print statementsMichael Forney
These messages aren't useful and were presumably left over from someone debugging this code.
2021-02-08games/gb: fix reversed audio channelsMichael Forney
The high bits correspond to the left channel, and the low bits to the right channel. Reference: https://gbdev.io/pandocs/#sound-control-registers Tested with pokemon crystal.
2021-02-08games/gb: various HDMA fixesMichael Forney
H-blank DMA should only transfer 16 bytes per h-blank, rather than waiting for the first h-blank and then transferring the whole size. HDMAC should read 0xff when the transfer is finished, and 0 in the high bit when the transfer is ongoing. Also, if 0 is written in the high bit, the current transfer should be aborted. Introduce two flags, DMAREADY and DMAHBLANK rather than special constants 1 and -1. If dma is non-zero, there is an ongoing DMA. If DMAREADY is set, the next chunk is ready to transfer. Reference: https://gbdev.io/pandocs/#ff55-hdma5-cgb-mode-only-new-dma-length-mode-start Tested with pokemon crystal. What was happening is that when the game was loading N background tiles into vram (each 16 bytes, so one per h-blank), it did something like this: - start an hdma transfer for N+1 tiles - after the Nth tile is transferred, it would read HDMA5, clear the high bit, then write it back to abort the transfer. games/gb would instead transfer all N+1 tiles at once, overwriting one extra tile with whatever was 1 past the end of the source array, and then would interpret the cancel request as the start of a new transfer of 16 bytes, which would copy an additional tile past the end. The end result is that every transfer would end up copying N+2 tiles instead of just N, overwriting certain tiles with whatever was after the end of the source data.
2021-02-08games/gb: fix timer divider for input clock 0Michael Forney
According to [0], input clock 0 should divide by 1024=2¹⁰, not 2¹². This caused audio to run at quarter-speed in one game I tried. [0] https://gbdev.io/pandocs/#ff07-tac-timer-control-r-w Tested with zelda: oracle of seasons, and dr. mario ---
2021-02-07[9front] upas/vf: install %τ format specifierMichael Forney
upas/vf was converted to use tmdate, but the formatter was never installed. This caused it to send attachments to validateattachment with header `From virusfilter %τ%`, which always failed since upas/fs would just skip over the message.
2021-02-06mergecinap_lenrek
2021-02-06bcm64: get inbound and outbound pci window base address from device treecinap_lenrek
On the pi400, the xhci reset firmware mailbox request assumes that the pci windows match the ones specified in the device tree. The inbound window (pcidmawin) also varies now depending on the amount of memory installed. It is all pretty ridiculous, as the firmware could as well just read the pci controllers hardware register to determine the window configuration and the os could keep a nice simple 1:1 mapping (with pci dma addresses == physical addresses).