A full source-tour somewhere?
At one stage at whistle we had the kernel fully cross-referenced using the 'global' program (now in ports) which produced a website that could be browsed to find 'all the callers of xxx()' etc. does anyone have such a site online at the moment? -- ++ __ _ __ | __--_|\ Julian Elischer | \ U \/ / hard at work in | / \ [EMAIL PROTECTED] +--x USA\ a very strange | ( OZ)\___ ___ | country ! +- X_.---._/presently in San Francisco \_/ \\ v To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: A full source-tour somewhere?
Julian Elischer [EMAIL PROTECTED] writes: At one stage at whistle we had the kernel fully cross-referenced using the 'global' program (now in ports) which produced a website that could be browsed to find 'all the callers of xxx()' etc. does anyone have such a site online at the moment? On http://www.freebsd.org/search/ there are links to two sites that might be what you're looking for: * The Source Code * A cross reference of the FreeBSD kernel To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: A full source-tour somewhere?
Dima Dorfman wrote: Julian Elischer [EMAIL PROTECTED] writes: At one stage at whistle we had the kernel fully cross-referenced using the 'global' program (now in ports) which produced a website that could be browsed to find 'all the callers of xxx()' etc. does anyone have such a site online at the moment? On http://www.freebsd.org/search/ there are links to two sites that might be what you're looking for: * The Source Code * A cross reference of the FreeBSD kernel well I have the source code of course, but the second is what I'm looking for except that it stopped being updated October 2000. I'm looking for a current one. -- ++ __ _ __ | __--_|\ Julian Elischer | \ U \/ / hard at work in | / \ [EMAIL PROTECTED] +--x USA\ a very strange | ( OZ)\___ ___ | country ! +- X_.---._/presently in San Francisco \_/ \\ v To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: A full source-tour somewhere?
Julian Elischer wrote: Dima Dorfman wrote: [...] * A cross reference of the FreeBSD kernel well I have the source code of course, but the second is what I'm looking for except that it stopped being updated October 2000. I'm looking for a current one. oh yeah, and that one doesn't work.. try clicking on something you want to cross reference.. -- ++ __ _ __ | __--_|\ Julian Elischer | \ U \/ / hard at work in | / \ [EMAIL PROTECTED] +--x USA\ a very strange | ( OZ)\___ ___ | country ! +- X_.---._/presently in San Francisco \_/ \\ v To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: kernel malloc
Hi, thx for ur reply. i wanted to know in side kernel is there any limit to the malloc that a user can do.what you told in ur previous mail is that at a time user can malloc 4k.but suppose i am doing 2k memory allocations. how many such mallocs i can do? is there any configuration we can do depending on our RAM size? please reply. thx vishwanath --- Bosko Milekic [EMAIL PROTECTED] wrote: On Fri, Jul 20, 2001 at 10:17:20AM +0100, vishwanath pargaonkar wrote: Hi, can any one please help me with this. i want allocate a memory in the kernel -a buffer of size 2k to 5k. can i do it using malloc with second parameter as M_TEMP and third as M_WAITOK. can anybody tell me what M_TEMP means .what is maximum malloc i can do with M_TEMP? will the OS allow me to malloc 4k buffer in side kernel??shd i give M_WAITOK or M_DONTWAIT??? M_TEMP is merely there for statistics gathering. If you're writing a subsystem and plan to malloc() a lot of things for the subsystem you may want to create your own malloc type (see malloc(9)). On another note, remember that if you allocate a 5k buffer with malloc() on x86 where the page size if 4k, that you're not guaranteed to have a physically contiguous backing. please tell me. thanx in advance. Regards, -- Bosko Milekic [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: A full source-tour somewhere?
On Mon, Jul 23, 2001 at 12:56:04AM -0700, Julian Elischer wrote: Julian Elischer wrote: Dima Dorfman wrote: [...] * A cross reference of the FreeBSD kernel well I have the source code of course, but the second is what I'm looking for except that it stopped being updated October 2000. I'm looking for a current one. oh yeah, and that one doesn't work.. try clicking on something you want to cross reference.. I'm not shure what you exactly need. With global you can simply gtags htags in a dir and enjoy the html. You have do do it for every application kernel on their own because they share identic named functions like main() and so on. The result is nice but I wouldn't call it cross reference -- B.Walter COSMO-Project http://www.cosmo-project.de [EMAIL PROTECTED] Usergroup [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: A full source-tour somewhere?
On Mon, Jul 23, 2001 at 12:56:04AM -0700, Julian Elischer wrote: Julian Elischer wrote: Dima Dorfman wrote: [...] * A cross reference of the FreeBSD kernel well I have the source code of course, but the second is what I'm looking for except that it stopped being updated October 2000. I'm looking for a current one. oh yeah, and that one doesn't work.. try clicking on something you want to cross reference.. I'm not shure what you exactly need. With global you can simply gtags htags in a dir and enjoy the html. You have do do it for every application kernel on their own because they share identic named functions like main() and so on. The result is nice but I wouldn't call it cross reference I think devel/cscope is reasonably good. -- B.Walter COSMO-Project http://www.cosmo-project.de [EMAIL PROTECTED] Usergroup [EMAIL PROTECTED] -- Brian [EMAIL PROTECTED][EMAIL PROTECTED] http://www.freebsd-services.com/brian@[uk.]FreeBSD.org Don't _EVER_ lose your sense of humour ! brian@[uk.]OpenBSD.org To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: NFS local mount
Jonathan Chen wrote: On Thu, Jul 19, 2001 at 02:38:07PM -0400, Michael Sinz wrote: I had been meaning to ask if there was a reason why NFS mounts happened before NFS servers were started but life kept getting in the way :-) If /usr was nfs mounted on a machine, then /usr needs to be mounted before nfsd was loaded, and portmap/rpcgen lives in /usr and nfsd requires one of those. Not to mention there are probably other services loaded before nfsd which may require nfs moutned directories. In general, it is a good idea to first setup vital parts of the system (like networking or mounting directories) before offering other services (such as nfsd). Ahh, but a auto-backgrounding of NFS mounts would be nice. In (albeit old) SYSV R4 which we (my old Commodore hat) did on the Amiga UNIX project, NFS mounts would try for a bit at boot time and then switch into the background if they took too long. One could specifically ask for a mount to be hard such that it would not background under any conditions. Under normal conditions, the system had its mounts up before the rest of the RC process ran. Under poor conditions, it may end up waiting for some reasonable amount of time (was it 1 or 2 minutes - I can not remember) and then background any mounts that had not yet worked. This always let the system come up to at least admin capable level, which is important when you have a headless machine somewhere. Possible ways to fix this includes: - do nothing, let those who run these circular nfs-mount systems fix it themselves. Perhaps recommend -o bg in the handbook or something. That may be good - I still think some form of timeout and then bg option would be even better... - setup a flag, nfs_mount_delayed=YES|NO in rc.conf - do something in fstab which distingushes nfs mounts which can be delayed * a new nfs_delayed fstype [this screams EVILE HACK!], or * a new delayable option (how's that different from bg?) I see that as the timeout before bg - where it tries and tries but after some point says hey, it still is not up, lets bg this thing * overload the Pass number in fstab, nobody fscks over nfs anyway. I hate that - it feels soo bad. However, it also happens to be a good place to put in a configurable timeout for bg operation. Arg Don't do it - must not go to the dark side. -- Michael Sinz Worldgate Communications [EMAIL PROTECTED] A master's secrets are only as good as the master's ability to explain them to others. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: using syscalls in a module (stack problem ?)
I call this function with (curproc, PATH_MAX+1), and everything is fine when I have just a few local variables defined in the caller (it all works on MOD_LOAD only). However, if I have 2 buffers, 4096 bytes each, as local variables and then try to allocate userspace memory the same way, kernel crashes - sometimes inside mmap(), sometimes a bit later. Why could this happen ? Is it related to possible stack overflow ? Yes. The kernel stack is only two pages; you absolutely must not use large local variables in the kernel. I see. But I still can define them using static, right ? Regards, Eugene To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: kernel malloc
On Mon, Jul 23, 2001 at 12:37:55PM +0100, vishwanath pargaonkar wrote: Hi, thx for ur reply. i wanted to know in side kernel is there any limit to the malloc that a user can do.what you told in ur previous mail is that at a time user can malloc 4k.but No. You _can_ malloc over 4k and I never said that you could not. All I said was that if you do malloc() a buffer larger than PAGE_SIZE that the buffer will likely not be contiguous in physical memory. What that means is that your buffer may span across two non-contiguous physical pages. Usually you won't care unless you're DMAing into the buffer, or relying on the physical pages to be contiguous. suppose i am doing 2k memory allocations. how many such mallocs i can do? In the kernel, you can do as many as you want. That is, until you run out of physical memory or until you exhaust the kmem_map virtual address space, whichever comes first. is there any configuration we can do depending on our RAM size? please reply. thx vishwanath Regards, -- Bosko Milekic [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
cluster size
Hi, in freebsd can we change the cluster size from 2048 bytes.If yes how can we do that? do we have to configure in some file? TIA vishwanath To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: cluster size
On Mon, Jul 23, 2001 at 11:01:27AM -0500, Dan Nelson wrote: In the last episode (Jul 23), vishwanath pargaonkar said: in freebsd can we change the cluster size from 2048 bytes.If yes how can we do that? do we have to configure in some file? Actually, the block size is 8192 bytes by default, with fragment size of 1024 bytes. You pick the sizes when you run newfs with the -b and -f options. I think he was referring to the mbuf cluster size being 2K. In any case, I think the question is way too ambiguous to be answered properly. -- Dan Nelson [EMAIL PROTECTED] -- Bosko Milekic [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: using syscalls in a module (stack problem ?)
Just out of curiosity, Linux's kernel stack is one page. Where in the kernel source code that says that we can have two pages instead of one page kernel stack? -Zhihui On Mon, 23 Jul 2001, Eugene L. Vorokov wrote: I call this function with (curproc, PATH_MAX+1), and everything is fine when I have just a few local variables defined in the caller (it all works on MOD_LOAD only). However, if I have 2 buffers, 4096 bytes each, as local variables and then try to allocate userspace memory the same way, kernel crashes - sometimes inside mmap(), sometimes a bit later. Why could this happen ? Is it related to possible stack overflow ? Yes. The kernel stack is only two pages; you absolutely must not use large local variables in the kernel. I see. But I still can define them using static, right ? Regards, Eugene To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: cluster size
You must be asking why the mbuf cluster size is chosen as 2048, right? It is probably a tradeoff between memory efficient and speed. -Zhihui On Mon, 23 Jul 2001, [iso-8859-1] vishwanath pargaonkar wrote: Hi, in freebsd can we change the cluster size from 2048 bytes.If yes how can we do that? do we have to configure in some file? TIA vishwanath To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: using syscalls in a module (stack problem ?)
I guess this is it (/usr/src/sys/i386/i386/locore.s): 348 /* now running relocated at KERNBASE where the system is linked to run */ 349 begin: 350 /* set up bootstrap stack */ 351 movl_proc0paddr,%esp/* location of in-kernel pages */ 352 addl$UPAGES*PAGE_SIZE,%esp /* bootstrap stack end location */ where UPAGES is defined as 2 in /usr/src/sys/compile/MYKERNEL/machine/param.h 101 #define UPAGES 2 /* pages of u-area */ Regards, Weiguang From: Zhihui Zhang [EMAIL PROTECTED] To: [EMAIL PROTECTED], Eugene L. Vorokov [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: using syscalls in a module (stack problem ?) Date: Mon, 23 Jul 2001 12:07:47 -0400 (EDT) Just out of curiosity, Linux's kernel stack is one page. Where in the kernel source code that says that we can have two pages instead of one page kernel stack? -Zhihui On Mon, 23 Jul 2001, Eugene L. Vorokov wrote: I call this function with (curproc, PATH_MAX+1), and everything is fine when I have just a few local variables defined in the caller (it all works on MOD_LOAD only). However, if I have 2 buffers, 4096 bytes each, as local variables and then try to allocate userspace memory the same way, kernel crashes - sometimes inside mmap(), sometimes a bit later. Why could this happen ? Is it related to possible stack overflow ? Yes. The kernel stack is only two pages; you absolutely must not use large local variables in the kernel. I see. But I still can define them using static, right ? Regards, Eugene To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: using syscalls in a module (stack problem ?)
Make sense. But there are other things in the UPAGES. -Zhihui On Mon, 23 Jul 2001, Weiguang SHI wrote: I guess this is it (/usr/src/sys/i386/i386/locore.s): 348 /* now running relocated at KERNBASE where the system is linked to run */ 349 begin: 350 /* set up bootstrap stack */ 351 movl_proc0paddr,%esp/* location of in-kernel pages */ 352 addl$UPAGES*PAGE_SIZE,%esp /* bootstrap stack end location */ where UPAGES is defined as 2 in /usr/src/sys/compile/MYKERNEL/machine/param.h 101 #define UPAGES 2 /* pages of u-area */ Regards, Weiguang From: Zhihui Zhang [EMAIL PROTECTED] To: [EMAIL PROTECTED], Eugene L. Vorokov [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: using syscalls in a module (stack problem ?) Date: Mon, 23 Jul 2001 12:07:47 -0400 (EDT) Just out of curiosity, Linux's kernel stack is one page. Where in the kernel source code that says that we can have two pages instead of one page kernel stack? -Zhihui On Mon, 23 Jul 2001, Eugene L. Vorokov wrote: I call this function with (curproc, PATH_MAX+1), and everything is fine when I have just a few local variables defined in the caller (it all works on MOD_LOAD only). However, if I have 2 buffers, 4096 bytes each, as local variables and then try to allocate userspace memory the same way, kernel crashes - sometimes inside mmap(), sometimes a bit later. Why could this happen ? Is it related to possible stack overflow ? Yes. The kernel stack is only two pages; you absolutely must not use large local variables in the kernel. I see. But I still can define them using static, right ? Regards, Eugene To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
RE: jmp after setting PE?
On 21-Jul-01 Weiguang SHI wrote: Hi, Please forgive me if this seems too easy. http://people.freebsd.org/~jhb/386htm/s10_03.htm; says: Immediately after setting the PE flag, the initialization code must flush the processor's instruction prefetch queue by executing a JMP instruction. The 80386 fetches and decodes instructions and addresses before they are used; however, after a change into protected mode, the prefetched instruction information (which pertains to real-address mode) is no longer valid. A JMP forces the processor to discard the invalid information. /home/src/sys/i386/i386 says: 329 /* Now enable paging */ 330 movlR(_IdlePTD), %eax 331 movl%eax,%cr3 /* load ptd addr into mm 332 movl%cr0,%eax /* get control word */ 333 orl $CR0_PE|CR0_PG,%eax /* enable paging */ 334 movl%eax,%cr0 /* and let's page NOW! * 335 336 #ifdef BDE_DEBUGGER 337 /* 338 * Complete the adjustments for paging so that we can keep tracing throu 339 * initi386() after the low (physical) addresses for the gdt and idt bec 340 * invalid. 341 */ 342 callbdb_commit_paging 343 #endif 344 345 pushl $begin /* jump to high virtuali 346 ret We are already in protected mode when the kernel starts (the boot blocks call us from protected mode) so this isn't turning on the PE bit. Line 333 is somewhat misleading (the comment is more accurate) and should probably read: orl $CRO_PG,%eax If PE isn't on by the time we get here we would have blown up by now anyways. -- John Baldwin [EMAIL PROTECTED] -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc Power Users Use the Power to Serve! - http://www.FreeBSD.org/ To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Estimado Usuario
Filtrar el agua de bebida incrementa nuestra calidad de vida. La mayoria de los malos sabores, olores y turbidez presente en el agua potable son causados por la presencia de cloro y materiales orgnicos. El cloro utilizado muy eficazmente para potabilizar el agua de bebida, es causal del mal sabor y en mayor cantidad es perjudicial para la salud. El material orgnico presente en tanques y caerias de agua corrientes (residuos de hojas, insectos, etc.) le agregan al agua turbidez y mal sabor. Tambin tenemos la combinacin del material orgnico con el cloro, formando los peligrosos Trihalometanos (THM), compuesto altamente txico. La forma mas simple y efectiva para remover tanto el cloro como el material orgnico y los THM es mediante el pasaje del agua a travs de un filtro purificador (*) con lecho de carbn activado. (*) CUNO posee mas de 90 aos de experiencia en purificacin y filtracin de agua, y provee filtros de agua a empresas como Mc Donald's en Argentina y en el mundo. Si quiere recibir ms informacin sobre este tema comunquese al 011- 4555-6050 o desde el interior sin cargo al 0800-222-6392 Gracias. NeWater Argentina Purificacin de agua para empresas y hogares Charlone 516 , Buenos Aires, Argentina tel: 011-4555-6050(rot.) email: [EMAIL PROTECTED] Si usted no desea recibir mas informacin nuestra envenos un email con asunto "Borrar". Gracias. Produced by La Jolla Advertiding Co., CA, USA To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
MPP and new processor designs.
A number of new chips have been released lately, along with some enhancements to existing processors that all fall into the same logic of parallelizing some operations. Why, just today I ran across an article about http://www.theregister.co.uk/content/3/20576.html, which bosts 128 ALU's on a single chip. This got me to thinking about an interesting way of using these chips. Rather than letting the hardware parallelize instructions from a single stream, what about feeding it multiple streams of instructions. That is, treat it like multiple CPU's running two (or more) processes at once. I'm sure the hardware isn't quite designed for this at the moment and so it couldn't just be done, but if you had say 128 ALU's most single user systems could dedicate one ALU to a process and never context switch, in the traditional sense. For systems that run lots of processors the rate limiting on a single process wouldn't be a big issue, and you could gain lots of effiencies in the global aspect by not context-switching in the traditional sense. Does anyone know of something like this being tried? Traditional 2-8 way SMP systems probably don't have enough processors (I'm thinking 64 is a minimum to make this interesting) and require other glue to make multiple independant processors work together. Has anyone tried this with them all in one package, all clocked together, etc? -- Leo Bicknell - [EMAIL PROTECTED] Systems Engineer - Internetworking Engineer - CCIE 3440 Read TMBG List - [EMAIL PROTECTED], www.tmbg.org To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: MPP and new processor designs.
You are talking about CMP (chip multi-processor) or SMT (Simultaneous Multi-Threading)!! Please look at the design of IBM Power4. Rayson --- Leo Bicknell [EMAIL PROTECTED] wrote: A number of new chips have been released lately, along with some enhancements to existing processors that all fall into the same logic of parallelizing some operations. Why, just today I ran across an article about http://www.theregister.co.uk/content/3/20576.html, which bosts 128 ALU's on a single chip. This got me to thinking about an interesting way of using these chips. Rather than letting the hardware parallelize instructions from a single stream, what about feeding it multiple streams of instructions. That is, treat it like multiple CPU's running two (or more) processes at once. I'm sure the hardware isn't quite designed for this at the moment and so it couldn't just be done, but if you had say 128 ALU's most single user systems could dedicate one ALU to a process and never context switch, in the traditional sense. For systems that run lots of processors the rate limiting on a single process wouldn't be a big issue, and you could gain lots of effiencies in the global aspect by not context-switching in the traditional sense. Does anyone know of something like this being tried? Traditional 2-8 way SMP systems probably don't have enough processors (I'm thinking 64 is a minimum to make this interesting) and require other glue to make multiple independant processors work together. Has anyone tried this with them all in one package, all clocked together, etc? -- Leo Bicknell - [EMAIL PROTECTED] Systems Engineer - Internetworking Engineer - CCIE 3440 Read TMBG List - [EMAIL PROTECTED], www.tmbg.org To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: A full source-tour somewhere?
I think what you need is http://current.jp.FreeBSD.org/tour/ -- FUJISHIMA Satsuki At Mon, 23 Jul 2001 00:04:15 -0700, Julian Elischer wrote: At one stage at whistle we had the kernel fully cross-referenced using the 'global' program (now in ports) which produced a website that could be browsed to find 'all the callers of xxx()' etc. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
passing function ptrs to syscalls
Hello, I'm writing a system call which requires a function pointer as an argument, In syscalls.master, it is specified as such: 366 STD BSD { int prfw_inject_fp(int sl, int synum, pid_t pi d, int (*fp)() ); } However, when I try compiling the kernel, sysproto complains In file included from ../../kern/imgact_shell.c:31: ../../sys/sysproto.h:1038: unterminated macro call ../../sys/sysproto.h:1449: warning: preprocessing directive not recognized within macro arg ../../sys/sysproto.h:1449: warning: preprocessing directive not recognized within macro arg ../../sys/sysproto.h:1449: warning: preprocessing directive not recognized within macro arg ../../sys/sysproto.h:1449: warning: preprocessing directive not recognized within macro arg ../../sys/sysproto.h:9: unterminated `#if' conditional In file included from ../../kern/imgact_shell.c:31: ../../sys/sysproto.h:1038: syntax error before `)' ../../sys/sysproto.h:1275: undefined or invalid # directive ../../sys/sysproto.h:1444: undefined or invalid # directive ../../sys/sysproto.h:1448: undefined or invalid # directive ../../sys/sysproto.h:1449: syntax error before `)' What definition should I use? Thanks, Evan -- --- Evan Sarmiento | www.open-root.org [EMAIL PROTECTED] | www.sekt7.org/~ems/ --- To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
RE: jmp after setting PE?
On 23-Jul-01 Weiguang SHI wrote: Thanks. I think I've found it in btx.s: 213 mov %eax,%cr0 # 214 ljmp $SEL_SCODE,$init.8 # To 32-bit code 215 .code32 216 init.8: xorl %ecx,%ecx # Zero And there IS this ljmp. Yes. Well, this BTX thing is amazing: all this effort, (btxld, run-time library crt0.o, loader, etc.) seems to just to provide a 32-bit protected and possibly paging-enabled environment to start the kernel/loader(and to confuse a new-comer like me.) What are the other gains? Where can I found more info about this BTX before going through the ultimate source code? (I've search the mailing-lists.) That's its purpose, to provide a mini-kenrel for the loader so we can write the loader in C and not assembly. (gcc doesn't do well with generating code for real mode). -- John Baldwin [EMAIL PROTECTED] -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc Power Users Use the Power to Serve! - http://www.FreeBSD.org/ To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
RE: passing function ptrs to syscalls
On 23-Jul-01 Evan Sarmiento wrote: Hello, I'm writing a system call which requires a function pointer as an argument, In syscalls.master, it is specified as such: The kernel has no business executing untrusted code from userland. Use a kernel module to add code to the kernel. Either that or rethink how you are doing this. -- John Baldwin [EMAIL PROTECTED] -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc Power Users Use the Power to Serve! - http://www.FreeBSD.org/ To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
No Subject
Hello I am experimenting with kernel modules and am trying to write to a file. This is the syscall function (sorry of my terminology is messed up) static int write_file(struct proc *p, void *arg) { struct write_args *wstructure; struct open_args *ostructure; ostructure-path=/tmp/blehfile; ostructure-flags = O_CREAT; ostructure-mode = 0; wstructure-fd = open(p, ostructure); wstructure-buf = Testing\n; wstructure-nbytes = 8; return write(p, wstructure); } Im not sure why, but that code crashes. Was created with: echo Hi /tmp/blehfile. Also, is there an official freebsd kernel hackers guide? Kernel programming is very interesting. ;-) To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
No Subject
Hello I am experimenting with kernel modules and am trying to write to a file. This is the syscall function (sorry of my terminology is messed up) static int write_file(struct proc *p, void *arg) { struct write_args *wstructure; struct open_args *ostructure; ostructure-path=/tmp/blehfile; ostructure-flags = O_CREAT; ostructure-mode = 0; wstructure-fd = open(p, ostructure); wstructure-buf = Testing\n; wstructure-nbytes = 8; return write(p, wstructure); } Im not sure why, but that code crashes. Was created with: echo Hi /tmp/blehfile. Also, is there an official freebsd kernel hackers guide? Kernel programming is very interesting. ;-) To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: your mail
* [EMAIL PROTECTED] [EMAIL PROTECTED] [010723 19:47] wrote: Hello I am experimenting with kernel modules and am trying to write to a file. This is the syscall function (sorry of my terminology is messed up) static int write_file(struct proc *p, void *arg) { struct write_args *wstructure; struct open_args *ostructure; ostructure-path=/tmp/blehfile; ostructure-flags = O_CREAT; ostructure-mode = 0; wstructure-fd = open(p, ostructure); wstructure-buf = Testing\n; wstructure-nbytes = 8; return write(p, wstructure); } Im not sure why, but that code crashes. Was created with: echo Hi /tmp/blehfile. Also, is there an official freebsd kernel hackers guide? Kernel programming is very interesting. ;-) The args to open() in the kernel are expected to point to a user address, so you have a couple of options: a) point your in kernel vmspace at the kernel b) copy your args into userspace using copyout and use those addresses there's no official guide, however if you pick up a couple of non-vendor specific OS programming textbooks you should have more fun. please use a more descriptive subject line, using an empty subject is likely to get your mail skipped over, also please do not send to the list more than once if possible. and lastly... check your damn return values, honestly! :) -- -Alfred Perlstein [[EMAIL PROTECTED]] Ok, who wrote this damn function called '??'? And why do my programs keep crashing in it? To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
pkg_add puzzlement
I've been using this in a PLIST: 1 @exec test -d %D/var/run/procstates || mkdir -p %D/var/run/procstates 2 @exec chown root.wheel %D/var/run/procstates chmod 1775 %D/var/run/procstates The rationale for each line: - 1 Install: make sure that the directory exists, avoiding error messages if an earlier instance of the package is on the machine. - 2 Install: make sure directory has correct permissions. For some reason, there are machines where the package is added, but /var/run/procstates does not get created. pkg_add has no complaints. I've looked at the package, root's login environment, and the pkg_add source code, but I don't see any reason for this anomaly. Suggestions, anyone? Thanks, Romain To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: your mail
On 23 Jul 2001 [EMAIL PROTECTED] wrote: static int write_file(struct proc *p, void *arg) { struct write_args *wstructure; struct open_args *ostructure; ostructure-path=/tmp/blehfile; ostructure-flags = O_CREAT; ostructure-mode = 0; wstructure-fd = open(p, ostructure); #1 bad form calling syscalls like this within the kernel -- just doesnt make sense #2 open(2) will attempt to do a copyinstr rather than a copystr and that is not correct. wstructure-buf = Testing\n; wstructure-nbytes = 8; return write(p, wstructure); } same idea with this write function and the buf parameter. Im not sure why, but that code crashes. Was created with: echo Hi /tmp/blehfile. Also, is there an official freebsd kernel hackers guide? Kernel programming is very interesting. ;-) While it's not the best, check out: http://www.daemonnews.org/200010/blueprints.html Andrew *-. | Andrew R. Reiter | [EMAIL PROTECTED] | It requires a very unusual mind | to undertake the analysis of the obvious -- A.N. Whitehead To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Invoking a userland function from kernel
Dear Friends I'm incorporating the Real Time Protocol RTP (rfc 1889) to FreeBSD 4.0 kernel. Months ago, I compiled successfully the RTP Library API developed by Lucent into the FreeBSD kernel with the right logical and technical adjustments for the BSD kernel of course (copyin, copyout, malloc, etc). I have changed many of the original API library functions to kernel systems calls, and it works fine. Now, I need invoke a userland function with several parameters from the a function into the kernel. How I can do? Do you know a example? I need to do this : /* In the kernel function - */ void MyKernelFuntion(){ int id; void *opaque; struct timeval *tp; /* ... */ MyUserlandFunction (id, opaque, tp); /* ... */ } /* In the userland - */ void MyUserlandFunction (int id, void *opaque, struct timeval *tp) int value = id * K + P; /* ... */ return; } /* - end - */ I don't need return data from userland function to kernel later. Well, MyKernelFunction() is only invoked for system calls that the userland process with MyUserlandFunction() have done before, of course. In other words, MyUserlandFuntion() is into the same userland process that invoke the system calls that call to MyKernelFunction(). Thanks for your help. ++ YONNY CARDENAS B. Systems Engineer [EMAIL PROTECTED] Student M.Sc. UNIVERSIDAD DE LOS ANDES Santafe de Bogota D.C Colombia - South America To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: pkg_add puzzlement
++ 23/07/01 18:21 -0700 - Romain Kang: | I've been using this in a PLIST: | | 1 @exec test -d %D/var/run/procstates || mkdir -p %D/var/run/procstates | 2 @exec chown root.wheel %D/var/run/procstates chmod 1775 %D/var/run/procstates [nitpick: you should use chown root:wheel] | | The rationale for each line: | - 1 Install: make sure that the directory exists, avoiding error messages | if an earlier instance of the package is on the machine. Just curious, but isn't this a bit redundant? mkdir -p will never return an error, so you don't have to worry if the directory already exists. | - 2 Install: make sure directory has correct permissions. | | For some reason, there are machines where the package is added, but | /var/run/procstates does not get created. pkg_add has no complaints. I did a real quick test, and noticed the same thing. But like I said above, just @exec mkdir -p should do the trick in this case. -pete -- Pete Fritchman [EMAIL PROTECTED] Databits Network Services, Inc. http://databits.net finger [EMAIL PROTECTED] for PGP key To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: cluster size
Hi, In case you are talking about mbuf clusters, then you will find the size mentioned in sys/mbuf.h. ( Just curious, why would you want to change the cluster size ?) Cheers __srp On Mon, 23 Jul 2001, [iso-8859-1] vishwanath pargaonkar wrote: Hi, in freebsd can we change the cluster size from 2048 bytes.If yes how can we do that? do we have to configure in some file? TIA vishwanath To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
review: sparc64 port commit candidate
Hello, Below are links to the sparc64 port I've been working on, which I'd like to commit. The way I started the port was to make stub versions of all the machine dependent functions in the kernel, which panic with an informative message when called. Given minimal startup code and console support it should be trivial to make this compile and run the first few sysinits (print the copyright message etc) on almost any architecture. Several people have suggested that I commit this first, followed by the rest of the code and changes. Currently the port gets through all the sysinits and the first context switch, and dies trying to copyout to init's address space (which isn't fully implemented yet :)). The early port is here: http://people.freebsd.org/~jake/sparc64-early.tgz The current code is here: http://people.freebsd.org/~jake/sparc64-current.tgz http://people.freebsd.org/~jake/sparc64.diff and here is a dump of how far it gets: http://people.freebsd.org/~jake/tip.record This isn't really ready for mass consumption yet, as there's no official loader and you need to build a cross compiler yourself, but its a start. Jake To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: review: sparc64 port commit candidate
* Jake Burkholder [EMAIL PROTECTED] [010724 00:34] wrote: Hello, Below are links to the sparc64 port I've been working on, which I'd like to commit. The way I started the port was to make stub versions of all the machine dependent functions in the kernel, which panic with an informative message when called. Given minimal startup code and console support it should be trivial to make this compile and run the first few sysinits (print the copyright message etc) on almost any architecture. Several people have suggested that I commit this first, followed by the rest of the code and changes. That would be excellent. Currently the port gets through all the sysinits and the first context switch, and dies trying to copyout to init's address space (which isn't fully implemented yet :)). h0h0, go ahead, people may step up to bat with this. :) The early port is here: http://people.freebsd.org/~jake/sparc64-early.tgz The current code is here: http://people.freebsd.org/~jake/sparc64-current.tgz http://people.freebsd.org/~jake/sparc64.diff and here is a dump of how far it gets: http://people.freebsd.org/~jake/tip.record This isn't really ready for mass consumption yet, as there's no official loader and you need to build a cross compiler yourself, but its a start. This was actually the hardest thing or at least the major hurdle I faced when I attempted to do a port, perhaps you can put the cross compiler up as a tarball/package so that people don't have to deal with setting up the cross compiler? -- -Alfred Perlstein [[EMAIL PROTECTED]] Ok, who wrote this damn function called '??'? And why do my programs keep crashing in it? To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message
Re: your mail
Alfred Perlstein [EMAIL PROTECTED] writes: * [EMAIL PROTECTED] [EMAIL PROTECTED] [010723 19:47] wr ote: Hello I am experimenting with kernel modules and am trying to write to a file. This is the syscall function (sorry of my terminology is messed up) static int write_file(struct proc *p, void *arg) { struct write_args *wstructure; struct open_args *ostructure; Notice how you (the originator) never allocated memory for these structures, so this assignment: ostructure-path=/tmp/blehfile; dereferences junk on the stack. Once you've fixed that, of course, you'll have to fix all the issues Alfred and Andrew told you about. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-hackers in the body of the message