[9fans] Hello, RPi fixes and bind -b trouble

2024-02-04 Thread Alyssa M via 9fans
Hello Plan9People!

I finally stumbled across Richard Miller's Raspberry Pi image a while back and 
managed to install it on an RPi, and have been learning more about it. I've 
used the 9P protocol for a couple of projects, but haven't actually used Plan 9 
itself until now...


So far I've patched my installation in a couple of small ways, which has been a 
useful exercise to get started with:

I think the v6fs support in tapefs has a bug: the last line of doread() should 
be
return buf+off;
rather than
return buf;
This only shows up if your reads are unaligned with block boundaries. I think 
v32fs.c has the same bug, but it's okay in v10fs.c.
I realise the number of people who care about this may be very small. :)


I also made a fix to exportfs.c:reply() so it works with the Linux v9fs on my 
other RPi, which was otherwise pretty much not working for me (???!): I got 
error 526 which is ESERVERFAULT - untranslatable error, which should supposedly 
not leak through into Linux user space, but does...
It seems there's a mismatch between the error strings that the plan 9 kernel 
produces and the ones that v9fs knows how to deal with, as exportfs just passes 
them along:
Plan 9 produces:
'foo' does not exist
in /sys/src/9/port/chan.c:namelenerror()
v9fs apparently currently expects:
file does not exist
or
file not found
in github/torvalds/linux/net/9p/error.c:p9_errstr2errno()
What I have replaces the 'nice' error string with what v9fs expects. It's not a 
great fix, but I'm not sure what (or where?) the fix *should* be??
I see the same problem between Ubuntu and 9front as I do between RPi Debian and 
Rpi Plan 9, so this seems to be a general problem. Without this fix, I couldn't 
actually create a file on a Plan 9 export from Linux via v9fs. It's not just a 
weird error message.


Currently I'm trying to build a 'drawterm' server for my experimental OS - so 
far I can run the clock program on Plan 9 and have it display on my window 
system (not the catclock - that one gives me the creeps!). I also have bitmaps 
and text beginning to work, but there's not enough there to run sam or rio yet.

I'm having trouble with bind-mounting my 9p server on Plan 9's /dev, though: 
the old /dev files are all there, but when I bind -b over it from /n only the 
files in the directory I'm binding show up in ls! It's like the -b is being 
ignored by bind(1), but if I ls /dev/null (for example) it's actually there - 
but after the bind I can no longer see it when I ls /dev! Very odd.
This is not actually blocking me at the moment, but if anyone has any clues 
about what I might be doing wrong it would save me a lot of hair-pulling?

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tbc78d29ab04652a2-M2d8b0b7bbb2f59b0acb40d34
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


[9fans] Re: Hello, RPi fixes and bind -b trouble

2024-02-04 Thread moody
The issue with exportfs and linux v9fs has been fixed in 9front commit 
6eed7a47863553bab31c7f9b1b5b314989efc640. It is regrettable that we had to 
shift around the err string to make linux happy, but I have no interest in 
getting involved with changing it on the linux side.

That issue with bind seems to me to be a bug in your walk code, the way the 
devmnt stuff works is that it walks down the union list and stops when a server 
returns that a file exists via walk. Like what you have is a server that is 
returning "yes I have this file" via walk, but when actually reading the 
directory, it does not show it. Just my guess anyway.

I plan to look in to that tapefs bug. 9front hasn't touched this code and I 
agree something seems fishy. Thank you for debugging this, I'll test it out and 
commit a fix.


Thanks,
moody

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tbc78d29ab04652a2-M50513125385a653fa0ed3084
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


[9fans] Re: Hello, RPi fixes and bind -b trouble

2024-02-04 Thread moody
Err sorry, I realize now my diagnoses of what devmnt is doing is likely not 
entirely correct, but I would bet money on this being a bug in your walk code.
--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tbc78d29ab04652a2-Mf5a02677fb44b38cc6da70ff
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


[9fans] Re: Hello, RPi fixes and bind -b trouble

2024-02-04 Thread Alyssa M via 9fans
> On Sunday, 4 February 2024, at 4:46 PM, moody wrote:
>> I would bet money on this being a bug in your walk code.
That seems entirely possible! Thanks for the pointer.
--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tbc78d29ab04652a2-M36646a9bf5752d3ed7b0863f
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


[9fans] Re: Hello, RPi fixes and bind -b trouble

2024-02-04 Thread Alyssa M via 9fans
Mystery solved: the bug was in my Ropen code. I was not returning QTDIR in the 
qid.type when opening the directory.
I'd hazard a guess that because Rwalk said it was a directory, but then Ropen 
said it was a file, sysfile.c:read() in the Plan 9 kernel didn't call 
unionread(), so only the first directory in the union mount was read. Maybe??
Anyway it works now. :)
--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tbc78d29ab04652a2-M4b5259ac6e9ab466572bbbf3
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription