Padding in gcc

2007-07-09 Thread Rajat Jain
Hi, Perhaps a little offtopic but no harm in trying ... Can we always rely on the fact that gcc will pad the following structure? typedef struct { int descrp; SYSCALL64_STRUCT_ATTR; (Automatic padding here?) long long pos; SYSCALL64_STRUCT_ATTR; int mode;

RE: Padding in gcc

2007-07-09 Thread Rajat Jain
Hi, Can we always rely on the fact that gcc will pad the following structure? typedef struct { int descrp; SYSCALL64_STRUCT_ATTR; (Automatic padding here?) long long pos; SYSCALL64_STRUCT_ATTR; int mode;SYSCALL64_STRUCT_ATTR; } lseek64_t; What is the

RE: what is the advantage of loading and unloading device drivers, apart from memory savings?

2007-07-25 Thread Rajat Jain
Hi, How / where do you specify the module load ordering? Perhaps modules.dep ? I thought that is only for specifying dependencies among modules. Could someone clarify? Thanks, Rajat

RE: Jiffies, Clock_per_tick ..

2007-07-27 Thread Rajat Jain
[EMAIL PROTECTED] wrote: Hello, The kernel needs both the 'jiffies' as well as the 'clocks_per_tick'. Why? Shouldn't one variable be enough to calcuate time? What do both these variable precisely mean? Hi, Which kernel version are you talking about? I could not find that sysmbol in

preempt_disable() - disables preemption on all processors?

2007-09-28 Thread Rajat Jain
Hi list, Does the preempt_disable() disable preemption on all the processors or just the current processor? Thanks, Rajat -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to [EMAIL PROTECTED] Please read the FAQ at http://kernelnewbies.org/FAQ

RE: SCSI drivers

2007-10-04 Thread Rajat Jain
http://lxr.linux.no/source/Documentation/scsi/scsi_mid_low_api.txt On 10/2/07, Onkar [EMAIL PROTECTED] wrote: I want to learn to write SCSI drivers. For which i want to make a simple setup at home. Please guide me with some ideas as to how I can learn to write such drivers (devices needed

RE: jiffies - Where does it get updated in the Kernel ?

2007-10-06 Thread Rajat Jain
Hi, I'm currently at the start_kernel() routine stuck in an infinite loop inside of a call to calibrate_delay(). The kernel is spinning inside of while( ticks == jiffies ) in the following snippet from init/calibrate.c: printk(KERN_DEBUG Calibrating delay loop... ); while

RE: how to list the PCI support in a running kernel?

2007-10-17 Thread Rajat Jain
Hi, a friend asks the following question: how can you list the PCI support that's *built in* to a given running kernel? allegedly, he wants to know if it's possible to move a kernel from one system to another (mostly similar) system, and know that the additional HW on that second system

RE: my global variable generates unresolved symbols

2007-11-14 Thread Rajat Jain
Everything seams to go OK (make clean; make mrproper: make menuconfig; make bzImage; make modules) until the make modules_install where it complains of Unresolved symbol (my global variable) in a list of modules that uses the function of string.h that I changed. Use EXPORT_SYMBOL() -- To

RE: RTC Driver in Linux

2007-11-14 Thread Rajat Jain
hi kernelnewbies, Whether the Major and minor numbers depends RTC or can we any random number. You need to allocate major and minor number for your device (alloc_chrdev_region()). Thanks, Rajat -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to

RE: Ethernet Driver: Transmitted Packets not received by receiver

2007-11-16 Thread Rajat Jain
Hi, The way I tested it - 1. I pinged from a remote machine. My driver received an ARP request. I filled up the response and sent it back. When transmission is done I got Transmit interrupt (no error). But on the remote machine, typing 'arp -a' I get an entry for my driver's machine with

RE: How to bring up a board.

2007-11-21 Thread Rajat Jain
Dare all, Thanking you in advance How to bring up the Hynix board. Using escalator? :-) -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to [EMAIL PROTECTED] Please read the FAQ at http://kernelnewbies.org/FAQ

RE: Question about request IRQ handler

2007-11-21 Thread Rajat Jain
Hi, I know request_irq is used to register our interrupt handler function. But I found some embedded system use below two functions to replace request_irq This is low level code that is taken care by request_irq() for you. For your driver puposes you should use request_irq() only.

