Kernel panic after insmod

2016-06-26 Thread Manavendra Nath Manav
Can someone explain the following kernel module code. I'm not familiar with
x86 assembly so have problem understanding this part. Also it seems this
code is able to modify the kernel stack.

/**start/

#include 

MODULE_LICENSE("GPL");

int __init init(void) __attribute__((noreturn))
{
unsigned long long cr0 = read_cr0();
write_cr0(cr0 & ~(1 << 4)); /* Clear Extension Type (ET) bit */
*(unsigned char *)sys_kill = 0xc3; /* opcode for "ret" */
write_cr0(cr0);

/* Optional code ahead to hide traces of this module. */
__this_module.refcnt = 1;
__this_module.state = MODULE_STATE_LIVE;

asm
(
"mov %0, %%rsp\n\t"
"mov %1, %%rdi\n\t" /* name = __this_module.name */
"xor %%rsi, %%rsi\n\t" /* flags = 0 */
"jmp sys_delete_module\n\t" /* call delete_module(name, flags) */
:: "r"(current->stack + THREAD_SIZE - sizeof(struct pt_regs) - 8), "r"(__
this_module.name) :
);
}

void __exit exit(void)
{
return;
}

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


Re: Building modules: missing scripts/basic/Makefile

2016-06-05 Thread Manavendra Nath Manav
Hi Steven,

On Mon, Jun 6, 2016 at 12:14 AM, Steven Laabs  wrote:
> Hi,
>
> I'm trying to build my first kernel module but when running the makefile, 
> make tries to use a file at 
> /usr/src/linux-headers-3.16.0-4-common/scripts/basic/Makefile which gives me 
> the "No such file or directory" error. I've looked into the folder it is 
> referencing and it  does not have any Makefile, the only file in that 
> location is the fixdep executable. The scripts folder itself is linked to 
> ../../lib/linux-kbuild-3.16/scripts.
>
> The Makefile I am using (located in a folder in my home directory):
>
> obj-m = hello.o
> KDIR ?= /lib/modules/$(shell uname -r)/build
>
> all:
> make -C $(KDIR) M=$(PWD) modules
>
> clean:
> make -C $(KDIR) M=$(PWD) clean
>
> I'm not quite sure where to look for this Makefile as I believe I have all of 
> the proper headers installed, and I am running everything with the proper 
> permission level.
>
> Any ideas on what I may be missing here?
>
> Thanks,
> Steven
>

You should use "+=" and not "="
-- obj-m = hello.o
++ obj-m += hello.o

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


Re: Request for guidance

2016-05-29 Thread Manavendra Nath Manav
Hi Abhishek,
Get a embedded board like Beaglebone or Raspberry Pi and start interfacing
new sensors or communication devices.

-- manav m-n

On Fri, May 20, 2016 at 6:49 AM, Abhishek  wrote:

