Re: unlikely compiler flag propagation

2015-02-18 Thread Matthias Brugger
Hi Greg, hi all,

2015-02-18 19:24 GMT+01:00 Greg KH :
> On Wed, Feb 18, 2015 at 07:09:47PM +0100, Matthias Brugger wrote:
>> Hi all,
>>
>> I have a question about the unlikely compiler flag.
>> When a called function is only returns an error with the unlikely flag
>> set, should I set the unlikely compiler flag for the return value
>> check in the callee as well?
>>
>> For example:
>>
>> int function_one(int *list, int num_elements)
>> {
>> int i;
>> for (i =0; i < num_elements; i++) {
>> if (unlikely(check_element(list + i)))
>>return 1;
>> }
>>
>> [...]
>>
>> return 0;
>> }
>>
>> int function_two(...)
>> {
>> [...]
>>
>>  if (function_one(list, num))
>>  return -1;
>> }
>>
>>
>> So my question is, if function_two should instead implement:
>> if (unlikely(function_one(list, num))
>>
>> Or does the unlikely compiler flag propagate to calling functions?
>
> NEVER use unlikely/likely unless you can actually measure that it
> matters if you use it.  The compiler and processor is almost always
> better at making these types of guesses and predictions, so let it do
> the work instead.
>
> As proof of this, there was a test of the kernel a year or so ago that
> measured the placement of the existing likely/unlikely markers in the
> kernel and 90% of the usages were wrong and actually slowed down the
> processor.
>
> So just don't use it, unless you can measure it.

I was just asking about the propagation because I found that
get_page_from_freelist [0] in mm/page_alloc.c calls prep_new_page [1]
which in place returns an error when entering an unlikely marked
branch.
As this happens in the fast path of a page allocation, I hope the
marker is properly set :)

So is it needed to set the unlikely in the get_page_from_freelist as
well, or will the compiler propagate the mark?

Cheers,
Matthias

[0] 
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/mm/page_alloc.c#n2171
[1] 
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/mm/page_alloc.c#n966

>
> thanks,
>
> greg k-h



-- 
motzblog.wordpress.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


unlikely compiler flag propagation

2015-02-18 Thread Matthias Brugger
Hi all,

I have a question about the unlikely compiler flag.
When a called function is only returns an error with the unlikely flag
set, should I set the unlikely compiler flag for the return value
check in the callee as well?

For example:

int function_one(int *list, int num_elements)
{
int i;
for (i =0; i < num_elements; i++) {
if (unlikely(check_element(list + i)))
   return 1;
}

[...]

return 0;
}

int function_two(...)
{
[...]

 if (function_one(list, num))
 return -1;
}


So my question is, if function_two should instead implement:
if (unlikely(function_one(list, num))

Or does the unlikely compiler flag propagate to calling functions?

Thanks a lot,
Matthias
-- 
motzblog.wordpress.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: x86_64_defconfig and i386_defconfig: What is the difference?

2014-09-09 Thread Matthias Brugger


On 09/09/14 09:58, Rajat Jain wrote:
> Hi,
> 
> Can someone tell me if the i386 one is to be used when we want to build for a 
> 32bit machine and the x86_64 is to be used for 64 bit machine?

You can build the kernel with any architecture for any architecture.
This is called cross-compiling. The homepage [0] should explain you how
to do that.

Cheers,
Matthias

[0] http://kernelnewbies.org/FAQ/KernelCrossCompilation

> 
> Thanks,
> 
> Rajat
> 
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> 

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Kconfig set default macro bug?

2014-04-09 Thread Matthias Brugger
Hi all,

I'm just playing with the early printk macros of the low level printk.
The address of the UART port is set to a default value [1].
So if you save the config and then enter again in menuconfig, you are
not able to change the value to a different default value (I suppose
because Kconfig see the value as set), but there is no way to find out
what the values for other UART ports would be. E.g. you have
accidentally selected the wrong port.

The only solution is, to disable the low level debugging functions,
save the config and open it with menuconfig again.

I'm not quite sure if this is the most convenient way of doing this.
At least the default address should be readable from the config to
change the value by hand.

Does anyone know if we can consider this to be a bug?

Cheers,
Matthias

[1] 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/Kconfig.debug?id=refs/tags/v3.14#n1007

-- 
motzblog.wordpress.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: DTS: clock not found

2014-02-07 Thread Matthias Brugger
Hi Javier,

2014-02-06 Javier Martinez Canillas :
> Hello Matthias,
>
> On Wed, Feb 5, 2014 at 6:02 PM, Matthias Brugger  
> wrote:
>> Hi,
>>
>> I'm stuck with dts problem. Whenever I try to find a clock for my
>> device, the of_get_clk returns an error "Kernel panic - not syncing:
>> Can't get timer clock"
>>
>> My DTS looks like this (reduced to relevant parts for easier reading):
>>
>
> Could you give more details about your platform?
>
> I would take a look to Documentation/devicetree/bindings/clock/ platform>-clock.txt to be sure that you are using the bindings
> correctly.
>

This is part of some effort to port Linux to a new SoC, so no
documentation up to now...
Anyway I found the error.

I forgot to add my SoC to arch/arm/Makefile so that my SoC specific
init funtion weren't called.
So my device tree wasn't populated and therefore the clock had no properties.

>> #include 
>> #include 
>> #include "skeleton.dtsi"
>>
>> / {
>>
>> [...]
>>
>> soc {
>> #address-cells = <1>;
>> #size-cells = <1>;
>> compatible = "simple-bus";
>> ranges;
>>
>> gic: interrupt-controller@10212000 {
>> compatible = "arm,cortex-a9-gic";
>> interrupt-controller;
>> #interrupt-cells = <3>;
>> reg = <0x10211000 0x1000>,
>>   <0x10212000 0x1000>;
>> };
>>
>>osc: oscillator {
>> compatible = "fixed-clock";
>> #clock-cells = <1>;
>
> Looking at Documentation/devicetree/bindings/clock/fixed-clock.txt it says:
>
> #clock-cells : from common clock binding; shall be set to 0

Yes, you are right.

>
> while your are setting your clock-cells to 1.
>
>> clock-frequency  = <1500>;
>> clock-output-names = "osc";
>> };
>>
>> timer: timer-mysoc {
>> compatible = "mysoc,mysoc-timer";
>> reg = <0x10008000 0x30>;
>> interrupts = ;
>> clocks = <&osc 0>;
>> clock-names = "system15m";
>> };
>> };
>
> Documentation/devicetree/bindings/clock/clock-bindings.txt also says:
>
> ==Clock consumers==
>
> Required properties:
> clocks: List of phandle and clock specifier pairs, one pair
> for each clock input to the device.  Note: if the
> clock provider specifies '0' for #clock-cells, then
> only the phandle portion of the pair will appear.
>
> So my educated guess is that you should use #clock-cells = <0>; your
> your clock provider device node and clocks = <&osc> on your clock
> consumer device node.

Thats true.

>
> By looking at DTS and DTSI that uses the fixed-clock binding I see
> that all platforms don't have their clocks providers device nodes
> under soc {} but on a separate clocks {} node. I didn't find on the
> clock-bindings.txt DT bindings documentation that this is a
> requirement so probably that is not issue in your case but still
> something to keep in mind.
>

The code I posted is nearly similar to the example in
Documentation/devicetree/bindings/clock/clock-bindings.txt.
Anyway it seems that of_clk_get searches for the "#clock-cells" cells
in the list "clocks". I suppose that the "clocks" list is populated by
the node present under clocks {}.

Thanks a lot for your hints.
Matthias

>> };
>>
>>
>> my /drivers/clocksource/mysoc-timer.c looks like this (reduced to
>> relevant parts for easier reading):
>>
>> [...]
>>
>> static void __init mysoc_timer_init(struct device_node *node)
>> {
>> unsigned long rate = 0;
>> struct clk *clk;
>> int ret, irq;
>> u32 val;
>>
>> gpt_base = of_iomap(node, 0);
>> if (!gpt_base)
>> panic("Can't map registers");
>>
>> irq = irq_of_parse_and_map(node, 0);
>> if (irq <= 0)
>> panic("Can't parse IRQ");
>>
>> clk = of_clk_get(node, 0);
>> if (IS_ERR(clk))
>> panic("Can't get timer clock");
>> clk_prepare_enable(clk);
>>
>> rate = clk_get_rate(clk);
>>
>> }
>> CLOCKSOURCE_OF_DECLARE(mtk_mt6589, "mysoc,mysoc-timer",
>> mysoc_timer_init);
>>
>>
>> What I'm missing? I seems as if the clock "osc" is not found in the
>> device tree. Any idea why. Building the DTB works without errors, but
>> I suppose that doesn't mean too much anyway.
>>
>> Cheers,
>> Matthias
>>
>> --
>> motzblog.wordpress.com
>
> Hope it helps,
>
> Javier



-- 
motzblog.wordpress.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


DTS: clock not found

2014-02-05 Thread Matthias Brugger
Hi,

I'm stuck with dts problem. Whenever I try to find a clock for my
device, the of_get_clk returns an error "Kernel panic - not syncing:
Can't get timer clock"

My DTS looks like this (reduced to relevant parts for easier reading):

#include 
#include 
#include "skeleton.dtsi"

/ {

[...]

soc {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
ranges;

gic: interrupt-controller@10212000 {
compatible = "arm,cortex-a9-gic";
interrupt-controller;
#interrupt-cells = <3>;
reg = <0x10211000 0x1000>,
  <0x10212000 0x1000>;
};

   osc: oscillator {
compatible = "fixed-clock";
#clock-cells = <1>;
clock-frequency  = <1500>;
clock-output-names = "osc";
};

timer: timer-mysoc {
compatible = "mysoc,mysoc-timer";
reg = <0x10008000 0x30>;
interrupts = ;
clocks = <&osc 0>;
clock-names = "system15m";
};
};
};


my /drivers/clocksource/mysoc-timer.c looks like this (reduced to
relevant parts for easier reading):

[...]

static void __init mysoc_timer_init(struct device_node *node)
{
unsigned long rate = 0;
struct clk *clk;
int ret, irq;
u32 val;

gpt_base = of_iomap(node, 0);
if (!gpt_base)
panic("Can't map registers");

irq = irq_of_parse_and_map(node, 0);
if (irq <= 0)
panic("Can't parse IRQ");

clk = of_clk_get(node, 0);
if (IS_ERR(clk))
panic("Can't get timer clock");
clk_prepare_enable(clk);

rate = clk_get_rate(clk);

}
CLOCKSOURCE_OF_DECLARE(mtk_mt6589, "mysoc,mysoc-timer",
mysoc_timer_init);


What I'm missing? I seems as if the clock "osc" is not found in the
device tree. Any idea why. Building the DTB works without errors, but
I suppose that doesn't mean too much anyway.

Cheers,
Matthias

-- 
motzblog.wordpress.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: ARM Linux and ATAGS

2014-01-12 Thread Matthias Brugger
El dia 09/01/2014 8:48, "Mj Embd"  va escriure:
>
> Hi,
>
> What are atags and are they still used after addition of device tree in
linux ?

Afaik atags is the mechanism how the kernel gets the boot parameter from
the bootloader.
In the kernel config you can decide if you will use the boot parameter from
the bootloader or the ones from the device tree file.

Cheers,
Matthias

>
> Regards
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Introducing Myself, Looking to Learn

2013-10-28 Thread Matthias Brugger
2013/9/3 Robert P. J. Day :
> On Tue, 3 Sep 2013, valdis.kletni...@vt.edu wrote:
>
>> On Wed, 04 Sep 2013 02:05:42 +0530, Varad Gautam said:
>> > Hi Vladis! Thanks for replying. I think I would be fine with
>> > writing real code once I figure out what goes where.
>>
>> Well, assuming you have a background as a professional or very
>> serious amateur programmer, *and* you have a *particular* drive to
>> do something specific.  There's still a lot of code being added by
>> amateurs who have some weird USB device that doesn't have a driver
>> and so on - but there's less and less room for beginners that just
>> want to hack code and don't care where.  Data structures and
>> algorithms have gotten more complex, the locking is more
>> fine-grained and subtle - gone are the days you could just take the
>> Big Kernel Lock and not worry, now you ofteh have to understand
>> stuff like RCU locking.
>>
>> So you might want to stop and ask yourself *why* you want to write
>> code for the kernel. :)
>
>  i'm going to jump in here since i see this question annoyingly
> frequently -- "i'm new to the kernel and i want to get involved and
> write code; how do i start?"  to be blunt, if that's your starting
> point, you're not ready to write code for the kernel. period.
>
>  as vladis quite correctly points out, gone are the days when there
> was piles of simple coding to be done. most of the kernel is well
> established, solid and stable, and ongoing development is *very*
> advanced. in other words, there's less and less room for enthusiastic
> beginners. but there's more.
>
>  at the very least, you should have an idea of what part of the kernel
> interests you most. if you can't even identify which major subsystem
> -- networking, USB, video, etc. -- you want to work on, you aren't
> even *remotely* ready to start writing code.
>
>  it's somewhat absurd to say you want to get involved in kernel
> development, then ask *others* where you should start. it's like
> saying, "i really want to write a book, but i have no idea what i
> should write about. can you give me some ideas for a plot? and
> characters? and possibly an ending?" yes, it's that silly.
>
>  if you're a beginner, then the obvious starting point is to start
> reading. and read. and read. and when you're done reading, read some
> more. and slowly, you'll figure out what interests you most. and
> that's where you then spend your time.

