Re: Could we use jprobe to skip kprboed function

2019-02-26 Thread Daniel Baluta
On Tue, Feb 26, 2019 at 11:59 AM wuzhouhui wrote: > > Hi, > > The documentation of jprobe says that we must call jprobe_return() > before return. I'm wondering what if we don't call jprobe_return, and > could we use it to skip probed function? Hi, Please keep in mind the jprobe is likely to be r

Re: Kernel API's for ADC

2018-07-25 Thread Daniel Baluta
On Wed, Jul 25, 2018 at 1:25 PM, chandrasekhar wrote: > Hi, > > > > Are there any kernel API's for ADC. I am using NXP IMX6UL processor. I have > to read ADC values in kernel space instead of sysfs/userspace. It depends on the type of driver used. Either input or IIO. The sysfs interface for IIO

Re: New to the Kernel Newbie

2018-05-21 Thread Daniel Baluta
Hi, You can have a look at our Linux kernel labs: https://linux-kernel-labs.github.io/master/ For example, start with a short introduction to Linux kernel: https://linux-kernel-labs.github.io/master/labs/introduction.html then create a simple kernel module: https://linux-kernel-labs.github.io

Re: Add IIO example to the kernelnewbies wiki

2018-05-09 Thread Daniel Baluta
Sure, you can do that. Nice to see that you are using Diolan DLN-2 adapter. thanks, Daniel. On Mon, Apr 2, 2018 at 8:06 PM, Gaston Gonzalez wrote: > Hi, > > I'm testing an AD7746 eval board using a Diolan DLN-2 adapter. I wrote > some basic notes about the installation an instanciation process f

Announce Linux kernel labs project

2018-02-15 Thread Daniel Baluta
Hi all, The Linux kernel labs documentation is a collection of "labs" for various device driver topics. For each topic there are two parts: a walk-through which explain the basic concepts and a hands-on part which contains a few exercises. The kernel labs are integrated with Linux kernel Document

Re: Problem in loading module of Software trigger

2017-03-27 Thread Daniel Baluta
Hi, On Sun, Mar 26, 2017 at 9:51 PM, SIMRAN SINGHAL wrote: > On Sun, Mar 26, 2017 at 1:47 PM, Jonathan Cameron > wrote: >> Insmod will not pick up dependencies in the same way modprobe will. >> >> Make sure to also insmod industrialio.ko and iio-sw-trigger.ko before the sw >> trigger module. I

Re: Linux Kernel Based Research Projects

2016-10-03 Thread Daniel Baluta
On Tue, Oct 4, 2016 at 4:08 AM, Robert P. J. Day wrote: > On Sun, 2 Oct 2016, Daniel Baluta wrote: > >> On Sun, Oct 2, 2016 at 2:54 PM, Shyam Saini wrote: >> > Hi everyone, >> > >> > I'm final year computer science undergraduate student. I want to do

Re: Linux Kernel Based Research Projects

2016-10-03 Thread Daniel Baluta
On Mon, Oct 3, 2016 at 12:48 PM, shyam wrote: > Thanks a lot for your reply, > I'ld like attend your session but right now I'm in India. So, couldn't > manage everything so early to attend linuxCon Europe. > > Apart from this thing, > I'ld like to work on lguest to port it on x86_64 architecture.

Re: Linux Kernel Based Research Projects

2016-10-02 Thread Daniel Baluta
On Sun, Oct 2, 2016 at 2:54 PM, Shyam Saini wrote: > Hi everyone, > > I'm final year computer science undergraduate student. I want to do my > major project based on linux kernel. > > Would you please suggest me some areas in the kernel which have some > projects. To be more specific, I want know

Re: How to debug ethernet driver ?

2016-08-04 Thread Daniel Baluta
On Mon, Aug 1, 2016 at 10:26 PM, Ran Shalit wrote: > Hello, > > I am writing ethernet network driver. > I would like to ask if there are any steps which can help when > debugging ethernet driver, or is it that the first test should already > involve transmit/recieve packets to/from ip stack ? > >

Re: pushing other commits upstream

2016-07-18 Thread Daniel Baluta
On Mon, Jul 18, 2016 at 1:49 AM, Alexander Couzens wrote: > Hi, > > I would like to push patches from somebody else upstream. > I'm talking of commits of the TI's beagleboard repo [1]. > > What do I need to take care of? Well, basically apply the patch from beagleboard repo into your repo. This w

Re: looking for tutorials

2016-06-21 Thread Daniel Baluta
On Mon, Jun 13, 2016 at 5:43 PM, ty armour wrote: > I need tutorials on kernel development. And on complete operating system > development. I would prefer them to be in assembly because it is faster, but > it seriously needs to get done. > > If you are interested, simply post all of the tutorials

Re: [PATCH] HC-SR04 ultrasonic ranger IIO driver

2016-06-01 Thread Daniel Baluta
On Wed, Jun 1, 2016 at 12:05 AM, wrote: > From: Johannes Thoma > > The HC-SR04 is an ultrasonic distance sensor attached to two GPIO > pins. The driver based on Industrial I/O (iio) subsystem and is > controlled via configfs and sysfs. It supports an (in theory) unlimited > number of HC-SR04 dev