> Hi All,
>
> I am an Embedded Software Engineer with 3+ years of experience. I am
> fascinated by kernel development and want to be a device driver developer.
>
> I have done following so far.
> #Studied LDD3.
> #Subscribed to eudyptula challenge and submitted solution
> for 4th task(waiting for next task).
> #Have compiled and installed kernel successfully on multiple boards.
>
> I want to start contributing to kernel so I looked into staging and
> found that I can not work on TODO unless I have required hardware to
> test patch (which
> unfortunately I don't have).
>
> Requesting you to guide me about how to start working on
> kernel/device drivers development.
>
> Thanks,
> Abhishek
>
> ___
> 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 to expand linux kernel macro in kernel source code/kernel module(outside)

2015-10-06 Thread Manavendra Nath Manav
On Tue 6 Oct, 2015 18:34 慕冬亮  wrote:

Recently I was learning doubly linked list in kernel, there are many
macro in linux/fs.h, like list_add, list_del,list_for_each,list_entry,
container_of.

I know we can use "gcc -E" to expand the macro, but how do we expand
the macro in kernel source code / kernel module?

- mudongliang





A quick look at cscope and ctags will solve your problem.

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


Re: Advice on Linux Kernel Development

2015-09-13 Thread Manavendra Nath Manav
Yes you can.

On Sun 13 Sep, 2015 23:40 Mayur Patil  wrote:

> hi all,
>
> I want to ask
>
> if I want to get started with Linux Kernel Development then is it feasible
> that
>
> I can do all my experiments on Virtual Machine as on Linux my Internet
> dongle does
>
> not work, I am asking in terms of performance and efficiency.
>
> Looking for guidance,
>
> Thanks !
> --
>
>
> *Mayur S Patil,*
> ___
> 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: Newbie help

2015-08-04 Thread Manavendra Nath Manav
On Tue, 4 Aug 2015 at 13:51 Bjørn Mork bj...@mork.no wrote:

 Rishabh Chakrabarti bassdevelo...@gmail.com writes:

  Hello all,
 
  Where can I search the archives and other resources for answering the
  following questions:
 
  1. How to dive into the code? i.e. entry points

  2. What are the pre-requisites for understanding the whole code?

  3. Best books and resource material


You can refer this answer from Stackoverflow:

http://unix.stackexchange.com/questions/1003/linux-kernel-good-beginners-tutorial/177539#177539
It basically provides a bird's eye view of the Linux kernel along with it's
broader subsystems with links to related books/resources. I am reproducing
parts of the answer below:

**TODO** +editPic: Linux Kernel Developer - (Ring Layer 0) +addSection:
Kernel Virtualization Engine KERN_WARN_CODING_STYLE: Do not Loop unless you
absolutely have to.

Recommended Books for the Uninitialized void *i: Men do not understand
books until they have a certain amount of life, or at any rate no man
understands a deep book, until he has seen and lived at least part of its
contents. –Ezra Pound. A journey of a thousand code-miles must begin with
a single step. If you are in confusion about which of the following books
to start with, don't worry, pick any one of your choice. Not all those who
wander are lost. As all roads ultimately connect to highway, you will
explore new things in your kernel journey as the pages progress without
meeting any dead ends, and ultimately connect to the code-set. Read with
alert mind and remember: Code is not Literature.

What is left is not a thing or an emotion or an image or a mental picture
or a memory or even an idea. It is a function. A process of some sort. An
aspect of Life that could be described as a function of something larger.
And therefore, it appears that it is not really separate from that
something else. Like the function of a knife - cutting something - is not,
in fact, separate from the knife itself. The function may or may not be in
use at the moment, but it is potentially NEVER separate.

Solovay Strassen Derandomized Algorithm for Primality Test: Read not to
contradict and confute; nor to believe and take for granted; nor to find
talk and discourse; but to weigh and consider. Some books are to be tasted,
others to be swallowed, and some few to be chewed and digested: that is,
some books are to be read only in parts, others to be read, but not
curiously, and some few to be read wholly, and with diligence and
attention.
---
Core Linux ( 5 - 1 - 3 - 2 - 7 - 4 - 6 ) “Nature has neither kernel
nor shell; she is everything at once” -- Johann Wolfgang von Goethe Reader
should be well versed with operating system concepts; a fair understanding
of long running processes and its differences with processes with short
bursts of execution; fault tolerance while meeting soft and hard real time
constraints. While reading, it's important to understand and n/ack the
design choices made by the linux kernel source in the core subsystems.
Threads [and] signals [are] a platform-dependent trail of misery, despair,
horror and madness (~Anthony Baxte). That being said you should be a
self-evaluating C expert, before diving into the kernel. You should also
have good experience with Linked Lists, Stacks, Queues, Red Blacks Trees,
Hash Functions, et al. volatile int i; int main(void) { int c; for (i=0;
i3; i++) { c = ii; printf(%d\n, c); /* find c */ } return 0; } The
beauty and art of the Linux Kernel source lies in the deliberate code
obfuscation used along. This is often necessitated as to convey the
computational meaning involving two or more operations in a clean and
elegant way. This is especially true when writing code for multi-core
architecture.
-
Device Drivers ( 1 - 2 - 4 - 3 - 8 - ... ) Music does not carry you
along. You have to carry it along strictly by your ability to really just
focus on that little small kernel of emotion or story. -- Debbie Harry
Your task is basically to establish a high speed communication interface
between the hardware device and the software kernel. You should read the
hardware reference datasheet/manual to understand the behavior of the
device and it's control and data states and provided physical channels.
Knowledge of Assembly for your particular architecture and a fair knowledge
of VLSI Hardware Description Languages like VHDL or Verilog will help you
in the long run. Intel® 64 and IA-32 Architectures Software Developer’s
Manual ARM Architecture Reference Manual ARM System Developer's Guide Q:
But, why do I have to read the hardware specs? A: Because, There is a
chasm of carbon and silicon the software can't bridge - Rahul Sonnad
However, the above doesn't poses a problem for Computational Algorithms
(Driver code - bottom-half processing), as it can 

Re: bitops for handling 32 bits

2015-07-28 Thread Manavendra Nath Manav
On Tue 28 Jul, 2015 20:24 Kevin Wilson wkev...@gmail.com wrote:

 Hi all,
 Is there a kernel API for handling 32 bits ?
 I see a macro like BIT(nr)
 http://lxr.free-electrons.com/source/include/linux/bitops.h#L6

 #define BIT(nr) (1UL  (nr))

 and also
 #define BIT_ULL(nr) (1ULL  (nr))

 However, these macros are using 64 bit semantics, so if I will use
 them with 32 bits values
 the results will  be wrong.

 Any ideas ?

 Regards,
 Kevin

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

The macros don't do type checking so it will work for both 32-bit and
64-bit.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: how can I find where is the macro or function deifined

2015-07-28 Thread Manavendra Nath Manav
On Tue 28 Jul, 2015 21:41 Ahmed Soliman ahmedsoliman0x...@gmail.com wrote:

Hi;
when I used libc I never memorized where each function is located
beyond the basics (for example I never knew if strlen is in string.h
or ctype.h or strlib.h )
I just check out the functions man pages by man strlen
is their such functionality for the kernel where I dont need to
memorize the dependencies for example if MODULE_LICENSE is in kernel.h
or module.h with out using the internel to google them .

__



You can use cscope and/or ctags to jump directly to the symbol definition.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


RE: Page fault in kernel code

2014-09-10 Thread Manavendra Nath Manav
On 09-Sep-2014 10:25 pm, Jeff Haran jeff.ha...@citrix.com wrote:


 While reading the book Essential Linux device drivers it says user mode
code is allowed to page fault, however, whereas kernel mode code isn't.

 Why is it so? Why can't kernel mode code handle the page fault and reload
the page from swap? Also, can page fault occur when kernel is executing in
process context and/or interrupt context?

 -- manav m-n

 Think about handling the case where a page fault has occurred but the
code that handles the page fault is itself not already in RAM, which leads
to another page fault. Gets complicated. That complexity can be avoided by
keeping all the kernel code in RAM all the time. Same applies to the kernel
data that is needed to handle a page fault.

 Jeff Haran



But if the total RAM is limited (less than 896MB LOWMEM), for example as in
embedded devices how the kernel code be kept in RAM all the time. Am I
correct to assume that the kernel pre-fetches all pages when entering
kernel mode from user mode?
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Page fault in kernel code

2014-09-10 Thread Manavendra Nath Manav
On 10-Sep-2014 6:24 pm, valdis.kletni...@vt.edu wrote:

 On Wed, 10 Sep 2014 14:45:23 +0530, Manavendra Nath Manav said:

  But if the total RAM is limited (less than 896MB LOWMEM), for example
as in
  embedded devices how the kernel code be kept in RAM all the time. Am I
  correct to assume that the kernel pre-fetches all pages when entering
  kernel mode from user mode?

 No, kernel code is loaded by your boot loader, and *it stays there*.
Similarly,
 if you modprobe something, the kernel allocates the page, loads the code,
 and leaves it there.

 Particularly in embedded devices, where you know all the modules the
kernel may
 need, it's common to just create a kernel with everything built in, no
module
 support, and when the system boots, it loads into memory and never moves
again.


Linux kernel memory is not page-able, but memory allocated through vmalloc
can still cause page fault. How device drivers using vmalloc handle this?
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Page fault in kernel code

2014-09-09 Thread Manavendra Nath Manav
While reading the book Essential Linux device drivers it says user mode
code is allowed to page fault, however, whereas kernel mode code isn't.

Why is it so? Why can't kernel mode code handle the page fault and reload
the page from swap? Also, can page fault occur when kernel is executing in
process context and/or interrupt context?

-- manav m-n
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


What is idr_alloc()

2013-04-02 Thread Manavendra Nath Manav
In the source code implementation it says idr_alloc() is used to
allocate new idr entry. I couldn't find the man page and want to know
why it is used especially when writing drivers for MTD devices.

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


How to analyze kernel Oops dump

2013-02-05 Thread Manavendra Nath Manav
: 80569f24 80569f10 8000fa08 80046550 fa212000
80569f40 80569f3c 80569f28
[  494.007934] 9f20: 80008658 8000f988 8000fd50 6013 80569f94
80569f40 8000e600 8000861c
[  494.016632] 9f40: 80568018 8000fd1c  805d75c0 0002
805d6d00 8900aa80 8058cbcc
[  494.025299] 9f60: 8000406a 410fc0f0  80569f94 80569f74
80569f88 8002633c 8000fd50
[  494.033966] 9f80: 6013  80569fa4 80569f98 80010130
8000fd28 80569fbc 80569fa8
[  494.042663] 9fa0: 803b9c0c 80010080 8054ff08 80589a10 80569ff4
80569fc0 8051f828 803b9b9c
[  494.051330] 9fc0:   8051f278  
80548098  10c5387d
[  494.059997] 9fe0: 80588dbc 80547c94  80569ff8 80008044
8051f580  

[  494.068664] Backtrace:
[  494.071289] [80109434] (__kmalloc_track_caller+0x0/0x1ec) from
[80335ec0] (__alloc_skb+0x60/0xfc)
[  494.081085] [80335e60] (__alloc_skb+0x0/0xfc) from [80336530]
(__netdev_alloc_skb+0x2c/0x54)
[  494.090423] [80336504] (__netdev_alloc_skb+0x0/0x54) from
[7f078788] (stmmac_poll+0x590/0x794 [stmmac])
[  494.100738]  r4:ed0b84c0 r3:
[  494.104553] [7f0781f8] (stmmac_poll+0x0/0x794 [stmmac]) from
[8033f23c] (net_rx_action+0x88/0x1f0)
[  494.114440] [8033f1b4] (net_rx_action+0x0/0x1f0) from
[80045fb4] (__do_softirq+0x12c/0x260)
[  494.123657] [80045e88] (__do_softirq+0x0/0x260) from [8004659c]
(irq_exit+0x58/0xb0)
[  494.132263] [80046544] (irq_exit+0x0/0xb0) from [8000fa08]
(handle_IRQ+0x8c/0xc8)
[  494.140563]  r4:0078 r3:020c
[  494.144378] [8000f97c] (handle_IRQ+0x0/0xc8) from [80008658]
(gic_handle_irq+0x48/0x6c)
[  494.153228]  r5:80569f40 r4:fa212000
[  494.157043] [80008610] (gic_handle_irq+0x0/0x6c) from
[8000e600] (__irq_svc+0x40/0x70)

[  494.165802] Exception stack(0x80569f40 to 0x80569f88)
[  494.171173] 9f40: 80568018 8000fd1c  805d75c0 0002
805d6d00 8900aa80 8058cbcc
[  494.179840] 9f60: 8000406a 410fc0f0  80569f94 80569f74
80569f88 8002633c 8000fd50
[  494.188507] 9f80: 6013 
[  494.192230]  r5:6013 r4:8000fd50
[  494.196014] [8000fd1c] (default_idle+0x0/0x3c) from [80010130]
(cpu_idle+0xbc/0x120)
[  494.204620] [80010074] (cpu_idle+0x0/0x120) from [803b9c0c]
(rest_init+0x7c/0x94)
[  494.212921] [803b9b90] (rest_init+0x0/0x94) from [8051f828]
(start_kernel+0x2b4/0x2fc)
[  494.221710]  r4:80589a10 r3:8054ff08
[  494.225494] [8051f574] (start_kernel+0x0/0x2fc) from [80008044]
(0x80008044)
[  494.233367] Code: eb0b01e9 e1a04000 ea1d e5952014 (e7941002)
[  494.240142] ---[ end trace 90a5ae2bdb3ab659 ]---

[  494.245117] Kernel panic - not syncing: Fatal exception in interrupt
[  494.251892] CPU1: stopping
[  494.254760] Backtrace:
[  494.257354] [80012f64] (dump_backtrace+0x0/0x114) from
[803c76fc] (dump_stack+0x20/0x24)
[  494.266204]  r6:0001 r5:0001 r4:ed091f70 r3:
[  494.266235] [803c76dc] (dump_stack+0x0/0x24) from [80014944]
(handle_IPI+0x10c/0x1e4)
[  494.273132] [80014838] (handle_IPI+0x0/0x1e4) from [80008674]
(gic_handle_irq+0x64/0x6c)
[  494.289703]  r7:ed091ed4 r6: r5:ed091ea0 r4:fa212000
[  494.289703] [80008610] (gic_handle_irq+0x0/0x6c) from
[8000e600] (__irq_svc+0x40/0x70)
[  494.304382] Exception stack(0xed091ea0 to 0xed091ee8)
[  494.304382] 1ea0: ed090028 ed091ee8 ed09 805f8b00 0202
ed090028  ed091f70
[  494.312194] 1ec0: 000a 0001  ed091f1c 
ed091ee8 0001 80045eec
[  494.326873] 1ee0: 2113 
[  494.327819]  r5:2113 r4:80045eec
[  494.334320] [80045e88] (__do_softirq+0x0/0x260) from [8004659c]
(irq_exit+0x58/0xb0)
[  494.342834] [80046544] (irq_exit+0x0/0xb0) from [80014908]
(handle_IPI+0xd0/0x1e4)
[  494.351165]  r4: r3:0001
[  494.354949] [80014838] (handle_IPI+0x0/0x1e4) from [80008674]
(gic_handle_irq+0x64/0x6c)
[  494.363830]  r7:ed091fa4 r6: r5:ed091f70 r4:fa212000
[  494.369812] [80008610] (gic_handle_irq+0x0/0x6c) from
[8000e600] (__irq_svc+0x40/0x70)
[  494.378509] Exception stack(0xed091f70 to 0xed091fb8)
[  494.378509] 1f60: ed090008
8000fd1c  805d75c0
[  494.392425] 1f80: 0001 0001 805d6ff0 805d7004 8000406a
410fc0f0  ed091fc4
[  494.398132] 1fa0: ed091fa4 ed091fb8 8002633c 8000fd50 6013 
[  494.407958]  r5:6013 r4:8000fd50
[  494.407958] [8000fd1c] (default_idle+0x0/0x3c) from [80010130]
(cpu_idle+0xbc/0x120)
[  494.420257] [80010074] (cpu_idle+0x0/0x120) from [803c4538]
(secondary_start_kernel+0x110/0x128)
[  494.429382] [803c4428] (secondary_start_kernel+0x0/0x128) from
[803c3e74] (__enable_mmu+0x0/0x2c)
[  494.439575]  r6:10c0387d r5:0015 r4:ed08006a r3:803c3e5c
[  494.445556] panic occurred, switching back to text console
[  497.913726]
[  497.913726]
[  497.913726] Error: McSPI_RX_DMA: FIFO Overrun..(1)
[  497.913726]

--
Manavendra Nath Manav

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

Re: Find out function arguments value from stack pointer

2012-12-12 Thread Manavendra Nath Manav
On Wed, Dec 12, 2012 at 3:56 PM, Fabio Pozzi pozzi.fa...@gmail.com wrote:
 Why function arguments are stored from offset 12 of SP? Also notice
 values at offset 0 to 10 are always same, and value at offset 11
 increases by 20 on each invocation of function foo().

 You have to consider that local variables are allocated on the stack,
 thus both i, stackptr and sp are allocated on
 the stack, so if you print all the stack records you will find this
 variables, then the return pointer, the saved frame pointer (if saved)
 and then the function parameters.
 See http://en.wikipedia.org/wiki/Call_stack for a better explanation.
 If you want to access immediately to the function call parameters you
 should start from the frame pointer address (if there's one).
 To play with backtraces you may find useful the backtrace function[1]
 and libraries like libunwind[2] which take care of this details for
 you.

 [1] 
 http://tdistler.com/2008/11/15/how-to-print-a-stack-backtrace-programatically-in-linux
 [2] http://www.nongnu.org/libunwind/

 --
 Saluti,
 Fabio Pozzi

Thanks Fabio,
You solved a lot of doubts for me. How to get the frame pointer address?

--
Manavendra Nath Manav

___
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 Manavendra Nath Manav
On Wed, Dec 12, 2012 at 4:02 PM, Manavendra Nath Manav
mnm.ker...@gmail.com wrote:
 On Wed, Dec 12, 2012 at 3:56 PM, Fabio Pozzi pozzi.fa...@gmail.com wrote:
 Why function arguments are stored from offset 12 of SP? Also notice
 values at offset 0 to 10 are always same, and value at offset 11
 increases by 20 on each invocation of function foo().

 You have to consider that local variables are allocated on the stack,
 thus both i, stackptr and sp are allocated on
 the stack, so if you print all the stack records you will find this
 variables, then the return pointer, the saved frame pointer (if saved)
 and then the function parameters.
 See http://en.wikipedia.org/wiki/Call_stack for a better explanation.
 If you want to access immediately to the function call parameters you
 should start from the frame pointer address (if there's one).
 To play with backtraces you may find useful the backtrace function[1]
 and libraries like libunwind[2] which take care of this details for
 you.

 [1] 
 http://tdistler.com/2008/11/15/how-to-print-a-stack-backtrace-programatically-in-linux
 [2] http://www.nongnu.org/libunwind/

 --
 Saluti,
 Fabio Pozzi

 Thanks Fabio,
 You solved a lot of doubts for me. How to get the frame pointer address?

I found that gcc has in-build function to retrieve frame pointer address
 void * __builtin_frame_address (unsigned int level)

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.

--
Manavendra Nath Manav

___
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 Manavendra Nath Manav
On Wed, Dec 12, 2012 at 4:38 PM, Fabio Pozzi pozzi.fa...@gmail.com 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?

-- 
Manavendra Nath Manav

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


Re: Device node at /dev/tty* not getting created for uart serial driver

2012-11-28 Thread Manavendra Nath Manav
On Mon, Nov 26, 2012 at 2:02 PM, Jinqiang Zeng jinqiangz...@gmail.com wrote:

 first creat a device class,then register a device to the kernel. using the 
 following functions:
 struct class *class_create(struct module *owner, char *name);
  struct class_device *class_device_create(struct class *cls,
   struct class_device *parent,
   dev_t devt,
   struct device *device, char *fmt, ...)


 2012/11/26 Manavendra Nath Manav mnm.ker...@gmail.com


 On Sat, Nov 24, 2012 at 2:20 PM, Manavendra Nath Manav 
 mnm.ker...@gmail.com wrote:

 Hi RK

 On Sat, Nov 24, 2012 at 2:03 PM, Manavendra Nath Manav 
 mnm.ker...@gmail.com wrote:

 I have written a simple UART serial driver in embedded Linux running 
 busybox with mdev rules. I have provided .dev_name as ttyC2C in my 
 driver code.

 static struct uart_driver serial_omap_reg = {
.owner  = THIS_MODULE,
.driver_name   = Omap-C2C-Serial,
.dev_name   = ttyC2C,
.nr  = OMAP_MAX_HSUART_PORTS,
.cons= NULL,
 };

 However the node is getting created in

 ./sys/devices/platform/omap_c2c_uart.0/tty/ttyC2C0
 ./sys/class/tty/ttyC2C0

 / # ls -l ./sys/class/tty/ttyC2C0
 lrwxrwxrwx1 root 00 Jan  1 00:14 
 ./sys/class/tty/ttyC2C0 - 
 ../../devices/platform/omap_c2c_uart.0/tty/ttyC2C0

 / # ls -l ./sys/devices/platform/omap_c2c_uart.0/tty/ttyC2C0
 -r--r--r--1 root 0 4096 Jan  1 00:14 dev
 lrwxrwxrwx1 root 00 Jan  1 00:14 device - 
 ../../../omap_c2c_uart.0
 drwxr-xr-x2 root 00 Jan  1 00:14 power
 lrwxrwxrwx1 root 00 Jan  1 00:14 subsystem - 
 ../../../../../class/tty
 -rw-r--r--1 root 0 4096 Jan  1 00:14 uevent
 / #

 The mdev rules for tty are:

 tty 0:5 0666
 tty.* 0:0 0620

 How to get device node as /dev/ttyC2C ?

 --
 Manavendra Nath Manav


 can you help me on following issue?

 --
 Manavendra Nath Manav


 In Essential Linux Device Drivers book, it says that that the driver name 
 in struct platform_driver and struct uart_driver should be same. I 
 modified the code according but still /dev/ttyC2C node is not being 
 populated.

 --
 Manavendra Nath Manav


When i add .major and .minor to the struct uart_driver and create the
device node manually using mknod then the driver works fine. Why the
kernel (3.4.0) is not able to create it automatically?

--
Manavendra Nath Manav

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


Re: Device node at /dev/tty* not getting created for uart serial driver

2012-11-25 Thread Manavendra Nath Manav
On Sat, Nov 24, 2012 at 2:20 PM, Manavendra Nath Manav mnm.ker...@gmail.com
 wrote:

 Hi RK

 On Sat, Nov 24, 2012 at 2:03 PM, Manavendra Nath Manav 
 mnm.ker...@gmail.com wrote:

 I have written a simple UART serial driver in embedded Linux running
 busybox with mdev rules. I have provided .dev_name as ttyC2C in my
 driver code.

 static struct uart_driver serial_omap_reg = {
.owner  = THIS_MODULE,
.driver_name   = Omap-C2C-Serial,
.dev_name   = ttyC2C,
.nr  = OMAP_MAX_HSUART_PORTS,
.cons= NULL,
 };

 However the node is getting created in

 ./sys/devices/platform/omap_c2c_uart.0/tty/ttyC2C0
 ./sys/class/tty/ttyC2C0

 / # ls -l ./sys/class/tty/ttyC2C0
 lrwxrwxrwx1 root 00 Jan  1 00:14 
 ./sys/class/tty/ttyC2C0 - ../../devices/platform/omap_c2c_uart.0/tty/ttyC2C0

 / # ls -l ./sys/devices/platform/omap_c2c_uart.0/tty/ttyC2C0
 -r--r--r--1 root 0 4096 Jan  1 00:14 dev
 lrwxrwxrwx1 root 00 Jan  1 00:14 device - 
 ../../../omap_c2c_uart.0
 drwxr-xr-x2 root 00 Jan  1 00:14 power
 lrwxrwxrwx1 root 00 Jan  1 00:14 subsystem - 
 ../../../../../class/tty
 -rw-r--r--1 root 0 4096 Jan  1 00:14 uevent
 / #

 The mdev rules for tty are:

 tty 0:5 0666
 tty.* 0:0 0620

 How to get device node as /dev/ttyC2C ?
 --
 Manavendra Nath Manav


 can you help me on following issue?

 --
 Manavendra Nath Manav


In Essential Linux Device Drivers book, it says that that the driver name
in struct platform_driver and struct uart_driver should be same. I
modified the code according but still /dev/ttyC2C node is not being
populated.

-- 
Manavendra Nath Manav
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Device node at /dev/tty* not getting created for uart serial driver

2012-11-24 Thread Manavendra Nath Manav
I have written a simple UART serial driver in embedded Linux running
busybox with mdev rules. I have provided .dev_name as ttyC2C in my driver
code.

static struct uart_driver serial_omap_reg = {
   .owner  = THIS_MODULE,
   .driver_name   = Omap-C2C-Serial,
   .dev_name   = ttyC2C,
   .nr  = OMAP_MAX_HSUART_PORTS,
   .cons= NULL,
};

However the node is getting created in

./sys/devices/platform/omap_c2c_uart.0/tty/ttyC2C0
./sys/class/tty/ttyC2C0

/ # ls -l ./sys/class/tty/ttyC2C0
lrwxrwxrwx1 root 00 Jan  1 00:14
./sys/class/tty/ttyC2C0 -
../../devices/platform/omap_c2c_uart.0/tty/ttyC2C0

/ # ls -l ./sys/devices/platform/omap_c2c_uart.0/tty/ttyC2C0
-r--r--r--1 root 0 4096 Jan  1 00:14 dev
lrwxrwxrwx1 root 00 Jan  1 00:14 device -
../../../omap_c2c_uart.0
drwxr-xr-x2 root 00 Jan  1 00:14 power
lrwxrwxrwx1 root 00 Jan  1 00:14 subsystem -
../../../../../class/tty
-rw-r--r--1 root 0 4096 Jan  1 00:14 uevent
/ #

The mdev rules for tty are:

tty 0:5 0666
tty.* 0:0 0620

How to get device node as /dev/ttyC2C ?
-- 
Manavendra Nath Manav
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Device node at /dev/tty* not getting created for uart serial driver

2012-11-24 Thread Manavendra Nath Manav
Hi RK

On Sat, Nov 24, 2012 at 2:03 PM, Manavendra Nath Manav mnm.ker...@gmail.com
 wrote:

 I have written a simple UART serial driver in embedded Linux running
 busybox with mdev rules. I have provided .dev_name as ttyC2C in my
 driver code.

 static struct uart_driver serial_omap_reg = {
.owner  = THIS_MODULE,
.driver_name   = Omap-C2C-Serial,
.dev_name   = ttyC2C,
.nr  = OMAP_MAX_HSUART_PORTS,
.cons= NULL,
 };

 However the node is getting created in

 ./sys/devices/platform/omap_c2c_uart.0/tty/ttyC2C0
 ./sys/class/tty/ttyC2C0

 / # ls -l ./sys/class/tty/ttyC2C0
 lrwxrwxrwx1 root 00 Jan  1 00:14 
 ./sys/class/tty/ttyC2C0 - ../../devices/platform/omap_c2c_uart.0/tty/ttyC2C0

 / # ls -l ./sys/devices/platform/omap_c2c_uart.0/tty/ttyC2C0
 -r--r--r--1 root 0 4096 Jan  1 00:14 dev
 lrwxrwxrwx1 root 00 Jan  1 00:14 device - 
 ../../../omap_c2c_uart.0
 drwxr-xr-x2 root 00 Jan  1 00:14 power
 lrwxrwxrwx1 root 00 Jan  1 00:14 subsystem - 
 ../../../../../class/tty
 -rw-r--r--1 root 0 4096 Jan  1 00:14 uevent
 / #

 The mdev rules for tty are:

 tty 0:5 0666
 tty.* 0:0 0620

 How to get device node as /dev/ttyC2C ?
 --
 Manavendra Nath Manav


can you help me on following issue?

-- 
Manavendra Nath Manav
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How does I/O ports work in linux kernel

2012-10-05 Thread Manavendra Nath Manav
On Mon, Oct 1, 2012 at 6:59 PM, Vineel Reddy vineel.kovv...@gmail.com wrote:
 Hi All,

 I have read about I/O ports recently from many recommended books for linux.
 Each of the book effectively taught me only two things
 1. Reserving the I/O ports using request_region(...) function
 2. Then access the I/O ports using inb, outb functions

 Apart from repeated reading and googling I still have the following queries

 Question 1:
 The one thing that the books haven't sufficiently answered is 'how does
 linux know to which device it should write or read from when we use inb and
 outb functions'?
 Say for example we are dealing with parallel port for instance. How does
 linux know that the parallel port is registered at 0x378 ?

 Question 2:
 Who registers the parallel port at 0x378 ?
 I have read somewhere that all the mapped ports can be found in
 /proc/ioports.
 Who generates this map. BIOS? or the Kernel?

 Question 3:
 How is /proc/ioports different from /proc/iomem(System Memory Map). Is there
 any overlap between them(because 0x378  is also an address, so it must be
 some where in the system map. right?) ?

 Question 4:
 Is 0x378 the physical address in the system memory map generated by BIOS as
 stated here
 http://www.pcguide.com/ref/mbsys/res/ioSummary-c.html
 Or a logical address from above table remapped inside the RAM which is in
 turn mapped at 0x0010 physical


 I am banging my head with all of these bits and pieces of information
 without having a clue to stitch all of them together.
 Please give me some pointers to understand them.
 Thanks in advance.


 Regards
 Vineel Kumar Reddy Kovvuri



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


From http://en.wikipedia.org/wiki/LPT

Most PC-compatible systems in the 1980s and 1990s had one to three
ports, with communication interfaces defined like this:
LPT1: I/O port 0x3BC, IRQ 7 (usually in monochrome graphics adapters)
LPT2: I/O port 0x378, IRQ 7 (dedicated IO cards or using a controller
built into the mainboard)
LPT3: I/O port 0x278, IRQ 5 (dedicated IO cards or using a controller
built into the mainboard)
If no printer port is present at 0x3BC, the second port in the row
(0x378) becomes LPT1 and 0x278 becomes LPT2. Sometimes, printer ports
are jumpered to share an interrupt despite having their own IO
addresses (i.e. only one can be used interrupt-driven at a time). In
some cases, the BIOS supports a fourth printer port as well, but the
base address for it differs significantly between vendors. Since a
fourth printer port is conflictive with other features on PS/2
machines, it typically requires special drivers in most environments.

See also http://en.wikipedia.org/wiki/Input/Output_Base_Address

-- 
Manavendra Nath Manav

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


Re: IPSec/IPv6 test gets unexpected ENOBUFS on connect on linux 3.2

2012-10-05 Thread Manavendra Nath Manav
On Mon, Oct 1, 2012 at 11:49 AM, Bhushan Kumar
bhushan.ku...@mphasis.com wrote:
 HI,

 I am getting the below mentioned  error  for Linux kernel  3.2.18.i am
 looking for patch for the same. If anyone having suggestion\patch is  much
 appreciated . And I will be thankful for ASAP response.



 “ TCP/IPv6 test doing repeated heavy sending and reconnecting,  connect()s

 start to fail with ENOBUFS on the Linux 3.2.18. “


Your system is running low on memory. I don't think it is specific to
3.2.18. The kernel's buffers for I/O operations are all in use. In
GNU, this error is always synonymous with ENOMEM; you may get one or
the other from network operations.

-- 
Manavendra Nath Manav

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


Re: Why exported const value modified by another driver not updated in original driver

2012-09-05 Thread Manavendra Nath Manav
On Tue, Sep 4, 2012 at 5:55 PM, Dan Carpenter dan.carpen...@oracle.com wrote:
 On Tue, Sep 04, 2012 at 03:58:20PM +0530, Manavendra Nath Manav wrote:
 Is the above a genuine kernel bug, or i am missing something out here. Pls 
 help.


 When you declare something as const then the compiler assumes it
 really is const and uses a literal instead of reading from memory.
 I'm surprised the compiler doesn't print a warning message.

 It has to do with compilers, nothing to do with kernels.

 regards,
 dan carpenter

Thanks All,
I understood the problem and current gcc behaviour after looking at
output of objdump of driver.ko file when the variable is declared as
const and in second case as const volatile. The compiler optimises
by directly passing the value in first case and the address of
variable in second case. Thanks for all the help and clarification.

push   $0x7b // 123 in decimal
push   $0x0

-- 
Manavendra Nath Manav

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


Re: Why exported const value modified by another driver not updated in original driver

2012-09-04 Thread Manavendra Nath Manav
On Tue, Sep 4, 2012 at 3:00 PM, Manavendra Nath Manav
mnm.ker...@gmail.com wrote:
 Hi,

 I have declared a static const int variable in one driver and exported
 that variable symbol. In another driver i am modifying that variable.
 The other driver prints the modified value but the original driver
 retains the original value. When both virtual and physical addresses
 of the variable as seen by both drivers are same, how is this even
 possible. Is it a kernel bug?

 [root@localhost bug]# uname -a
 Linux localhost.localdomain 3.5.3 #3 SMP Mon Sep 3 21:52:12 IST 2012
 i686 i686 i386 GNU/Linux

 
 [root@localhost bug]# cat driver.c
 #include linux/module.h

 static const int value = 123;

 int init_module()
 {
 printk(Base driver (init): value = %d\n, value);
 printk(Base driver (init): virtual address of value  = %p\n, (void 
 *)value);
 printk(Base driver (init): physical address of value = %p\n, (void
 *)__pa(value));
 return 0;
 }

 void cleanup_module()
 {
 printk(Base driver (exit): value = %d\n, value);
 printk(Base driver (exit): virtual address of value  = %p\n, (void 
 *)value);
 printk(Base driver (exit): physical address of value = %p\n, (void
 *)__pa(value));
 }
 EXPORT_SYMBOL(value);

 ==
 [root@localhost bug]# cat hacker.c
 #include linux/module.h

 extern int value;

 int init_module()
 {
 value = 987;
 printk(Hacker driver (init): value = %d\n, 
 value);
 printk(Hacker Base driver (init): virtual address of value  = %p\n,
 (void *)value);
 printk(Hacker Base driver (init): physical address of value = %p\n,
 (void *)__pa(value));
 return 0;
 }

 void cleanup_module()
 {
 printk(Hacker driver (exit): value = %d\n, 
 value);
 printk(Hacker driver (exit): virtual address of value  = %p\n,
 (void *)value);
 printk(Hacker driver (exit): physical address of value = %p\n,
 (void *)__pa(value));
 return;
 }

 =
 [root@localhost bug]# insmod driver.ko
 Base driver (init): value = 123
 Base driver (init): virtual address of value  = f89d61c8
 Base driver (init): physical address of value = 389d61c8

 [root@localhost bug]# insmod hacker.ko
 Hacker driver (init): value = 987
 Hacker Base driver (init): virtual address of value  = f89d61c8
 Hacker Base driver (init): physical address of value = 389d61c8

 [root@localhost bug]# rmmod hacker.ko
 Hacker driver (exit): value = 987
 Hacker driver (exit): virtual address of value  = f89d61c8
 Hacker driver (exit): physical address of value = 389d61c8

 [root@localhost bug]# rmmod driver.ko
 Base driver (exit): value = 123
 Base driver (exit): virtual address of value  = f89d61c8
 Base driver (exit): physical address of value = 389d61c8

 [root@localhost bug]# cat /proc/kallsyms | grep value
 f89f91c8 R value[driver]
 f89f9088 r __ksymtab_value  [driver]
 f89f91cc r __kstrtab_value  [driver]

 Interestingly, when i change the declaration of variable to volatile
 in driver.c as static const volatile int then the driver.ko prints
 modified value 987 during rmmod and the original value 123 is
 lost. What is the difference between this and previous declaration?
 Please forgive if you find this question silly?
 --
 Manavendra Nath Manav

Is the above a genuine kernel bug, or i am missing something out here. Pls help.

Thanks,
Manavendra Nath Manav

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


Re: Why exported const value modified by another driver not updated in original driver

2012-09-04 Thread Manavendra Nath Manav
On Tue, Sep 4, 2012 at 4:09 PM, Julian Andres Klode j...@jak-linux.org wrote:
 On Tue, Sep 04, 2012 at 03:58:20PM +0530, Manavendra Nath Manav wrote:
 On Tue, Sep 4, 2012 at 3:00 PM, Manavendra Nath Manav
 mnm.ker...@gmail.com wrote:
  Hi,
 
  I have declared a static const int variable in one driver and exported
  that variable symbol. In another driver i am modifying that variable.

 No, you did not export it. It's static (and static is kind of the opposite
 of extern). And then you try to assign a value to a non-static variable with
 the same name, which might not even exist (as the other is static, this should
 not even work in my opinion).

  The other driver prints the modified value but the original driver
  retains the original value. When both virtual and physical addresses
  of the variable as seen by both drivers are same, how is this even
  possible. Is it a kernel bug?

 It only works because the compiler optimized the value = 123 away,
 and replaced value with 123 in the first module everywhere, as it
 is declared const and thus cannot be changed, so there's no reason
 to read it from memory.

 --
 Julian Andres Klode  - Debian Developer, Ubuntu Member

 See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

Still I am not able to understand !! Why the output behaviour changes
when the declaration is made as const volatile. I get the same
results as above when i remove static and retain const.
-- 
Manavendra Nath Manav

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


Re: kernel boot procedure

2012-03-03 Thread Manavendra Nath Manav
On Sun, Mar 4, 2012 at 2:46 AM, beyond.hack beyond.h...@gmail.com wrote:
 ***        when bootloader in bios executes its code, it do POST and other
 things...then as I read from somewhere  kernel does initrd to load some
 basic modules so as to mount the root file system and then removes the
 initrd fs.
 (srry my mistake)
 ___
 Kernelnewbies mailing list
 Kernelnewbies@kernelnewbies.org
 http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Quoting from Understanding the Linux Kernel:

The LILO boot loader is too large to fit into a single sector, thus it
is broken into two parts. The
MBR or the partition boot sector includes a small boot loader, which
is loaded into RAM starting from
address 0x7c00 by the BIOS. This small program moves itself to the
address 0x00096a00, sets up
the Real Mode stack (ranging from 0x00098000 to 0x000969ff), loads the
second part of the LILO boot
loader into RAM starting from address 0x00096c00, and jumps into it.

The LILO boot loader, which relies on BIOS routines, performs
essentially the following operations:
1. Invokes a BIOS procedure to display a Loading message.
2. Invokes a BIOS procedure to load an initial portion of the kernel
image from disk: the first 512 bytes of the kernel image are put in
RAM at address 0x0009, while the code of the setup( ) function is
put in RAM starting from address 0x00090200.
3. Invokes a BIOS procedure to load the rest of the kernel image from
disk and puts the image in RAM starting from either low address
0x0001 (for small kernel images compiled with make zImage) or high
address 0x0010 (for big kernel images compiled with make bzImage).
We say that the kernel image is loaded low or loaded high in RAM,
respectively.
4. Jumps to the setup( ) code.

So, you see the init routine is run only after the kernel has been
loaded in RAM.

-- 
Manavendra Nath Manav

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


Re: Linux cdc-acm-driver

2012-03-02 Thread Manavendra Nath Manav
Hi Stefan

On Thu, Mar 1, 2012 at 7:51 PM, Stefan Dreyer
stefan.dre...@ddnetservice.net wrote:
 Hi,



 Am 01.03.2012 14:57, schrieb Manavendra Nath Manav:

 The Metrologic scanner is working perfectly in bi-directional serial
 mode. But when I configure it as USB HID Keyboard mode as shown in the
 link and keyboard layout as US-English, I am not getting any data from
 Scanner. I have opened a terminal and scanned multiple barcodes but no
 output on screen.

 [root@pe1800xs e518816]# dmesg
 [98498.945783] input: Honeywell Scanning and Mobility Honeywell
 Scanning and Mobility Scanner as
 /devices/pci:00/:00:1d.1/usb7/7-2/7-2:1.0/input/input20
 [98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID
 v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and
 Mobility Scanner] on usb-:00:1d.1-2/input0

 [root@pe1800xs e518816]# lsusb -v
 Bus 007 Device 020: ID 0c2e:0200 Metro Metrologic Scanner
 [root@pe1800xs e518816]# cat /proc/bus/usb/devices
 T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
 D:  Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=0c2e ProdID=0200 Rev=58.88
 S:  Manufacturer=Honeywell Scanning and Mobility
 S:  Product=Honeywell Scanning and Mobility Scanner
 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
 I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

 Can you help me in getting data from Scanner in USB HID Keyboard
 Emulation mode as this would reduce the burden of using an extra
 driver and the application program can read directly from the
 emulation keyboard instead of listening to serial device.


 For me, that looks good. But i never have any problems using the scanner in
 Keyboard-Mode. Are all the necessary drivers loaded
 (usbcore,hid,usbhid,...)
 What happens, if you plug a new USB-Keyboard in. Does it works? Did you try
 to recall factory-settings before? Maybe the Keyboard-mode is disabled
 somewhere else.

 you can test all the input-devices, in directory /dev/input there must be
 device-files named event0 ... eventN (You could identify it via directory:
 /dev/input/by-id, if you have it on fedora 14)
 you can test them via
 # cat /dev/input/event9 | hexdump
 If you scan codes, the hexdump of the keycodes is shown.


I scanned all the required bar-codes to make Metrologic MS1690 work as
USB HID Keyboard, it is being detected and driver usbhid attached to
it, but I am not able to see any output on console. The output is fine
when it is configured in serial mode. However, hexdump shows keycodes.
I attached another standard USB Dell keyboard and it is working fine.

[98498.945783] input: Honeywell Scanning and Mobility Honeywell
Scanning and Mobility Scanner as
/devices/pci:00/:00:1d.1/usb7/7-2/7-2:1.0/input/input20
[98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID
v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and
Mobility Scanner] on usb-:00:1d.1-2/input0

[root@pe1800xs input]# cat /proc/bus/usb/devices
T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0c2e ProdID=0200 Rev=58.88
S:  Manufacturer=Honeywell Scanning and Mobility
S:  Product=Honeywell Scanning and Mobility Scanner
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

[root@pe1800xs ~]# ll /dev/input/by-id/
total 0
lrwxrwxrwx 1 root root 9 Feb 29 15:46
usb-Dell_Dell_QuietKey_Keyboard-event-kbd - ../event2
lrwxrwxrwx 1 root root 9 Feb 29 17:17
usb-Dell_Dell_USB_Entry_Keyboard-event-kbd - ../event5
lrwxrwxrwx 1 root root 9 Mar  1 19:10
usb-Honeywell_Scanning_and_Mobility_Honeywell_Scanning_and_Mobility_Scanner-event-kbd
- ../event6

[root@pe1800xs input]# cat event6 | hexdump
000 8be0 4f50 ef90 0009 0004 0004 0027 0007
010 8be0 4f50 ef97 0009 0001 000b 0001 
020 8be0 4f50 ef98 0009    
030 8be0 4f50 0ecf 000a 0004 0004 0027 0007
040 8be0 4f50 0ed4 000a 0001 000b  
050 8be0 4f50 0ed5 000a    
*** snip ***

I am getting hexdump after scanning bar-codes, but why it is not
coming on console as it should like a standard keyboard.

-- 
Manavendra Nath Manav

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


Re: Linux cdc-acm-driver

2012-03-02 Thread Manavendra Nath Manav
On Fri, Mar 2, 2012 at 2:50 PM, Stefan Dreyer
stefan.dre...@ddnetservice.net wrote:
 Hi,

 Am 02.03.2012 10:05, schrieb Manavendra Nath Manav:

 Hi Stefan

 On Thu, Mar 1, 2012 at 7:51 PM, Stefan Dreyer
 stefan.dre...@ddnetservice.net  wrote:

 Hi,



 Am 01.03.2012 14:57, schrieb Manavendra Nath Manav:

 The Metrologic scanner is working perfectly in bi-directional serial
 mode. But when I configure it as USB HID Keyboard mode as shown in the
 link and keyboard layout as US-English, I am not getting any data from
 Scanner. I have opened a terminal and scanned multiple barcodes but no
 output on screen.

 [root@pe1800xs e518816]# dmesg
 [98498.945783] input: Honeywell Scanning and Mobility Honeywell
 Scanning and Mobility Scanner as
 /devices/pci:00/:00:1d.1/usb7/7-2/7-2:1.0/input/input20
 [98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID
 v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and
 Mobility Scanner] on usb-:00:1d.1-2/input0

 [root@pe1800xs e518816]# lsusb -v
 Bus 007 Device 020: ID 0c2e:0200 Metro Metrologic Scanner
 [root@pe1800xs e518816]# cat /proc/bus/usb/devices
 T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
 D:  Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=0c2e ProdID=0200 Rev=58.88
 S:  Manufacturer=Honeywell Scanning and Mobility
 S:  Product=Honeywell Scanning and Mobility Scanner
 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
 I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

 Can you help me in getting data from Scanner in USB HID Keyboard
 Emulation mode as this would reduce the burden of using an extra
 driver and the application program can read directly from the
 emulation keyboard instead of listening to serial device.



 For me, that looks good. But i never have any problems using the scanner
 in
 Keyboard-Mode. Are all the necessary drivers loaded
 (usbcore,hid,usbhid,...)
 What happens, if you plug a new USB-Keyboard in. Does it works? Did you
 try
 to recall factory-settings before? Maybe the Keyboard-mode is disabled
 somewhere else.

 you can test all the input-devices, in directory /dev/input there must be
 device-files named event0 ... eventN (You could identify it via
 directory:
 /dev/input/by-id, if you have it on fedora 14)
 you can test them via
 # cat /dev/input/event9 | hexdump
 If you scan codes, the hexdump of the keycodes is shown.


 I scanned all the required bar-codes to make Metrologic MS1690 work as
 USB HID Keyboard, it is being detected and driver usbhid attached to
 it, but I am not able to see any output on console. The output is fine
 when it is configured in serial mode. However, hexdump shows keycodes.
 I attached another standard USB Dell keyboard and it is working fine.

 [98498.945783] input: Honeywell Scanning and Mobility Honeywell
 Scanning and Mobility Scanner as
 /devices/pci:00/:00:1d.1/usb7/7-2/7-2:1.0/input/input20
 [98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID
 v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and
 Mobility Scanner] on usb-:00:1d.1-2/input0

 [root@pe1800xs input]# cat /proc/bus/usb/devices
 T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 20 Spd=1.5 MxCh= 0
 D:  Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
 P:  Vendor=0c2e ProdID=0200 Rev=58.88
 S:  Manufacturer=Honeywell Scanning and Mobility
 S:  Product=Honeywell Scanning and Mobility Scanner
 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
 I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

 [root@pe1800xs ~]# ll /dev/input/by-id/
 total 0
 lrwxrwxrwx 1 root root 9 Feb 29 15:46
 usb-Dell_Dell_QuietKey_Keyboard-event-kbd -  ../event2
 lrwxrwxrwx 1 root root 9 Feb 29 17:17
 usb-Dell_Dell_USB_Entry_Keyboard-event-kbd -  ../event5
 lrwxrwxrwx 1 root root 9 Mar  1 19:10

 usb-Honeywell_Scanning_and_Mobility_Honeywell_Scanning_and_Mobility_Scanner-event-kbd
 -  ../event6

 [root@pe1800xs input]# cat event6 | hexdump
 000 8be0 4f50 ef90 0009 0004 0004 0027 0007
 010 8be0 4f50 ef97 0009 0001 000b 0001 
 020 8be0 4f50 ef98 0009    
 030 8be0 4f50 0ecf 000a 0004 0004 0027 0007
 040 8be0 4f50 0ed4 000a 0001 000b  
 050 8be0 4f50 0ed5 000a    
 *** snip ***

 I am getting hexdump after scanning bar-codes, but why it is not
 coming on console as it should like a standard keyboard.


 If you get the hexdump, your scanner is configured and working correctly.
 There must be a problem with your console or your X-configuration.



Thanks Stefan, you are right that if I get hexdump then the scanner is
working properly. This test was failing before because I was trying to
get barcodes over Putty terminal emulation which is basically a SSH
session and will not display the keyboard inputs from the host
machine. When I checked on the host machine, it’s

Re: Linux cdc-acm-driver

2012-03-01 Thread Manavendra Nath Manav
On Thu, Mar 1, 2012 at 1:57 PM, Stefan Dreyer
stefan.dre...@ddnetservice.net wrote:
 Hi,

 allthough the answer is offtopic for cdc-acm-driver, i will answer, because
 maybe it helps other people in future.

 I can tell you exactly, what is going on. If the scanner switches to
 ProductId=0720 (0c2e:0720) the scanner is working in Serial-Mode. If you
 want the scanner let work as serial device, you have to use the driver
 metro-usb. The manufacturer has this driver, but that one is outdatet and
 doesn't compile on actual Linux kernel.
 I found an actual driver, which compiles even with kernel 3.2
 https://gitorious.org/other/metro-usb/commits/master

Thanks a lot for the prompt reply, this should adequately solve my
problem. I am able to download the driver source and compile. However,
I have run into a trivial module format error.

[root@pe1800xs serial]# modinfo metro-usb.ko
filename:       metro-usb.ko
description:    Metrologic Instruments Inc. - USB-POS driver
author:         Aleksey Babahin tamerlan...@gmail.com
author:         Philip Nicastro
license:        GPL
srcversion:     AF4C7DDE2804EBB1578A05F
alias:          usb:v0C2Ep0710d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0C2Ep0720d*dc*dsc*dp*ic*isc*ip*
depends:        usbserial
vermagic:       2.6.35.6-45.fc14.i686 SMP mod_unload modversions 686
parm:           debug:Print debug info (bool 1=on, 0=off) (bool)
parm:           vendor:User specified vendor ID (ushort) (ushort)
parm:           product:User specified product ID (ushort) (ushort)

[root@pe1800xs serial]# modprobe -f -v metro-usb
insmod /lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko
FATAL: Error inserting metro_usb
(/lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko):
Invalid module format

[root@pe1800xs serial]# uname -a
Linux pe1800xs 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC
2010 i686 i686 i386 GNU/Linux

[root@pe1800xs serial]# dmesg
[84119.755750] metro_usb: version magic '2.6.35.6-45.fc14.i686 SMP
mod_unload modversions 686 ' should be '2.6.35.6-45.fc14.i686 SMP
mod_unload 686 '

I am running Fedora14 with Force module loading option disabled. How
can I turn it ON without recompiling the kernel. Or, since I have the
souce files of the driver (attached), how can I modify the metro-usb.c
file to provide suitable module version.

--
Manavendra Nath Manav


Makefile
Description: Binary data
/*
  Date Created:	9/15/2006
  File Name:		metro-usb.c
  Description:	metro-usb.c is the drivers main source file. The driver is a USB to Serial converter.
		The driver takes USB data and sends it to a virtual ttyUSB# serial port.
		The driver interfaces with the usbserial.ko driver supplied by Linux. 

		NOTES: 
		To install the driver:
		1. Install the usbserial.ko module supplied by Linux with: # insmod usbserial.ko
		2. Install the metro-usb.ko module with: # insmod metro-usb.ko vender=0x product=0x debug=1
		   The vendor, product and debug parameters are optional.

		Some of this code is credited to Linux USB open source files that are distributed with Linux.

  Copyright:	2007 Metrologic Instruments. All rights reserved.
  Copyright:	2011 Azimut Ltd. http://azimutrzn.ru/
  Requirements: gedit.exe, notepad.exe
 
  Revision History:

  Date:			Developer:			Revisions:		
  --
  1/30/2007		Philip Nicastro		Initial release. (v1.0.0.0)
  2/27/2007		Philip Nicastro		Changed the metrousb_read_int_callback function to use a loop with the tty_insert_flip_char function to copy each byte to the tty layer. Removed the tty_buffer_request_room and the tty_insert_flip_string function calls. These calls were not supported on Fedora.
  2/27/2007		Philip Nicastro		Released. (v1.1.0.0)
  10/07/2011		Aleksey Babahin		Update for new kernel (tested on 2.6.38)
		Add unidirection mode support
 
 
*/

#include linux/kernel.h
#include linux/init.h
#include linux/tty.h
#include linux/module.h
#include linux/usb.h
#include linux/errno.h
#include linux/slab.h
#include linux/tty_driver.h
#include linux/tty_flip.h
#include linux/moduleparam.h
#include linux/spinlock.h
#include asm/uaccess.h
#include linux/errno.h
#include metro-usb.h
#include linux/usb/serial.h

/* Version Information */
#define DRIVER_VERSION v1.2.0.0
#define DRIVER_DESC Metrologic Instruments Inc. - USB-POS driver

/* Device table list. */
static struct usb_device_id id_table [] = {
	{ USB_DEVICE(FOCUS_VENDOR_ID, FOCUS_PRODUCT_ID) },	
	{ USB_DEVICE(FOCUS_VENDOR_ID, FOCUS_PRODUCT_ID_UNI) },
	{ }, /* Optional paramenter entry. */
	{ }, /* Terminating entry. */
};
MODULE_DEVICE_TABLE(usb, id_table);

/* Input parameter constants. */
static int debug;
static __u16 vendor;
static __u16 product;

/* Function prototypes. */
static void metrousb_cleanup (struct usb_serial_port *port);
static void metrousb_close (struct usb_serial_port *port);
static int  metrousb_open (struct tty_struct *tty, struct usb_serial_port

Re: Linux cdc-acm-driver

2012-03-01 Thread Manavendra Nath Manav
On Thu, Mar 1, 2012 at 3:18 PM, Manavendra Nath Manav
mnm.ker...@gmail.com wrote:
 On Thu, Mar 1, 2012 at 1:57 PM, Stefan Dreyer
 stefan.dre...@ddnetservice.net wrote:
 Hi,

 allthough the answer is offtopic for cdc-acm-driver, i will answer, because
 maybe it helps other people in future.

 I can tell you exactly, what is going on. If the scanner switches to
 ProductId=0720 (0c2e:0720) the scanner is working in Serial-Mode. If you
 want the scanner let work as serial device, you have to use the driver
 metro-usb. The manufacturer has this driver, but that one is outdatet and
 doesn't compile on actual Linux kernel.
 I found an actual driver, which compiles even with kernel 3.2
 https://gitorious.org/other/metro-usb/commits/master

 Thanks a lot for the prompt reply, this should adequately solve my
 problem. I am able to download the driver source and compile. However,
 I have run into a trivial module format error.

 [root@pe1800xs serial]# modinfo metro-usb.ko
 filename:       metro-usb.ko
 description:    Metrologic Instruments Inc. - USB-POS driver
 author:         Aleksey Babahin tamerlan...@gmail.com
 author:         Philip Nicastro
 license:        GPL
 srcversion:     AF4C7DDE2804EBB1578A05F
 alias:          usb:v0C2Ep0710d*dc*dsc*dp*ic*isc*ip*
 alias:          usb:v0C2Ep0720d*dc*dsc*dp*ic*isc*ip*
 depends:        usbserial
 vermagic:       2.6.35.6-45.fc14.i686 SMP mod_unload modversions 686
 parm:           debug:Print debug info (bool 1=on, 0=off) (bool)
 parm:           vendor:User specified vendor ID (ushort) (ushort)
 parm:           product:User specified product ID (ushort) (ushort)

 [root@pe1800xs serial]# modprobe -f -v metro-usb
 insmod 
 /lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko
 FATAL: Error inserting metro_usb
 (/lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko):
 Invalid module format

 [root@pe1800xs serial]# uname -a
 Linux pe1800xs 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC
 2010 i686 i686 i386 GNU/Linux

 [root@pe1800xs serial]# dmesg
 [84119.755750] metro_usb: version magic '2.6.35.6-45.fc14.i686 SMP
 mod_unload modversions 686 ' should be '2.6.35.6-45.fc14.i686 SMP
 mod_unload 686 '

 I am running Fedora14 with Force module loading option disabled. How
 can I turn it ON without recompiling the kernel. Or, since I have the
 souce files of the driver (attached), how can I modify the metro-usb.c
 file to provide suitable module version.


I am able to load the metro-usb.ko module now and the scanner works
perfectly.  I opened the serial console using
bash# serial /dev/ttyUSB0 9600
and can see the 1D and 2D scanned barcodes. Thanks :)

[89073.533413] metro-usb 7-1:1.0: Metrologic USB to serial converter.
converter detected
[89073.533489] usb 7-1: Metrologic USB to serial converter. converter
now attached to ttyUSB0

The workaround I did to remove invalid module format error is that I
modified the vermagic.h file.

[root@pe1800xs e518816]# diff
/usr/src/kernels/2.6.35.6-45.fc14.i686/include/linux/vermagic.h.old
/usr/src/kernels/2.6.35.6-45.fc14.i686/include/linux/vermagic.h.new
32,33c32
   MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS   \
   MODULE_ARCH_VERMAGIC
---
   MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC

Is this the correct way to resolve the error, although it works for
me? I am sure there would be other better ways to resolve vermagic
conflict errors.

-- 
Manavendra Nath Manav

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


Re: Linux cdc-acm-driver

2012-03-01 Thread Manavendra Nath Manav
Hi Stefan

On Thu, Mar 1, 2012 at 5:48 PM, Manavendra Nath Manav
mnm.ker...@gmail.com wrote:
 On Thu, Mar 1, 2012 at 3:18 PM, Manavendra Nath Manav
 mnm.ker...@gmail.com wrote:
 On Thu, Mar 1, 2012 at 1:57 PM, Stefan Dreyer
 stefan.dre...@ddnetservice.net wrote:
 Hi,

 allthough the answer is offtopic for cdc-acm-driver, i will answer, because
 maybe it helps other people in future.

 I can tell you exactly, what is going on. If the scanner switches to
 ProductId=0720 (0c2e:0720) the scanner is working in Serial-Mode. If you
 want the scanner let work as serial device, you have to use the driver
 metro-usb. The manufacturer has this driver, but that one is outdatet and
 doesn't compile on actual Linux kernel.
 I found an actual driver, which compiles even with kernel 3.2
 https://gitorious.org/other/metro-usb/commits/master

 Thanks a lot for the prompt reply, this should adequately solve my
 problem. I am able to download the driver source and compile. However,
 I have run into a trivial module format error.

 [root@pe1800xs serial]# modinfo metro-usb.ko
 filename:       metro-usb.ko
 description:    Metrologic Instruments Inc. - USB-POS driver
 author:         Aleksey Babahin tamerlan...@gmail.com
 author:         Philip Nicastro
 license:        GPL
 srcversion:     AF4C7DDE2804EBB1578A05F
 alias:          usb:v0C2Ep0710d*dc*dsc*dp*ic*isc*ip*
 alias:          usb:v0C2Ep0720d*dc*dsc*dp*ic*isc*ip*
 depends:        usbserial
 vermagic:       2.6.35.6-45.fc14.i686 SMP mod_unload modversions 686
 parm:           debug:Print debug info (bool 1=on, 0=off) (bool)
 parm:           vendor:User specified vendor ID (ushort) (ushort)
 parm:           product:User specified product ID (ushort) (ushort)

 [root@pe1800xs serial]# modprobe -f -v metro-usb
 insmod 
 /lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko
 FATAL: Error inserting metro_usb
 (/lib/modules/2.6.35.6-45.fc14.i686/kernel/drivers/usb/serial/metro-usb.ko):
 Invalid module format

 [root@pe1800xs serial]# uname -a
 Linux pe1800xs 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC
 2010 i686 i686 i386 GNU/Linux

 [root@pe1800xs serial]# dmesg
 [84119.755750] metro_usb: version magic '2.6.35.6-45.fc14.i686 SMP
 mod_unload modversions 686 ' should be '2.6.35.6-45.fc14.i686 SMP
 mod_unload 686 '

 I am running Fedora14 with Force module loading option disabled. How
 can I turn it ON without recompiling the kernel. Or, since I have the
 souce files of the driver (attached), how can I modify the metro-usb.c
 file to provide suitable module version.


 I am able to load the metro-usb.ko module now and the scanner works
 perfectly.  I opened the serial console using
 bash# serial /dev/ttyUSB0 9600
 and can see the 1D and 2D scanned barcodes. Thanks :)

 [89073.533413] metro-usb 7-1:1.0: Metrologic USB to serial converter.
 converter detected
 [89073.533489] usb 7-1: Metrologic USB to serial converter. converter
 now attached to ttyUSB0

 The workaround I did to remove invalid module format error is that I
 modified the vermagic.h file.

 [root@pe1800xs e518816]# diff
 /usr/src/kernels/2.6.35.6-45.fc14.i686/include/linux/vermagic.h.old
 /usr/src/kernels/2.6.35.6-45.fc14.i686/include/linux/vermagic.h.new
 32,33c32
        MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS       \
        MODULE_ARCH_VERMAGIC
 ---
       MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC

 Is this the correct way to resolve the error, although it works for
 me? I am sure there would be other better ways to resolve vermagic
 conflict errors.


The Metrologic scanner is working perfectly in bi-directional serial
mode. But when I configure it as USB HID Keyboard mode as shown in the
link and keyboard layout as US-English, I am not getting any data from
Scanner. I have opened a terminal and scanned multiple barcodes but no
output on screen.

[root@pe1800xs e518816]# dmesg
[98498.945783] input: Honeywell Scanning and Mobility Honeywell
Scanning and Mobility Scanner as
/devices/pci:00/:00:1d.1/usb7/7-2/7-2:1.0/input/input20
[98498.945850] generic-usb 0003:0C2E:0200.0011: input,hidraw2: USB HID
v1.11 Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and
Mobility Scanner] on usb-:00:1d.1-2/input0