Basically my answer to this kind of questions is, to start reading
LDD3 [1] try to figure out what have changed and try to get the source
code examples work with a newer kernel [2].

[1] http://lwn.net/Kernel/LDD3/
[2] https://github.com/martinezjavier/ldd3

Cheers,
Matthias

>
> rday
>
> --
>
> 
> Robert P. J. Day Ottawa, Ontario, CANADA
> http://crashcourse.ca
>
> Twitter:   http://twitter.com/rpjday
> LinkedIn:   http://ca.linkedin.com/in/rpjday
> 
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



-- 
motzblog.wordpress.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


First userspace executalbe run at boot up

2013-08-27 Thread Matthias Brugger
Hi all,

I'm actually reading the init/main.c source code to understand which
is the first user space program the Linux kernel runs.

As far as I understood it:
1. tries to execute the file defined by the rdinit= kernel parameter
and sets it to "/init" if the parameter is not given
2. tries to execute the file defined by the init= kernel parameter
3. /sbin/init
4. /etc/init
5. /bin/init
6. /bin/sh
7. No init found - error

All of them try to execute init by invoking run_init_process.
So my question is, why does the rdinit= parameter exist, I suppose for
reasons of compatibility with older kernel versions. But why it is set
to "/init"?
Searching in the web, I found information saying that the first file,
the Linux kernel executes after boot is "/sbin/init". As far as I
understand that's not correct.

Cheers,
Matthias
-- 
motzblog.wordpress.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: pulling in patches mentioned in mails (linux-ker...@vger.kernel.org)

2013-08-04 Thread Matthias Brugger
El 25/07/2013 5:14, "kernel neophyte"  va
escriure:
>
> Hi,
>
> I am sorry if this has been asked before, I tried to look around but did
not get an solution and hence the mail.
>
> In this mail from Mel Gorman:
>
> https://lkml.org/lkml/2013/7/15/362
>
> He mentions a set of patches:
>
> https://lkml.org/lkml/2013/7/15/292
>
> https://lkml.org/lkml/2013/7/15/383
>
> https://lkml.org/lkml/2013/7/15/322
>
> Could someone please teach me
>
> 1) how do I find out where is the tree he is working on (i.e. is he
working on linux-next or ... )
> 2) Where do I find these patches mentioned ? Currently I cut copy paste
in a vim manually and its really frustrating, could some one please point
out the right way of pulling these patches. via git ?

If you use a mail client, you can just save the mail. Now just use e.g. git
apply to apply it to your own branch.

Cheers,
Matthias

>
> Thanks a lot for your time in advance.
>
> -Neophyte
>
> PS: This is my first ever mail in public, please pardon my grammatical
errors or choice of words.
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Memory leaks in Samsung's kernel

