Hello,

thank you both.

If you wanted to do text/pseudo-graphical output, you'd use io/console.h
> and read keyboard events with console_get_event[_timeout]().


Yes, that's exactly what I tried in the morning and it worked. Although I'm
not sure I know why. Does fsession in console_init create direct connection
to console service, so the console_ functions aren't using VFS or locfs as
a proxy?

>From your description, I assume that your writer is blocking on the VFS
> node's contents_rwlock because it cannot take it as a reader since locfs
> does not support this. It remains to be established whether it would be
> wise and possible to modify locfs in such a way that it could guarantee
> that a write does not modify node's size. On the other hand, the nodes
> located on locfs are not ordinary files and their size is always 0, so
> maybe the change is possible.


That was exactly the case. But when I tried to set locfs supporting
concurrent_read_write and write_retains_size it a) didn't help - I assume
it blocked on service_mutex in locfs and b) the behavior of HelenOS started
to be very buggy, so I immediately realized it's set like that for a
reason. After that I wrote here and later I tried the experiment
console_get_event, which I thought would go through VFS as well and hence
wouldn't work either.

QEMU is now able to poll for an input from console, thank you,

Jan

2015-06-08 14:35 GMT+02:00 Jiri Svoboda <[email protected]>:

> Hi Jan,
>
> somehow I cannot understand why you would need to do that. What are you
> trying to achieve? If you need input from keyboard, then you should use the
> correct API depending on the type of user interface you are using.
>
> So normally Qemu would use graphical output. So you'd probably create a
> window with a canvas and set up a handler for keyboard events with the
> canvas widget.
>
> If you wanted to do text/pseudo-graphical output, you'd use io/console.h
> and read keyboard events with console_get_event[_timeout]().
>
> An interactive application in HelenOS is not really supposed to read/write
> stdin/stdout. It won't do what you want, since stdin/stdout are completely
> dumbed down, they won't work with special keys, pseudo-graphics, mouse etc.
> There is no serial terminal emulation in HelenOS for stdin/stdout of tasks.
>
> Cheers,
> Jiri
>
> Od: Jan Mareš <[email protected]>
>
> Hello,
>
> I noticed that when I have a fibril which is blocked in read from stdin
> and I want to write something to stdout, call to write gets blocked until
> read is finish. Is there a way to fix vfs/locfs so the write would finish
> before read?
>
> Thank you for every suggestion,
> Jan
> _______________________________________________
> HelenOS-devel mailing list
> [email protected]
> http://lists.modry.cz/listinfo/helenos-devel
>
>
> _______________________________________________
> HelenOS-devel mailing list
> [email protected]
> http://lists.modry.cz/listinfo/helenos-devel
>
>
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to