doubts regarding System Initialization working (SYSINIT)
Hello all, I have been browsing through the FreeBSD kernel's source code trying to understand its working . In the mi_startup() in /sys/kern/init_main.c all the SYSINIT objects are sorted using bubble sort and then they are executed in order. My doubt is that we have declared the pointer to the struct sysinit as const pointer to a const in the macro definition of SYSINIT ie when the macro SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_FIRST, kmeminit, NULL) is expanded completely we get the following static struct sysinit kmem_sys_init = { SI_SUB_KMEM, SI_ORDER_FIRST, (sysinit_cfunc_t)(sysinit_nfunc_t)kmeminit, ((void *)(((void *)0))) }; static void const * const __set_sysinit_set_sym_kmem_sys_init __attribute__((__section__(set_ sysinit_set))) __attribute__((__used__)) = kmem_sys_init; Here we see that the pointer is of type const and to a const but when we sort and swap using *sipp=*xipp; We are trying to change the address of const pointer to a new address in which case it should segfault but it works fine. Why does it not segfault it seems I have not understood the concept behind using const *const... I will be very thankful if you can help me with it. Regards, Mehul ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: FreeBSD kernel Debugging tools for Virtual Memory Module
Michel Talon Wrote: Do you mean like vkernel in DragonFlyBSD? Yes, UML and vkernel cater to same problem the implementation being the obvious difference between them. We have implemented some part of it and working on the design of the rest. We have been following the vkernel and UML and trying to move away with some of the shortcomings in both. It will be helpful for us if we can have some valuable inputs or any advice from your side. Regards, Mehul On Fri, Jan 2, 2009 at 6:24 PM, Michel Talon ta...@lpthe.jussieu.fr wrote: Mehul Chadha wrote: But I am working on a virtual mode freebsd project similar to what UML does in linux. Do you mean like vkernel in DragonFlyBSD? http://leaf.dragonflybsd.org/cgi/web-man/?command=vkernelsection=ANY -- Michel TALON ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: FreeBSD kernel Debugging tools for Virtual Memory Module
Hi kamlesh, Happy New Year. I am not aware of the debugging tools in freebsd available right now in the market. But I am working on a virtual mode freebsd project similar to what UML does in linux. This will help in executing the entire OS in the user space of real OS running on HW. This will be the best debugging tool to debug all the non architecture specific code in freebsd. The project is specially catered to problems similar to what you are facing. We are expecting the project to be completed in next 3 months. Regards, Mehul On Fri, Jan 2, 2009 at 7:57 AM, Kamlesh Patel shilp.ka...@yahoo.com wrote: Hi Friends, Happy New Year, I am working on Virtual Memory parts of FreeBSD OS. My Problem is, whenever i modify little code of vmpage.c file i need to build the whole kernel to check the modification and i even am not able to debug the kernel code. Could anyone please inform me kernel Debugging tools for FreeBSD OS? Kamlesh MS CS, CSUS ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org