2013-05-30 Thread Matthias Brugger
El 28/05/2013 19:16, "Michał Akaanonim"  va escriure:
>
> Hi,
> I'm developing custom kernel for my Samsung Galaxy Ace 2 phone.
> First, I'd like to check if there are any bugs, so I built kernel with
kmemleak enabled and I get 10 entries, for example:
>
> unreferenced object 0xce2a2000 (size 8192):
>   comm "vold", pid 1855, jiffies 4294942835 (age 1394.240s)
>   hex dump (first 32 bytes):
> 00 00 00 00 24 7e 50 c0 d0 7d 50 c0 7c 7d 50 c0  $~P..}P.|}P.
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
>   backtrace:
> [] create_object+0x10c/0x24c
> [] kmemleak_alloc+0x6c/0xd0
> [] __kmalloc+0x178/0x27c
> [] __crypto_alloc_tfm+0x4c/0x140
> [] crypto_spawn_tfm+0x78/0xcc
> [] crypto_cbc_init_tfm+0x2c/0x44
> [] __crypto_alloc_tfm+0xa0/0x140
> [] crypto_spawn_tfm+0x78/0xcc
> [] skcipher_geniv_init+0x2c/0x54
> [] eseqiv_init+0x50/0x54
> [] __crypto_alloc_tfm+0xa0/0x140
> [] crypto_alloc_ablkcipher+0x68/0xa8
> [] crypt_ctr+0x294/0x8a0
> [] dm_table_add_target+0xf8/0x260
> [] table_load+0x114/0x2c4
> [] dm_ctl_ioctl+0x1d0/0x2cc
>
> I noticed that in 6 of 10 entries there are dm_ctl_ioctl, table_load and
dm_table_add_target functions. So I think something is wrong with MD driver
but I compared source of this driver with other find on net and there
aren't any differences.
> Source code of my kernel can be found here:
https://github.com/hckk/GT-I8160_Kernel
>
> Thanks for any help.

Could it be false positives?

Regards,
Matthias

> Greetings, Michal.
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: how do i read a block

2013-05-13 Thread Matthias Brugger
El 13/05/2013 10:07, "shampavman"  va escriure:
>
> Hi all,
>
> Supposing i create a file of size 10K, it will occupy 2 blocks (4K each).
> Now if i want to read only 1 block from it how can i do it?
>
> read(fd, buf, 4096) ;
> would this mean i would read the first block and all its contents?

You actually might even read more, depending on your file system. The
dentrys and inodes are stored in blocks on the disk as well. You can try to
access your disk through /dev/sdX directly, but beware that when writing
you will most probably destroy your data on that disk.

Regards,
Matthias

>
> Thanks
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: [help] kernel oops in function gpio_to_irq

2013-03-30 Thread Matthias Brugger
El 27/03/2013 18:16, "Mylene Josserand"  va
escriure:
>
> Hi everyone,
>
>
> I have a problem with gpio functions.
> My kernel version is 3.8.2 and my SoC is a imX27 on a "home-made" board.
>
> First, when I boot, I had only the "Starting kernel..." message.
> So I rebuild my kernel with CONFIG_DEBUG_KERNEL, CONFIG_DEBUG_LL and
> CONFIG_EARLY_PRINTK. I have also add the line
> "earlyprintk=console,UART0,115200" on the bootargs of my Barebox.
>
> With that, I can see more messages :
>
> [...]
> Unable to handle kernel NULL pointer dereference at virtual address
002c
> pgd = c0004000
> [002c] *pgd=
> Internal error: Oops: 5 [#1] PREEMPT ARM
> Modules linked in:
> CPU: 0Not tainted  (3.8.2+ #4)
> PC is at __gpio_to_irq+0x1c/0x44
> LR is at navocap_baseboard_init+0xd8/0x2c8
> pc : []lr : []psr: 6053
> sp : c7835ef0  ip : 0079  fp : c05a5628
> r10: c04f817c  r9 :   r8 : c05a562c
> r7 : c7834000  r6 : 0004  r5 : c05158c4  r4 : c0578844
> r3 : 05ac  r2 : c05b0410  r1 : c7834000  r0 : 
> Flags: nZCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
> Control: 0005317f  Table: a0004000  DAC: 0017
> Process swapper (pid: 1, stack limit = 0xc78341b8)
> Stack: (0xc7835ef0 to 0xc7836000)
> 5ee0: c05158c4 c04fd468 0002
> 10009000
> 5f00: 10009fff  0200    c05158c4
> c04fd348
> 5f20: c0578844 c04f819c c04d23dc c00087f8 0003 0003 c04d1b2c
> c06bd6a0
> 5f40:  c0578844 c05158c4 0004 008b c05a562c c0515898
> c04f6378
> 5f60: c05a5620 c04f62a0 0003 0003 c04f6378 c00403e0 
> 
> 5f80: c03cfee0      
> c03cfeec
> 5fa0:   c03cfee0 c00093b0   
> 
> 5fc0:       
> 
> 5fe0:     0013  0010
> 000a1000
> [] (__gpio_to_irq+0x1c/0x44) from []
> (navocap_baseboard_init+0xd8/0x2c8)
> [] (navocap_baseboard_init+0xd8/0x2c8) from []
> (customize_machine+0x20/0x30)
> [] (customize_machine+0x20/0x30) from []
> (do_one_initcall+0x2c/0x168)
> [] (do_one_initcall+0x2c/0x168) from []
> (kernel_init_freeable+0xf4/0x1cc)
> [] (kernel_init_freeable+0xf4/0x1cc) from []
> (kernel_init+0xc/0x164)
> [] (kernel_init+0xc/0x164) from []
> (ret_from_fork+0x14/0x24)
> Code: e0433100 e1a0c000 e7920003 e24dd004 (e590302c)
> ---[ end trace 61bb09c25216d85b ]---
> Kernel panic - not syncing: Attempted to kill init! exitcode=0x000b
>
>
> The problem is in the function "gpio_to_irq" in my board init functions
> (navocap_baseboard_init).
>
> To know which lines the opps appears, I have followed this tutorial :
> https://wiki.ubuntu.com/Kernel/KernelDebuggingTricks
>
> Thanks to it, I can notice that the opps appears when I called the
> "gpio_to_irq" function in :
>
> ret = request_irq(gpio_to_irq(IMX_GPIO_NR(2,14)), detect_irq,
> IRQF_TRIGGER_FALLING, "imx-mmc-detect", data);

Make sure your arguments are not NULL (IMX_GPIO_NR, detect_irq and data).

Some extra printk's before calling request_irq should do.

>
>
> I have checked in other boards how to use this function and it is
> configured in the same way.
> I did see where I have made a mistake. Maybe in my config file where I
> have missed a configuration option ? How to solve this opps problem ? It
> would be very great if someone could give me some helps / feedbacks on
> this problem.
>
> Thank you in advance !
>
> Best regards,
>
>
> --
> Mylène JOSSERAND
> Navocap
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: BFQ: simple elevator

2013-03-25 Thread Matthias Brugger
2013/3/25 Raymond Jennings :
> On Sat, Mar 23, 2013 at 9:42 AM, Matthias Brugger
>  wrote:
>> On 03/23/2013 01:05 AM, Raymond Jennings wrote:
>>
>> On Fri, Mar 22, 2013 at 2:20 PM,   wrote:
>>
>> On Fri, 22 Mar 2013 13:53:45 -0700, Raymond Jennings said:
>>
>> The first heap would be synchronous requests such as reads and syncs
>> that someone in userspace is blocking on.
>>
>> The second is background I/O like writeback and readahead.
>>
>> The same distinction that CFQ completely makes.
>>
>> Again, this may or may not be a win, depending on the exact workload.
>>
>> If you are about to block on a userspace read, it may make sense to go ahead
>> and tack a readahead on the request "for free" - at 100MB/sec transfer and
>> 10ms
>> seeks, reading 1M costs the same as a seek.  If you read 2M ahead and save 3
>> seeks later, you're willing.  Of course, the *real* problem here is that how
>> much readahead to actually do needs help from the VFS and filesystem levels
>> -
>> if there's only 600K more data before the end of the current file extent,
>> doing
>> more than 600K of read-ahead is a loss.
>>
>> Meanwhile, over on the write side of the fence, unless a program is
>> specifically using O_DIRECT, userspace writes will get dropped into the
>> cache
>> and become writeback requests later on.  So the vast majority of writes will
>> usually be writebacks rather than syncronous writes.
>>
>> So in many cases, it's unclear how much performance CFQ gets from making
>> the distinction (and I'm positive that given a sufficient supply of pizza
>> and
>> caffeine, I could cook up a realistic scenario where CFQ's behavior makes
>> things worse)...
>>
>> Did I mention this stuff is tricky? :)
>>
>> Oh I'm well aware that it's tricky.  but as I said i'm more interested
>> in learning the api than tuning performance.
>>
>> Having a super efficient toaster won't do much good if I can't plug
>> the darn thing in.
>>
>>
>> If you want to understand the interface, I would recommend to start having a
>> look to the noop scheduler. It's by far the simplest implementation of a
>> scheduler.
>>
>> For me a good starting point were this slides:
>> http://www.cs.ccu.edu.tw/~lhr89/linux-kernel/Linux%20IO%20Schedulers.pdf
>>
>> Hope that helps you to bring the theory into practice :)
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>>
>
> Just what I was looking for.
>
> Now, how do I enable/disable my scheduler during kernel config?

