summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-04-09page: fix for kerTeX dviHumm
2021-04-09disk/fdisk: add OpenBSD partition typeHumm
2021-04-09printfont: load all fonts for `printfont all`Humm
2021-04-09trofftable.rc: make workHumm
2021-04-09g: add lua, mk, ml, mli, myr, and sh suffixeskvik
2021-04-08nusbrc: ignore rndis ethernet in /rc/bin/nusbed, handled by ↵cinap_lenrek
/sys/src/9/boot/nusbrc (thanks romano)
2021-04-08minor man page typosRomano
2021-04-07vgadb: igfx: add vid/did for early 2011 apple mbp (thanks Romano)Sigrid
2021-04-06[9front] walk: properly format permissionsStephen Gregoratto
This patch adds dirmodefmt from fcall.h to pretty-print file permissions, similarly to ls -l. I didn't notice any performance degradation. I hope no-one relied on the old behaviour.
2021-04-03file: detect webp files (thanks kemal)cinap_lenrek
this patch adds a small check to the "iff" function, so this way file can detect webp files. tested with a webp file i found randomly.
2021-04-02games/glendy: your complication had a complication (god damn it kemal)cinap_lenrek
2021-04-02games/glendy: don't use lucida sans in menus by default and bugfix (thanks ↵cinap_lenrek
kemal) i have found one bug. when i put glenda in a position like this i somehow win, but the glenda can escape from there. in addition, i have changed the games manpage to include more info about glendy.
2021-04-02kernel: get rid of physical page bank array and use conf.mem[] insteadcinap_lenrek
We can take advantage of the fact that xinit() allocates kernel memory from conf.mem[] banks always at the beginning of a bank, so the separate palloc.mem[] array can be eleminated as we can calculate the amount of non-kernel memory like: upages = cm->npage - (PGROUND(cm->klimit - cm->kbase)/BY2PG) for the number of reserved kernel pages, we provide the new function: ulong nkpages(Confmem*) This eleminates the error case of running out of slots in the array and avoids wasting memory in ports that have simple memory configurations (compared to pc/pc64).
2021-04-02whois: suppress missing file errors (thanks kivik)cinap_lenrek
2021-04-02acme: fix suicide *and* resource leak in ecmd.c (thanks igor)cinap_lenrek
To reproduce the suicide try running the following in acme: • 'Edit B <ls lib' by select and middle clicking in a window that is in your $home. There is a very high chance acme will commit suicide like this: <snip> cpu% broke echo kill>/proc/333310/ctl # acme cpu% acid 333310 /proc/333310/text:amd64 plan 9 executable /sys/lib/acid/port /sys/lib/acid/amd64 acid: lstk() edittext(nr=0x31,q=0x0,r=0x45aa10)+0x8 /sys/src/cmd/acme/ecmd.c:135 xfidwrite(x=0x461230)+0x28a /sys/src/cmd/acme/xfid.c:479 w=0x0 qid=0x5 fc=0x461390 t=0x1 nr=0x100000031 r=0x45aa10 eval=0x3100000000 a=0x405621 nb=0x500000001 err=0x419310 q0=0x100000000 tq0=0x80 tq1=0x8000000000 buf=0x41e8d800000000 xfidctl(arg=0x461230)+0x35 /sys/src/cmd/acme/xfid.c:52 x=0x461230 launcheramd64(arg=0x461230,f=0x22357e)+0x10 /sys/src/libthread/amd64.c:11 0xfefefefefefefefe ?file?:0 </snap> The suicide issue is caused by the following chain of events: • /sys/src/cmd/acme/ecmd.c:/^edittext is called at /sys/src/cmd/acme/xfid.c:479 passing nil as its first parameter: <snip> ... case QWeditout: r = fullrunewrite(x, &nr); if(w) err = edittext(w, w->wrselrange.q1, r, nr); else err = edittext(nil, 0, r, nr); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... </snap> ...and /sys/src/cmd/acme/ecmd.c:/^edittext dereferences the first parameter that is *nil* at the first statement: <snip> char* edittext(Window *w, int q, Rune *r, int nr) { File *f; f = w->body.file; ^^^^^^^^^^^^^^^^^^^^^ This will crash if 'w' is *nil* switch(editing){ ... </snap> Moving the the derefernce of 'w' into the case where it is needed (see above patch) fixes the suicude. The memory leak is fixed in /sys/src/cmd/acme/ecmd.c:/^filelist. The current implementation of filelist(...) breaks its contract with its caller, thereby leading to a memory leak in /sys/src/cmd/acme/ecmd.c:/^B_cmd and /sys/src/cmd/acme/ecmd.c:/^D_cmd. The contract /sys/src/cmd/acme/ecmd.c:/^filelist seems to have with its callers is that in case of success it fills up a 'collection' that callers can then clear with a call to clearcollection(...). The fix above honours this contract and thereby removes the leak. After you apply the patch the following two tests should succeed: • Execute by select and middle click in a Tag: 'Edit B lib/profile' • Execute by select and middle click in a Tag: 'Edit B <ls lib' The former lead to a resource leak that is now fixed. The latter lead to a suicide that is now fixed by moving the statement that dereferences the parameter to the location where it is needed, which is not the path used in the case of 'Edit B <ls'. Cheers, Igor
2021-04-01[9front] [patch] nusb/ether -t rndisRomano
2021-03-31mergecinap_lenrek
2021-03-31devfs: fix locking and ignore undocumented "fsdev:\n" configuration signaturecinap_lenrek
The confstr was shared between readers so seprintconf() could write concurrently to that buffer which is not safe. This replaces the shared static confstr[Maxconf] buffer with a pointer that is initially nil and a buffer that is alloced on demand. The new confstr pointer (and buffer) is now only updated while wlock()ed from the new setconfstr() function. This is now done by mconfig() / mdelctl() just before releasing the wlock. Now, rdconf() will check if confstr has been initialized, and test for it again while wlock()ed; making sure the configuration is read only once. Also, rdconf() used to check for a undocumented "fsdev:\n" string at the beginning of config data tho that was never documented. This changes mconfig() to ignore that particular signature so the example from the manpage will work as documented.
2021-03-29mergeOri Bernstein
2021-03-29libsunrpc: work around arm64 compiler bug in sunStringUnpack()cinap_lenrek
The sunStringUnpack() routine was miscompiled by 7c, as pointer arithmetic is done in 64 bit but the constant -1 offset got expended to a unsigned 32 bit integer.
2021-03-23kbmap/tr: add one missing key to Turkish keymap (thanks kemal)Ori Bernstein
while we're here, change the hex values to unicode chars.
2021-03-23legal: mit neuer lizenz: mitOri Bernstein
The Plan 9 foundation has ownership of the Plan 9 code now, and has made it accessible under the MIT license, so we're taking that version of the code as our base now.
2021-03-13kernel: remove ucalloc.c duplicatescinap_lenrek
2021-03-13kernel: use 64-bit mask to avoid compiler warning in port/pci.ccinap_lenrek
2021-03-135c, 6c, 7c, 8c, kc, qc, vc: use explicit gmove(... , nn) in cgen() for ↵cinap_lenrek
result of OAS*, OPREINC, OPOSTINC The expression value of the assignment operation was returned implicitely by relying on regalloc() on the right hand side "nod" borrowing the register from nn. But this only works if nn is a register. In case of 6c, it can also be a ONAME from a .safe rathole returned by regsalloc(). This change adds explicit gmove() calls to assign the expression value. Note that gmove() checks if source and destination are the same register so it wont emit redundant move operations in the common case. The same is applied also to OPREINC and OPOSTINC operations.
2021-03-13audio(1): fix little typo.rgl
2021-03-11correct off-by-one nul termination.rgl
2021-03-10Mail: separate deletion from relinking messagesOri Bernstein
Mutating lists that are being iterated is needlessly error prone, and we were removing the wrong message in some cases if it the dummy got inserted in the right place. Separating deletion into a redraw/relink and zap phase simplifies the problem.
2021-03-07riostart: revert, this doesnt fix anythingcinap_lenrek
This change does not work and the real fix is in rio.
2021-03-07rio: make window focus changes deterministic, cleanup wind.ccinap_lenrek
Switching window focus used to be non deterministic as the current window in focus (Window *input) was set concurrently while processing window messages such as Resized and Topped. This implements a new approach where wcurrent() and wuncurrent() are responsible for the synchronization and switch of the input. It is implemented by sending a Repaint message to the old input window first, neccesarily waiting until that window releases the focus and then input is updated and then a Topped or Reshaped message is send to the new input window. Note, that when the whole screen is resized that no input changes need to happening anymore.
2021-03-06[9front] [PATCH] fix small typo in vmx(3)kemal
vmx(3) does not use itself to implement virtual machines.
2021-03-02/sys/man/1/mothra: eu regulations require that we disclose we're sending ↵sl
search queries to duckduckgo.
2021-03-02[9front] riostart: make text window focused by defaultJosé Miguel Sánchez García
This change makes the text window be focused on startup when using default riostart (e.g: when using the release ISO). This little change makes you able to immediately reach the rc shell without clicking the window, which at the very least is more convenient, and if you have problems to use your mouse but want to install the system, you also can (I had to stop profile from running at boot to patch it in my VPS KVM console because the mouse wasn't working properly. Could install and setup it to connect through drawterm).
2021-03-02mothra: "d": use lite version, disable redirectSigrid
2021-03-02mothra: add "d" command to search for a text on the internet (using duckduckgo)Sigrid
2021-03-01Mail: revert 096538d64724Ori Bernstein
2021-03-01devpccard, pci: fix pccard support and handle pci expansion romscinap_lenrek
let pci.c deal with the special cardbus controller bar0 and expansion roms. handle apic interrupt routing for devices behind a cardbus slot. do not free the pcidev on card removal, as the drivers most certanly are not prepared to handle this yet. instead, we provide a pcidevfree() function that just unlinks the device from pcilist and the parent bridge.
2021-02-28Mail: fix infinite deletion loopOri Bernstein
When deleting messages that came in just the right order, we would end up stuck in a loop deleting and reinserting a dummy parent, rather than the messages we wanted to remove.
2021-02-28bcm: change color chan to RGB24 (thanks p.kosyh)cinap_lenrek
p.kosyh writes: Hello! I finally bought rpi4 4Gb specially for 9front. It seems, that default bpp of framebuffer is 16. I changed it to 24 (via cmdline.txt and config.txt) and found, that rendering is much faster! (May be due removing overheads in 16->24 conversions?) But on rpi4 r and b channels are swapped. So, i changed BGR24 to RGB24 in bcm/screen.c and now it works fine!
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.