RE: Question regarding User Space and the Kernel

2007-11-21 Thread Rajat Jain
Original Message From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Mulyadi Santosa Sent: Wednesday, November 21, 2007 9:49 AM To: Sikandar Khan Cc: kernelnewbies Subject: Re: Question regarding User Space and the Kernel Hi... 1) Can the kernel access User Address Space. Yes

RE: Memory mapping a UART

2007-12-07 Thread Rajat Jain
Hi, Anyone got any ideas? I've found some functions, ioremap, kmap and mem_request_region. Not really sure what I ought to be doing though. Any thoughts greatly appreciated. You need request_mem_region(). Thanks, Rajat -- To unsubscribe from this list: send an email with unsubscribe

RE: synchronize user kernel spaces

2007-12-12 Thread Rajat Jain
Hi, Are user space device drivers what you're looking for? http://lwn.net/Articles/232575/ http://lwn.net/Articles/127698/ http://lwn.net/Articles/198202/ http://lwn.net/Articles/66829/ Thanks, Rajat -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to [EMAIL

RE: synchronize user kernel spaces

2007-12-13 Thread Rajat Jain
- Original Message - From: Rajat Jain [EMAIL PROTECTED] To: Sumudu Nishantha [EMAIL PROTECTED]; kernelnewbies@nl.linux.org Sent: Thursday, December 13, 2007 9:15 PM Subject: RE: synchronize user kernel spaces Hi, Instead of looping forever in the user space, you could

RE: initrd image ??