1. Add your disk scheduler to the kernel sources (Kconfig, Makefile
and in block/bfq-iosched.c)
2. Add the bfq scheduler in the kernel config (as a moudle might make sense)
3. Recompile and install your new kernel
4. You can load/unload the module dynamically. Via sysfs you can
associate the bfq scheduler with one disk.

Happy hacking :)

-- 
---
motzblog.wordpress.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: BFQ: simple elevator

2013-03-23 Thread Matthias Brugger
 On 03/23/2013 01:05 AM, Raymond Jennings wrote:

On Fri, Mar 22, 2013 at 2:20 PM,  
 wrote:

 On Fri, 22 Mar 2013 13:53:45 -0700, Raymond Jennings said:


 The first heap would be synchronous requests such as reads and syncs
that someone in userspace is blocking on.

The second is background I/O like writeback and readahead.

The same distinction that CFQ completely makes.

 Again, this may or may not be a win, depending on the exact workload.

If you are about to block on a userspace read, it may make sense to go ahead
and tack a readahead on the request "for free" - at 100MB/sec transfer and 10ms
seeks, reading 1M costs the same as a seek.  If you read 2M ahead and save 3
seeks later, you're willing.  Of course, the *real* problem here is that how
much readahead to actually do needs help from the VFS and filesystem levels -
if there's only 600K more data before the end of the current file extent, doing
more than 600K of read-ahead is a loss.

Meanwhile, over on the write side of the fence, unless a program is
specifically using O_DIRECT, userspace writes will get dropped into the cache
and become writeback requests later on.  So the vast majority of writes will
usually be writebacks rather than syncronous writes.

So in many cases, it's unclear how much performance CFQ gets from making
the distinction (and I'm positive that given a sufficient supply of pizza and
caffeine, I could cook up a realistic scenario where CFQ's behavior makes
things worse)...

Did I mention this stuff is tricky? :)


 Oh I'm well aware that it's tricky.  but as I said i'm more interested
in learning the api than tuning performance.

Having a super efficient toaster won't do much good if I can't plug
the darn thing in.


If you want to understand the interface, I would recommend to start having
a look to the noop scheduler. It's by far the simplest implementation of a
scheduler.

For me a good starting point were this slides:
http://www.cs.ccu.edu.tw/~lhr89/linux-kernel/Linux%20IO%20Schedulers.pdf

Hope that helps you to bring the theory into practice :)

 ___
Kernelnewbies mailing
listKernelnewbies@kernelnewbies.orghttp://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: BFQ: simple elevator

2013-03-23 Thread Matthias Brugger
On 03/20/2013 10:41 PM, Raymond Jennings wrote:
> On Wed, Mar 20, 2013 at 2:03 PM,   wrote:
>> On Thu, 21 Mar 2013 02:24:23 +0700, Mulyadi Santosa said:
>>
>>> pardon me for any possible sillyness, but what happen if there are
>>> incoming I/O operation at very nearby sectors (or perhaps at the same
>>> sector?)? I suppose, the elevator will prioritize them first over the
>>> rest? (i.e starving will happen...)
> This is actually why I proposed to enforce forward progress by only
> looking for further requests in one direction at a time.
>
> Suppose you have requests at sectors 1, 4, 5, and 6
>
> You dispatch sectors 1, 4, and 5, leaving the head parked at 5 and the
> direction as ascending.
>
> But suddenly, just before you get a chance to dispatch for sector 6,
> sector 4 gets busy again.
>
> I'm not proposing going back to sector 4.  It's behind us and (as you
> indicated) we could starve sector 6 indefinitely.
>
> So instead, because sector 4 is on the wrong side of our present head
> position, it is ignored and we keep marching forward, and then we hit
> sector 6 and dispatch it.
>
> Once we hit sector 6 and dispatch it, we do a u-turn and start
> descending.  That's when we pick up sector 4 again.
>
> When we're going up, we ignore what's below us, and when we're going
> down we ignore what is above us.
>
> We only switch directions when there's nothing in front of us the way
> we were going.  In theory, given that disk capacity is itself finite,
> so too is the amount of time one has to wait before getting reached by
> the elevator.
>
> Anyway, does this clarification answer your concerns about starvation?
>
>> And this, my friends, is why elevators aren't as easy to do as the average
>> undergrad might hope - it's a lot harder to balance fairness and throughput
>> across all the corner cases than you might think.  It gets really fun
>> when you have (for example) a 'find' command moving the heads all over
>> the disk while another process is trying to do large amounts of streaming
>> I/O.  And then you'll get some idiot process that insists on doing the
>> occasional fsync() or syncfs() call.  Yes, it's almost always *all*
>> corner cases, it's very rare (unless you're an embedded system like a Tivo)
>> that all your I/O is one flavor that is easily handled by a simple elevator.
> In my case I'm just concerned with raw total system throughput.
>
> I called it "BFQ" for a reason.

It sounds to me like the LOOK disk scheduling algorithm from 1970? Or do 
I miss something?


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Android Kernel Compilation

2013-01-31 Thread Matthias Brugger
2013/1/30 Rahul Gandhi :
> I am trying to compile Kernel for my Android device. I am using the NDK
> Toolchain (arm-linux-androideabi-4.4.3). When I use the defconfig, the
> kernel compiles without any errors but when I flash it onto my device, it
> either gets stuck on the HTC logo or continuously reboots.
> If I pull the config.gz from my device, it gives errors at the tome of
> compilation.
>
> What could have possibly gone wrong?

first of all, check the kernel logs. that will give you a clue where
to start digging.

>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
---
motzblog.wordpress.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: guides to board files -> device-tree and Android -> mainline?

2013-01-26 Thread Matthias Brugger
Hi Paul,

2013/1/26 Paul Wise :
> Hi all,
>
> Are there any guides for developers new to Linux for:
>
>   * converting board files to device-tree
>   * porting drivers and patches from Android to current mainline?

there are several parts of Android, which are not part of the mainline
kernel. Others are in staging. See
http://elinux.org/Android_Mainlining_Project for more details.