[root@pe1800xs e518816]# lsusb -v
Bus 007 Device 020: ID 0c2e:0200 Metro Metrologic Scanner
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   1.10
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 8
  idVendor   0x0c2e Metro
  idProduct  0x0200 Metrologic Scanner
  bcdDevice   58.88
  iManufacturer   1 Honeywell Scanning and Mobility
  iProduct2 Honeywell Scanning and Mobility Scanner
  iSerial 0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   34

Re: Linux cdc-acm-driver

2012-02-29 Thread Manavendra Nath Manav
:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=02(O) Atr=03(Int.) MxPS=   8 Ivl=10ms
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

How to make this device work on Linux?

Please note this link http://forums.gentoo.org/viewtopic-t-852806.html
says that They tracked it down to the scanner registering itself as a
keyboard and then power cycling and registering as a custom POS
device. I contacted the manufacturer and they sent me a barcode
(99940) which when scanned locked the device into USB keyboard mode.
It then worked fine as a standard keyboard.

-- 
Manavendra Nath Manav

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


Re: USB Scanner driver

2012-02-28 Thread Manavendra Nath Manav
Hi Ondrez

Hi All,

I have connected Metrologic USB Scanner, but Fedora is not able to attach a
driver to it. Is there a generic USB scanner driver which I can associate
with it to make it work? This scanner is HID compliant device. Can't I make
usbhid driver to make the scanner work? The sources from Metrologic said
that it should work in USB Keyboard emulation mode. How to enable this?

 dmesg snip 
[ 7002.199153] usb 8-2: new low speed USB device using uhci_hcd and address
18
[ 7002.373938] usb 8-2: New USB device found, idVendor=0c2e, idProduct=0200
[ 7002.373943] usb 8-2: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[ 7002.373946] usb 8-2: Product: Honeywell Scanning and Mobility Scanner
[ 7002.373949] usb 8-2: Manufacturer: Honeywell Scanning and Mobility
[ 7002.399070] input: Honeywell Scanning and Mobility Honeywell Scanning and
Mobility Scanner as
/devices/pci:00/:00:1d.2/usb8/8-2/8-2:1.0/input/input13
[ 7002.399170] generic-usb 0003:0C2E:0200.000B: input,hidraw2: USB HID v1.11
Keyboard [Honeywell Scanning and Mobility Honeywell Scanning and Mobility
Scanner] on usb-:00:1d.2-2/input0
[ 7008.463407] usb 8-2: USB disconnect, address 18
[ 7011.780271] usb 8-2: new low speed USB device using uhci_hcd and address
19
[ 7011.957957] usb 8-2: New USB device found, idVendor=0c2e, idProduct=0720
[ 7011.957962] usb 8-2: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[ 7011.957965] usb 8-2: Product: Honeywell Scanning and Mobility Scanner
[ 7011.957968] usb 8-2: Manufacturer: Honeywell Scanning and Mobility