Re: How to enable IIO driver in 3.18 kernel

2016-06-01 Thread Daniel Baluta
On Wed, Jun 1, 2016 at 5:26 PM, Munagala Naresh wrote: > Thanks for the response. > > From the "cat /proc/devices", I could see "iio" listed like this. > > / # cat /proc/devices > cat /proc/devices > Character devices: > 1 mem > 4 /dev/vc/0 > 4 tty > 5 /dev/tty > 5 /dev/console > 5 /de

Re: make oldconfig forces HWMON to be inbuilt

2016-05-25 Thread Daniel Baluta
On Fri, May 20, 2016 at 7:35 AM, Ani Sinha wrote: > Hi guys : > > I am seeing this weird issue where even though my original kernel > configuration tries to build HWMON as a module, when I do 'make > oldconfig', it forces HWMON to be built into the kernel. Is there > anyway I can find what configu

Re: git send-email

2016-05-22 Thread Daniel Baluta
On Sun, May 22, 2016 at 2:29 PM, Tobin Harding wrote: > Workflow - > > $ git format-patch -s -1 > > add patch comment then > > $ git send-email > > Question please - > > Who should the email be sent to without having a 'To' address repeated in the > CC > field generated by `git send-email`. > > T

Re: if block style when condition spams to multiple lines.