Regarding drivers for chips on your board, see the kernel
documentation about coding style
(http://lxr.free-electrons.com/source/Documentation/CodingStyle) and
submitting drivers
(http://lxr.free-electrons.com/source/Documentation/SubmittingDrivers),
submitting patches etc.

Beware to send the patches/drivers to the right mailing list (see the
MAINTAINERS file).

If you want to add the board itself and it is ARM based, then you have
to create a device tree file. I think the older board files are no
more accepted in the mainline kernel.

Hope that answered your question.
Cheers and happy hacking.
Matthias

>
> There are a lot of ARM mobile devices out there that aren't supported by
> Linux mainline and having these guides available would really help
> getting the usual Linux distros to support more mobile devices. Usually
> the SoC is supported by mainline but the board is not, as is the case
> for the device I have been trying to work on:
>
> http://bonedaddy.net/pabs3/log/2012/12/03/debian-mobile/
>
> --
> bye,
> pabs
>
> http://bonedaddy.net/pabs3/
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
---
motzblog.wordpress.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


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

2012-12-14 Thread Matthias Brugger
Hi,

On 12/14/2012 01:53 AM, horse_rivers wrote:
> At 2012-12-13 18:52:53,"Matthias Brugger"  wrote:
>> On 12/13/2012 04:17 AM, horse_rivers wrote:
>>>   is there method for doing this work? take kernel data to user?
>>
>> I think copy_to_user is what you are looking for:
>> http://lxr.free-electrons.com/source/include/asm-generic/uaccess.h#L253
>>
>
> thanks !
>
> can this function run at user level ?
>
> when programme is   at user level , can  I use this function to get kernel 
> text segment data ,and then analysis it ?

no you can't. Userspace programs can only access the kernel trough a 
systemcall, otherwise userspace could read memory from other programs 
which would be dangerous (think of passwords etc).

If you want to read certain parts of kernel memory from userspace, you 
need a kernel module which uses copy_to_user, for example a character 
driver using the read or ioctl function to call copy_to_user.

The userspace then would use that character device to invoke systemcalls.

Please refer to http://lwn.net/Kernel/LDD3/ about device driver 
programing. Although the book is outdated it is a perfect point to start 
understanding the concepts.

Best regards,
Matthias

>
> BestRegards!
>
>> Cheers,
>> Matthias
>>
>>>
>>>
>>>   thanks!
>>>
>>>   ___
>>>   Kernelnewbies mailing list
>>>   Kernelnewbies@kernelnewbies.org
>>>   http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>>
>>
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


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

2012-12-13 Thread Matthias Brugger
On 12/13/2012 04:17 AM, horse_rivers wrote:
> is there method for doing this work? take kernel data to user?

I think copy_to_user is what you are looking for:
http://lxr.free-electrons.com/source/include/asm-generic/uaccess.h#L253

Cheers,
Matthias

>
>
> thanks!
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Find out function arguments value from stack pointer

2012-12-12 Thread Matthias Brugger
On 12/12/2012 12:24 PM, Manavendra Nath Manav wrote:
> On Wed, Dec 12, 2012 at 4:38 PM, Fabio Pozzi  wrote:
>>> When i call  print values at offsets starting from
>>> __builtin_frame_address (0) the function arguments start from offset
>>> 2. How can I confirm that this behavior is always consistent.
>>
>> Arguments are pushed on the stack before the saved frame pointer, thus
>> you have to add an offset equal to the frame pointer address size if
>> you start from the beginning of the saved frame pointer record on the
>> stack.
>
> Thanks Fabio!
> If I execute the same code on ARM arch, does it needs any changes?
>

I just wanted to mention. AFAIK who parameters are passed to the called 
function depends on the architecture (stack or some registers + stack).
I vaguely remember some MIPS ASM programming exercises in first year of 
university...

But if gcc has a in built function, that should do on all architectures, 
though.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Best and fastest way to understand kernel subsystem ?

2012-12-06 Thread Matthias Brugger
On 12/06/2012 10:54 AM, Shraddha Kamat wrote:
> What is the best (and the fastest ) way to understand a kernel
> subsystem ( for e.g., filesystem , Networking .. etc.)

If you are a beginner it might be convenient to look on a small 
subsystem first. The filesystem is really big and complicated, I think.
If you are familiar with the embedded world, maybe something like spi or 
i2c might be a good starting point.

If you want to understand networking, maybe starting with the tun/tap 
kernel module and try to understand how it "injects"/"grabs" 
packets/frames from/to userspace. This way you learn something on the 
data structures of the network subsystem.

Just my 3 cents.
Cheers,
Matthias

>
> -- Shraddha
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


system call numbers

2012-11-22 Thread Matthias Brugger
Hi all,

I'm looking into the avr32 architecture implementation, as compiling the 
kernel gives you several warnings about system calls which are missing.

I had a look in the unistd.h file I realized that system call numbers 
differ widely from other architectures (I had a look at arm and x86).
Are the system call numbers platform specific. As far as I understand, 
the system calls are "wrapped" in libc. So I wonder if [g,e,uC]libc uses 
a different system call number each architecture.
A look in the source of uClibc didn't helped me to clear my doubts.

If not all system calls are implemented for avr32:
- is there a problem at all, or does libc implementation take care of 
not implemented system calls?
- if I want to add a system call, what are the steps needed?

Best regards,
Matthias

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re:

2012-10-15 Thread Matthias Brugger
Hi,

On 10/15/2012 11:24 AM, Niroj Pokhrel wrote:
> Hi,
> I'm new to linux and kernel . I'm ongoing with the linux device drivers.
> I've followed the the book LDD but i'm lost about how to call my
> driver's specific method from the user space.
> Eg: if have developed a character device and inserted the module then
> how can i make sure that when I read or write that it implement the
> functions via the methods i have implemented in my module.

the most easy way would be to put some printk output in your read/write 
functions of your driver. So with cat/echo from userspace you should be 
able to verify your implementation.

Regards,
Matthias

>
> --
> Niroj Pokhrel
> NIT Jamshedpur,
> B.Tech,Electronics and Communication
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Writing a new device driver

2012-06-26 Thread Matthias Brugger
Hi Malice,

On 06/25/2012 09:42 PM, Malice wrote:
> Hi
>
> I'm planning to write a new device driver on linux kernel . The device i
> intend to write will be a device that'll pipe the data coming into it to
> another computer that'll be also having the same device . So in short
> the device'll be readable/writable and should communicate through
> network . I know it sounds like a socket but the idea would be to
> implement a interface in shell so that if you type
>
> | root@host$echo "Hi">>mydevice
> |
>
> will transfer the word hi to the system on the other side of network
> (and may be configure it to store on file). This is a leisure time
> project i intend to do and it sounds much like sockets and other already
> existing implementations . Well the questions regarding the design for
> device implementations are : 1)Should i use a block or a character
> device . The advantage i see for a block device is that if i am a
> initiating a complete file transfer through the device(which i in tend
> to support later) , then it would be fast .
>
> 2)How do i write the data on the network . I'm familiar with sockets and
> stuff , but using sockets from with in the kernel has performance
> issues(I read it somewhere, after all sockets was desined to be used in
> userspace) . Will using netfilter or other stuffs work ?Maybe crafting
> the packet directly would help :-)? Any innovations are welcome

have a look on the tun/tap driver, I think that's what you need.
http://lxr.free-electrons.com/source/drivers/net/tun.c

>
> 3)How do i configure the driver , like how do i let it know that it
> should connect to a specific host >in user space programs we usually do
> this by config files , but to change the connection settings of a driver
> how do you manage it ? (sysfs ?? Frankly i never worked with sysfs or
> proc/ )
>
> 4)Now as the design specifies all the transfer of files is in kernel
> space . When i transfer huge chunks of data through kernel space , will
> it slow down the system ?. The design shouldnt overload the system ,
> doing it in a pre-empitble kernel will help, but are there other
> charecterstics i should be aware of to make the design as efficient as
> possible (i'm doing it on the latest linux kernel) ?
>
> 5)And i dont want to leave a huge memory imprint so is there any way i
> can reduce it while tranferring of data , may be cacheing data on disk ?
>
> 6)I will have to design a user space programme to co ordinate the driver
> wont i ? I cannot let the driver alone do the whole task , tat wud be
> tedious
>
> Comments Welcome
>
>
> I've also posted the same question at stackoverflow too
> http://stackoverflow.com/questions/11167424/writing-a-new-device-driver
>
> Regards
> Malice
>
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Missing Key-codes from input.h file.

2012-06-26 Thread Matthias Brugger
On 06/26/2012 08:47 AM, Dharam Kumar wrote:
> On Tue, Jun 26, 2012 at 12:02 PM, anish kumar
>  wrote:
>> On Mon, 2012-06-25 at 23:24 +0530, Dharam Kumar wrote:
>>> On Mon, Jun 25, 2012 at 10:47 PM, anish kumar
>>>  wrote:
 On Mon, 2012-06-25 at 18:52 +0530, Dharam Kumar wrote:
> Hi,
> I'm working on a module which is an input device and hence it needs to
> report certain key events.
>
> While browsing through the , I did find most of the
> key-codes(which I need to use)already defined but not all.
>
>
> Few of the KEY_xxx which i could not find are:
>
>
> a.) A Key for going to the previous channel.
> b.) Keys for Moving upper-right, lower-right, upper-left and
> lower-left direction(probably a GUI(grid of icons),where you move
> diagonally)
> d.) A key for Subpicture (this 'subpicture' key is deeined in
> CEA-931C).
 I think you are interested in the user space implementation of
 the keys reported by the input subsystem of kernel.
 Keys reported by the driver->input subsystem->reported to user space.

 I am not sure about linux way of reporting keys but in android the key
 is reported at a particular sysfs file and this sysfs file is read by
 eventhub.cpp.This file in turn is responsible for sending the events
 to particular application and it is the responsibility of the
 application how they interpret this keys.It can interpret events by
 moving diagonally a pointer/touch or going left/right.