[root@pe1800xs ~]# cat /proc/bus/usb/devices

T:  Bus=08 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 19 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0c2e ProdID=0720 Rev= 1.00
S:  Manufacturer=Honeywell Scanning and Mobility
S:  Product=Honeywell Scanning and Mobility Scanner
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=02(O) Atr=03(Int.) MxPS=   8 Ivl=10ms
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

--
Thanks  Regards,
Manavendra Nath Manav

On Tue, Feb 28, 2012 at 2:15 PM, Ondrej Zary li...@rainbow-software.org wrote:
 On Tuesday 28 February 2012, Manavendra Nath Manav wrote:
 Hi All,

 I have connected Metrologic USB Scanner, but Fedora is not able to attach a
 driver to it. Is there a generic USB scanner driver which I can associate
 with it to make it work? This scanner is HID compliant device. Can't I make
 usbhid driver to make the scanner work? The sources from Metrologic said
 that it should work in USB Keyboard emulation mode. How to enable this?

 You forgot to say that this is a *barcode* scanner. It should work fine in USB
 keyboard mode. If it's configured in some other mode, use the MetroSelect
 Configuration Guide to change the mode (by scanning some special barcodes).


 --
 Ondrej Zary

Yeah, I forgot to mention that it's a barcode scanner. I reconfigured
the device mode as USB HID keyboard as given in the Metrologic manual.
Now the driver associated with it shows as usbhid. But still when i
scan any barcode i am not able to see any output on the console. Is
there any redirection required?

