Re: RFC for patch to add task_{set,get}_name RPC

2013-05-08 Thread Samuel Thibault
Roland McGrath, le Wed 08 May 2013 16:47:24 -0700, a écrit :
> > When it helps a huge lot to debug some things, it surely is a way to
> > debug.  I was able to debug quite a few spurious port deallocations as
> > soon as I was able to print from the kernel which process was doing
> > it.  I don't see how to do the same kind of debugging through the proc
> > server.
> 
> You can implement some debug-only logging that shows you the mappings you
> want to see.

But the point is that I don't know which mapping I want to see.  I just
happen to notice from the kernel that a given task does a erroneous
thing.  From there, how to continue debugging without knowing which
userland process was doing that?

Samuel



Re: RFC for patch to add task_{set,get}_name RPC

2013-05-08 Thread Roland McGrath
> When it helps a huge lot to debug some things, it surely is a way to
> debug.  I was able to debug quite a few spurious port deallocations as
> soon as I was able to print from the kernel which process was doing
> it.  I don't see how to do the same kind of debugging through the proc
> server.

You can implement some debug-only logging that shows you the mappings you
want to see.



Re: RFC for patch to add task_{set,get}_name RPC

2013-05-08 Thread Samuel Thibault
Roland McGrath, le Wed 08 May 2013 16:27:53 -0700, a écrit :
> > But we can't really ask the proc server from the kernel debugger.
> 
> There are lots of things you can't do from the kernel debugger.
> That doesn't mean that more state in the microkernel is the way
> to debug.

When it helps a huge lot to debug some things, it surely is a way to
debug.  I was able to debug quite a few spurious port deallocations as
soon as I was able to print from the kernel which process was doing
it.  I don't see how to do the same kind of debugging through the proc
server.

Samuel



Re: RFC for patch to add task_{set,get}_name RPC

2013-05-08 Thread Roland McGrath
> But we can't really ask the proc server from the kernel debugger.

There are lots of things you can't do from the kernel debugger.
That doesn't mean that more state in the microkernel is the way
to debug.



Re: RFC for patch to add task_{set,get}_name RPC

2013-05-08 Thread Samuel Thibault
Roland McGrath, le Wed 08 May 2013 15:34:59 -0700, a écrit :
> > So the kernel can tell what a task is in, e.g. show tasks command, in
> > memory object statistics, etc.  Without this it is hard to inspect the
> > whole system state without divining what task is what process.
> 
> The proc server exists to provide that mapping.

But we can't really ask the proc server from the kernel debugger.

Samuel



Re: RFC for patch to add task_{set,get}_name RPC

2013-05-08 Thread Roland McGrath
> So the kernel can tell what a task is in, e.g. show tasks command, in
> memory object statistics, etc.  Without this it is hard to inspect the
> whole system state without divining what task is what process.

The proc server exists to provide that mapping.



Re: RFC for patch to add task_{set,get}_name RPC

2013-05-08 Thread Samuel Thibault
Roland McGrath, le Wed 08 May 2013 14:59:47 -0700, a écrit :
> What for?
> If you want something like this, why does it belong in the microkernel?

So the kernel can tell what a task is in, e.g. show tasks command, in
memory object statistics, etc.  Without this it is hard to inspect the
whole system state without divining what task is what process.

Samuel



Re: RFC for patch to add task_{set,get}_name RPC

2013-05-08 Thread Roland McGrath
What for?
If you want something like this, why does it belong in the microkernel?



RFC for patch to add task_{set,get}_name RPC

2013-05-08 Thread Barry deFreese
Hi folks,

I am trying to get a test environment going to test this but in the meantime if 
any of you care to
review, here is a patch to add task_set_name() and task_get_name() RPCs to 
gnumach.

Thanks!

Barry

diff --git a/include/mach/gnumach.defs b/include/mach/gnumach.defs
index 7331334..b26be96 100644
--- a/include/mach/gnumach.defs
+++ b/include/mach/gnumach.defs
@@ -37,3 +37,17 @@ type vm_cache_statistics_data_t = struct[11] of integer_t;
 routine vm_cache_statistics(
target_task : vm_task_t;
out vm_cache_stats  : vm_cache_statistics_data_t);
+
+/*
+ *  Set the name of a task.
+ */
+routine task_set_name(
+   task: task_t;
+   name: task_name_t);
+
+/*
+ *  Get the name of a task.
+ */
+routine task_get_name(
+   task: task_t;
+   out name: task_name_t);
diff --git a/include/mach/mach_types.defs b/include/mach/mach_types.defs
index 607d5d9..c913cbb 100644
--- a/include/mach/mach_types.defs
+++ b/include/mach/mach_types.defs
@@ -230,6 +230,8 @@ type emulation_vector_t = ^array[] of 
vm_offset_t;
 
 type rpc_signature_info_t  = array[*:1024] of int;
 
+type task_name_t   = (MACH_MSG_TYPE_STRING, 8*32);
+
 #ifKERNEL_SERVER
 simport ;  /* for null conversion */
 simport ;   /* for task/thread conversion */
diff --git a/include/mach/mach_types.h b/include/mach/mach_types.h
index 8768482..5bb3a7b 100644
--- a/include/mach/mach_types.h
+++ b/include/mach/mach_types.h
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/mach/task_name.h b/include/mach/task_name.h
new file mode 100644
index 000..296bd9e
--- /dev/null
+++ b/include/mach/task_name.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2013 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  Author: Barry deFreese.
+ */
+
+#ifndef _TASK_NAME_H_
+#define _TASK_NAME_H_
+
+typedef char task_name_t[32];
+
+#endif /* _TASK_NAME_H_ */
diff --git a/kern/task.c b/kern/task.c
index 114dd31..d8690c6 100644
--- a/kern/task.c
+++ b/kern/task.c
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1212,3 +1213,33 @@ task_ras_control(
 #endif
 return ret;
 }
+
+kern_return_t
+task_set_name (
+   task_t task,
+   task_name_t name)
+{
+
+   if (task == TASK_NULL)
+   return KERN_INVALID_ARGUMENT;
+
+   strncpy(task->name, name, sizeof(task->name) -1);
+   task->name[sizeof(task->name) -1] = '\0';
+
+   return KERN_SUCCESS;
+}
+
+kern_return_t 
+task_get_name (
+   task_t task, 
+   task_name_t name)
+{
+
+   if (task == TASK_NULL)
+   return KERN_INVALID_ARGUMENT;
+
+   strncpy(name, task->name, sizeof(task->name) - 1);
+   name[sizeof(name) -1] = '\0';
+
+   return KERN_SUCCESS;
+}
diff --git a/kern/task.h b/kern/task.h
index 9bfea57..842979a 100644
--- a/kern/task.h
+++ b/kern/task.h
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -111,6 +112,8 @@ struct task {
natural_t   cow_faults; /* copy-on-write faults counter */
natural_t   messages_sent;  /* messages sent counter */
natural_t   messages_received; /* messages received counter */
+
+   task_name_t name;   /* Task name */
 };
 
 #define task_lock(task)simple_lock(&(task)->lock)


Re: MD5 for CD/DVD iso files

2013-05-08 Thread Samuel Thibault
Hello,

Larry Sevilla, le Wed 08 May 2013 13:27:17 +0800, a écrit :
> Want to try Debian/Hurd.
> 
> Can you include MD5 info for the CD/DVD iso files on this site:
> http://people.debian.org/~sthibault/hurd-i386/installer/cdimage/

They are actually already there inside 20130503. I have just made a
symlink to make it clear.

Samuel