>>> Thanks Anish ! To be clear, i just want to know the key-code
>>> which will be used by the Input Subsytem of the Kernel.
>>>
>>> For example, in  file you will find a lot of #defines
>>> like the below,mapping different kind of key events to some key-code
>>> or value :
>>> #define KEY_UP 0xXYZ
>>> #define KEY_DOWN 0xABC and so on...
>>>
>>> Now, I'm looking for key events like:
>>> #define KEY_PREVIOUSCHANNEL   
>>> #define KEY_RIGHTUP 
>>> #define kEY_RIGHTLEFT 
>>> #define kEY_SUBPICTURE  and so on...
>>>
>>> You are probably right , that Userspace reads the key-events/key-codes
>>> from certain sysfs entries exported by Android Linux Kernel and these
>>> key-codes/events will be handled accordingly by the respective
>>> Framework/Application. But  I'm really not interested in how and what
>>> Userspace gets from Kernel.
>>> I'm interested in what values the Kernel or input subsystem will
>>> provide to such keys..
>> Do you have such keys in your device KEY_RIGHTUP?
>>
> Yes, my device is supposed to support such keys:
> RIGHTUP --> moves cursor upper-right direction.
> RIGHTDOWN ---> moves cursor lower-right direction.
> and similar keys for upper-left and lower-left cursor direction.
> Sadly, I could not find any #define in input.h file for such key events.

 From your response I interpret that you have some kind of custom 
key-pad, or anything similar which is not a standard keyboard.

If there are no such defines in the Kernel, it's probably because no one 
has had the need for them up to now.

I think the implementation should be done as Anish described beforehand. 
Anyway you can add some defines to your Kernel if this is a requirement 
for you.

Regards,
Matthias

 Not sure if this is what you are interested in but would have been
 better if you had described the problem in more detail.
>
>
> Does anybody have any idea about this?
>
>
> -
> Dharam
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


>>
>>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Kernel 3.4 compile problem

2012-06-19 Thread Matthias Brugger
On 06/19/2012 02:43 PM, Kaan Akşit wrote:
> Lieber Matthias,
>
> Vielen dank für ihre email :) Here is the English version of the output:
>
>DEPMOD  3.4.3
> DEBUG: return value for "make
> INSTALL_MOD_PATH=/var/pisi/kernel-3.4.3-163/install/ DEPMOD=/bin/true
> modules_install mod-fw=" is 0
> .
...
.
> 10229 blocks
> DEBUG: return value for "find . -path './include/*' -prune -o -path
> './scripts/*' -prune -o -path './Documentation/*' -prune -o -type f \(
> -name 'Makefile*' -o -name 'Kconfig*' -o -name 'Kbuild*' -o -name '*.sh'
> -o -name '*.pl' -o -name '*.lds' \) -print | cpio -pVd
> --preserve-modification-time
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3" is 0
> DEBUG: return value for "cp -a drivers/media/dvb/dvb-core/*.h
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/drivers/media/dvb/dvb-core"
> is 0
> DEBUG: return value for "cp -a drivers/media/dvb/frontends/*.h
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/drivers/media/dvb/frontends"
> is 0
> DEBUG: return value for "cp -a drivers/media/video/*.h
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/drivers/media/video"
> is 0
> DEBUG: return value for "cp -a include scripts Documentation
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3" is 0
> DEBUG: return value for "rm -rf
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/scripts/*.o"
> is 0
> DEBUG: return value for "rm -rf
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/scripts/*/*.o"
> is 0
> DEBUG: return value for "rm -rf
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/Documentation/DocBook"
> is 0
> cpio:
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/arch/xtensa/include/asm/Kbuild
> not created: newer or same age version exists
> cpio:
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/arch/cris/include/asm/Kbuild
> not created: newer or same age version exists
> cpio:
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/arch/cris/include/arch-v32/arch/Kbuild
> not created: newer or same age version exists
> cpio:
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/arch/cris/include/arch-v32/arch/hwregs/iop/Makefile
> not created: newer or same age version exists
> cpio:
> /var/pisi/kernel-3.4.3

Re: Kernel 3.4 compile problem

2012-06-19 Thread Matthias Brugger
Merhaba,

On 06/19/2012 01:11 PM, Kaan Akşit wrote:
> Dear all,
>
> I am a newbie who try to solve a problem on compiling new kernel on my
> computer. Here is the point where I am stuck; I can configure and
> compile kernel without any error, but whenever I try to install libc
> headers I keep receiving the error below: I have the devel package
> installed for my existing kernel, I could not understand what I am doing
> wrong:
>
> DEBUG: "make INSTALL_MOD_PATH=/var/pisi/kernel-3.4.3-163/install/
> DEPMOD=/bin/true modules_install mod-fw=" dönüş değeri 0
> .
...
.
> 10229 blok
> DEBUG: "find . -path './include/*' -prune -o -path './scripts/*' -prune
> -o -path './Documentation/*' -prune -o -type f \( -name 'Makefile*' -o
> -name 'Kconfig*' -o -name 'Kbuild*' -o -name '*.sh' -o -name '*.pl' -o
> -name '*.lds' \) -print | cpio -pVd --preserve-modification-time
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3" dönüş
> değeri 0
> DEBUG: "cp -a drivers/media/dvb/dvb-core/*.h
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/drivers/media/dvb/dvb-core"
> dönüş değeri 0
> DEBUG: "cp -a drivers/media/dvb/frontends/*.h
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/drivers/media/dvb/frontends"
> dönüş değeri 0
> DEBUG: "cp -a drivers/media/video/*.h
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/drivers/media/video"
> dönüş değeri 0
> DEBUG: "cp -a include scripts Documentation
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3" dönüş
> değeri 0
> DEBUG: "rm -rf
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/scripts/*.o"
> dönüş değeri 0
> DEBUG: "rm -rf
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/scripts/*/*.o"
> dönüş değeri 0
> DEBUG: "rm -rf
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/Documentation/DocBook"
> dönüş değeri 0
> cpio:
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/arch/xtensa/include/asm/Kbuild
> oluşturulmadı: daha yeni ya da aynı yaşta sürümü mevcut
> cpio:
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/arch/cris/include/asm/Kbuild
> oluşturulmadı: daha yeni ya da aynı yaşta sürümü mevcut
> cpio:
> /var/pisi/kernel-3.4.3-163/install/usr/src/linux-headers-3.4.3/arch/cris/include/arch-v32/arch/Kbuild
> oluşturulmadı: daha ye

Re: A confusion about invoking my syscall

2012-06-19 Thread Matthias Brugger
On 06/19/2012 06:32 AM, 王哲 wrote:
>
>
> 2012/6/19 Jeff Haran mailto:jha...@bytemobile.com>>
>
> __ __
>
> __ __
>
> *From:*kernelnewbies-boun...@kernelnewbies.org
> 
> [mailto:kernelnewbies-boun...@kernelnewbies.org
> ] *On Behalf Of *??
> *Sent:* Monday, June 18, 2012 6:40 PM
> *To:* kernelnewbies
> *Subject:* A confusion about invoking my syscall
>
> __ __
>
> Hello everyone:
>
>   I append a simple syscall in kernel. and the function is
> as follows:
>
>asmlinkage  long sys_mysyscall(long data)
>   {
>printk("This is my syscall!\n");
>return data;
>}
>
> and i test it sucessfully in user space . and the test program:
>
> #include 
> #include 
> #include 
> #include 
>
>
>
> int main(void)
> {
> long n = 0,m = 0,pid1,pid2;
> n = syscall(345,190);// #define __NR_mysyscall  345
> printf("n = %ld\n",n);
> pid1 = syscall(SYS_getpid);  //getpid
> printf("pid = %ld\n",pid1);
> pid2 = syscall(20);  //getpid
> printf("pid = %ld\n",pid2);
> return 0;
>}
> and the result:
> n = 190
> pid = 4097
> pid = 4097
>
> but if the test program is:
> #include 
> #include 
> #include 
> #include 
>
>
>
> int main(void)
> {
>   long n = 0,m = 0,pid1,pid2;
>   n = syscall(345,190);// #define __NR_mysyscall  345
>   printf("n = %ld\n",n);
>   m = syscall(SYS_mysyscall,190);
>   printf("m = %ld\n",m);
>   pid1 = syscall(SYS_getpid);  //getpid
>   printf("pid = %ld\n",pid1);
>   pid2 = syscall(20);  //getpid
>   printf("pid = %ld\n",pid2);
>   return 0;
> }
> and the result:
> wanny@wanny-C-Notebook-:~/syscall/src$ gcc test1.c
> test1.c: In function ‘main’:
> test1.c:13:14: error: ‘SYS_mysyscall’ undeclared (first use in this
> function)
> test1.c:13:14: note: each undeclared identifier is reported only
> once for each function it appears in
>
>
> why i can't invoke my syscall with "SYS_mysyscall"?
>
> Thanks in advance!
>
> Because it appears you never defined the symbol SYS_mysyscall.
>
> __ I think so,but where shoud i defne the __symbol SYS_mysyscall ?
>
>and where is the symbol SYS_getpid defined?

