Re: One Filesystem vnode operations declare problem.
From: Peter Wemm <[EMAIL PROTECTED]> It is up to the file system to get it right. The normal procedure is to use namei() which does VOP_LOOKUP() calls to each file system. As a side effect of doing a lookup, the file system itself returns a "new" vnode pointer that corresponds to the name being looked up. If we are using a ufs/ffs file system then the fs code will set the operations vector in the vnode iself to point to either the specfs or regular vop entries. See v_op in struct vnode. For devfs and the seperate /dev case it is similar.. for devfs there are two types of vnodes.. The first is the "special" device type (devfs_specop_entries[]), and the second is the vnodes that are used for traversing the directory structure (directory files, symlinks etc) - devfs_vnodeop_entries[]. The selection is done here: error = getnewvnode("devfs", mp, devfs_vnodeop_p, &vp); or vp->v_op = devfs_specop_p; If you have a look at vnode_if.c and vnode_if.h in the compile directory, that should give a few more clues too. sys/kern/vfs_init.c constructs the tables that these inlines use. Cheers, -Peter Thank you very much! I have read vnode_if.c, vnode_if.h and sys/kern/vfs_init.c and understand the vfs initialization. I have read the John Shelby Heidemann dissertation "Stackable Design of File Systems". I have some questions. About "Coherence Architecture", in FreeBSD, how is it implemented? Should I read which part code? About "Featherweight Layer", in FreeBSD, how is it implemented? Should I read which part code? Could you give me some clues? I have not a clear idea about Stackable VFS, I hope read the FreeBSD kernel source to understand the real VFS implementation. Thank your help! Best Regards Ouyang Kai _ The new MSN 8 is here: Try it free* for 2 months http://join.msn.com/?page=dept/dialup To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
buffer management questions
Hi,everybody, I do not know the KVA real means what. From internet, I only know it is kernel address space. In buf structure, there are two members about KVA - b_kvabase & b_kvasize; And when the buf management works, it will remove/add a buf from one queue to another, one instance, based on b_kvasize, a buf can be moved form QUEUE_DIRTY to QUEUE_EMPTYKVA or QUEUE_EMPTY(i.e: brelse function). So, what is the difference between the two empty queue? Another question, the buf queues have one QUEUE_NONE queue, I do not know how the QUEUE_NONE queue works. When buf init, all buffers will be added to QUEUE_EMPTY. I reference the 5.0RC2 source. Thank you! Best Regards Ouyang Kai _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
some questions about ACL implementation
Hi, robert I am reading the ACL implementation based FreeBSD5.0 release. I have some problems, please help. 1. the 'extattrctl initattr -p / 388 posix1e.acl_access' command: why the size is 388. the 'ufs_extattr_header' size is 12 and the 'acl' is 324, so the sum is 336. 2. what is the relationship of ACL_GROUP_OBJ and ACL_MASK? If I do not set the ACL EA, we can not get the information of 'ACL_MASK'. ACL_MASK represents what? 3. "As part of the ACL is stored in the inode, and the rest in an EA, assemble both into a final ACL product. Right now this is not done very efficiently.", Do you any viewpoint about that? How we can improve the efficiency? 4. about ACL based on UFS2, do the ACLs of an inode store di_extb? Could you introduce the ACLs' management on UFS2? Thank you very much! Best Regards Ouyang Kai _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
how can I hack my com interrupt?
Hi, guys, I want to hack my com interface to specail purpose. I want to use the Modem Status Register. When the high 4 bits change, it could spring an interrupt. So, I set the Intertupt Enable Register(in sioattach fuction) to the interrupt, which support changing in the state of the modem input pins(IER_EMSC). I set the MSR successfully. But when the MSR state change, the siointr print anything(I add a printf as the first line of the function). I found there are 4 level interrupt(IIR). I want to set the IIR 4 level to support Modem status. But I couldn't set the Interrupt Identification Register, why? the code of set IIR is in the sioattach function: sio_setreg(com, com_iir, IIR_MLSC); I found the com_iir content is not changed. How can I do that? My OS is FreeBSD4.8-Release. Thanks a lot! Best Regards Ouyang Kai _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
[no subject]
Hi Everybody, I am a jackaroo to FreeBSD kernel. I have a question about how the kernel add all devices. For example, in NetBSD, I can find the code in /sys/kern/init_main.c: /* Attach pseudo-devices. */ for (pdev = pdevinit; pdev->pdev_attach != NULL; pdev++) (*pdev->pdev_attach)(pdev->pdev_count); I know the NetBSD kernel add devices(such as storage device and network device) by them. But in FreeBSD, I can not locate the place. which part code should I read? Thank you. Best Regards Ouyang KaiGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Hi, how the kernel add the devices
Hi Everybody, I am a jackaroo to FreeBSD kernel. I have a question about how the kernel add all devices. For example, in NetBSD, I can find the code in /sys/kern/init_main.c: /* Attach pseudo-devices. */for (pdev = pdevinit; pdev->pdev_attach != NULL; pdev++) (*pdev->pdev_attach)(pdev->pdev_count);I know the NetBSD kernel add devices(such as storage device and network device) by them.But in FreeBSD, I can not locate the place.which part code should I read?Thank you. Best Regards Ouyang Kai Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Re: Hi, how the kernel add the devices
Dear Terry, >See /usr/src/sys/kernel.h. It is done using linker sets and>SYSINIT.Hmm¡. Thank you!I find the mi_startup() function in /sys/kern/init_main.c, there are some code as follow:for (sipp = sysinit; sipp < sysinit_end; sipp++) { if ((*sipp)->subsystem == SI_SUB_DUMMY) continue; /* skip dummy task(s)*/ if ((*sipp)->subsystem == SI_SUB_DONE) continue; /* Call function */ (*((*sipp)->func))((*sipp)->udata); /* Check off the one we're just done */ (*sipp)->subsystem = SI_SUB_DONE; /* Check if we've installed more sysinit items via KLD */ if (newsysinit != NULL) { if (sysinit != SET_BEGIN(sysinit_set))free(sysinit, M_TEMP); sysinit = newsysinit; sysinit_end = newsysinit_end; newsysinit = NULL; newsysinit_end = NULL; goto restart; } }Now, I am puzzled about the function pointer(func), which is how to work. For example, I have a NIC ¡®fxp0¡¯, so the function pointer should point to the fxp_attach?If that is right, I want to know how the kernel call the mi_startup()? Best Regards Ouyang Kai Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com Dear Terry >See /usr/src/sys/kernel.h. It is done using linker sets and >SYSINIT. Hmm¡. Thank you! I find the mi_startup() function in /sys/kern/init_main.c, there are some code as follow: for (sipp = sysinit; sipp < sysinit_end; sipp++) { if ((*sipp)->subsystem == SI_SUB_DUMMY) continue; /* skip dummy task(s)*/ if ((*sipp)->subsystem == SI_SUB_DONE) continue; /* Call function */ (*((*sipp)->func))((*sipp)->udata); /* Check off the one we're just done */ (*sipp)->subsystem = SI_SUB_DONE; /* Check if we've installed more sysinit items via KLD */ if (newsysinit != NULL) { if (sysinit != SET_BEGIN(sysinit_set)) free(sysinit, M_TEMP); sysinit = newsysinit; sysinit_end = newsysinit_end; newsysinit = NULL; newsysinit_end = NULL; goto restart; } } Now, I am puzzled about the function pointer(func), which is how to work. For example, I have a NIC ¡®fxp0¡¯, so the function pointer should point to the fxp_attach? Best Regards Ouyang Kai If that is right, I want to know how the kernel call the mi_startup()?
How the kernel add the devices when the kernel start
Dear Terry, (*((*sipp)->func))((*sipp)->udata); I saw the corresponding code based on your hints. I have some questions. When the kernel process this code to check the SI_SUB_DRIVERS, it would find the registed 'fxp' device(fxp_probe), right? If the 'fxp' device is exist, the kernel will try to attach it(fxp_attach), right? Another, If we do not compile the 'vr' device into the kernel and we do load the corresponding 'ko',so the kernel will not check the device, that is to say, the 'vr' device does not registe to kernel, right? But, I have some problem :1. When the kernel process the specified device, the 'func' means what? For example: the member 'if_ioctl' of the structure 'ifnet', when the kernel process the 'fxp' device, Iknow it should call the function 'fxp_ioctl'. But I do not the 'func' means what when it check SI_SUB_DRIVERS.2. In NetBSD, I can find main() function in init_main.c, but in FreeBSD, I could not find it, I am puzzled aboutthe place of the FreeBSD main process. Thank you so much!Best Regards Ouyang Kai Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
About nge NIC problem
Hi,I have trouble in using nge NIC(LinkSys EG1032) to support Novell and Applein FreeBSD 4.5.The apple software is netatalk 1.5.3.1. And the novell netware software isMARS_NWE.The TCP/IP and the Samba work well on the nge.Do you have any experiance on netatalk and MARS_NWE of the nge NIC?Please help. Best RegardsOuyang KaiGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com Hi, I have trouble in using nge NIC(LinkSys EG1032) to support Novell and Apple in FreeBSD 4.5. The apple software is netatalk 1.5.3.1. And the novell netware software is MARS_NWE. The TCP/IP and the Samba work well on the nge. Do you have any experiance on netatalk and MARS_NWE of the nge NIC? Please help. Best Regards Ouyang Kai
Hi, the kernel how control timeout and interrupt method?
Hi guys, I have two questions, please help.1. in one book, there are both pfslowtimo(void *arg) and pffasttimo(void *arg) in uipc_domain.c, which will be called by timeout, one is called every 500ms,the other is called every 200ms. I want to know how FreeBSD control the timeout?I want to the kernel how to know it is time to call pfslowtimo or pffasttimo? 2. I have a data-line, which connet the COM2 with a special backplane(my box's IDE diskattach by the backplane). I can scan the COM2's state to find whether the IDE disk existor not. I use the polling method to scan in user space. I access '/dev/io' device and get the COM state from the interface address.I think thismethod is unefficient. I think when the COM status change, it should spring an interrupt, the kerenl will ignorethe interrupt default, right? I can write an interrupt program, or embed my process in thekernel. But I have no idea how to start. how can I start my task? Thank you!Best RegardsOuyang Kai Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com Hi guys, I have two questions, please help. 1. in one book, there are both pfslowtimo(void *arg) and pffasttimo(void *arg) in uipc_domain.c, which will be called by timeout, one is called every 500ms, the other is called every 200ms. I want to know how FreeBSD control the timeout? I want to the kernel how to know it is time to call pfslowtimo or pffasttimo? 2. I have a data-line, which connet the COM2 with a special backplane(my box's IDE disk attach by the backplane). I can scan the COM2's state to find whether the IDE disk exist or not. I use the polling method to scan in user space. I access '/dev/io' device and get the COM state from the interface address.I think this method is unefficient. I think when the COM status change, it should spring an interrupt, the kerenl will ignore the interrupt default, right? I can write an interrupt program, or embed my process in the kernel. But I have no idea how to start. how can I start my task? Thank you! Best Regards Ouyang Kai
About 'sysctl' routine problem?
Hi guys, In the "TCP/IP Illustrated, Volume2: The Implementation" book,there give 'ioctl' and 'sysctl' in the kernel routine. ioctl -> sooioctl->(interface)ifioctl. sysctl-> net_sysctl -> pr_sysctl -> ip_sysctl Now, I can find the corresponding code about 'ioctl' routine.But, I could not find any code about 'sysctl', why?how the FreeBSD realize the corresponding functions? Thank you! Best RegardsOuyang Kai Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Re: About 'sysctl' routine problem?
Dear Terry, Thank you! >Once again, we are talking about linker sets. This is a little>more complex, though, since you have to take the "boot environment">into account, as well (the boot environment is the basis for a>preinitialized sysctl space contents, seperate from the code you>see in the kernel itself for the declarations of specific sysctl>OIDs that are added to the ones exported before the kernel is even>really started. in kern_mib.c:SYSCTL_NODE(, CTL_NET, net, CTLFLAG_RW, 0, "Network, (see socket.h)");-->struct sysctl_oid_list sysctl_net_children;static struct sysctl_oid sysctl__net = { &sysctl_children, { 0 }, CTL_NET, CTLTYPE_NODE|CTLFLAG_RW, (void*)&sysctl_net_children, 0, "net", 0, "N", 0 }; DATA_SET(sysctl_set, sysctl__net); It seem like the SYSINIT macro.> TUNABLE_INT_DECL> TUNABLE_INT_FETCH> SYSCTL_DECL> SYSCTL_NODE> SYSCTL_INT> SYSCTL_STRUCT> SYSCTL_PROC Whether do they register also in mi_startup() like other devices, when the'sipp' is looped to 'SI_SUB_TUNABLES'? You said some specific sysctl OIDs can be added before the kernel is even really started,I want to know when they will be added? Could you give me an example? I try to trace some routine from the 'ifconfig' program source code.The following code is copied from 'ifconfig' program: mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; mib[3] = 0; /* address family */ mib[4] = NET_RT_IFLIST; mib[5] = 0; /* if particular family specified, only ask about it */ if (afp) mib[3] = afp->af_af; if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) errx(1, "iflist-sysctl-estimate"); From the SYSCTL_NODE(_net, PF_ROUTE, routetable, CTLFLAG_RD, sysctl_rtsock, "");we can know the RF_ROUTE is the 'net's children', and its' handler is sysctl_rtsock.So, the kernel will call sysctl_rtsock, right?in sysctl_rtsock function: case NET_RT_IFLIST: error = sysctl_iflist(af, &w);So, this time, the kernel will call sysctl_iflist finally, right?But I have some wonder how the 'sysctl' command transfer from user space to kernel space?I find the line in sysproto.h:int __sysctl __P((struct proc *, struct sysctl_args *));I think whether the 'sysctl' is changed to '__sysctl' in kernel space?If that is right, the __sysctl is how conect with sysctl_rtsock? Thank you very much!:-) Best RegardsOuyang KaiGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com Dear Terry, Thank you! >Once again, we are talking about linker sets. This is a little >more complex, though, since you have to take the "boot environment" >into account, as well (the boot environment is the basis for a >preinitialized sysctl space contents, seperate from the code you >see in the kernel itself for the declarations of specific sysctl >OIDs that are added to the ones exported before the kernel is even >really started. in kern_mib.c: SYSCTL_NODE(, CTL_NET,net,CTLFLAG_RW, 0, "Network, (see socket.h)"); --> struct sysctl_oid_list sysctl_net_children; static struct sysctl_oid sysctl__net = { &sysctl_children, { 0 }, CTL_NET, CTLTYPE_NODE|CTLFLAG_RW, (void*)&sysctl_net_children, 0, "net", 0, "N", 0 }; DATA_SET(sysctl_set, sysctl__net); It seem like the SYSINIT macro. > TUNABLE_INT_DECL > TUNABLE_INT_FETCH > SYSCTL_DECL > SYSCTL_NODE > SYSCTL_INT > SYSCTL_STRUCT > SYSCTL_PROC Whether do they register also in mi_startup() like other devices, when the 'sipp' is looped to 'SI_SUB_TUNABLES'? You said some specific sysctl OIDs can be added before the kernel is even really started, I want to know when they will be added? Could you give me an example? I try to trace some routine from the 'ifconfig' program source code. The following code is copied from 'ifconfig' program: mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; mib[3] = 0; /* address family */ mib[4] = NET_RT_IFLIST; mib[5] = 0; /* if particular family specified, only ask about it */ if (afp) mib[3] = afp->af_af; if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) errx(1, "iflist-sysctl-estimate"); >From the SYSCTL_NODE(_net, PF_ROUTE, routetable, CTLFLAG_RD, sysctl_rtsock, ""); we can know the RF_ROUTE is the 'net's children', and its' handler is sysctl_rtsock. So, the kernel will call sysctl_rtsock, right? in sysctl_rtsock function: case NET_RT_IFLIST: error = sysctl_iflist(af, &w); So, this time, the kernel will call sysctl_iflist finally, right? But I have some wonder how the 'sysctl' command transfer from user space to kernel space? I find the line in sysproto.h: int __sysctl __P((struct proc *, struct sysctl_args *)); I think whether the 'sysctl' is changed to '__sysctl' in kernel space? If that is right, the __sysctl is how conect with sysctl_rtsock? Thank you very much!:-) Best Regards Ouyang Kai
Re: One Filesystem vnode operations declare problem.
From: Peter Wemm <[EMAIL PROTECTED]> The name of the macro is a little strange, that is more of a historical relic where we used to declare these things in something called a 'linker set'. These days it is handled by a SYSINIT() function that registers the vnode ops. I know in mi_startup(),the kernel will try to load the modules registered by SYSINIT. I think its order is: firstly according 'sysinit_sub_id'; secondly,if the 'sysinit_sub_id' are the same, it is accord 'sysinit_elem_order', right? I wonder if both of them is the same, the kernel will try to load which. For example: SYSINIT(nameA, SI_SUB_DRIVERS, SI_ORDER_FIRST, initA, NULL); SYSINIT(nameB, SI_SUB_DRIVERS, SI_ORDER_FIRST, initB, NULL); which do the kernel load firstly? Our vnode op system is fully dynamic. We can create new VOP_xxx() functions on the fly. But for this to work, they need to be registered and assigned an index number in the system vectors. The act of referencing a "foo" vector in the xxx_opv_desc table adds support for a VOP_FOO(). For example, suppose we have some remote file system loadable module that supports remote file copies. That filesystem could introduce VOP_COPYFILE() that would cause the file to be copied on the server, rather than the source file being read by the client and then copied back to the new file. We could then load another module that adds a copyfile(2) syscall that calls VOP_COPYFILE(). And because of the vnode stacking system and the VOP_DEFAULT() vectors, we could even mount union fs's over the top of this hypothetical file system, even though at the time that unionfs was compiled there was no VOP_COPYFILE operation to pass down the stack. union fs's means what? FreeBSD's UFS is result that union of UFS and FFS, right? Quite a while ago, the kernel used to have a static list of supported VOP_* calls. This has not been the case for quite some time now. Any file system can create any VOP_* that it likes. Based on your words, I still do not understand those difference among those VOP_SET. :(. I think your viewpoints is that the number of VOP_SETs and the function of VOP_SETs is decided by the filesystem, right? I want to know the general purposes of those VOP_SETs. For example: in FFS: VNODEOP_SET(ffs_vnodeop_opv_desc); I think it is normal operation vectors. VNODEOP_SET(ffs_specop_opv_desc); I think it is special operation vectors. But I do not know its purpose. VNODEOP_SET(ffs_fifoop_opv_desc); I think it is FIFO operation vectors. Why do those three VOP_SETs have many repeated defines? Or All my thought is wrong? Thank you very much! Best Regards Ouyang Kai _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: One Filesystem vnode operations declare problem.
From: Peter Wemm <[EMAIL PROTECTED]> Undefined. The bubble sort that orders these could leave it in any state. Woo. thank you. In mi_startup(), the kernel will register those device/modules, and excute the 'func' declared by SYSINIT, right? I think the kernel will have not real "/" filesystem until kernel completes the SI_SUB_ROOT_CONF register. How the kernel get those info we stored in "/" filesystem, such as 'loader.conf' and part of '/etc/rc'? The kernel use the BIOS model? I am puzzled. But in 5.0, both SI_SUB_DEVFS and SI_SUB_DRIVERS(GEOM) will be loaded before the SI_SUB_ROOT_CONF. Both of them will initial, specail GEOM, so they will create special device in '/dev'. why can we see those device after the system is normal. For example: mount /dev/ad0s2e /usr/share1 mount /dev/ad0s1f /usr now, we can not see the '/dev/ad0s2e' filesystem context. No, unionfs is a stacked file system. For example, you could create a read/ write layer stacked on top of a cdrom. This would allow you to create files which would end up in the top layer, but unmodified files could be read from the bottom layer. If you rm a file, a whiteout record gets created to make it appear that the file got deleted from the cdrom etc. Unfortunately, this works better in theory than in practice due to many layering problems in our kernel and VM system that are still work in progress. That is a whole different topic though. Now, I have a more understanding about it. If I want to learn more about that, where can I get info from internet? Could you commend some articles or documents about that? There is no VOP_SET. I think you mean VFS_SET(). This connects the file system itself to the kernel. VNODEOP_SET() connects the vnode descriptions to the kernel. Sorry, I write a mistake. ufs/ffs are a mini-filesystem-stack. ffs provides the on-disk infrastructure, while ufs is layered on top of it to provide name space. This is quite well hidden though and is mostly a behind-the-scenes thing. At one point there was a log structured file system that shared a lot of code this way. The file systems provide multiple operation vectors due to the way that device and named pipe nodes exist. For ufs/ffs, the actual connection point for /dev/ttyv0 (for example) lived on disk. When the user opened it, the file system would substitute the "normal" file based vectors for the specfs vectors. That way, the vnode would behave like a device. And the same goes for the fifo (named pipe) nodes. For FreeBSD 5.0, we have a seperate file system for /dev, so the specfs nodes in ufs/ffs are not normally used. But they do still work and are sometimes used for jail(8) environments. Yes, I know in 5.0, we can use 'dev' filesystem. Based on DEVFS, when we create device, we usually call 'make_dev', in this function, we can create device in DEVFS through 'devfs_create_hook'. Or we destroy device in DEVFS through 'devfs_destroy_hook'.I think the DEVFS is special for 'device', I do not know why the DEVFS support both 'normal' and 'specfs'. I guess it we use normarl file operation such as 'ls' or 'find'in '/dev/', it use the 'normarl' vop; we use 'devfs rules', it use the 'special' vop, right? If I guess right, but the kernel how to know it should use which vop? Thank you very much! Best Regards Ouyang Kai _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Some problems about KSE
Hi, everybody, I want to make sure whether we can program the multi-thread code based on KSE in FreeBSD5.0 RC-1. I have make in '/usr/src/lib/libpthread', I found some new things in '/usr/lib' as follow: lrwxr-xr-x 1 root wheel 11 Dec 11 16:04 libkse.so -> libkse.so.1 -r--r--r-- 1 root wheel68780 Dec 11 16:04 libkse.so.1 -r--r--r-- 1 root wheel 164448 Dec 11 16:04 libkse_p.a -r--r--r-- 1 root wheel 153854 Dec 11 16:04 libkse.a So if I program. How can I use the kse? I can use pthread(3) as traditional manner, only using '-lpthread' instead of '-pthread' in my makefile, right? when I use /usr/src/tools/KSE/ksetest/ksetest program , it always cause my box crash. I have report this issue to Julian. I am seeing KSE(2), I have some puzzles about that. 1. upcall is really means what? Does it represent through 'km_func'? if it were true, the 'km_func' is indicated by whom? UTS, Kernel, or user program, I do not know. 2. When one process has more than one KSEG, the signal should be delivered to which KSEG? The manual said it is indeterminate. I do not know how the signal could be delivered to the special KSEG exactly? Thank you! Best Regards Ouyang Kai _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Some problems about KSE
From: Julian Elischer <[EMAIL PROTECTED]> Well it's still being written so you may be a bit ahead of yourself.. cc ... -lkse no use -lkse until we have if more finished... then it will become -lpthread the fix was committed yesterday. the UTS fills in km_func before creating the KSE and loaded by the kernel. At THIS time it is never looked at again, but that could change in the future. I have cvsup my box today, the 'ksetest' works nice. But only one time, when I am excuting the 'ksetest'on ptty0, I am excuting 'tar zcvf src1212.tgz ./src' on ptty1. The box crash. I do not know why. I want to repeat the problem, but the box works well. so, I think it may be irrelevant with KSE. I have studied the 'ksetest' code, if the app programmers use KSE as your method, I think it is too hard.:) In the furture, whether do the app programmers never use the round robin KSE functions(kse_create, kse_release, etc.) directly? Only the pthread lib(UTS) considers calling KSE functions? (see how ksetest is written) I do not know whether my understanding about 'ksetest' is right, please point out. in 'ksetest' program: you simulated the UTS mechanism. In this mechanism: 1. one KSEG is a queue(runq_init); 2. every thread(in userland) is managed by the uts_data structure(init_uts); 3. through thread_start, you start a child thread, the child thread function is ''. 4. through start_uts, you setup a bridge between UTS and KT(kse_create). I wants to draw my understanding about this 'ksetest', but I can not finish it.:( User Program (kse_thr_mailbox) UTS (kse_mailbox) KT ksetest queue1 KSEG1 child1data1(have a bridge) child2 data2(have a bridge) queue2 KSEG2 child3data3(have a bridge) child4 child5 data4(have a bridge with KSEG1 ???) In the main() function, I have some puzzles: why do you start child thread with 'data1' two times and with 'data3' three times? I think the 'uts_data' should the the management structure in UTS, why use the same 'uts_data' instances manage one queue? why could not use 'data2' or 'data4' to create child thread? why did you call "start_uts(&data4, 0);" by "thread_start", what is your purpose? Why the 'data4' is in queue2 but belongs to KSEG1? So, I am puzzled about the relationship between queue and KSEG. Maybe, from beginning, I am wrong? :( It is indetirminate because that code has not been written. At this time the signal will be delivered in the normal way to the next thread to enter the kernel in any way. This actually works for a surprising number of programs as long as they do not need to do any thread_specific actions in the handler. How to route the signals to a specific thread is still under discussion. Oh, later... _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message