2016-05-20 Thread Daniel Baluta
On Thu, May 19, 2016 at 9:07 PM, Daniel. wrote: > What is the preferred way to ident if statement when the condition > spams to multiple lines, ex: > > if (cond1 && > cond2 && > cond3) { > ... > ... > } ^ this one is preferred. > > or > > if (cond1 && > cond2 && >

Re: Is there anyone on MAC kernel

2016-05-11 Thread Daniel Baluta
On Tue, May 10, 2016 at 12:26 PM, Robert Clove wrote: > Hi, > > I am looking for some with whom i can discuss my mac kernel problems. > If you know someone please mail me . Hi, It doesn't work this way. Please describe your problem here. What is the issue and how did you try to fix it? Daniel.

Re: i2c driver develpment with diolan DLN-2 / ACPI?

2016-04-30 Thread Daniel Baluta
On Sat, Apr 30, 2016 at 6:10 PM, Martin Kepplinger wrote: > Am 2016-04-27 um 13:51 schrieb Daniel Baluta: >> On Wed, Apr 27, 2016 at 2:36 PM, Martin Kepplinger wrote: >>> Hi roberta or anyone who uses a diolan i2c/spi bridge device, >>> >>> I try to do get

Re: i2c driver develpment with diolan DLN-2 / ACPI?

2016-04-27 Thread Daniel Baluta
On Wed, Apr 27, 2016 at 2:36 PM, Martin Kepplinger wrote: > Hi roberta or anyone who uses a diolan i2c/spi bridge device, > > I try to do get the kernel driver for the connected chip loaded, but I'm > having some trouble getting it right. > > Cables are connected to the device (i2c), and the (main

Re: [PATCH] misc devices: HC-SRO4 ultrasonic distance driver

2016-03-24 Thread Daniel Baluta
On Thu, Mar 24, 2016 at 5:02 PM, Johannes Thoma wrote: > From 56e8f71c990b92c28a8cb03d859880eab8d06a3d Mon Sep 17 00:00:00 2001 > From: Johannes Thoma > Date: Mon, 21 Mar 2016 22:11:01 +0100 > Subject: [PATCH] HC-SRO4 ultrasonic distance sensor driver > > The HC-SRO4 is an ultrasonic distance se

Re: How to correctly decode fun+X/Y

2015-12-04 Thread Daniel Baluta
On Thu, Dec 3, 2015 at 8:14 PM, Matwey V. Kornilov wrote: > Hello, > > I have the following stack trace: > > [ 1351.381696] a.out S c0afb050 0 1676 1658 0x > [ 1351.387048] [] (__schedule) from [] > (schedule+0x58/0xcc) > [ 1351.392436] [] (schedule) from [] > (tty_port_bl

Re: i want to use the script in kernel script folder.

2015-11-17 Thread Daniel Baluta
On Tue, Nov 17, 2015 at 7:10 AM, 윤영석 wrote: > > hi, > i want to use a script in kernel, but i can't use this. > in my terminal. > yoon@pc:~/project/aosp/kernel/linux/scripts$ ./checkpatch.pl sortextable.c > Must be run from the top-level dir. of a kernel tree Hi, You can try ./checkpatch.pl -f -

Re: How to see the preprocessed output of a module source file

2015-11-02 Thread Daniel Baluta
On Mon, Nov 2, 2015 at 2:02 PM, Shiyao Ma wrote: > Hi, > > > Say I am writing a module. Instead of directly compile it into a ko file, > I'd like to see the preprocessed output of that file, similarly the way it's > done in gcc -E. Use make V=1 path/to/your/module.ko and see the exact gcc comman

Re: Regirect /var/log/log/syslog messages to our own txt file

2015-09-19 Thread Daniel Baluta
On Sat, Sep 19, 2015 at 9:29 PM, Gunjan Mehta wrote: > Hi, > > I am working on a project, where i print my log messages in > /var/log/log/syslog like > > project_my:info::project started > project_my:debug::value of a is 1 > > i want to redirect project_my:info messages in info.txt file and > proj

Re: kernel.c//Starting for The Journey of The Kernel;

2015-09-17 Thread Daniel Baluta
On Thu, Sep 17, 2015 at 7:56 AM, GanesH AvacharE wrote: > if I have to start with the basics of the OS then what sequence should I > follow? You can start with Operating Systems Concepts book. http://www.amazon.com/Operating-System-Concepts-Abraham-Silberschatz/dp/0470128720 ___

Re: samples driver is not compiling and building at present dir ".ko" file

2015-08-21 Thread Daniel Baluta
On Fri, Aug 21, 2015 at 10:25 AM, ravi ranjan Mishra wrote: > Hi, > > Just for learning purpose , i need to compile the sample directory in > mainline kernel . > can anybody tell to how build samples directory through make. Use: $ make menuconfig, to select CONFIG_SAMPLES=y, then in the root of

Re: Is there any tool can format source code according to kernel coding rule?

2015-08-03 Thread Daniel Baluta
On Mon, Aug 3, 2015 at 6:35 AM, Nan Xiao wrote: > Hi all, > > I am just wondering whether there is a script/tool which format source code > according to kernel coding rule automatically? Such as tab, space, brace, > etc. Try scripts/Lindent from the kernel source tree. Daniel.

Re: How can I locate a struct's defination?

2015-08-02 Thread Daniel Baluta
On Sun, Aug 2, 2015 at 8:01 AM, Navy Cheng wrote: > Hi, > I use emacs and tags to read kernel source. The tags is create by > > make tags > > in the kernel source tree. When I want to find a struct's defination, > something goes wrong. For example: when I find *dentry* , the first > result is:

Re: Unit in which generic_buffer.c application gives data for sensors.

2015-07-02 Thread Daniel Baluta
On Thu, Jul 2, 2015 at 2:53 PM, s.rawat wrote: > On Thu, Jul 2, 2015 at 4:13 PM, Daniel Baluta wrote: >> >> * accel - m/s^2 >> * gyro - rad/s >> * magneto - Gaus > > I get the data as below : > > in_accel_x 71000 71000.0 in_accel_y -45000 -45000.0 in_accel

Re: Unit in which generic_buffer.c application gives data for sensors.

2015-07-02 Thread Daniel Baluta
On Thu, Jul 2, 2015 at 10:46 AM, s.rawat wrote: > Hi, > What are the unit in which the generic_buffer.c application gives the > accelerometer , Gyro and Magnetometer values. > Thanks in advance ! Hi, Look for process_scan function in generic_buffer.c. It says: process_scan() - print out the valu

Re: About guiding hello world module submission

2015-06-24 Thread Daniel Baluta
On Wed, Jun 24, 2015 at 7:49 AM, Mayur Patil wrote: > Hi All, > >I am conducting one workshop at FUDCon in which I am trying to teach how > to write > > and send your first linux kernel device driver. Could please suggest me the > place where I > > can guide the students to send the device dri

Re: Suggested environments for kernel development

2015-05-05 Thread Daniel Baluta
On Sun, May 3, 2015 at 8:11 PM, Lewis Clark wrote: > I would really like to know how you guys do your kernel development. > What distro do you use and whats the process? > > I’m very comfortable with debian, but i’ve heard it’s not the easiest distro > to build kernels for as you need to build to

Re: What is kmemleak_alloc used for?

2015-04-19 Thread Daniel Baluta
On Sun, Apr 19, 2015 at 11:36 AM, yoma sophian wrote: > hi all: > I found in alloc_bootmem_bdata, kmem_cache_alloc, kmalloc, vmalloc, > they will call kmemleak_alloc. > > Would anyone know why we have to do so for calling kmemleak_alloc at > different places? AFAIK this is used for accounting all

Re: Writing driver for a net device which does not support interrupt

2015-03-24 Thread Daniel Baluta
On Tue, Mar 24, 2015 at 3:34 AM, Freeman Zhang wrote: > Hi phil, > > Thanks for your reply! I googled timer, it might be a solution except > that interval granularity is a little bit large. This device is for high > performance network. I'm not sure whether the missmatch will cause problem. Googl

Re: Sysfs requirement for running generic_buffer.c application - IIO sensors

2015-03-23 Thread Daniel Baluta
On Mon, Mar 23, 2015 at 7:27 AM, s.rawat wrote: > I have two system having different kernel version and drivers(IIO) on which > i can run the generic_buffer.c application .On one system it works fine but > on the other it does not give the input reports data. What kernel versions are you using? W

Re: Delaying an interrupt handler

2015-03-23 Thread Daniel Baluta
On Mon, Mar 23, 2015 at 2:18 PM, Milton Krutt wrote: > Hi. > It is known that no semaphore synchronization should be > used inside an interrupt handler. > > Anyway, I am looking at a freeBSD device driver (written by > a profesionist) and there are semaphores inside an interrupt > handler's subrou

Re: CHECK: Alignment should match open parenthesis

2015-03-13 Thread Daniel Baluta
On Fri, Mar 13, 2015 at 5:33 PM, Nicholas Mc Guire wrote: > On Fri, 13 Mar 2015, Daniel Baluta wrote: > >> On Fri, Mar 13, 2015 at 3:47 PM, Nicholas Mc Guire wrote: >> > On Fri, 13 Mar 2015, Nicholas Mc Guire wrote: >> > >> >> On Fri, 13 Mar 2015, pal

Re: CHECK: Alignment should match open parenthesis

2015-03-13 Thread Daniel Baluta
On Fri, Mar 13, 2015 at 3:47 PM, Nicholas Mc Guire wrote: > On Fri, 13 Mar 2015, Nicholas Mc Guire wrote: > >> On Fri, 13 Mar 2015, palik imre wrote: >> >> > On Friday, 13 March 2015, 13:43, Nicholas Mc Guire >> > wrote: >> > > On Fri, 13 Mar 2015, palik imre wrote: >> > > >> > > >> > > > Sorry

Re: Getting error "failed to setup attributes" on Adding Custom Fields in accelerometer HID driver

2015-02-26 Thread Daniel Baluta
+ linux-iio list. On Thu, Feb 26, 2015 at 8:04 AM, s.rawat wrote: > I have modified the hid-sensor-accel_3d.c driver to add the custom fields - > CHANNEL_SCAN_DATA_MOTION and HID_USAGE_SENSOR_DATA_CUSTOM_VALUEX ( X = > 2,3,4). > Below are my modifications : > > enum accel_3d_channel { > CHANNEL_S

Re: from WHERE platform driver's probe is called?

2014-11-21 Thread Daniel Baluta
On Fri, Nov 21, 2014 at 3:16 PM, Sunil Shahu wrote: > Hello, > > I am looking into platform driver and devices and understood HOW platform > driver's probe is called from kernel doc and following forum. > http://comments.gmane.org/gmane.linux.kernel.kernelnewbies/37050 > > For further information

Re: fd type from number

2014-08-19 Thread Daniel Baluta
On Tue, Aug 19, 2014 at 6:38 PM, Loris Degioanni wrote: > (resending making sure this is not part of another thread) > > I'm looking for an efficient way to determine the type of an fd (file, > socket...) given its number, from a kernel module. > The closest thing I found by looking at the kernel

Re: A new way to dive into the kernel!

2014-03-14 Thread Daniel Baluta
> It's there any solution to this issue? > > I'm using mutt, It's ok. Hi, Evolution works for me. thanks, Daniel. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: Linux-wireless: why use macro to call functions

2013-12-22 Thread Daniel Baluta
On Mon, Dec 23, 2013 at 8:05 AM, Fred Chou wrote: > Hi, > > I was studying the Linux wireless subsystem code and noticed this code (in > ieee80211_rx_handlers): > > It first defines the macro: > > #define CALL_RXH(rxh) \ > do {\ > res = rxh(rx); \

Re: How can I 'getchar()' in module code?

2013-12-04 Thread Daniel Baluta
On Tue, Dec 3, 2013 at 4:20 PM, Bernd Petrovitsch wrote: > On Die, 2013-12-03 at 08:38 -0500, valdis.kletni...@vt.edu wrote: >> On Tue, 03 Dec 2013 20:35:41 +0800, said: >> > For debugging purpose, I want something like 'getchar()' that can pause >> > execution in the module code. Do any candidat

Re: How can I 'getchar()' in module code?

2013-12-03 Thread Daniel Baluta
On Tue, Dec 3, 2013 at 2:35 PM, 乃宏周 wrote: > For debugging purpose, I want something like 'getchar()' that can pause > execution in the module code. Do any candidates I can choose? No. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http

Re: Can mm_struct of a process be null?

2013-11-15 Thread Daniel Baluta
On Fri, Nov 15, 2013 at 6:24 PM, Paul Davies C wrote: > Hi, > I happen to find this code snippet in the kernel source : > > struct mm_struct *mm=current->mm; > > /* some other code */ > > if(mm){ /*<==Why is this here? */ > /*read the contents by locking*/ > } > > The i

Re: Initial git repository - kernel tree

2013-05-13 Thread Daniel Baluta
On Mon, May 13, 2013 at 10:51 AM, Kevin Wilson wrote: > Hello, > I have a question about git patches. > When I run > git log include/linux/skbuff.h > and page down till the end, I reach > 1da177e Linux-2.6.12-rc2 > > (I do it on the net-next tree.) > > git show 1da177e gives: > Author: Linus Torva

Re: misc device question

2012-12-19 Thread Daniel Baluta
On Wed, Dec 19, 2012 at 10:36 AM, Kevin Wilson wrote: > Hello,kernelnewbies > > I am trying to develop a misc driver in 3.7.0 kernel. > > As a basis I copy and paste this code, *without any change*, > > http://virtlog.com/2008/03/25/linux-miscdevice-sample/ > > And build it. > after insmod I have

Re: can I input a gate service to kernel to get kernel data to user ?

2012-12-13 Thread Daniel Baluta
On Thu, Dec 13, 2012 at 5:17 AM, horse_rivers wrote: > is there method for doing this work? take kernel data to user? Check copy_to_user [1]. thanks, Daniel. [1] http://lxr.linux.no/#linux+v3.7/arch/x86/lib/usercopy_32.c#L715 ___ Kernelnewbies mailin

Re: Linux Kernel Development

2012-09-09 Thread Daniel Baluta
On Sun, Sep 9, 2012 at 12:16 PM, Kaushal Shriyan wrote: > On Sun, Sep 9, 2012 at 9:02 AM, Alexandru Juncu wrote: >> On 9 September 2012 06:15, Kaushal Shriyan wrote: >>> Hi, >>> >>> I am interested to contribute to linux kernel development process. I >>> have been working on Linux for the last t

Re: Profiling my Modules

2012-04-26 Thread Daniel Baluta
On Thu, Apr 26, 2012 at 10:33 AM, Rishi Agrawal wrote: > Hi All, > > I have a kernel module which has functions which take a lot of time in > execution. I am curious to know how can I profile it, and find out the > functions taking most of the time. > > I saw Oprofile, but it seems that I will hav

Re: slacks usage,..

2012-03-05 Thread Daniel Baluta
On Mon, Mar 5, 2012 at 11:00 AM, trisha yad wrote: > Hi All, > > I am going through below topic http://patches.linaro.org/6833/. I > could not got the meaning of slacks. Why I need this .. > Is there some real example of need of slacks. Have you tried searching for it? :D [1]. thanks, Daniel. [

Re: Check if specific functionally is built into the kernel

2012-02-26 Thread Daniel Baluta
On Sun, Feb 26, 2012 at 7:08 PM, Arokux B. wrote: > Dear all, > > I have the following problem. Some functionality can be either built > into the kernel or it can be build as a module. In the latter case the > application should load the module. > > Is there a general approach to test if specific

Re: cross compile linux

2012-02-11 Thread Daniel Baluta
On Sat, Feb 11, 2012 at 9:05 AM, chromaticwt zac wrote: > what is the proper way to cross compile the linux kernel from one arch to > another? specifically, > i386 -> ppc. You should use a cross-compiler. I recommend you crosstool-ng. Use google for references. [1] thanks, Daniel. [1] http://f

Re: How to use /proc

2012-02-05 Thread Daniel Baluta
On Sun, Feb 5, 2012 at 11:07 PM, Surenkumar Nihalani wrote: > Hello Guys, > > I am CS student trying to write a kernel module as a part of my class > assignment. I wanted to know, from within kernel, how do I read and write > data to my proc file? > I need to store state from last call of my funct

Re: How to create patch for checkpatch.pl cleanups

2012-02-05 Thread Daniel Baluta
On Sun, Feb 5, 2012 at 11:00 PM, kashyap gada wrote: > Hello Linux Newbies, I'm one too. I was looking out for some clean up work > and I ran the checkpatch.pl script. I came across a file with some 400 > errors and 200 warnings. Now there were bunch of 80 char per line warning , > braces and rela

Re: using sizeof operator

2012-01-22 Thread Daniel Baluta
On Sun, Jan 22, 2012 at 10:17 PM, Sukrit Sangwan wrote: > I found an instance where sizeof(struct xyz) is used instead of > sizeof(variablename). > I want to ask if it would be appropriate to contact the author about the > same. Well, this doesn't really matter, but the recommended practice is to

Re: using sizeof operator

2012-01-22 Thread Daniel Baluta
On Sun, Jan 22, 2012 at 8:14 PM, Sukrit Sangwan wrote: > There are instances in the code where sizeof(*ptr) is used. e.g. > in net/802/garp.c >           const struct garp_msg_hdr *gm; >           if (!pskb_may_pull(skb, sizeof(*gm))) >  return -1; > i want to ask is there any sense in using sizeo

Re: [OOT] About the symbols in binary file.

2012-01-20 Thread Daniel Baluta
On Fri, Jan 20, 2012 at 11:56 AM, nilesh wrote: > Hi, > > The question is not completely related to kernel. But I came across > similar question when debugging in kernel. > > I tried dissecting the SSL library using 'nm' command. It is showing the > list of symbols along with some generic addresse

Re: multiple definition error from dl-addr.c with addition of printf, in glibc compilation

2011-12-08 Thread Daniel Baluta
On Thu, Dec 8, 2011 at 10:59 AM, solmac john wrote: > Hi All, > > in glibc-2.13/nptl/sigaction.c, i just put a simple printf("test\n"); and my > glibc compilation fails. Just adding a printf gives me multiple definitions > of _itoa from dl-addr.c and i have no idea why. Can any body please tell me

Re: How to hook the system call?

2011-11-23 Thread Daniel Baluta
On Wed, Nov 23, 2011 at 11:22 AM, Alexandru Juncu wrote: > On Wed, Nov 23, 2011 at 10:40 AM, Geraint Yang wrote: >> Hello everyone, >> >> I am going to hook a system call like 'read' or 'send' by modifying the >> sys_call_table, but it seems that the sys_call_table is in read only page, >> how ca

Re: x86 kernel build chain - how bzImage gets created

2011-11-22 Thread Daniel Baluta
On Tue, Nov 22, 2011 at 12:46 PM, Graeme Russ wrote: > Hi All, > > Hopefully this will help demystify the build process > > Notation: > () >  | >  + >  | >  * >  | >  \-> () > > The file sizes are arbitrary and are based on the current configuration > options I have set for a small kernel. The

Re: Contributing for the first time

2011-11-07 Thread Daniel Baluta
On Mon, Nov 7, 2011 at 3:05 PM, Greg Freemyer wrote: > Alexandru Juncu wrote: > >>Hello! >> >>I have been a linux user for many years, and mostly on the networking >>side. And I would like to start contributing somehow to the linux >>community (in some other way than just promoting it). I guess t

Re: spin_lock behavior

2011-11-03 Thread Daniel Baluta
Hello, > I wrote a sample module which looked like this and i expected the module to > hang as i have used 2 spin_lock simultaneously. But i find the print after > the second spin_lock being printed and the module works perfectly fine. Can > any body please help me in understanding this? I got thi

Re: how to check kernel is configured with preemption or not

2011-10-21 Thread Daniel Baluta
On Fri, Oct 21, 2011 at 2:28 PM, sri wrote: > Hi, > > Am using kernel 2.6.18-195(centos 5.5). > My kernel configs have CONFIG_PREEMPT_NONE=7 and "CONFIG_PREEMPT_VOLUNTERY > is not set". > How to check that preemption is really in place? > Is there any way to check my kernel is configured with what

Re: Trouble removing character device

2011-10-19 Thread Daniel Baluta
On Wed, Oct 19, 2011 at 7:04 PM, Kai Meyer wrote: > I can't seem to get my character device to remove itself from the > /proc/devices list. I'm calling all of the following functions like so: > > alloc_chrdev_region(&dev, 0, 5, "my_char"); > cdev_init(&my_cdev, &my_ops); > cdev_add(&my_cdev, MKDEV

Re: Getting 'bad file number' error writing to device driver

2011-10-17 Thread Daniel Baluta
On Mon, Oct 17, 2011 at 6:49 PM, Philip Anil-QBW348 wrote: > -Original Message- > From: Daniel Baluta [mailto:daniel.bal...@gmail.com] > Sent: Saturday, October 15, 2011 3:34 AM > To: Philip Anil-QBW348 > Cc: kernelnewbies@kernelnewbies.org > Subject: Re: Getting '

Re: Getting 'bad file number' error writing to device driver

2011-10-15 Thread Daniel Baluta
On Sat, Oct 15, 2011 at 2:42 AM, Philip Anil-QBW348 wrote: > I am calling the driver from an Android program (OMAP4/Blaze). It calls a > c++ program via JNI which then calls the device driver. > Someone suggested it might be a permissions problem - the program is running > in user mode. > > on Bla

Re: Why can the kernel be stuck by a busy kernel thread ?

2011-10-14 Thread Daniel Baluta
On Fri, Oct 14, 2011 at 5:04 PM, Parmenides wrote: > Hi, > >   I code a kernel module which do some nop. When inserted into the > kernel, the kernel will be stuck and can not reponse my keypress > anymore. So, I have to reboot to get out. Why? Is kernel preemption activated? Could you check for #

Re: Getting 'bad file number' error writing to device driver

2011-10-13 Thread Daniel Baluta
Hello, > I am trying to write to mydriver but get a 'Bad file number' error. > > int fd = open("/dev/mydriver",O_RDWR); > > this opens successfully as fd is not -1. > > ssize_t bytesToWrite = strlen(buf); > > value is: bytesToWrite 28 > > ssize_t bytesWritten = write(fd,buf,bytesToWrite); > > valu

Re: When is to preempt safe?

2011-10-08 Thread Daniel Baluta
On Sat, Oct 8, 2011 at 7:19 PM, Parmenides wrote: > 2011/10/8 Chetan Nanda : >> >> New task pick by scheduler may try to get the same lock resulting in >> deadlock > > It seems that this kind of deadlock may be removed eventually. Suppose > that we have a task A, which is holding a spinlock. If A

Re: Debugging IP packet through Linux stack

2011-09-21 Thread Daniel Baluta
On Wed, Sep 21, 2011 at 10:26 PM, Abu Rasheda wrote: > I am inserting packets into Linux stack and they are accepted by net_rx > function, but are latter dropped. What tools are available in Linux kernel > to for debugging this issue. printk + dump_stack + your brain :). thanks, Daniel. ___

Re: TCP_DELACK_MIN vs TCP_ATO_MIN

2011-09-21 Thread Daniel Baluta
> Now the default value is of both the macros is same. > > But if you want to make delayed ack timeout configurable, then I think you > should give proc interface for TCP_DELACK_MIN. Thanks Rohan. Then also I have to export TCP_DELACK_MAX since I think ato cannot grow over this value. thanks, Dan

TCP_DELACK_MIN vs TCP_ATO_MIN

2011-09-21 Thread Daniel Baluta
Hello, RFC2582, Section 4.2 says: "... an ACK SHOULD be generated for at least every second full-sized segment, and MUST be generated within 500 ms of the arrival of the first unacknowledged packet. ". I guess that the delayed ACK timeout is computed in tcp_send_delayed_ack: === void tcp_send_

Re: how to use hashmap in kernel module?

2011-09-19 Thread Daniel Baluta
On Mon, Sep 19, 2011 at 9:23 AM, Jon Zhou wrote: > Hi > > I want to hashmap to store datat in kernel module, how can I do this? Any > existed code? Hello, There are a lot of places where hashes are used. Just grep for 'hash' through the kernel sources. For example have a look at futex_queues [

Re: Kernel Lock Debugging

2011-08-31 Thread Daniel Baluta
Hello, > i wrote a linux kernel module which uses mmap_sem in lots of places. I grab > mmap_sem for both reads & writes.  And, i also use page_table_lock spinlock > under them. The problem i have is that there is a hard to reproduce a race > condition bug in which a thread doesn't release the semap

Re: TCP - RST flag

2011-08-23 Thread Daniel Baluta
On Wed, Aug 24, 2011 at 12:50 AM, Eric Dumazet wrote: > Le mercredi 24 août 2011 à 00:32 +0300, Daniel Baluta a écrit : >> On Tue, Aug 23, 2011 at 11:55 PM, Eric Dumazet >> wrote: > >> > TCP in RFC 1122 section 4.2.2.13: >> > >> >  "A host MA

Re: TCP - RST flag

2011-08-23 Thread Daniel Baluta
On Tue, Aug 23, 2011 at 11:55 PM, Eric Dumazet wrote: > Le mardi 23 août 2011 à 23:31 +0300, Daniel Baluta a écrit : >> Hello, >> >> Please help me understanding the behavior of the following >> TCP conversation. >> >> You can find bellow a snippet of the

TCP - RST flag

2011-08-23 Thread Daniel Baluta
Hello, Please help me understanding the behavior of the following TCP conversation. You can find bellow a snippet of the (FTP) conversation captured both on client (C) and server (S). [client]$ tcpdump -n -r client-6-conv.cap [P1] 49.045690 IP 10.10.0.1.21 > 10.10.0.20.58277: Flags [P.], seq 1

Re: Debugging Kernel Panic

2011-08-10 Thread Daniel Baluta
> I'm using fedora 15, and just compiled 3.0.1 stable. I'm getting a kernel > panic when I close my laptop lid and it goes into suspend. > How should I go about debugging this? Are there error logs I can check? Is > there some way I can debug the linux kernel image? > I'm a complete newb to linux d

Re: One more question on alignment

2011-08-06 Thread Daniel Baluta
On Sat, Aug 6, 2011 at 10:17 PM, subin gangadharan wrote: > Hi, > This is a text excerpt from the article [1]. > Below paragraph I didn't understand quite well.Mainly in bold letters.Could > anybody please explain how this will lead to an infinite loop. It seems self-explanatory. Most atomic ops

Re: How to get current core id in kernel source

2011-08-06 Thread Daniel Baluta
Hello, > I wish to get the current core id in which the code is being processed, > in device driver code. > What function or global variable can I use ? I think smp_processor_id is the function you are looking for ([1]). thanks, Daniel. [1] http://lxr.linux.no/linux+v3.0/include/linux/smp.h#L17

Re: linux dma apis

2011-07-16 Thread Daniel Baluta
On Sat, Jul 16, 2011 at 10:23 AM, Abhishek Batta wrote: > Hello everyone, > > Please point me to some useful links to start understanding linux dma . Please check Documentation/ files: * DMA-API-HOWTO.txt * DMA-API.txt thanks, Daniel. [1] http://lxr.linux.no/linux+v2.6.39/Documentation/DMA-API-

Re: Need help understanding memory models, cpu modes and address translation

2011-07-13 Thread Daniel Baluta
Hi, > I am eager to understand the basics of Memory models  (flat, segmented etc) > , CPU modes (real,protected) > and address translation (physical to logical etc.) and how all of them work > together. I am very confused > about this and would really appreciate if someone could provide good > ref

Re: question about staging tree branches

2011-07-12 Thread Daniel Baluta
On Tue, Jul 12, 2011 at 7:01 PM, Greg KH wrote: > On Tue, Jul 12, 2011 at 12:15:17PM +0530, Prashant Shah wrote: >> Hi, >> >> There are 4 branches in the staging tree >> >>   remotes/staging/master >>   remotes/staging/ralink >>   remotes/staging/staging-linus >>   remotes/staging/staging-next >>

Re: data transfer from kernel to user space

2011-07-12 Thread Daniel Baluta
On Tue, Jul 12, 2011 at 9:56 AM, Amit Nagal wrote: > On Tue, Jul 12, 2011 at 11:51 AM, Tirtha Ghosh wrote: >> Use a shared memory between user space and kernel space. >> The same physical memory can be translated as user-space virtual address as >> well as kernel space. >> See more about mmap, io

Re: timer problem

2011-07-07 Thread Daniel Baluta
On Wed, Jul 6, 2011 at 11:48 PM, Daniel Baluta wrote: > Hello Prashant, > >> struct timer_list tim; >> >> void timfunc(unsigned long data) >> { > [..] >>        schedule_timeout(10 * HZ); > [..] >> } >> >> static int __init init_testmod(

Re: timer problem

2011-07-06 Thread Daniel Baluta
Hello Prashant, > struct timer_list tim; > > void timfunc(unsigned long data) > { [..] >        schedule_timeout(10 * HZ); [..] > } > > static int __init init_testmod(void) > { >        init_timer(&tim); >        tim.expires = jiffies + HZ*5; >        tim.data = 1000; >        tim.function = timfu

Re: Problem in compiling kernel

2011-06-29 Thread Daniel Baluta
On Wed, Jun 29, 2011 at 4:37 PM, Ponkumaran Annadurai wrote: > > > On Wed, Jun 29, 2011 at 12:42 PM, Daniel Baluta > wrote: >> >> >>> I got struck in making initrd file, I got the following error >> >>> >> >>> >>

Re: Problem in compiling kernel

2011-06-29 Thread Daniel Baluta
On Wed, Jun 29, 2011 at 9:28 AM, Mulyadi Santosa wrote: > On Wed, Jun 29, 2011 at 01:08, Daniel Baluta wrote: >> On Tue, Jun 28, 2011 at 8:39 PM, Ponkumaran Annadurai >> wrote: >>> >>> >>> I got struck in making initrd file, I got the following error

Re: Problem in compiling kernel

2011-06-28 Thread Daniel Baluta
On Tue, Jun 28, 2011 at 8:39 PM, Ponkumaran Annadurai wrote: > > > I got struck in making initrd file, I got the following error > > > root@rocker:/boot# mkinitramfs -o  initrd.img-2.6.39.1 2.6.39.1Y 2.6.39.1Y? - shouldn't it be 2.6.39.1. These days I cooked a script to compile the kernel. Perha

Re: how to test a linux driver for SMP concurrency issues

2011-06-28 Thread Daniel Baluta
On Tue, Jun 28, 2011 at 3:36 PM, Amit Nagal wrote: > Hi , > > i want to test a linux driver to identify concurrecy issue that may > arise on a SMP system . > can i be advised with  usage of some tools / mechanisms , so that the > driver can be made SMP safe ? Hi, Check make menuconfig -> Kernel

Re: Problem in compiling kernel

2011-06-28 Thread Daniel Baluta
On Tue, Jun 28, 2011 at 2:07 PM, Ponkumaran Annadurai wrote: > > > On Tue, Jun 28, 2011 at 1:13 PM, Daniel Baluta > wrote: >> >> >> Have you tried to setup some sort of cross-compilation environment? >> >> Could you check CROSS_COMPILE env variable? >

Re: Problem in compiling kernel

2011-06-28 Thread Daniel Baluta
>> Have you tried to setup some sort of cross-compilation environment? >> Could you check CROSS_COMPILE env variable? >  Yes, I have given yes for that option during configuration OK, then that's your problem. CROSS_COMPILE is a string pointing to your cross compiler prefix. thanks, Daniel. ___

Re: Problem in compiling kernel

2011-06-27 Thread Daniel Baluta
On Mon, Jun 27, 2011 at 7:21 PM, Ponkumaran Annadurai wrote: > Hello, > > I encountered the following error while compiling the kernel version > linux-2.6.39.1. So I am giving here what I got on my screen. > > root@rocker:/usr/src/linux-2.6.39.1# make >   CHK include/linux/version.h >   CHK   

Re: threading problem

2011-06-22 Thread Daniel Baluta
Hello Murali, > I have a device driver which provides the IOCTL function for the > application to interact. > > when the application sends the IOCTL CMD_GO, my driver has to toggle a > GPIO every 500 m Sec. until a 3 minute timeout occurs or a CMD_STOP > IOCTL is received. > > I tried the DECLARE_

Re: tools to identify linux kernel panics and system hangs

2011-06-19 Thread Daniel Baluta
On Sun, Jun 19, 2011 at 9:33 AM, Amit Nagal wrote: > Hi , > > What are the best tools to trace  linux kernel  panics and system > hangs for linux kernel . > please recommend for x86 as well as arm platforms . Look under kernel hacking. There are a lot of useful tools like: kmemcheck, lockdep, sla

Getting started with kernel sources [Was: No subject]

2011-06-16 Thread Daniel Baluta
On Thu, Jun 16, 2011 at 2:41 PM, Venkateswarlu P wrote: > how to understand the kernerl source  files in a simple way > > > what header  files i have to understand first > > > for example  to understand  do_fork() function  for process > creation  which is defined in  kernel/fork.c There'

Re: struct task_struct

2011-06-14 Thread Daniel Baluta
> Now ,iam reading  Linux kernel Development  3rd ed > > > I want  the  explanation of each member of   struct task_struct    found in > Hello, This structure is very well described in Chapter 2.3 from 'Professional Linux Kernel Architecture' by W. Mauerer. Please fix your email client to send

  1   2   >