Not sure, but I think the syscalls should be defined in syscall.h which 
is included by your program. I suppose that this file is part of libc, 
so there won't be your syscall definition in there.
The easiest way would be to define the syscall by yourself.

Remember that adding a syscall to the linux kernel is a bad idea.

Regards,
Matthias

>
> Jeff Haran
> 
>
>
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: no-op error in dmesg

2012-06-19 Thread Matthias Brugger
Hi,

On 06/18/2012 08:34 PM, Pritam Bankar wrote:
> Hi,
> I have one structure called foo. Address of object of foo(say objfoo) is
> passed to ioctl call
>
> status = ioctl(fd, arg, &objfoo);

as objfoo is a pointer to foo:
struct something foo;
struct somethint *objfoo = &foo;

&objfoo therefore is a pointer to a pointer, not sure if you wanted to 
pass this to the ioctl.

>
> But during manipulation I am not getting ioctl error 5 (input/output error).
> I am more confused about error in dmesg which is
> *foo: no-op *

you can't work directly on a object in userspace memory as this might be 
a security issue. There exits a function to copy from user memory area 
to kernel memory area (copy_from_user; and afterwards copy back to the 
user; copy_to_user).

Cheers,
Matthias

>
> What does no-op indicate? If it is no-operation, how can we relate this
> to foo structure?
>
> Thanks,
> Pritam
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: cross compile linux

2012-02-11 Thread Matthias Brugger
On 02/11/2012 10:15 AM, Daniel Baluta wrote:
> 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://forum.samdroid.net/wiki/showwiki/How+to+build+cross+toolchains+for+ARM+crosstool-NG
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Apart from that in the Makefile you have to specify with
ARCH ?= ppc
and in CROSS_COMPILE the prefix of your cross compiler (e.g. pcc-linux-)

beware that the corss compile toolchain is in you $PATH.

If you want to cross compile for an embedded Linux board, have a look at 
buildroot. With this tool you can build the whole userspace environment 
to get a shell running.

good luck,
matthias

-- 
---
http://motzblog.wordpress.com/

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: blktrace vs ftrace

2012-02-08 Thread Matthias Brugger
Hi,

On 02/03/2012 06:59 AM, Mulyadi Santosa wrote:
>
> I could only offer this explanation:
> blktrace traces events in block level. In this level, I/O is likely
> serializedunless you have more than one physical disks.
>
> in ftrace, you see events right before it hits block level operation.
> Somewhere between VFS, filesystem operation and I/O scheduling which
> deals with queue reordering. In this case, parallel operation is
> likely to happen because more than processes could submit read or
> write.

If I understand the patch which introduces the blk tracer to ftrace 
(http://lwn.net/Articles/315508/) just uses the blktrace interface. So I 
wonder why using this influences the I/O behaviour.

Best regards,
Matthias

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Changes in block layer for IOScheduler Insertion selection

2012-02-06 Thread Matthias Brugger

On 06/02/2011 05:41 AM, mani wrote:

Dear All,

Any suggestions on the below point ?


have you tried different benchmarks?
This can give you an idea of the impact. It seems that up to now, you've 
only executed sequential read and write access by one process.


Personally I use the fio benchmark. For flash file systems, David Wagner 
from Free Electrons developed a benchmarksuite. Maybe it would be worse 
having a look on it.


Best regards,
Matthias Brugger



Thanks in advance..

On Mon, May 30, 2011 at 10:53 AM, mani <mailto:manish...@gmail.com>> wrote:


Dear Eduardo,

   I am using squashfs filesystem. So i am more concern with the
read speed.
whereas below are the details
 read speed  
write speed

ELEVATOR_INSERT_SORT   8 MBps5MBps
ELEVATOR_INSERT_BACK  10 MBps   7.2MBps

   used the following command for measurement for both the cases.
   reading
   hdparm -t /dev/mtdblock3

   writing
   dd if=/dev/zero of=/dev/mtd3 bs=4096 count=100k

   As of now everything is working fine with those changes
   but i am worried if these changes would have any adverse effect
anywhere ?

   Thanks.


On Fri, May 27, 2011 at 8:37 PM, Eduardo Silva mailto:edsi...@gmail.com>> wrote:

On Fri, May 27, 2011 at 8:29 AM, mani mailto:manish...@gmail.com>> wrote:
>
> Dear All,
>
> I am working on linux kernel 2.6.32.9 tegra NVIDIA board.
>
> I am getting ~8MBps speed of the Nand disk if i use hdparm
> hdparm -t /dev/mtdblock3
>
> i made changes in block layer of kernel as below:-
>
> block/blk-core.c
> static inline void add_request(struct request_queue *q,
struct request *req)
> {
> drive_stat_acct(req, 1);
>
> /*
>  * elevator indicated where it wants this request to be
>  * inserted at elevator_merge time
>  */
>
> __elv_add_request(q, req, ELEVATOR_INSERT_BACK, 0);
> //__elv_add_request(q, req, ELEVATOR_INSERT_SORT, 0);
> }
>
>

What are the results for read and write for both cases ?


> changed ELEVATOR_INSERT_SORT to ELEVATOR_INSERT_BACK
> it improves my NAND speed to 10MBps.
>
> I am using "noop" I/O scheduler.
>
> Will this change have any adverse effect in kernel ? or any
other side
> effect as far as i am using only Nand no Hard disk.
>
>
> Thanks
> Mani
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
<mailto:Kernelnewbies@kernelnewbies.org>
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>



--
Eduardo Silva
http://edsiper.linuxchile.cl
http://www.monkey-project.com




___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: blktrace vs ftrace

2012-02-02 Thread Matthias Brugger
On 02/02/2012 07:15 PM, Mulyadi Santosa wrote:
> On Thu, Feb 2, 2012 at 17:20, Matthias Brugger
>   wrote:
>> Hi all,
>>
>> I'm trying to analize I/O behavior of Qemu on the host.
>
> what is your complete command to invoke Qemu?

qemu -hda scheduler.raw -drive 
file=/mnt/disk/testdisk2.img,if=virtio,cache=none -m 1024 -enable-kvm -k 
es -smp 2 -vnc 127.0.0.1:10 -smb /home/matthias/nfs/

>
> sometimes Qemu's I/O behaviour can be modified by certain parameter.
> All I know recent Qemu release (>= 1.x) use iothread by default, which
> might explain your 4 threads reads.

I use qemu-0.15.1 configured with the following parameter:

./configure --disable-xen --enable-kvm --enable-io-thread 
--enable-vnc-thread --disable-darwin-user --disable-bsd-user 
--target-list=i386-softmmu

-- 
---
http://motzblog.wordpress.com/

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: creation of blktrace completion messages

2012-02-02 Thread Matthias Brugger
On 01/18/2012 02:59 PM, Matthias Brugger wrote:
> Hi all,
>
> where does the kernel create the blktrace completion messages?

the mesage is created in block/blk-core.c:blk_update_request which calls 
trace_block_rq_complete

>
> Is it done in the interrupt routine or in the block layer.
>
> I just found:
> register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
> and
> register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);
>
> But I don't find the corresponding functions.
>
> Thanks,
> Matthias
>
> ---
> http://motzblog.wordpress.com/


-- 
---
http://motzblog.wordpress.com/

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


blktrace vs ftrace

2012-02-02 Thread Matthias Brugger
Hi all,

I'm trying to analize I/O behavior of Qemu on the host.

I used blktrace and the blk tracer for ftrace but I see different I/O 
behavior.
I use 4 threads in the VM each reading sequentially a file. Readahead is 
turned off. With blktrace reads are transmitted in a sequential way, 
which means the next read will be executed when the first one has 
completed. In comparison with ftrace, up to 4 reads are issued to the 
disk in parallel.

I suppose the different behaviors are due to the overhead introduced by 
the tracers.
My doubt is, which tracer has less influence on the I/O behaviour and 
therefore reflects the system behaviour without tracing.

Thanks a lot,
Matthias

---
http://motzblog.wordpress.com/

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


creation of blktrace completion messages

2012-01-18 Thread Matthias Brugger
Hi all,

where does the kernel create the blktrace completion messages?

Is it done in the interrupt routine or in the block layer.

I just found:
register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL);
and
register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL);

