Hi -
On 2016-04-13 at 03:36 ron minnich <[email protected]> wrote:
> The following changes since commit
> 392acd0dc1210a0cc74a62e2ab3493686235c8f7:
>
> Return 0 for a timed-out select() (2016-04-04 17:54:50 -0400)
>
> are available in the git repository at:
>
> [email protected]:rminnich/akaros killdevfs
The big issue is that the mlx4 driver uses parts of devfs still. This
breaks that. Sorry - I forgot about this when we were talking the
other day. When I saw the removal of make_device(), I remembered. The
stuff is in kern/drivers/net/udrvr/compat.c.
We can still use the new stuff for console I/O, but we'll need to sort
out something for udrvr. One option would be this:
- Patch 1: Basically this patch, minus the removal. We switch the
console I/O to run in #cons instead of devfs.c.
- Patch 2: Keep devfs, but move its mount to /linux-dev. Have the
udrvr/compat.c use that path.
- Patch 3: Mount #cons at /dev/, and profit! Though that might not be
enough. Busybox runs earlier that ifconfig. It's probably not a
problem now, but we'll have to keep that in mind. For instance,
busybox attempts to open /dev/tty early on. (Hardcoded in glibc!
(Which we can change if we need to later.)).
Here's some minor stuff:
> From 2e4e9837e728519166046957a7f6a14712544a16 Mon Sep 17 00:00:00 2001
> diff --git a/kern/drivers/dev/cons.c b/kern/drivers/dev/cons.c
> @@ -771,6 +782,7 @@ static long consread(struct chan *c, void *buf, long n,
> int64_t off)
> #if 0
> extern char configfile[];
> #endif
> + extern struct kb_buffer cons_buf;
#include <console.h> to get this, I think.
> @@ -1005,6 +1017,18 @@ static long consread(struct chan *c, void *buf, long
> n, int64_t off)
> n = consreadstr((uint32_t) offset, buf, n, tmp);
> return n;
>
> + case Qstdin:
> + if (!n)
> + return 0;
> + kb_get_from_buf(&cons_buf, &ch, 1);
> + /* TODO UMEM */
> + if (current)
> + memcpy_to_user_errno(current, buf, &ch, 1);
> + else
> + memcpy(buf, &ch, 1);
Since you ran into this recently, who is it that is calling read/write
on the console that doesn't have current set?
Obligatory checkpatch warnings:
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per
line)
#18:
This is I assume going to need tweaking, but : it works. And we have /dev now.
WARNING: externs should be avoided in .c files
#72: FILE: kern/drivers/dev/cons.c:785:
+ extern struct kb_buffer cons_buf;
WARNING: break is not useful after a goto or return
#90: FILE: kern/drivers/dev/cons.c:1030:
+ return 1;
+ break;
WARNING: line over 80 characters
#115: FILE: kern/drivers/dev/cons.c:1226:
+ /* TODO: tty hack. they are sending us an escape sequence, and
the keyboard
WARNING: line over 80 characters
#116: FILE: kern/drivers/dev/cons.c:1227:
+ * would try to print it (which it can't do yet). The hack is
even dirtier
WARNING: line over 80 characters
#168: FILE: kern/src/blockdev.c:286:
+static int dev_c_llseek(struct file *file, off64_t offset, off64_t *ret, int
whence)
total: 0 errors, 6 warnings, 141 lines checked
../patches/0001-Remove-devfs-devfs.c-use-new-name-space-for-stdin-st.patch has
style problems, please review.
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
Thanks,
Barret
--
You received this message because you are subscribed to the Google Groups
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.