[PATCH] kern: set the name of tasks created during the bootstrap
* kern/bootstrap.c (boot_script_task_create): Set the name of newly created tasks. --- kern/bootstrap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kern/bootstrap.c b/kern/bootstrap.c index 7cfff3a..d919e90 100644 --- a/kern/bootstrap.c +++ b/kern/bootstrap.c @@ -800,6 +800,7 @@ boot_script_task_create (struct cmd *cmd) printf(boot_script_task_create failed with %x\n, rc); return BOOT_SCRIPT_MACH_ERROR; } + task_set_name(cmd-task, cmd-path); return 0; } -- 1.9.1
Re: [PATCH] kern: set the name of tasks created during the bootstrap
Justus Winter, le Sun 13 Apr 2014 09:21:05 +0200, a écrit : * kern/bootstrap.c (boot_script_task_create): Set the name of newly created tasks. Ack. --- kern/bootstrap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kern/bootstrap.c b/kern/bootstrap.c index 7cfff3a..d919e90 100644 --- a/kern/bootstrap.c +++ b/kern/bootstrap.c @@ -800,6 +800,7 @@ boot_script_task_create (struct cmd *cmd) printf(boot_script_task_create failed with %x\n, rc); return BOOT_SCRIPT_MACH_ERROR; } + task_set_name(cmd-task, cmd-path); return 0; } -- 1.9.1 -- Samuel y t1 faich y les programmes ils segfaultent jamais quand on veut -+- #ens-mim en plein débogage -+-
[PATCH 1/6] libmachdev: fix device_open
device_open used to explicitly call ds_device_open_reply instead of just letting the mig-generated wrapper around ds_device_open generate the return message. There is really no need for that. * libmachdev/net.c: Do not include device_reply_U.h. (device_open): Do not call ds_device_open_reply. Set *devicePoly to MACH_MSG_TYPE_MAKE_SEND. --- libmachdev/ds_routines.c | 1 - libmachdev/net.c | 13 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c index 0e431a3..44f1139 100644 --- a/libmachdev/ds_routines.c +++ b/libmachdev/ds_routines.c @@ -64,7 +64,6 @@ #include vm_param.h #include device_S.h -#include device_reply_U.h #include io_req.h #include dev_hdr.h #include util.h diff --git a/libmachdev/net.c b/libmachdev/net.c index 501c9bb..300d946 100644 --- a/libmachdev/net.c +++ b/libmachdev/net.c @@ -368,15 +368,14 @@ device_open (mach_port_t reply_port, mach_msg_type_name_t reply_port_type, dev-set_multicast_list (dev); #endif } - if (MACH_PORT_VALID (reply_port)) - ds_device_open_reply (reply_port, reply_port_type, - err, dev_to_port (nd)); - return MIG_NO_REPLY; } - *devp = ports_get_right (nd); - *devicePoly = MACH_MSG_TYPE_COPY_SEND; - return D_SUCCESS; + if (nd) +{ + *devp = ports_get_right (nd); + *devicePoly = MACH_MSG_TYPE_MAKE_SEND; +} + return err; } static io_return_t -- 1.9.1
more dde fixes
Some more fixes for the code in the dde branch of the incubator. Justus
[PATCH 2/6] libmachdev: remove mach_device_deallocate
mach_device_deallocate just called ports_port_deref. However, the reference counting is done by the translation functions, explicitly reducing the reference count is just wrong. * libmachdev/ds_routines.c (mach_device_deallocate): Remove now unused function. (ds_device_close): Drop spurious call to mach_device_deallocate. --- libmachdev/ds_routines.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c index 44f1139..2f9388a 100644 --- a/libmachdev/ds_routines.c +++ b/libmachdev/ds_routines.c @@ -82,12 +82,6 @@ static int num_emul; boolean_t is_master_device (mach_port_t port); -static inline void -mach_device_deallocate (void *device) -{ - ports_port_deref (device); -} - /* * What follows is the interface for the native Mach devices. */ @@ -180,7 +174,6 @@ ds_device_close (struct mach_device *device) ret = (device-dev.emul_ops-close ? (*device-dev.emul_ops-close) (device-dev.emul_data) : D_SUCCESS); - mach_device_deallocate (device); return ret; } -- 1.9.1
[PATCH 4/6] libmachdev: drop unused declarations
* libmachdev/net.c (linux_intr_pri): Drop unused declaration. (port_bucket): Likewise. (dev_class): Likewise. --- libmachdev/net.c | 4 1 file changed, 4 deletions(-) diff --git a/libmachdev/net.c b/libmachdev/net.c index 300d946..6037e2f 100644 --- a/libmachdev/net.c +++ b/libmachdev/net.c @@ -80,10 +80,6 @@ #define ether_header ethhdr -extern int linux_intr_pri; -extern struct port_bucket *port_bucket; -extern struct port_class *dev_class; - /* One of these is associated with each instance of a device. */ struct net_data { -- 1.9.1
[PATCH 6/6] libmachdev: add, fix and use declaration for create_device_port
* libmachdev/ds_routines.c (create_device_port): Fix the type of the size parameter. Make it return error_t. * libmachdev/ds_routines.h (create_device_port): Add declaration. * libmachdev/net.c: Include ds_routines.h. * libmachdev/block.c: Include ds_routines.h. --- libmachdev/block.c | 1 + libmachdev/ds_routines.c | 3 ++- libmachdev/ds_routines.h | 2 ++ libmachdev/net.c | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libmachdev/block.c b/libmachdev/block.c index 756a07b..cd868d2 100644 --- a/libmachdev/block.c +++ b/libmachdev/block.c @@ -35,6 +35,7 @@ #include ddekit/printf.h +#include ds_routines.h #include vm_param.h #include device_reply_U.h #include dev_hdr.h diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c index 1da1393..6bd5a12 100644 --- a/libmachdev/ds_routines.c +++ b/libmachdev/ds_routines.c @@ -331,7 +331,8 @@ ds_device_map (struct mach_device *device, vm_prot_t prot, vm_offset_t offset, return D_INVALID_OPERATION; } -int create_device_port (int size, void *result) +error_t +create_device_port (size_t size, void *result) { return ports_create_port (dev_class, device_bucket, size, result); diff --git a/libmachdev/ds_routines.h b/libmachdev/ds_routines.h index e314e80..3706aa5 100644 --- a/libmachdev/ds_routines.h +++ b/libmachdev/ds_routines.h @@ -52,4 +52,6 @@ boolean_t ds_write_done(io_req_t); void iowait (io_req_t ior); +error_tcreate_device_port (size_t size, void *result); + #endif /* DS_ROUTINES_H */ diff --git a/libmachdev/net.c b/libmachdev/net.c index 6037e2f..07bb74a 100644 --- a/libmachdev/net.c +++ b/libmachdev/net.c @@ -70,6 +70,7 @@ #define MACH_INCLUDE +#include ds_routines.h #include vm_param.h #include device_reply_U.h #include dev_hdr.h -- 1.9.1
[PATCH 5/6] libmachdev: add missing includes
Include the mig-generated X_S.h files so that the X_routine functions can be inlined into the demuxer functions. * libmachdev/ds_routines.c: Add missing include of notify_S.h * libmachdev/trivfs_server.c: Add missing include of device_S.h, and notify_S.h. --- libmachdev/ds_routines.c | 1 + libmachdev/trivfs_server.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c index 4541d54..1da1393 100644 --- a/libmachdev/ds_routines.c +++ b/libmachdev/ds_routines.c @@ -64,6 +64,7 @@ #include vm_param.h #include device_S.h +#include notify_S.h #include io_req.h #include dev_hdr.h #include util.h diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c index 0d7fe24..7d69a2a 100644 --- a/libmachdev/trivfs_server.c +++ b/libmachdev/trivfs_server.c @@ -6,6 +6,9 @@ #include hurd/trivfs.h #include hurd.h +#include device_S.h +#include notify_S.h + static struct port_bucket *port_bucket; /* Trivfs hooks. */ -- 1.9.1
Problem with glibc and libihash
First of all libihash and any of the hurd libraries cannot be built without a working glibc. Hurd libs depend heavily on header files found in glibc like lowlevellock.h, so even after making the build system of the hurd repository to accept not to be able to build programs (as Samuel suggested), we are still not able to build the libs. So our only option is to build a glibc without the libpthread addon, use it to build libihash, and then rebuild glibc with libpthread. But theres comes our second and biggest problem. Glibc cannot be built without libpthread. If you try to do it, you will get the error message: In file included from hurdsig.c:23:0: ../include/pthread.h:1:26: fatal error: pthread.h: No such file or directory #include_next pthread.h ^ compilation terminated. ../o-iterator.mk:9: recipe for target '/tmp/nix-build-glibc-hurd-cross-i686-pc-gnu-2.19.drv-2/build/hurd/hurdsig.o' failed make[2]: *** [/tmp/nix-build-glibc-hurd-cross-i686-pc-gnu-2.19.drv-2/build/hurd/hurdsig.o] Error 1 make[2]: *** Waiting for unfinished jobs which pthread.h is a header file from libpthread in sysdeps/generic/bits/ . So my question is, shouldn't the glibc be able to be built without this addon? Is glibc building procedure broken?
Re: Problem with glibc and libihash
Manolis Ragkousis, le Sun 13 Apr 2014 21:50:17 +, a écrit : First of all libihash and any of the hurd libraries cannot be built without a working glibc. Hurd libs depend heavily on header files found in glibc like lowlevellock.h, Mmm, if it's only headers, wouldn't it be possible to install just them? In file included from hurdsig.c:23:0: ../include/pthread.h:1:26: fatal error: pthread.h: No such file or directory #include_next pthread.h ^ compilation terminated. ../o-iterator.mk:9: recipe for target '/tmp/nix-build-glibc-hurd-cross-i686-pc-gnu-2.19.drv-2/build/hurd/hurdsig.o' failed make[2]: *** [/tmp/nix-build-glibc-hurd-cross-i686-pc-gnu-2.19.drv-2/build/hurd/hurdsig.o] Error 1 make[2]: *** Waiting for unfinished jobs which pthread.h is a header file from libpthread in sysdeps/generic/bits/ . So my question is, shouldn't the glibc be able to be built without this addon? That should be possible, by disabling some things. I'm afraid signals need to be disabled in that case for instance, or at least the parts which makes them actually get delivered. Is glibc building procedure broken? Probably, few people actually build it from zero. Samuel
Re: [PATCH 2/6] libmachdev: remove mach_device_deallocate
Justus Winter, le Sun 13 Apr 2014 13:43:10 +0200, a écrit : mach_device_deallocate just called ports_port_deref. However, the reference counting is done by the translation functions, explicitly reducing the reference count is just wrong. Ack. * libmachdev/ds_routines.c (mach_device_deallocate): Remove now unused function. (ds_device_close): Drop spurious call to mach_device_deallocate. --- libmachdev/ds_routines.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c index 44f1139..2f9388a 100644 --- a/libmachdev/ds_routines.c +++ b/libmachdev/ds_routines.c @@ -82,12 +82,6 @@ static int num_emul; boolean_t is_master_device (mach_port_t port); -static inline void -mach_device_deallocate (void *device) -{ - ports_port_deref (device); -} - /* * What follows is the interface for the native Mach devices. */ @@ -180,7 +174,6 @@ ds_device_close (struct mach_device *device) ret = (device-dev.emul_ops-close ? (*device-dev.emul_ops-close) (device-dev.emul_data) : D_SUCCESS); - mach_device_deallocate (device); return ret; } -- 1.9.1 -- Samuel ...very few phenomena can pull someone out of Deep Hack Mode, with two noted exceptions: being struck by lightning, or worse, your *computer* being struck by lightning. (By Matt Welsh)
Re: [PATCH 1/6] libmachdev: fix device_open
Justus Winter, le Sun 13 Apr 2014 13:43:09 +0200, a écrit : device_open used to explicitly call ds_device_open_reply instead of just letting the mig-generated wrapper around ds_device_open generate the return message. There is really no need for that. Ack. * libmachdev/net.c: Do not include device_reply_U.h. (device_open): Do not call ds_device_open_reply. Set *devicePoly to MACH_MSG_TYPE_MAKE_SEND. --- libmachdev/ds_routines.c | 1 - libmachdev/net.c | 13 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c index 0e431a3..44f1139 100644 --- a/libmachdev/ds_routines.c +++ b/libmachdev/ds_routines.c @@ -64,7 +64,6 @@ #include vm_param.h #include device_S.h -#include device_reply_U.h #include io_req.h #include dev_hdr.h #include util.h diff --git a/libmachdev/net.c b/libmachdev/net.c index 501c9bb..300d946 100644 --- a/libmachdev/net.c +++ b/libmachdev/net.c @@ -368,15 +368,14 @@ device_open (mach_port_t reply_port, mach_msg_type_name_t reply_port_type, dev-set_multicast_list (dev); #endif } - if (MACH_PORT_VALID (reply_port)) - ds_device_open_reply (reply_port, reply_port_type, - err, dev_to_port (nd)); - return MIG_NO_REPLY; } - *devp = ports_get_right (nd); - *devicePoly = MACH_MSG_TYPE_COPY_SEND; - return D_SUCCESS; + if (nd) +{ + *devp = ports_get_right (nd); + *devicePoly = MACH_MSG_TYPE_MAKE_SEND; +} + return err; } static io_return_t -- 1.9.1 -- Samuel c'est pas nous qui sommes à la rue, c'est la rue qui est à nous
Re: [PATCH 3/6] libmachdev: make the two port buckets clearly distinct
Justus Winter, le Sun 13 Apr 2014 13:43:11 +0200, a écrit : libmachdev uses two port buckets previously both named port_bucket. Rename the one containing device_t ports to device_bucket to clearly distinguish them. Ack. * libmachdev/ds_routines.c (port_bucket): Rename to device_bucket. * libmachdev/mig-decls.h: Likewise. --- libmachdev/ds_routines.c | 8 libmachdev/mig-decls.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c index 2f9388a..4541d54 100644 --- a/libmachdev/ds_routines.c +++ b/libmachdev/ds_routines.c @@ -70,7 +70,7 @@ #include queue.h #include mach_glue.h -struct port_bucket *port_bucket; +struct port_bucket *device_bucket; struct port_class *dev_class; #define NUM_EMULATION num_emul @@ -332,7 +332,7 @@ ds_device_map (struct mach_device *device, vm_prot_t prot, vm_offset_t offset, int create_device_port (int size, void *result) { - return ports_create_port (dev_class, port_bucket, + return ports_create_port (dev_class, device_bucket, size, result); } @@ -340,7 +340,7 @@ void mach_device_init() { int i; - port_bucket = ports_create_bucket (); + device_bucket = ports_create_bucket (); dev_class = ports_create_class (0, 0); for (i = 0; i NUM_EMULATION; i++) { @@ -377,7 +377,7 @@ void * ds_server(void *arg) /* Launch. */ do { - ports_manage_port_operations_one_thread (port_bucket, demuxer, 0); + ports_manage_port_operations_one_thread (device_bucket, demuxer, 0); } while (1); return NULL; diff --git a/libmachdev/mig-decls.h b/libmachdev/mig-decls.h index 1d137cd..b3dc43d 100644 --- a/libmachdev/mig-decls.h +++ b/libmachdev/mig-decls.h @@ -23,7 +23,7 @@ #include hurd/ports.h #include dev_hdr.h -extern struct port_bucket *port_bucket; +extern struct port_bucket *device_bucket; extern struct port_class *dev_class; /* Called by server stub functions. */ @@ -31,7 +31,7 @@ extern struct port_class *dev_class; static inline struct mach_device * __attribute__ ((unused)) begin_using_device_port (mach_port_t port) { - return ports_lookup_port (port_bucket, port, dev_class); + return ports_lookup_port (device_bucket, port, dev_class); } static inline void __attribute__ ((unused)) -- 1.9.1 -- Samuel A sauf que le firewall bloque tout sauf internet -+- ben ouais, il bloque ipx/spx ! -+-
Re: [PATCH 6/6] libmachdev: add, fix and use declaration for create_device_port
Justus Winter, le Sun 13 Apr 2014 13:43:14 +0200, a écrit : * libmachdev/ds_routines.c (create_device_port): Fix the type of the size parameter. Make it return error_t. * libmachdev/ds_routines.h (create_device_port): Add declaration. * libmachdev/net.c: Include ds_routines.h. * libmachdev/block.c: Include ds_routines.h. Ack. --- libmachdev/block.c | 1 + libmachdev/ds_routines.c | 3 ++- libmachdev/ds_routines.h | 2 ++ libmachdev/net.c | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libmachdev/block.c b/libmachdev/block.c index 756a07b..cd868d2 100644 --- a/libmachdev/block.c +++ b/libmachdev/block.c @@ -35,6 +35,7 @@ #include ddekit/printf.h +#include ds_routines.h #include vm_param.h #include device_reply_U.h #include dev_hdr.h diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c index 1da1393..6bd5a12 100644 --- a/libmachdev/ds_routines.c +++ b/libmachdev/ds_routines.c @@ -331,7 +331,8 @@ ds_device_map (struct mach_device *device, vm_prot_t prot, vm_offset_t offset, return D_INVALID_OPERATION; } -int create_device_port (int size, void *result) +error_t +create_device_port (size_t size, void *result) { return ports_create_port (dev_class, device_bucket, size, result); diff --git a/libmachdev/ds_routines.h b/libmachdev/ds_routines.h index e314e80..3706aa5 100644 --- a/libmachdev/ds_routines.h +++ b/libmachdev/ds_routines.h @@ -52,4 +52,6 @@ boolean_t ds_write_done(io_req_t); void iowait (io_req_t ior); +error_t create_device_port (size_t size, void *result); + #endif /* DS_ROUTINES_H */ diff --git a/libmachdev/net.c b/libmachdev/net.c index 6037e2f..07bb74a 100644 --- a/libmachdev/net.c +++ b/libmachdev/net.c @@ -70,6 +70,7 @@ #define MACH_INCLUDE +#include ds_routines.h #include vm_param.h #include device_reply_U.h #include dev_hdr.h -- 1.9.1 -- Samuel Cliquez sur le lien qui suit dans ce mail...vous n'avez plus qu'a vous inscrire pour gagner de l'argent en restant connecteet puis faites passer le message et vous gagnerez encore plus d'argent ... -+- AC in NPC : Neuneu a rencontré le Pere Noël -+-
Re: [PATCH 5/6] libmachdev: add missing includes
Justus Winter, le Sun 13 Apr 2014 13:43:13 +0200, a écrit : Include the mig-generated X_S.h files so that the X_routine functions can be inlined into the demuxer functions. Ack. * libmachdev/ds_routines.c: Add missing include of notify_S.h * libmachdev/trivfs_server.c: Add missing include of device_S.h, and notify_S.h. --- libmachdev/ds_routines.c | 1 + libmachdev/trivfs_server.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c index 4541d54..1da1393 100644 --- a/libmachdev/ds_routines.c +++ b/libmachdev/ds_routines.c @@ -64,6 +64,7 @@ #include vm_param.h #include device_S.h +#include notify_S.h #include io_req.h #include dev_hdr.h #include util.h diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c index 0d7fe24..7d69a2a 100644 --- a/libmachdev/trivfs_server.c +++ b/libmachdev/trivfs_server.c @@ -6,6 +6,9 @@ #include hurd/trivfs.h #include hurd.h +#include device_S.h +#include notify_S.h + static struct port_bucket *port_bucket; /* Trivfs hooks. */ -- 1.9.1 -- Samuel CN J'ai enseigné l'algorythmique. GLG C'est quoi l'algorythmique ? Une contrebasse programmée en Algol ? -+- in : Guide du Neuneu d'Usenet - Neuneu fait ses gammes. -+-
Re: [PATCH 4/6] libmachdev: drop unused declarations
Justus Winter, le Sun 13 Apr 2014 13:43:12 +0200, a écrit : * libmachdev/net.c (linux_intr_pri): Drop unused declaration. (port_bucket): Likewise. (dev_class): Likewise. Ack. --- libmachdev/net.c | 4 1 file changed, 4 deletions(-) diff --git a/libmachdev/net.c b/libmachdev/net.c index 300d946..6037e2f 100644 --- a/libmachdev/net.c +++ b/libmachdev/net.c @@ -80,10 +80,6 @@ #define ether_header ethhdr -extern int linux_intr_pri; -extern struct port_bucket *port_bucket; -extern struct port_class *dev_class; - /* One of these is associated with each instance of a device. */ struct net_data { -- 1.9.1 -- Samuel * x remarque qu'avec un peu de volonté, on peut faire du code de porc dans d'importe quel langage Turing-complet -+- x sur #ens-mim - codons porc -+-