But I don't find the corresponding functions.

Thanks,
Matthias

---
http://motzblog.wordpress.com/

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Guidance on writing device drivers

2011-11-18 Thread Matthias Brugger
On 11/10/2011 05:26 AM, Prajosh Premdas wrote:
> [...]
> On Thu, Nov 10, 2011 at 10:08 AM, rohan puri  > wrote:
> On Wed, Nov 9, 2011 at 10:40 PM, suraj khurana
> mailto:surajkhuran...@gmail.com>> wrote:
>
> Hi all,
> I am a newbie in linux world and want to learn linux device drivers.
>
> I am currently reading book - "Linux Device Drivers" by O'reilly.
>
> Does anyone has any problem statements based on device drivers
> for practice
> so that I can enhance my skills in writing device drivers.

The Linux Device Driver book (ldd3) is outdated, as Linux kernel ABI 
changes constantly, although I would still recommend the book as good 
starting point.
Martinez Javier started to port the source code examples to the actual 
Kernel versions. I'm not sure about the actual status of the work, but I 
vaguely remember that I tried to use the block device driver some month 
ago. It compiled without any warning but crashed when used.

Maybe you want to dig in the example code and see if you can find and 
resolve some issues.

https://github.com/martinezjavier/ldd3

Regards,
Matthias

>
>
> Thanks,
> Suraj
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> 
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> Hello Suraj,
> I would suggest complete reading the book with the examples given in
> the book.
>
> Regards,
> Rohan Puri
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org 
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
>
>
> --
> Regards,
>
> Prajosh Premdas
>
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


-- 
---
http://motzblog.wordpress.com/

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Create a one-to-many tunnel

2011-03-15 Thread Matthias Brugger
Vimal schrieb:
> Hi,
> 
> I wish to create an IP in IP tunnel interface that works as follows:
> 
> At the sender:
> * The interface checks the dst IP address on the IP packet that it receives.
> * It encapsulates the IP packet inside another IP packet with:
>Field 1: source address = the interface's IP address
>Field 2: dst address = the packet's dst IP address
> * The interface now transmits the packet

your question isn't clear to me. anyway, have a look on the tun/tap kernel 
module, so you would be able to do the impementation in userspace (might be 
good for a first prototype or even good enough...).

good luck.
matthias

> 
> This is different from normal IPinIP tunnels because it is not
> point-to-point.  The operation in Field 2 is similar to NAT.  Also,
> this is different from SNAT, because I want the receiver to know what
> the original source IP.
> 
> At the receiver, assume that there is a stack that understands this
> special IPinIP packet and has a way to handle it.
> 
> If it's too specific, then I do not mind implementing it.
> 
> Thanks,


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Regarding Linux device driver Project

2011-01-23 Thread Matthias Brugger
Hi,

ashutosh mishra schrieb:
>> hi
>> i want to write a driver for DIO-48S PCI Card
>> (its automation Project - Aluminium Foil Winding Automated System Using PCI 
>> Interface)
>> i want to ask that what are the..prerequesite...for the Project...
>> i hav konwledge of C,89c51 Microcontroller,Arm Processor.
>> but i am not able to start...i hav gonr through  
>> Kernelnewbies@kernelnewbies.org Collected lots of information.
>> so please ...any one can help...
>> its Urgent Require.

have a look on http://lwn.net/Kernel/LDD3/ especially chapter 12 should help 
you.

Regrads,
Matthias

>  
> Thanks anr Regard ,
> Ashutosh 
>  
>  
>  
>> From: kernelnewbies-requ...@kernelnewbies.org
>> Subject: Kernelnewbies Digest, Vol 2, Issue 50
>> To: kernelnewbies@kernelnewbies.org
>> Date: Thu, 20 Jan 2011 12:00:01 -0500
>>
>> Send Kernelnewbies mailing list submissions to
>> kernelnewbies@kernelnewbies.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>> or, via email, send a message with subject or body 'help' to
>> kernelnewbies-requ...@kernelnewbies.org
>>
>> You can reach the person managing the list at
>> kernelnewbies-ow...@kernelnewbies.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Kernelnewbies digest..."
>>
>>
>> Today's Topics:
>>
>> 1. Re: Running kmemleak without sysfs support (Daniel Baluta)
>> 2. Re: possible regression? (Mag Gam)
>> 3. Re: possible regression? (Greg Freemyer)
>> 4. Re: Regarding Kernel Project (Greg KH)
>> 5. Re: Running kmemleak without sysfs support (Greg KH)
>>
>>
>> --
>>
>> Message: 1
>> Date: Thu, 20 Jan 2011 14:33:36 +0200
>> From: Daniel Baluta 
>> Subject: Re: Running kmemleak without sysfs support
>> To: Catalin Marinas 
>> Cc: kernelnewbies@kernelnewbies.org
>> Message-ID:
>> 
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> On Thu, Jan 20, 2011 at 12:52 PM, Catalin Marinas
>>  wrote:
>>> On Thu, 2011-01-20 at 10:41 +, Daniel Baluta wrote:
 Can I make any use of kmemcheck if I don't have sysfs
 kernel support enabled?
>>> Kmemleak can scan output the memory and report the number of leaked
>>> objects but if you need to get additional information about the leaked
>>> objects (like backtrace), you need debugfs enabled.
>> How is this reporting done? It will appear in dmesg output?
>>
>>> DEBUG_FS doesn't seem to be dependent on SYSFS but I never tried to
>>> enable one without the other (you might be able to mount the DEBUG_FS
>>> somewhere other than /sys/kernel/debug/).
>> I see. I was using 2.6.32 where it seems that debugfs depended on sysfs.
>> Decoupling was done some time later [1].
>>
>> thanks,
>> Daniel.
>>
>> [1] http://kerneltrap.org/mailarchive/linux-kernel/2010/8/5/4603446
>>
>>
>>
>> --
>>
>> Message: 2
>> Date: Thu, 20 Jan 2011 07:50:38 -0500
>> From: Mag Gam 
>> Subject: Re: possible regression?
>> To: Mulyadi Santosa 
>> Cc: Kernelnewbies@kernelnewbies.org
>> Message-ID:
>> 
>> Content-Type: text/plain; charset=UTF-8
>>
>> I am using RHEL 5.1. Sorry for not being clear.
>>
>> I wil give this a try today when I go back to class. But I was just
>> curious why this was happening. How would one disable "block merge"
>> efficiency? Has this feature been added recently?
>>
>> On Thu, Jan 20, 2011 at 12:28 AM, Mulyadi Santosa
>>  wrote:
>>> Hi...
>>>
>>> On Thu, Jan 20, 2011 at 10:36, Mag Gam  wrote:
 Running on Redhat 5.1 if I do,
>>> Are you sure you're using that archaic distro? Or are you talking
>>> about RHEL 5.1?
>>>
 dd bs=1024 count=100 if=/dev/zero of=/dev/null

 I get around 30Gb/sec
>>> Hm, mine is:
>>> $ dd bs=1024 count=100 if=/dev/zero of=/dev/null
>>> 100+0 records in
>>> 100+0 records out
>>> 102400 bytes (1.0 GB) copied, 1.12169 seconds, 913 MB/s
>>>
>>> This is on 2.6.36 SMP kernel compiled with gcc version 4.1.2 20080704
>>> (Red Hat 4.1.2-48).
>>>
 However, when I do this with 2.6.37 I get close to 5GB/sec
>>> what if you use another blocksize, let's say 4K or even 32K? here's
>>> mine (again):
>>> $ dd bs=4K count=100 if=/dev/zero of=/dev/null
>>> 100+0 records in
>>> 100+0 records out
>>> 409600 bytes (4.1 GB) copied, 1.31167 seconds, 3.1 GB/s
>>>
>>> $ dd bs=32K count=100 if=/dev/zero of=/dev/null
>>> 100+0 records in
>>> 100+0 records out
>>> 3276800 bytes (33 GB) copied, 4.91775 seconds, 6.7 GB/s
>>>
>>> see the difference?
>>>
>>> IMHO it's a matter of what I call "block merge efficiency"the more
>>> you stuff pages (that fits into a "magic" number), the faster I/O you
>>> got.
>>>
>>> --
>>> regards,
>>>
>>> Mulyadi Santosa
>>> Freelance Linux trainer and consultant
>>>
>>> blog: the-hydra.blogspot.com
>>> training: mulyaditraining.blogspot.com
>>>
>>
>>
>> --