]> git.lizzy.rs Git - plan9front.git/commit
vmx: fix 9p debug server and make it compatible to /proc
authorcinap_lenrek <cinap_lenrek@felloff.net>
Wed, 12 May 2021 16:17:06 +0000 (18:17 +0200)
committercinap_lenrek <cinap_lenrek@felloff.net>
Wed, 12 May 2021 16:17:06 +0000 (18:17 +0200)
commit682414ce0d8245bef6c09d9e7ca015331a5ddd35
tree5f41a2fdda9d93c3d0de4bc7728744f37097793f
parent532c7479e96e439a13df421d3b9f547cde5b5642
vmx: fix 9p debug server and make it compatible to /proc

The 9p debug server was broken as it assumed the first
tree file added would have a qid of 0 (it has a qid
of 1 as the root directory is using 0 already).

Instead, just compare File* pointers and get rid of
the table (less code).

When passing 64-bit unsigned addresses as 64-bit signed
file offsets, we have to make sure to not pass negative
offsets (filtered out by kernel and lib9p)!
This is solved by clearing and sign bit in encoding and
63-bit sign extension on decoding.

Make the mem file writable (needed for acid).

The 9p debug server provided a single directory containing
mem and regs files. This patch renames the regs file
(which is in vmx specific text format) to "xregs" and
adds "regs" and "kregs" file which use the same format
as exported by the kernels /proc filesystem.

This allows one to bind the vmx directory over a proc
directory and attach acid to a running system like:

mount -b /srv/vmx /proc/1
acid -k -lkernel 1 /sys/src/9/pc64/9pc64
sys/src/cmd/vmx/9p.c
sys/src/cmd/vmx/vmxgdb.c