2008-01-21 Thread Rajat Jain
Original Message From: Onkar [mailto:[EMAIL PROTECTED] Sent: Monday, January 21, 2008 12:31 PM To: Rajat Jain Subject: Re: initrd image ?? Rajat, That is exactly the case. It is obvious . for instance If I see initrd image of non-Xen patched (call it pristine in this context

RE: Copy-on-Write

2008-02-06 Thread Rajat Jain
Hi, I had read that the operating systems that use copy-on-write mechanism for fork(), it is better if they deliberately allow the CHILD to run first. This would be better because in 99% of the cases child will call exec() and the new address space will be allocated. Instead if the

RE: What is page_alloc.c's bad_page() function?

2008-02-06 Thread Rajat Jain
Hi, static void bad_page(struct page *page) { printk(KERN_EMERG Bad page state in process '%s'\n KERN_EMERG page:%p flags:0x%0*lx mapping:%p mapcount:%d count:%d\n KERN_EMERG Trying to fix it up, but a reboot is needed\n KERN_EMERG

RE: Location of syscall wrappers

2008-02-07 Thread Rajat Jain
Hi, Use syscall(SYSTEM_CALL_NUMBER, arg1, arg2, arg3); _syscall3() macro are are not supported nowadays. http://lkml.org/lkml/2007/7/5/314 Who is supposed to provide syscall()?? C library? Where do I find its definition (not declaration)? What is an application supposed to do if it

RE: Permanent HD spindown?

2008-02-11 Thread Rajat Jain
Hi, It sounds like what you are doing is pretty dangerous think about it, you are telling the drive to spin down and then an app tries to access the drive and it spins up again. if the drive failes to spin up (because you have been successful), the app is going get a read failed, leaving

ISR may be called with interrupts enabled (Was:Use of IRQF_DISABLED along with IRQF_SHARED)

2008-02-10 Thread Rajat Jain
Hi, Was wondering if I did not frame my question appropriately? Or it there a better place to discuss this? Thanks, Rajat This is regarding the following code in kernel/irq/handle.c. Consider the case of a shared IRQ line, where two handlers are registered such that first handler does

RE: Use of IRQF_DISABLED along with IRQF_SHARED

2008-02-10 Thread Rajat Jain
Original Message From: Peter Teoh [mailto:[EMAIL PROTECTED] Sent: Friday, February 08, 2008 8:11 PM To: Rajat Jain Cc: kernelnewbies@nl.linux.org; [EMAIL PROTECTED] Subject: Re: Use of IRQF_DISABLED along with IRQF_SHARED sorry, i am also quite confused the caller of your function

RE: assembly IDE

2008-02-12 Thread Rajat Jain
Hi... On Feb 12, 2008 7:47 PM, vichy [EMAIL PROTECTED] wrote: Could someone tell or suggest me where I can get any IDE that he think suitable to trace both c and assembly, no matter freeware or not. Ehm, how about Vim + gdb? Or if looks matter, ddd! Thanks, Rajat -- To unsubscribe

RE: process / thread stack

2008-03-04 Thread Rajat Jain
Yes. From: [EMAIL PROTECTED] on behalf of Wu Yu Sent: Tue 04-Mar-08 8:30 PM To: Mauricio Mauad Menegaz Filho Cc: Vijay Chauhan; kernelnewbies@nl.linux.org Subject: Re: process / thread stack So, if threads share the same address space, does it mean that they

RE: Reg Kernel Configuration parameters

2008-03-05 Thread Rajat Jain
From: [EMAIL PROTECTED] on behalf of emani murali Sent: Wed 05-Mar-08 11:08 AM To: kernelnewbies@nl.linux.org Subject: Reg Kernel Configuration parameters Hi,, For setting kernel config parameters, is the method of changing them in make menuconfig the only way

Memory defragmentor in linux?

2008-03-12 Thread Rajat Jain
Hi, As the system stays up for longer time, the physical memory becomes fragmented (external fragmentation) such that physically continuous pages may be difficult to find.Is there any kind of memory defragmentor mechanism built in linux (Like disk defragmentor) that helps solves such issues?

RE: question about SCSI commands

2008-03-24 Thread Rajat Jain
Hi, I think it represents the size of the command, and not size of data transferred. Thanks, Rajat -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of vichy Sent: Tuesday, March 18, 2008 11:31 AM To: '??' Cc: kernelnewbies@nl.linux.org Subject: RE:

Detect Stack Overflows?

2008-03-24 Thread Rajat Jain
Hi, Is there a way to detect stack overflows in the kernel? I mean, apart from You should use it sparingly suggestions :-). Thanks, Rajat -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to [EMAIL PROTECTED] Please read the FAQ at http://kernelnewbies.org/FAQ

RE: Detect Stack Overflows?

2008-03-24 Thread Rajat Jain
Hi, Kernel configuration has an option to check for stack overflows under kernel hacking section. Is that what you are looking for ? grep your .config for DEBUG_STACKOVERFLOW Thanks, that it what I was looking for. Rajat -- To unsubscribe from this list: send an email with unsubscribe

RE: starting function for kernel process

2008-03-31 Thread Rajat Jain
Hi, As for every program there will be start function( ie main). What is the starting function for kerenl process , ie similarly main(). Do you mean the entry point for the kernel image (The first instruction that gets executed)? That will be in architecture specific, will be written

RE: how to tell if my kernel is SMP enabled?

2008-04-01 Thread Rajat Jain
Checking for CONFIG_SMP (Assuming kernel .config CONFIG_IKCONFIG_PROC is set)? From: [EMAIL PROTECTED] on behalf of Robert P. J. Day Sent: Tue 01-Apr-08 9:45 PM To: Kernel Newbies Subject: how to tell if my kernel is SMP enabled? a simple one this time --

RE: semaphore locks

2008-04-08 Thread Rajat Jain
Hi, What happens if someone does not follow the standard protocol as in the example above? Locks and semaphores are totally ADVISORY VOLUTARY. They are not enforced. So if some one decides to throw away the recommended usage, he's heading for race conditiions or deadlocks. Thanks, Rajat

RE: Working of spinlock_irqsave

2008-04-09 Thread Rajat Jain
Hi, Will this work for multiple writers to solve: * contention between ISR and write * contention between 2 or more writers In the write() method: Grab spin_lock_irq Copy from interrupt buffer to local buffer spin_unlock_irq copy_to_user from local buffer If so, How? How is it

RE: Working of spinlock_irqsave

2008-04-10 Thread Rajat Jain
Hi, It will work only if you are absolutely sure that interrupts will be enabled when this code gets executed. If you are not sure about the current state of interrupts when you are trying to grab a spinlock, use spin_lock_irqsave(). This will be more clearer below: I understand that

RE: kernel preemption does not work

2008-04-10 Thread Rajat Jain
Hi, Test code: -- read() { if(down_interruptible()) return error; mdelay(1); up(); } With this code in place, I try to do a 'CTRL+C' when it hangs at that delay. It does not respond to my 'CTRL + C'. Where am I missing the preemption thing in

RE: schedular..

2008-04-16 Thread Rajat Jain
Hi, I'll add my 10 cents in addition to what others have already said... Who schedule the schedular? I mean , let linux uses round-robin scheduling policy, with some time slice say 'x'. So process can run upto x time slice and if not finished it is preemted and schedular schedule another

RE: memory allocation when allocating pages

2008-04-18 Thread Rajat Jain
Hi Wang, As the program needs, it continues to invoke alloc_pages to get pages to use. But when the machine's free memory drops to a certain value, the alloc_pages will cause the system to crash.I want to ask if there is some mechanism to block the process of alloc_pages until there is

i386 - x86?

2008-04-22 Thread Rajat Jain
Hi, I recently had to look into the i386 code and realized that the i386 directory has been disappeared and x86 has appeared. So has it simply been renamed or are there any other source level reorganization? Thanks, Rajat -- To unsubscribe from this list: send an email with unsubscribe

RE: errors from booting from a custom built kernel

2008-05-04 Thread Rajat Jain
Hi, help here? Is it possible that the config file of the installed RH8.0, which is /boot/config-2.4.18-14, includes too much or too little configuration that the custom built kernel is not fully working? Yes the configuration may be inappropriate depending upon how much the the running

RE: EXPORT_SYMBOL Vs extern?

2008-05-05 Thread Rajat Jain
Hi, Is it a compulsion for a function which need to be used in any other source file, exported through EXPORT_SYMBOL only? Does this means all the places in kernel(and there are loads of them), where a function is non-static and is used in other source files should actually be using

RE: Allocation Memory

2008-05-12 Thread Rajat Jain
Hi, The elf image of your application contains enough information on the amount of memory needed for it to be loaded. The dynamic memory needed (for stack growth / runtime allocations) are done dynamically as the stack and heap can grow and shrink as needed. Thanks, Rajat -- To

RE: kthread_create() vs tasklet

2008-05-13 Thread Rajat Jain
Hi, On Wed, May 7, 2008 at 12:55 PM, Peter Teoh [EMAIL PROTECTED] wrote: Not sure whybut under the drivers directory, u can see a lot more tasklet than kthread_create(). Huh? I'm not sure if I understand this right ... But I thought they are completely different

RE: Compiling a particular directory in source tree

2008-05-13 Thread Rajat Jain
Is there a way by which I can compile only a particular directory under kernel source tree after making changes in it ? I don't want to compile the full kernel after making a small change. Just specify the directory you want to build at the command line. For E.g: make drivers/net/irda/

RE: Install kernel headers

2008-05-21 Thread Rajat Jain
Hi, I simple question: How do you install kernel headers? make headers_install Thanks, Rajat -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to [EMAIL PROTECTED] Please read the FAQ at http://kernelnewbies.org/FAQ

RE: Install kernel headers

2008-05-21 Thread Rajat Jain
Hi, # make headers_install make: *** No rule to make target `headers_install'. Stop. I downloaded 2.6.15.7 vanilla from kernel.org, unpacked it and ran make defconfig. Nothing else :) Cheers, Konstantin IIRC it was called make hinstall on the older kernels ... make headers_install

RE: Module loading and Unloading

2008-05-27 Thread Rajat Jain
Message- From: Rajat Jain [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 27, 2008 7:09 PM To: Vivek Kumar Gupta; kernelnewbies Subject: RE: Module loading and Unloading Hi Vivek, What you are trying to do is very unclear. 1. Is there a way of exporting symbol kernel? Ofcourse

RE: Thread scheduling

2008-05-28 Thread Rajat Jain
Hi, How does scheduling of multiple threads in a thread group happen? I remember reading that each process has a single mm_struct. I assumed that all threads would share the same mm_struct and that scheduling will be based on these mm_structs. nope, scheduling is generally based on

RE: Module loading and Unloading

2008-05-28 Thread Rajat Jain
Hi Vivek, I just want solution of Module A exports symbol x and module B uses it. Now you want to be able to load module B irrespective of whether module A is loaded or not If any one have any things please please share .. My question remains still valid. Since module B needs

RE: how to get current cs:eip value for some process while it is in kernel mode?

2008-06-04 Thread Rajat Jain
Hallo Group Members Is it possible? You can write inline assembly to get that. Although, I'm sure you realize that it will have changed by the time you get to use it. :-) Thanks, Rajat -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to [EMAIL PROTECTED]

RE: Help needed in deciphering strace Output

2008-06-09 Thread Rajat Jain
Hi, getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Process 826 detached What you can gather from this log is that most likely your application tried to access a memory it shouldn't

RE: list of fuctions defined and exported by a library

2008-06-17 Thread Rajat Jain
Hi, greping the output of the two commands above for func did not help because it ended up showing internals functions which it uses but does not define ( something like puts ). I think what you have done should work. The reason you are seeing some extra symbols is because perhaps they are

RE: How to compile only single driver in kernel source

2008-06-24 Thread Rajat Jain
Just specify which driver you want to build. For e.g: make drivers/scsi/qla2xxx/ Thanks, Rajat -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to [EMAIL PROTECTED] Please read the FAQ at http://kernelnewbies.org/FAQ

Ethernet driver (MAC connected to switch instead of PHY)

2008-06-30 Thread Rajat Jain
Hi, Perhaps not a relevant question on this list, but still trying before posting on linux-net: I'm doing a network driver for the MPC8313E-rdb board, which has 2 ethernet MACs. I'm successfully able to bring up the second MAC that is connected to a Marvell PHY (and hence has a given phy

RE: getting panic during kmalloc

2008-07-02 Thread Rajat Jain
Hi, Although kmalloc() gives you 24 bytes per call that you can use, but internally it allocates in pages, and hence 1 page (=4K bytes in each iteration) HTH, Rajat From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of gagan grover

RE: Question on functions related to swapping in pages.

2008-07-21 Thread Rajat Jain
Hi, Also, how can I know by looking at the kernel code if a function is preemptible or not ? You cannot. It is a run time property. So it is theoritically possible (although not quite likely) that one process calls the function while holding a spinlock (making it non-preemptible), and other

Who decides PCI device number?

2008-08-06 Thread Rajat Jain
Hi, In the PCI addess (domain + PCI bus num + PCI Device num + function num) of a PCI device, who decides the PCI device number assigned to a PCI device? - Is it hard wired for a particular PCI slot? (So that any PCI card plugged into this slot will always have a particular PCI device number).

PCI interrupt queries

2008-08-19 Thread Rajat Jain
PROTECTED] Sent: Wednesday, August 06, 2008 11:19 PM To: Rajat Jain Cc: [EMAIL PROTECTED]; kernelnewbies@nl.linux.org Subject: Re: Who decides PCI device number? On 06-08-08 07:54, Rajat Jain wrote: In the PCI addess (domain + PCI bus num + PCI Device num + function num) of a PCI device, who

RE: PCI interrupt queries

2008-08-19 Thread Rajat Jain
Hello Rene, Thanks for the reply. On 19-08-08 07:11, Rajat Jain wrote: I want to understand who decides the IRQ number that a agiven PCI card will use. I understand that from a PCI device drivers point of view, it'll find the IRQ vector that it needs to attach by reading it from

RE: Debugging a module

2008-08-24 Thread Rajat Jain
Hi, If you are loading that module at the run time, the GDB won't find its debug symbols. You need to firstly ensure that the module is compiled with debug info, and then you need to manually load its debug / symbol info into the gdb (using file command?). There is also a script available at

RE: Inline Functions ...

2008-09-18 Thread Rajat Jain
Hi, Is it mandotary to put static before inline which declaring the inline function? No. But your inline function stands a better chance of ACTUALLY being made inline by the compiler if it knows that it is static (and hence is not used anywhere else) Thanks, Rajat -- To

RE: how to find library of header file?

2008-10-20 Thread Rajat Jain
I assume you are talking purely about user space here? So your problems boils down to this: Your compiler is unamble to find definition of certain symbols (that have been defined in the header files). Since you compiler is complaining that means it is certainly not able to find the libraries

RE: qestion about kernel/head.S

2008-10-29 Thread Rajat Jain
Hi, Dear all: I try to cross-compile linux on my arm-platform but I always fail at bl __lookup_processor_type __lookup_processor_type is a function defined at head-common.s and it seems to load the base address of structs below .long __proc_info_begin .long __proc_info_end 3:

USB Gadget Drivers

2008-12-04 Thread Rajat Jain
Hi, I understand that the USB mailing list might be a better choice, but still trying my luck here... I'm very new to USB and would like to understand what would it take to make my ARM board appear as a USB mass storage device to a PC? What pieces of the framework I can reuse and what piece of

RE: limiting kernel memory

2009-01-08 Thread Rajat Jain
Hi, I am working on mips-64bit multi-core with 4GB RAM/8GB RAM, my question how do,I strict kernel to use only 2GB Physical RAM or Kernel should use only 2GB Physical RAM. Pass mem=2G as kernel command line parameter. Thanks, Rajat -- To unsubscribe from this list:

RE: request_irq returns -ENOSYS

2009-04-20 Thread Rajat Jain
Hi, I'm sure this has been working in the past, but now I get -38 (-ENOSYS) returned from my call to request_irq. I can't for the life of me figure out why, although I've dug a bit and found that this is being returned by the following lines in kernel/irq/manage.c: 404: if (desc-chip

RE: When the driver probe functions will be called!!!

2009-04-21 Thread Rajat Jain
Hello, Hi, i have built-in the module into kernel.I am seeing that smc911x_init is calling properly.I have placed print messages in probe function, but those prints are not coming on the UART. Is this (smc911x) a PCI bus based hardware? It looks like your system hasn't detected the

RE: PC to PC debugging in Linux Environment

2009-05-11 Thread Rajat Jain
I'm not sure what windows has. But KGDB gives you everything that a normal GDB session gives. And it is quite simple to use ... -Original Message- From: kernelnewbies-bou...@nl.linux.org [mailto:kernelnewbies-bou...@nl.linux.org] On Behalf Of Srinivas G. Sent: Monday, May 11, 2009

Current state of Linux support for the Intel Atom processor

2009-05-18 Thread Rajat Jain
Hi, Can some one please update me with what is the state of the current support for the Intel Atom processor Z520PT? Is the support already merged into mainline stock kernel (available at kernel.org)? Or is it still available in patched floating on the net? Thanks, Rajat -- To unsubscribe

RE: MSI on Intel APIC

2009-06-18 Thread Rajat Jain
specified by the same specification (sec 9.12.1) actually falls into the reserved category. But since the device can use that address, theoritically my SW should also be able to? No? Thanks Best Regards, Rajat Jain -Original Message- From: Pei Lin [mailto:telent...@gmail.com] Sent

RE: loading a kernel image on arm processor

2009-10-05 Thread Rajat Jain
www.arm.linux.org.uk/ From: kernelnewbies-bou...@nl.linux.org [mailto:kernelnewbies-bou...@nl.linux.org] On Behalf Of Harinderjit Singh Sandhu Sent: Saturday, October 03, 2009 7:52 PM To: kernelnewbies@nl.linux.org Subject:

strange code in linux kernel

2009-10-05 Thread Rajat Jain
a) { return alpha_mv.mv_ioportmap(a); } Using a definition along with extern does not make any sense to me. Can some one please enlighten what is its use / purpose? Thanks, Rajat Jain -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ

RE: strange code in linux kernel

2009-10-05 Thread Rajat Jain
Thanks! From: kernelnewbies-bou...@nl.linux.org [mailto:kernelnewbies-bou...@nl.linux.org] On Behalf Of Denis Kirjanov Sent: Tuesday, October 06, 2009 9:53 AM To: Rajat Jain Cc: kernelnewbies Subject: Re: strange code

RE: locking and interrupts

2009-10-06 Thread Rajat Jain
Hello Govind, What happens when you go for spin locks without disabling kernel preemption? Suppose you acquire a spin lock in a system call handler (a service routine on behalf of a user mode process) with kernel preemption enabled. This is not possible. Spin lock APIs disable kernel

RE: How gdb attach command works?

2009-10-07 Thread Rajat Jain
space? No. See: http://www.kernel.org/doc/man-pages/online/pages/man2/ptrace.2.html This is the system call gdb usses to attach to the process and make observations and control it. Thanks Best Regards, Rajat Jain -- To unsubscribe from this list: send an email with unsubscribe

RE: How gdb attach command works?

2009-10-07 Thread Rajat Jain
BTW, ptrace is about when the process to be debugged is started from within gdb process. PArent process debugging the child process. How does gdb attach to a process that it has not started, in other words, how does it attach to a process that is not its child? Thanks, Rajat -- To

RE: how to pass the content of a file to kernel driver

2009-10-07 Thread Rajat Jain
Hello, I try to pass the content of file,1G, to kernel driver for operation and then return the result back to application. My questions are: 1. The only way I can use is copy_from_user? If so, does it have the size limitation? Yes, you will have to use copy_from_user() because the

RE: How gdb attach command works?

2009-10-07 Thread Rajat Jain
The debugged process effectively becomes a child of GDB when PTRACE_ATTACH is used. More info in the man page. Oh! And how are user restrictions imposed? I assume that you can attach to a process only if the process has been started with owner ID = your uer id or if you are the

RE: Recursive makefiles for module spanning over multiple dir

2009-10-07 Thread Rajat Jain
Hi, obj-m = test.o test-objs := test1/test1.o test2/test2.o No need for makefiles under test1 and test2. However, only throwing ideas here, without a feasibility check. Thanks, Rajat Why it is not possible? Just trying to understand whether it is limited by the Linux kernel

RE: Recursive makefiles for module spanning over multiple dir

2009-10-08 Thread Rajat Jain
It works for me. See below: [ra...@linux-server module]$ cat Makefile obj-m := module.o module-objs := 1/t1.o 2/t2.o [ra...@linux-server module]$ cat 1/t1.c #include linux/init.h #include linux/module.h void hello_exit(void) { printk(KERN_ALERT Goodbye, cruel world\n); }

RE: Changing Kernel 3g / 1g memory split

2009-10-08 Thread Rajat Jain
Hi, 3) And finally, in order to complete this change and to ensure my applications are awrae of it and are doing the needful to restrict themselves in only 2G, do I also need to make changes in the glibc or the gcc? No, you don't need changes to glibc or gcc. I think he will

RE: Recursive makefiles for module spanning over multiple dir

2009-10-08 Thread Rajat Jain
Hi, For me it is not working, only difference is I am using make -f Makefile.kern i.e. top level make file is renamed as Makefile.kern, there are reasons I am not naming it as Makefile. When I do make -f Makefile.kern, I get following error: make[1]: Entering directory

RE: how to support long file name in vfat format under linux

2009-10-13 Thread Rajat Jain
Hi, The problem comes from my trying to write a autoscrpit to mound usb device under my embedded system. I guess hotplug agents are what you are looking for. I had used them long back and I think they are still available. The basic concept is that every time anew device is added in the

RE: Understanding VFS Filesystem using proc fs

2009-10-19 Thread Rajat Jain
Hi, Just developing upon Mulyadi's idea: A quick idea would be to implement something like /proc/tracethispid which read integer. Then you do i.e echo /proc/tracethispid and store this integer in a kernel variable. A simpler technique could simply be storing the current pid in the

RE: About the system call named sys_mount.

2009-10-20 Thread Rajat Jain
Hi, now, i want to simplify the function according to the following method, but i don't know wether there is some potential risk. 1. don't to allocates memory in kernel space for each parameter. 2. sys_mount refer to the parameter through the memory pointer passed directly. You can't refer

RE: About the system call named sys_mount.

2009-10-20 Thread Rajat Jain
Hi, Thank you for your reply. it's interesting, my modified kernel image is run ok on my hardware(arm926ejs). i test mounting ramfs and nfs, they are all ok. are they occasional? sorry, i don't comprehend your explanation about it In my opinion, if it's possible that the content of

RE: 32 bit processors / 64 bit processors

2009-10-22 Thread Rajat Jain
Hi, 1. The size of the processor's internal address bus (virtual address space) is what qualifies it as a 32-bit / 64-bit processor. Well, in that sense, isn't Pentium a 36-bit processor (since it gives the option of PAE to use 64 GB of memory - it must be having atleast 36 address lines)?

RE: Whats is the operator ##

2009-10-28 Thread Rajat Jain
Concatenation. The C Programming Language. Original Message From: kernelnewbies-bou...@nl.linux.org [mailto:kernelnewbies-bou...@nl.linux.org] On Behalf Of Shameem Ahamed Sent: Wednesday, October 28, 2009 1:41 PM To: kernelnewbies@nl.linux.org Subject: Whats is the operator ## Hi

RE: Virtual Memory Doubt

2009-11-02 Thread Rajat Jain
Hi, Other than that, most likely for anonymous mapping, it is random. However, if you take a look very carefully, it would be somewhere between 0x0800 and slightly below bottom of stack (0xc00 minus something). Just curious why are the virtual addresses below 0x0800 left out?

A way to let initramfs continue as THE final root filesystem?

2009-11-03 Thread Rajat Jain
Hi, I'm trying to use an embedded cpio archieve (initramfs) to boot my embedded board, and I'm curious is there a way to let initramfs be the final root filesystem for my kernel? Thanks, Rajat -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to

RE: why kernel implement udelay by cpu instructions?

2009-11-03 Thread Rajat Jain
Hi, I thought hrtimers allow higher-precision wakeups these days? Of course, if you only want to sleep for a few microseconds, the context switch might take longer than you want to sleep... Yes, that is right. Sorry, I missed that. But that is purely HW dependent - if your HW providea a

local_irq_disable() V/S disable_irq()

2009-11-03 Thread Rajat Jain
Hi, I'm just trying to understand how he things would look like, if the device sends an interrupt (edge-triggered) while a driver has issued one of the above mentioned APIs (to disable the interrupts temporarily). A) local_irq_disable(): As far as I understand, this API disables the interrupt

RE: doubt abt a function in ext2

2009-11-04 Thread Rajat Jain
Hi, The function calculates the last byte in a page OF A PARTICULAR FILE. static unsigned ext2_last_byte(struct inode *inode, unsigned long page_nr) { unsigned last_byte = inode-i_size; /* Currently, last_byte = file size */ last_byte -= page_nr PAGE_CACHE_SHIFT; /*

RE: doubt abt a function in ext2

2009-11-04 Thread Rajat Jain
...@gmail.com] Sent: Wednesday, November 04, 2009 3:16 PM To: Rajat Jain; Manish Katiyar Cc: Kernelnewbies Subject: Re: doubt abt a function in ext2 in simple words--- simple maths

RE: Calling driver functions from kernel space

2009-11-09 Thread Rajat Jain
You will obviously need to include a header file from your driver into kernel (Alternatively, declate the function as extern in the kernel). From: kernelnewbies-bou...@nl.linux.org [mailto:kernelnewbies-bou...@nl.linux.org] On Behalf Of Sam Carter

RE: mmap non-kmalloc'ed or non-vmalloc'ed buffer?

2009-11-16 Thread Rajat Jain
Hi, Example: Within my device driver code I have the following table ... typedef struct foobar_entry { char foo[1024]; char bar[1024]; uint32_t x; uint32_t y; } foobar_entry_t; foobar_entry_t foobar_table[] = { { foo1, bar1, 232, 0 },

mmap confusion

2010-09-20 Thread Rajat Jain
of thinks to initiate the diska read / write transaction. How is this achieved? Because application is not making any System calls. Its just having load / store instructions. Thanks, Rajat Jain -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please

RE: Reading TLB Entries

2010-10-04 Thread Rajat Jain
This is architecture specific question. On powerpc for example, you can read it via special purpose registers MAS0 - MAS3. From: kernelnewbies-bou...@nl.linux.org [mailto:kernelnewbies-bou...@nl.linux.org] On Behalf Of Prabhu nath Sent: Monday,

RE: Learning Memory management and process management.

2010-10-25 Thread Rajat Jain
. How the kernel determine processor architecture. That means at what point of the kernel understand the processor architecture and start working on architecture based operations? Rajat Kernel does not determine architecture at run time. It is specified by you at compile time and a different

  1   2   >