-- 
Manavendra Nath Manav

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


Re: USB Scanner driver

2012-02-28 Thread Manavendra Nath Manav
Hi Oliver,

On Tue, Feb 28, 2012 at 2:12 PM, Oliver Neukum oneu...@suse.de wrote:
 Am Dienstag, 28. Februar 2012, 09:32:13 schrieb Manavendra Nath Manav:
 Hi All,

 I have connected Metrologic USB Scanner, but Fedora is not able to attach a
 driver to it. Is there a generic USB scanner driver which I can associate

 Apart from a few very old scanners which are repackaged SCSI devices,
 scanners are handled by libusb. There is no kernel driver involved.

 with it to make it work? This scanner is HID compliant device. Can't I make
 usbhid driver to make the scanner work? The sources from Metrologic said
 that it should work in USB Keyboard emulation mode. How to enable this?

 Keyboard emulation is a bad idea. You need to find the correct backend of SANE
 for your scanner.

        Regards
                Oliver

In my Barcode scanner device SANE utility is not supported according
to the documentation of Metrologic. Is it correct that SANE is
predominately used for image capture functionality? how we can use it
for barcode scanning?

-- 
Manavendra Nath Manav

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


Re: error in git clone

2012-02-28 Thread Manavendra Nath Manav
Hi Mayank

 sudo git clone
 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
 Initialized empty Git repository in
 /home/mayank/linuxkernel/linux-stable/.git/
 ^[[Agit.kernel.org[0: 149.20.4.72]: errno=Connection timed out
 fatal: unable to connect a socket (Connection timed out)

 I tried disabling firewall also but that is also of not help.

 Any reasons why this error is happening and how can i get over this.


Most probably your company's firewall is blocking the git protocol.
You can try to clone using http or https url instead of git url.

-- 
Manavendra Nath Manav

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


Re: USB CDC ethernet interface from Ubuntu on VirtualBox to Windows 7

2012-02-27 Thread Manavendra Nath Manav
On Mon, Feb 27, 2012 at 1:13 PM, Manavendra Nath Manav
mnm.ker...@gmail.com wrote:
 Hi All,

 I am having a USB CDC ethernet device whose driver exists only for
 Linux. However, my end application needs to run on Windows. So, I have
 set up Ubuntu 11.10 on Virtual Box running on Windows-7. Ubuntu is
 able to register the device but not able to open an interface for it,
 say eth1, etc.

 [  382.531901] usb 2-1: new full speed USB device number 4 using uhci_hcd
 [  392.992690] cdc_ether: probe of 2-1:2.0 failed with error -32

 e518816@ubuntu:~$ lsusb
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 Bus 002 Device 002: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
 Bus 002 Device 004: ID 0e1e:0800
 e518816@ubuntu:~$

 My device is Bus 002 Device 004. How to enable USB CDC ethernet on
 this device and expose this interface to Windows using a loop-back
 adapter. Any solution on VMware would also be helpful.

 --
 Manavendra Nath Manav

Any inputs about what might be the problem. I am able to register the
device perfectly on standalone Linux machine but on Linux running on
Virtual box, USB CDC ethernet device is not able to register. Any help
would be greatly appreciated.

-- 
Manavendra Nath Manav

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


Re: USB CDC ethernet interface from Ubuntu on VirtualBox to Windows 7

2012-02-27 Thread Manavendra Nath Manav
On Mon, Feb 27, 2012 at 11:53 PM, Greg KH gre...@linuxfoundation.org wrote:
 On Mon, Feb 27, 2012 at 11:46:34PM +0530, Manavendra Nath Manav wrote:
 On Mon, Feb 27, 2012 at 1:13 PM, Manavendra Nath Manav
 mnm.ker...@gmail.com wrote:
  Hi All,
 
  I am having a USB CDC ethernet device whose driver exists only for
  Linux. However, my end application needs to run on Windows. So, I have
  set up Ubuntu 11.10 on Virtual Box running on Windows-7. Ubuntu is
  able to register the device but not able to open an interface for it,
  say eth1, etc.
 
  [  382.531901] usb 2-1: new full speed USB device number 4 using uhci_hcd
  [  392.992690] cdc_ether: probe of 2-1:2.0 failed with error -32
 
  e518816@ubuntu:~$ lsusb
  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  Bus 002 Device 002: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
  Bus 002 Device 004: ID 0e1e:0800
  e518816@ubuntu:~$
 
  My device is Bus 002 Device 004. How to enable USB CDC ethernet on
  this device and expose this interface to Windows using a loop-back
  adapter. Any solution on VMware would also be helpful.
 
  --
  Manavendra Nath Manav

 Any inputs about what might be the problem. I am able to register the
 device perfectly on standalone Linux machine but on Linux running on
 Virtual box, USB CDC ethernet device is not able to register. Any help
 would be greatly appreciated.

 As this is a Windows issue, combined with virtual box, I suggest you ask
 on a virtualbox mailing list, there's nothing we can do here, sorry.

 best of luck,

 greg k-h

Okay, I will post in Virtual box mailing list too. Just a small query,
what does [usb probe] failed with error -32 means here? I am just
curious to know can we reverse engineer the root cause by looking at
this error.

-- 
Manavendra Nath Manav

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


USB Scanner driver

2012-02-27 Thread Manavendra Nath Manav
Hi All,

I have connected Metrologic USB Scanner, but Fedora is not able to attach a
driver to it. Is there a generic USB scanner driver which I can associate
with it to make it work? This scanner is HID compliant device. Can't I make
usbhid driver to make the scanner work? The sources from Metrologic said
that it should work in USB Keyboard emulation mode. How to enable this?

 dmesg snip 
[ 7002.199153] usb 8-2: new low speed USB device using uhci_hcd and address
18
[ 7002.373938] usb 8-2: New USB device found, idVendor=0c2e, idProduct=0200
[ 7002.373943] usb 8-2: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[ 7002.373946] usb 8-2: Product: Honeywell Scanning and Mobility Scanner
[ 7002.373949] usb 8-2: Manufacturer: Honeywell Scanning and Mobility
[ 7002.399070] input: Honeywell Scanning and Mobility Honeywell Scanning
and Mobility Scanner as
/devices/pci:00/:00:1d.2/usb8/8-2/8-2:1.0/input/input13
[ 7002.399170] generic-usb 0003:0C2E:0200.000B: input,hidraw2: USB HID
v1.11 *Keyboard* [Honeywell Scanning and Mobility Honeywell Scanning and
Mobility Scanner] on usb-:00:1d.2-2/input0
[ 7008.463407] usb 8-2: USB disconnect, address 18
[ 7011.780271] usb 8-2: new low speed USB device using uhci_hcd and address
19
[ 7011.957957] usb 8-2: New USB device found, idVendor=0c2e, idProduct=0720
[ 7011.957962] usb 8-2: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[ 7011.957965] usb 8-2: Product: Honeywell Scanning and Mobility Scanner
[ 7011.957968] usb 8-2: Manufacturer: Honeywell Scanning and Mobility

[root@pe1800xs ~]# cat /proc/bus/usb/devices

T:  Bus=08 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 19 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0c2e ProdID=0720 Rev= 1.00
S:  Manufacturer=Honeywell Scanning and Mobility
S:  Product=Honeywell Scanning and Mobility Scanner
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=450mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 *Driver=(none)*
E:  Ad=02(O) Atr=03(Int.) MxPS=   8 Ivl=10ms
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

-- 
Thanks  Regards,
Manavendra Nath Manav
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


USB CDC ethernet interface from Ubuntu on VirtualBox to Windows 7

2012-02-26 Thread Manavendra Nath Manav
Hi All,

I am having a USB CDC ethernet device whose driver exists only for
Linux. However, my end application needs to run on Windows. So, I have
set up Ubuntu 11.10 on Virtual Box running on Windows-7. Ubuntu is
able to register the device but not able to open an interface for it,
say eth1, etc.

[  382.531901] usb 2-1: new full speed USB device number 4 using uhci_hcd
[  392.992690] cdc_ether: probe of 2-1:2.0 failed with error -32

e518816@ubuntu:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 004: ID 0e1e:0800
e518816@ubuntu:~$

My device is Bus 002 Device 004. How to enable USB CDC ethernet on
this device and expose this interface to Windows using a loop-back
adapter. Any solution on VMware would also be helpful.

-- 
Manavendra Nath Manav

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


Re: Recursive Makefile howto

2012-01-28 Thread Manavendra Nath Manav
On Fri, Jan 27, 2012 at 9:28 PM, Dave Hylands dhyla...@gmail.com wrote:
 Hi Manavendra,

 On Thu, Jan 26, 2012 at 10:13 PM, Manavendra Nath Manav
 mnm.ker...@gmail.com wrote:
 Hi All,

 I have developed a Makefile which recursively builds the code spread
 across multiple directories, each having it's own Makefile.

 You may want to reconsider your approach:
 http://aegis.sourceforge.net/auug97.pdf
 http://evbergen.home.xs4all.nl/nonrecursive-make.html

 --
 Dave Hylands
 Shuswap, BC, Canada
 http://www.davehylands.com

Thanks Dave, I went through both the links provided by you and the
make process is pretty much clear to me now. The following two points
I would want elaborate from the paper:
1. As a rule of thumb: always use immediate evaluation assignment
unless you knowingly want deferred evaluation.
2. You will get more accurate builds of your project if you use
whole-project make rather than recursive make.

-- 
Manavendra Nath Manav

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


Re: Recursive Makefile howto

2012-01-27 Thread Manavendra Nath Manav
On Fri, Jan 27, 2012 at 2:32 PM, Kristof Provost kris...@sigsegv.be wrote:
 On 2012-01-27 11:43:10 (+0530), Manavendra Nath Manav mnm.ker...@gmail.com 
 wrote:
 I have developed a Makefile which recursively builds the code spread
 across multiple directories, each having it's own Makefile.

 build_all: targetA \
                targetB \
                target C

 Now, the problem is that even when the Makefile of targetA fails, the
 master Makefile continues building with targetB and targetC. I can
 also see the make errors being printed on console. I want the make to
 stop immediately at the first error encountered in any target
 Makefile. How to do this?

 It would be a lot easier to help you if you'd post the relevant bits of
 your Makefile.

 Dusting off my crystal ball, I see in the mists that your makefile looks
 something like this:

 build:
        for d in $(DIRS) ; \
        do \
                $(MAKE) -C $$d $@ ; \
        done

 The problem here is that make considers the whole for loop as one and
 doesn't get the exit status of each sub-make, but only of the last one.

 Try something like this instead:

 build:
        for d in $(DIRS) ; \
        do \
                $(MAKE) -C $$d $@ || exit $? ; \
        done

 Regards,
 Kristof


Hi Kristof,

Your crystal ball insight was fairly accurate. The syntax $(MAKE) -C
$$d $@ || exit $? ; is both new and helpful to me. For more clarity,
the format of my Makefile is like this:

my_exec: Build_sqllib   \
Create_obj_dir  \
objs/server/foo.o   \
objs/server/bar.c   
$(LINK) -o my_exec  \
objs/server/foo.o   \
objs/server/bar.c

Build_sqllib:
cd src/sqllib;  \
rm -rf LIBS/*;  \
make;   \
rm -f $(CURDIR)/sqllib.a;   \
cp -fv LIBS/sqllib.a $(CURDIR)/lib/sqllib.a;\
cd $(CURDIR);

Create_obj_dir:
mkdir -p objs/server\
objs/html   \
objs/log\
objs/cipher \
objs/curse  \
objs/crypto \
objs/protocol

objs/server/foo.o:  \
src/server/foo.c
$(LINK) -c  \
-o objs/server/foo.o\
src/server/foo.c

Now, I am getting error in the make part of Build_sqllib but the
makefile continues to next line. I guess, I need to add || exit also
with this make command. Kristof, can you pls also explain me the
meanings of $$d, $@, and $? as used in Makefiles.
-- 
Manavendra Nath Manav

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


Recursive Makefile howto

2012-01-26 Thread Manavendra Nath Manav
Hi All,

I have developed a Makefile which recursively builds the code spread
across multiple directories, each having it's own Makefile.

build_all: targetA \
   targetB \
   target C

Now, the problem is that even when the Makefile of targetA fails, the
master Makefile continues building with targetB and targetC. I can
also see the make errors being printed on console. I want the make to
stop immediately at the first error encountered in any target
Makefile. How to do this?

-- 
Manavendra Nath Manav

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


git clone of linux kernel provides only compressed pack files

2012-01-20 Thread Manavendra Nath Manav
Hi All,

I cloned 3.2 kernel from git repository, but I am not seeing any
source files. The .git directory contains .git/objects/pack/*.pack
file which is huge and it seems all source code with commit revision
is stored there. When I do git unpack-objects -r  xyz.pack, it
completes 100% but still no source files show up. The only thing it
generates is some more entries in .git/objects/ directory. The same
problem also occurs when I try to clone android repository. Pls help,
I am sure I am missing some obvious step here.

[root@pe1800xs src]# git clone --recursive -v
http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Cloning into linux-stable...
remote: Counting objects: 2446667, done.
remote: Compressing objects: 100% (391011/391011), done.
Receiving objects:  18% (447106/2446667), 259.18 MiB | 43 KiB/s

[root@pe1800xs .git]# du -h
4.0K./objects/info
284M./objects/pack
285M./objects
8.0K./info
4.0K./refs/tags
4.0K./refs/heads
12K ./refs
48K ./hooks
4.0K./branches
285M.

[e518816@pe1800xs common]$ git unpack-objects -r 
.git/objects/pack/pack-d2d041c2bd4a39fdfdf37c896f64a3c1b53d3d2b.pack
Unpacking objects: 100% (2074089/2074089), done.

From the man page of git-unpack-objects: Objects that already exist
in the repository will not be unpacked from the pack-file. Therefore,
nothing will be unpacked if you use this command on a pack-file that
exists within the target repository. I guess this is the problem I am
facing. How do I extract the linux souce files (HEAD branch) from pack
file?

-- 
Thanks  Regards,
Manavendra Nath Manav

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


Re: git clone of linux kernel provides only compressed pack files

2012-01-20 Thread Manavendra Nath Manav
On Fri, Jan 20, 2012 at 6:55 PM, Mirco Tischler mt...@gmx.de wrote:

**snip**
 You just need to do git checkout master after the git clone. This
 gives you the version the master branch in the stable repo points to
 at the time of the cloning.
 To update your local master branch later, just do git pull.

 git unpack-objects is usually not directly needed by users. It's
 called by git internally though.

 Mirco

Thanks Mirco, after doing git checkout and git pull on cloned Linux
git repo, I can see all the Linux source files. The problem got
resolved for Linux tree but for android repository, I am still facing
issues.

After cd to android git repo dir:
[e518816@pe1800xs common]$ git checkout master
Already on 'master'

[e518816@pe1800xs common]$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull repository refspec').
See git-pull(1) for details.

If you often merge with the same branch, you may want to
use something like the following in your configuration file:

[branch master]
remote = nickname
merge = remote-ref

[remote nickname]
url = url
fetch = refspec

See git-config(1) for details.

[e518816@pe1800xs common]$ git pull
https://android.googlesource.com/kernel/common.git
From https://android.googlesource.com/kernel/common
 * branchHEAD   - FETCH_HEAD
Already up-to-date.

But, still the source files were not displayed. Also, when I did git
clone of Linux repo, I have given --recursive flag to git clone
command but when i cloned android repo I have omitted this flag. Does
this has any impact. Sorry, for the dump question, but after googling
whole day without any luck, I need a quick fix.
-- 
Manavendra Nath Manav

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


Re: git clone of linux kernel provides only compressed pack files

2012-01-20 Thread Manavendra Nath Manav
On Sat, Jan 21, 2012 at 12:43 AM, Greg KH g...@kroah.com wrote:
 On Sat, Jan 21, 2012 at 12:06:08AM +0530, Manavendra Nath Manav wrote:
 On Fri, Jan 20, 2012 at 6:55 PM, Mirco Tischler mt...@gmx.de wrote:

 **snip**
  You just need to do git checkout master after the git clone. This
  gives you the version the master branch in the stable repo points to
  at the time of the cloning.
  To update your local master branch later, just do git pull.
 
  git unpack-objects is usually not directly needed by users. It's
  called by git internally though.
 
  Mirco

 Thanks Mirco, after doing git checkout and git pull on cloned Linux
 git repo, I can see all the Linux source files. The problem got
 resolved for Linux tree but for android repository, I am still facing
 issues.

 That's different, you need to check out the specific android kernel repo
 you want to use, by the branch name.

 The android kernel tree is wierd that way, try doing this:
        git checkout android-3.0
 and you should be fine.

 Even better yet, do this:
        git checkout -t -b android-3.0 origin/android-3.0

 which creates a tracking branch for this branch of their kernel tree,
 which will let you handle things when they update it in the future to
 newer releases.

 Hope this helps,

 greg k-h

Thanks Greg, the checkout with android-3.0 worked. I feel working with
git is a bit too geeky for the non-initiated. I can upvote this
because i didn't used the repo python script provided by Google to
download android source but git alone. Thank you all for the support.

[e518816@pe1800xs common]$ git checkout android-3.0
Checking out files: 100% (37131/37131), done.
Branch android-3.0 set up to track remote branch android-3.0 from origin.
Switched to a new branch 'android-3.0'

[e518816@pe1800xs common]$ ls
arch CREDITSdrivers   include  Kbuild   lib  mm
  REPORTING-BUGS  security  usr
blockcrypto firmware  init Kconfig  MAINTAINERS  net
  samples sound virt
COPYING  Documentation  fsipc  kernel   Makefile
README  scripts tools

-- 
Cheers,
Manavendra Nath Manav

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


Re: Does LAN speed distributes among connected terminals on load

2012-01-12 Thread Manavendra Nath Manav
On Wed, Jan 11, 2012 at 7:08 PM, Alexandru Juncu alex.ju...@rosedu.org wrote:
 On Wed, Jan 11, 2012 at 12:21 PM, Manavendra Nath Manav
 mnm.ker...@gmail.com wrote:
 Hi All,

 I have a 100Mbps LAN with 10 connected terminals through a Switch.
 Now, I understand 100Mbps is the max speed at which a terminal can
 send/receive data. If every terminal sends data at this speed, then
 does this speed distributes/divides according to load, or is it
 dedicated for each terminal. How to measure it?

 --
 Manavendra Nath Manav

 It's rather a generic question... let me try to begin to answer it.
 First of all, the speed of the link is 100mbps wire speed. There is a
 lot of overhead caused by different protocols (I redirect you to learn
 about the OSI or TCP/IP stacks and about encapsulations). So the speed
 is way lower than 100 when doing anything over the network.

 Now, the question about if the speed is shared is hard to answer. The
 straight forward answer is no. Traffic would be shared if the network
 would be connected via a hub ( I doubt hubs are actually used in
 modern networks). Switches are 'smart' so they don't push traffic in
 parts of the network where is not needed, so, theoretically, the
 bandwidth is not share.

 However, most of the traffic we have in a network is not inside our
 Local Area Network, but with the Internet and all that traffic passes
 through the gateway. So the gateway would be the bottleneck and the
 traffic is 'distributed' among the hosts in the network.

 This is a very brief answer to what you said... maybe if you could
 provide some further details on what exactly you want to do, you will
 receive a better answer.


 --
 Alexandru Juncu

 ROSEdu
 http://rosedu.org

Hi Alexandru,

Thanks for the detailed answer. In my 100Mbps LAN setup, I have
several clients/terminals connected to a server. The problem is that
the server is connected to the LAN via a GPRS module whose bandwidth
is very less (128kbps). So, different clients are parallely sending
data to server but most are getting timed-out because of bandwidth
constraints. My question is how I can verify that packets are being
dropped/timed-out because of bandwidth at the GPRS interface? Is there
any tool to do this?

--
Manavendra Nath Manav

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


Does LAN speed distributes among connected terminals on load

2012-01-11 Thread Manavendra Nath Manav
Hi All,

I have a 100Mbps LAN with 10 connected terminals through a Switch.
Now, I understand 100Mbps is the max speed at which a terminal can
send/receive data. If every terminal sends data at this speed, then
does this speed distributes/divides according to load, or is it
dedicated for each terminal. How to measure it?

--
Manavendra Nath Manav

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


Re: Master Thesis

2012-01-03 Thread Manavendra Nath Manav
Hi Koriandus

On Wed, Jan 4, 2012 at 10:31 AM, koriandus korian...@googlemail.com wrote:
 Hallo,
 I am looking for a topic for my Master Thesis.
 Is there a document/website/place where potential ideas for Master
 Thesis are listed ?

 Regards,
 koriandus


I do not know about such website but I would suggest you to take up
Thesis on Scheduling Algorithms and Policies for different
architectures and platforms. There is still a lot of scope for
improvement of these algorithms and there are lots of materials,
resources and white papers available on scheduling including source
code. You can start by looking into Linux Elevator  IO scheduler, The
Deadline IO scheduler, The Anticipatory IO scheduler, and the much
debated Completely Fair Queuing (CFQ) IO scheduler.

--
Manavendra Nath Manav

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


Re: logging kernel panics with netconsole

2011-12-30 Thread Manavendra Nath Manav
Hi Zac,

On Fri, Dec 23, 2011 at 1:39 AM, chromaticwt zac zac.3.14...@gmail.com wrote:
 my laptop is getting kernel panics often. I have a desktop connected to my
 internet router via ethernet, and my laptop connected to my router via wifi.
 how can I log my laptops panics on my desktop? I'm hoping to do this using
 wifi somehow. I am a newbie, and I know nothing about networking.
 should I use netconsole? or is there a way for panics to be logged to disk.

 I really want to find a patch/s to fix these panics, as my laptop freezes
 with panics 2-4 times a day...

 thanks,

 zac

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


You can use kgdb to debug kernel panics. You need to run kgdb in
client-server mode with kgdb server running in you PC and kgdb client
running in your laptop. Apart from this you can also use Kernel Magic
SysRq keys to generate core dump file after kernel panic to analyze
the root cause of the crash using the coredump file as input to gdb.

The SysRq key can be disabled with the following command:
bash# echo 1  /proc/sys/kernel/sysrq

netconsole is useful to show syslogd messages over UDP network, but
coredump provides more useful crash statistics like stack backtrace,
cpu registers, list of blocked (D state) tasks, etc.

Thanks  Regards,
Manavendra Nath Manav

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