how to find a file in sysfs created with my module for a pci device

2007-12-07 Thread ilya
hello, i wrote a driver for a pci board an created a file in sysfs, which i use for communication from userspace. so far the path to the file was hardcoded in my userspace client but now i want it to be independent of whatever system and pci slot this card is installed on. it seems like no matter

Re: 3 goals of a newbie - please guide

2007-12-07 Thread Claudio Eduardo
You could read "OReilly.Understanding.the.Linux.Kernel.3rd.Edition.Nov.2005". The name says everything =D. A direct link: http://eduunix.ccut.edu.cn/index/html/linux/OReilly.Understanding.the.Linux.Kernel.3rd.Edition.Nov.2005.HAPPY.NEW.YEAR/ On Dec 7, 2007 5:14 AM, Amogh Hooshdar <[EMAIL PROTECTED

RE: 3 goals of a newbie - please guide

2007-12-07 Thread IMG
1)Can read the appendix of the book “Understanding Linux Kernel 3rd Ed as chap said erlier. However if you just want to print a message while booting, just follow your intuition in the / directory.You just need to add a line with your text somewhere ;-). 2)Can start here , though you will need

Re: [OT]: [Mail arivall out of order, was Understanding Linux kernel book]

2007-12-07 Thread Pradeep Singh
On Fri, 7 Dec 2007 17:23:17 +0100 [CC'ing Rik] Thomas Petazzoni <[EMAIL PROTECTED]> wrote: [...] Okay, is something wrong somewhere? Why am i getting mails out of order? I got Thomas's reply before the parent post, see mail headers - From: Thomas Petazzoni <[EMAIL PROTECTED]> To: kernelnewbies@

Re: 3 goals of a newbie - please guide

2007-12-07 Thread Carter Smithhart
I went through this and it started me in the right direction: http://www.freesoftwaremagazine.com/articles/drivers_linux On Dec 7, 2007 1:14 AM, Amogh Hooshdar <[EMAIL PROTECTED]> wrote: > Hi, > > I have knowledge of assembly language. I am good at C programming. I > have learnt to write "hello w

Re: Slub versus slab

2007-12-07 Thread Andrea Gasparini
Hi Thomas, > As far as I've understood the SLUB development, I'd say the SLUB > intends to be a drop-in replacement for SLAB, usable in all situations, > with performances at least equal to the ones of SLAB, but with a better > scalability. Yes, I intended it in this way, too. But I read some d

Re: [OT]: Understanding Linux kernel book

2007-12-07 Thread Thomas Petazzoni
Le Fri, 7 Dec 2007 19:58:26 +0530, "Adil Mujeeb" <[EMAIL PROTECTED]> a écrit : > void fastcall __lock_page(struct page *page) > > { > > DEFINE_WAIT_BIT(wait, &page->flags, PG_locked); > > __wait_on_bit_lock(page_waitqueue(page), &wait, sync_page, > TASK_UNINTERRUPTIBLE); > > }

[OT]: Understanding Linux kernel book

2007-12-07 Thread Adil Mujeeb
Hi All, In Oreilly book "Understanding Linux kernel", following text written under section "15.1.3.1. Finding a page": "The lock_page( ) function, in turn, blocks the current process if the page is already locked. To that end, it invokes the _ _wait_on_bit_lock( ) function on the PG_locked bi

Re: Question using get_cycles for function breakdown

2007-12-07 Thread Mulyadi Santosa
Hi > This function usually sleeps a couple of times, so it may change cpu. > If get_cycles is called the first time (function start) on one cpu and the > second one on another one, will this difference of get_cycle values be > meaningful? IMHO, they are getting the same "jiffies" variable (or TSC

Re: Slub versus slab

2007-12-07 Thread Thomas Petazzoni
Le Thu, 6 Dec 2007 11:54:47 +0100, Andrea Gasparini <[EMAIL PROTECTED]> a écrit : > there's someone with experience on Slub/slab performance? > I would understand when to use the first, when the latter... > > I found that on numa architecture is surely bettere SLUB.[1] > But this is a rare case,

Re: enable_irq unbalanced?

2007-12-07 Thread Leo Hendrawan
Hallo, thanks for the answer. yes you're right, it is just because i called enable_irq() function more than one time without any disable_irq() function. it works now. btw, i am using 2.4 kernel on PPC target. regards, On Dec 7, 2007 2:17 PM, Thomas Petazzoni <[EMAIL PROTECTED]> wrote: > Le Fri

Re: how to boot and print message

2007-12-07 Thread Amogh Hooshdar
Hi I am a newbie too and I faced this problem a few months back when I was trying to understand the process of booting. I got two articles from an IRC channel which helped me a lot. 1. http://en.skelix.org/skelixos/tutorial01.php 2. http://susam.in/articles/boot-sector-code.php Hope these articl

Re: enable_irq unbalanced?

2007-12-07 Thread Thomas Petazzoni
Le Fri, 7 Dec 2007 12:00:35 +0100, "Leo Hendrawan" <[EMAIL PROTECTED]> a écrit : > i am working on a project with linux on embedded platform (MPC5200 > processor). > i have this problem that the kernel says "enable_irq(some_number) > unbalaced". what does it mean? > i tried to google but haven't f

Re: tiny modules

2007-12-07 Thread Thomas Petazzoni
Le Fri, 7 Dec 2007 13:29:06 +0330, "Iman Darabi" <[EMAIL PROTECTED]> a écrit : > i'm trying to find some tiny modules > searched personal pages , blogs and ... , but can't find useful > samples . do you have any link , sample , even your hobbies (or what > ever you think which is good for newbie)

Re: how to boot and print message

2007-12-07 Thread Luciano Rocha
On Fri, Dec 07, 2007 at 04:20:45PM +0530, balzar tondo wrote: > i am not sure whether this is the correct forum to ask. i am a newbie to > this forum and please pardon me if I violate any rule. i want to write a > small code in Linux that will boot and print something. this is something > very basi

Re: Memory mapping a UART

2007-12-07 Thread Thomas Petazzoni
Le Fri, 7 Dec 2007 14:04:16 +0530, "Rajat Jain" <[EMAIL PROTECTED]> a écrit : > You need request_mem_region(). I'm not sure it's enough in Gavin's case. From what I understand, request_mem_region() simply allows to reserve a memory region, to say « I'm using it », so that nobody else will use it

Re: sys_open fails with error 14

2007-12-07 Thread Thomas Petazzoni
Le Thu, 6 Dec 2007 16:18:24 +0530, "Sandeep K Sinha" <[EMAIL PROTECTED]> a écrit : > Am I logically wrong somewhere ?? Yes, you should not open files from the kernel: http://kernelnewbies.org/FAQ/WhyWritingFilesFromKernelIsBad Thomas -- Thomas Petazzoni, [EMAIL PROTECTED], http://thomas.enix.o

Re: dma fails in re-insmod

2007-12-07 Thread Thomas Petazzoni
Le Thu, 6 Dec 2007 22:47:35 +0900, "Sumudu Nishantha" <[EMAIL PROTECTED]> a écrit : > My guess is a hardware problem. > can it be a problem of the driver or anything to do with > the kernel?? > There is no register to reset dma.(no idea whether it is > necessary). It can be a driver problem, but

Re: What does __user do?

2007-12-07 Thread Thomas Petazzoni
Le Fri, 07 Dec 2007 10:28:53 +0100, Peter Poulsen <[EMAIL PROTECTED]> a écrit : > I have noticed __user in some code, when a pointer points to > userspace code. What does that do exaclty? AFAIK, they are used by sparse[1] to verify that the kernel code doesn't access directly to pointers pointing

enable_irq unbalanced?

2007-12-07 Thread Leo Hendrawan
Hi all, i am working on a project with linux on embedded platform (MPC5200 processor). i have this problem that the kernel says "enable_irq(some_number) unbalaced". what does it mean? i tried to google but haven't found any clear hint. thanks for any answer. regards,

how to boot and print message

2007-12-07 Thread balzar tondo
i am not sure whether this is the correct forum to ask. i am a newbie to this forum and please pardon me if I violate any rule. i want to write a small code in Linux that will boot and print something. this is something very basic but I have no clue how this can be done. i searched the web and got

tiny modules

2007-12-07 Thread Iman Darabi
hi i'm trying to find some tiny modules searched personal pages , blogs and ... , but can't find useful samples . do you have any link , sample , even your hobbies (or what ever you think which is good for newbie) to share with me ? thx for your attention . -- Nothing but perfection http://ima

Re: What does __user do?

2007-12-07 Thread Robert P. J. Day
On Fri, 7 Dec 2007, Peter Poulsen wrote: > I have noticed __user in some code, when a pointer points to > userspace code. What does that do exaclty? it's meant to denote that the pointer is a pointer to *userspace*, not kernel space. it doesn't actually get involved in the build process, it's fo

What does __user do?

2007-12-07 Thread Peter Poulsen
I have noticed __user in some code, when a pointer points to userspace code. What does that do exaclty? /peter -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to [EMAIL PROTECTED] Please read the FAQ at http://kernelnewbies.org/FAQ

Re: sys_open fails with error 14

2007-12-07 Thread Sandeep K Sinha
Oops... I had missed the setting of fs to the oldfs... Thanks. On Dec 7, 2007 1:29 PM, Vivek Kutal <[EMAIL PROTECTED]> wrote: > Sandeep K Sinha wrote: > > It returns with ENOENT after using set_fs. > > > > > same code works for me. > take a look at this http://www.linuxjournal.com/article/8110 > t

3 goals of a newbie - please guide

2007-12-07 Thread Amogh Hooshdar
Hi, I have knowledge of assembly language. I am good at C programming. I have learnt to write "hello world" type of kernel modules using printk() statements. I know nothing else about kernel programming. I want to become a kernel hacker. I am a newbie at the moment. To begin with, I have 3 goals.

RE: Memory mapping a UART

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

Re: sys_open fails with error 14

2007-12-07 Thread Vivek Kutal
Sandeep K Sinha wrote: It returns with ENOENT after using set_fs. same code works for me. take a look at this http://www.linuxjournal.com/article/8110 there is a example given at the end. HTH -- Vivek Kutal -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies