Re: What is the practical significance of fork

2010-12-15 Thread Dave Hylands
understanding, although the use of vfork seems to be discouraged. Be sure to read the man page: http://linux.die.net/man/2/vfork I normally work in kernel space, so I haven't had much need to use fork or vfork :) -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe

Re: SRIO user level interface

2010-12-15 Thread Dave Hylands
). The calls to class_create and device_create sets things up sp that udev will create the /dev node. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http

Re: why vmalloc free with fdtable is done with workqueue?

2010-12-13 Thread Dave Hylands
importantly, the whatisRCU.txt file. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: some questions about times

2010-12-09 Thread Dave Hylands
Hi miloody, On Thu, Dec 9, 2010 at 4:58 PM, loody milo...@gmail.com wrote: ...snip... But I man nothing about times. $ man 2 times No manual entry for times in section 2 $ I use die.net when I don't have access to man pages: http://linux.die.net/man/2/times -- Dave Hylands Shuswap, BC

Re: How to run a hello world module

2010-12-09 Thread Dave Hylands
like SMP, PREEMPT 4KSTACKS etc all have to match with the vermagic info from your module. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http

Re: gpio rising edge

2010-12-01 Thread Dave Hylands
Hi guys, On Wed, Dec 1, 2010 at 9:30 PM, Hemanth Kumar hemw...@yahoo.co.in wrote: Hi All,          I tried with gpio-event from http://svn.hylands.org/linux/gpio-event/module/gpio-event-drv.c which is provide by Dave Hylands , it gives me the put ./daveuser 156:b:2000 # cat /proc/gpio

Re: crap, i think LKD3 explains linked list head nodes incorrectly ...

2010-11-20 Thread Dave Hylands
iteration.  does this make sense? I concur. And this is why routines like list_is_last need to be passed in the node to test along with the head of the list. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe

Re: crap, i think LKD3 explains linked list head nodes incorrectly ...

2010-11-20 Thread Dave Hylands
Hi Robert, On Sat, Nov 20, 2010 at 11:17 PM, Robert P. J. Day rpj...@crashcourse.ca wrote: On Sat, 20 Nov 2010, Dave Hylands wrote: ...snip... And this is why routines like list_is_last need to be passed in the node to test along with the head of the list.  huh ... i never knew that test

Re: help

2010-11-16 Thread Dave Hylands
in an embedded environment (ARM and MIPS), not programming for linux under x86, so its possible that things happen a little differently in that environment. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe

Re: /dev/mem

2010-10-28 Thread Dave Hylands
hole? This particular thing might fit into some weird class of security holes (things to protect the system from the root user). I'm much more interested in preventing people from being root in the first place (much easier to fix in an OS like linux). -- Dave Hylands Shuswap, BC, Canada http

Re: /dev/mem

2010-10-27 Thread Dave Hylands
. The second phase of the attack is identical once you're in kernel space. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: /dev/mem

2010-10-27 Thread Dave Hylands
Via simple pointers? Yes - provided it hasn't been swapped out. There are a few exceptions for a few processors with segmented memory and other funky stuff, but generally, all of the memory is accessible from kernel space by the use of a simple pointer. -- Dave Hylands Shuswap, BC, Canada http

Re: /dev/mem

2010-10-26 Thread Dave Hylands
, pretty much anything at all. Writing indiscriminantly through /dev/mem is the same thing as writing indiscriminantly from within a driver. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar

Re: /dev/mem

2010-10-26 Thread Dave Hylands
registers directly from user space, which is sometimes useful when you don't want to write a whole driver just to tweak a register. It can also be bad to tweak registers this way, so you need to be aware of the issues. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe

Re: How to do DIRECT IO on kernel buffer

2010-10-18 Thread Dave Hylands
/from_user will now work on kernel buffers. I'm pretty sure that this is NOT a recoemmended practice, but I figured I'd throw it out there. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar

Re: where does the stack of a process start

2010-10-17 Thread Dave Hylands
. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: Regarding device cycles

2010-10-14 Thread Dave Hylands
and puts it into memory. ...snip... -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: Trouble making module

2010-10-13 Thread Dave Hylands
Hi Wouter, On Tue, Oct 12, 2010 at 11:50 PM, Wouter Simons l...@woutersimons.org wrote: On 10/12/2010 04:40 PM, Dave Hylands wrote: Hi guys, On Tue, Oct 12, 2010 at 6:46 AM, Wouter Simons l...@woutersimons.org wrote: On 10/12/2010 12:30 PM, shivanth m p wrote: ...snip... all:        obj-m

Re: Regarding device cycles

2010-10-13 Thread Dave Hylands
an architecture design thing. I often DMA from relatively slow devices like audio at 8 kHz into memory. Samples typically accumulate in a small buffer (part of the audio circuitry) and are then burst onto the memory bus. There just happens to be lots of time between the bursts. -- Dave Hylands Shuswap, BC

Re: Trouble making module

2010-10-12 Thread Dave Hylands
to be done, i.e. all targets are up to date. The error is essentially saying that mydriver.o already exists and is newer than mydriver.c. It would help if you could copy and paste the exact error, along with all of the other output of running make. -- Dave Hylands Shuswap, BC, Canada http

Re: Raw kernel from kernel.org

2010-10-12 Thread Dave Hylands
ls, ps, GCC or XWindows. If you're installing your new kernel into a system that already has the tools, then the toolset that was present before will be the toolset that's present afterwards, just the kernel changes. This, of course, assumes that your new kernel boots. -- Dave Hylands Shuswap

Re: Regarding device cycles

2010-10-12 Thread Dave Hylands
. Generally speaking, each block on the diagram will have a clock, and will execute in parallel with the CPU (which is just one of many blocks). -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar

Re: Trouble making module

2010-10-11 Thread Dave Hylands
+= mydriver.o else all : modules modules : make -C ..kerndev/linux-2.6/  M=$(PWD) modules clean : make -C ../kerndev/linux-2.6/  M=$(PWD) clean endif -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email

Re: Trouble making module

2010-10-11 Thread Dave Hylands
Hi Robert, On Mon, Oct 11, 2010 at 11:18 AM, Robert P. J. Day rpj...@crashcourse.ca wrote: On Mon, 11 Oct 2010, Dave Hylands wrote: HI Shivanth, On Mon, Oct 11, 2010 at 8:20 AM, shivanth m p fordearli...@gmail.com wrote: I created a kernel module for the 2.6.33 kernel outside the kernel

Re: Regarding device cycles

2010-10-11 Thread Dave Hylands
controller, sometimes an LCD controller) may cause the CPU to slow down (depends on how the bus arbiter is set). -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ

Re: __chk_user_ptr : How does it work ?

2010-10-10 Thread Dave Hylands
.html -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: kernel stuck test

2010-10-07 Thread Dave Hylands
preemption on all cores. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: ARM Linux book

2010-10-07 Thread Dave Hylands
are that the ARM is purely memory mapped - no I/O instructions. In order to turn on the cache you need to tun on the MMU. Some ARMs use virtually tagged caches and some use physically tagged caches. There typically is no HW floating point support, although some of the newer ARMs have it. -- Dave

Re: Module unload fails

2010-10-06 Thread Dave Hylands
that the module has no module_exit, and thus can't be unloaded. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: Workqueues

2010-10-04 Thread Dave Hylands
= container_of( ws, struct my_work_struct, work ); ... access your data from my_ws ... } -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http

Re: my kmalloc implementation

2010-10-02 Thread Dave Hylands
Hi Bond, Sending to the list this time... On Fri, Oct 1, 2010 at 10:18 PM, Bond jamesbond.2...@gmail.com wrote: On Fri, Oct 1, 2010 at 8:13 PM, Dave Hylands dhyla...@gmail.com wrote: Hi Bond, There are many different algorithms, and you wanted to know how indexes would work for tracking

Re: my kmalloc implementation

2010-10-02 Thread Dave Hylands
Hi Bond, On Sat, Oct 2, 2010 at 2:34 AM, Bond jamesbond.2...@gmail.com wrote: On Sat, Oct 2, 2010 at 1:13 PM, Dave Hylands dhyla...@gmail.com wrote: Hi Bond, Sending to the list this time... glibc has a fairly sophisticated heap... Look at glibc alternatives. Each one will have a heap

Re: my kmalloc implementation

2010-10-02 Thread Dave Hylands
Hi Bond, On Sat, Oct 2, 2010 at 11:25 AM, Bond jamesbond.2...@gmail.com wrote: No not glibc I  want a link to heap implementation in glibc Look for malloc... in the glibc source code and go from there -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from

Re: my kmalloc implementation

2010-10-01 Thread Dave Hylands
. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: Reducing the physical memory for the allocator

2010-09-30 Thread Dave Hylands
of RAM, Kernel should see it has IO memory Is there any option that I can pass to the kernel so that it only takes 768 MB of RAM. I believe that you can pass mem=768M on the command line -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email

Re: my kmalloc implementation

2010-09-28 Thread Dave Hylands
a separate list for every 256 bytes, but that would have very low overhead. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: my kmalloc implementation

2010-09-28 Thread Dave Hylands
Hi Bond, On Tue, Sep 28, 2010 at 1:43 AM, Bond jamesbond.2...@gmail.com wrote: On Tue, Sep 28, 2010 at 11:59 AM, Dave Hylands dhyla...@gmail.com wrote: Hi Bond, So user mode programs don't allocate memory using kmalloc. I believe that they wind up calling __get_free_pages. There are many data

Re: memory consumed by kernel

2010-09-28 Thread Dave Hylands
. It also appears that CONFIG_PAGE_OFFSET can move around even on ARM and x86, if other options like CONFIG_VMSPLIT_2G is defined (linux 2.6.34). -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar

Re: memory consumed by kernel

2010-09-27 Thread Dave Hylands
. So, something like: printk( 0x%08x\n, *(uint32_t *)0xc0004000 ); -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: memory consumed by kernel

2010-09-27 Thread Dave Hylands
or 304 (base 10) Makefile.boot is saying zreladdr-y      := 0x13008000 params_phys-y      := 0x13000100 This further confirms that physical memory starts at 0x1300 -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email

Re: printk and \n

2010-09-25 Thread Dave Hylands
unbuffered characters will be flushed. Here's some documentation: http://linux.die.net/man/3/setvbuf -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http

Re: copy_to_user() and copy_from_user(): confusing code

2010-09-25 Thread Dave Hylands
which the driver accepted). write(1, bcde, 4) = 1 So usermode then tried to write the remaining 4 characters. The driver only accepted one. write(1, cde, 3) = 1 etc. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from

Re: regarding synchronization code

2010-09-24 Thread Dave Hylands
/OPTIMIZE_INLINING.html -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: error in a compiling simple character device driver

2010-09-23 Thread Dave Hylands
, by the time you actually compile the source for 'func', struct foo can no longer be incomplete. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http

Re: Regarding do_irq code

2010-09-16 Thread Dave Hylands
://en.wikipedia.org/wiki/Read-copy-update and the more interesting stuff can be found in your linux Documentation/RCU/ directory. Start with the rcu.txt file. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies

Re: adding semaphores to my device driver

2010-09-15 Thread Dave Hylands
than spinlocks, and if you look at the implementation of mutexes, you'll find that they actually use spinlocks (because it is OK to unlock a mutex from an ISR, it just isn't OK to lock a mutex from an ISR). -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from

Re: Regarding Signals in Kernel

2010-09-12 Thread Dave Hylands
kernel. So can anyone please clarify this, what is the right scenario. I'm not familiar enough with the distinctions to provide any more detail here. I don't see any reason why a process can't signal itself, but this is just an opinion, not backed up by any fact or experiment. -- Dave Hylands

Re: regarding do_irq

2010-09-10 Thread Dave Hylands
, it is possible for there to be a delay between the hardirq completing and the softirq executing. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http

Re: Integer Division on 32 Bit Machines

2010-09-09 Thread Dave Hylands
CPUs you can only do 32-bit arithmetic, with 64-bit addition, subtraction, and multiplications. 64-bit divides must be done using do_div or do_div64. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies

Re: regarding do_irq

2010-09-09 Thread Dave Hylands
some interrupt occurs, then idle mode is exiting. exit_idle allows for this to happen. Take a look at Documentation/timers/highres.txt. It takes advantage of being able to know when the kernel enters and exits idle mode. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com

Re: regarding do_irq

2010-09-09 Thread Dave Hylands
Hi, On Thu, Sep 9, 2010 at 12:00 AM, Bond jamesbond.2...@gmail.com wrote: On Thu, Sep 9, 2010 at 12:04 PM, Dave Hylands dhyla...@gmail.com wrote: The kernel has the notion of going idle. This happens whenever there is nothing to do. Hi Dave from your message I want to ask going idle

Re: Integer Division on 32 Bit Machines

2010-09-09 Thread Dave Hylands
Hi Andreas, On Thu, Sep 9, 2010 at 1:28 AM, Andreas Leppert wu...@web.de wrote: Hi Dave, On Wed, Sep 08, 2010 at 11:14:30PM -0700, Dave Hylands wrote: Replying to the list this time... finally an answer to *my* problem, thanks :-D Another general rule, is that on 32-bit CPUs you can only

Re: regarding do_irq

2010-09-09 Thread Dave Hylands
. Please can anyone explain the sequence of operations how the softirq is recognized (that it was set) and scheduled to execute. softirqs and tasklets are really the same thing (as far as I know). They run with interrupts enabled, but preemption disabled. -- Dave Hylands Shuswap, BC, Canada http

Re: spin_lock spin_trylock race

2010-08-25 Thread Dave Hylands
a case of how they're used. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: linux/module.h does not exist

2010-08-21 Thread Dave Hylands
thing I've been able to get is by following the first 4 lessons in the crash course I mentioned earlier. http://crashcourse.ca/introduction-linux-kernel-programming/introduction-linux-kernel-programming -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list

Re: linux/module.h does not exist

2010-08-20 Thread Dave Hylands
Hi Tapas, Replying to all this time... On Fri, Aug 20, 2010 at 12:52 AM, Tapas Mishra wrote: Hi Dave I could not understand your reply. Go back to page 48 of the PDF, and look at the example. And then look at the code you posted. It's missing a line in the spot I indicated. -- Dave Hylands

Re: linux/module.h does not exist

2010-08-20 Thread Dave Hylands
/usr/src//usr/src/linux-headers-2.6.28-11/arch/x86/include/asm to your search path. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http

Re: linux/module.h does not exist

2010-08-20 Thread Dave Hylands
Hi Tapas, On Fri, Aug 20, 2010 at 9:34 PM, Tapas Mishra mightydre...@gmail.com wrote: Ohh Ok now it becomes a bit clear, On Sat, Aug 21, 2010 at 8:51 AM, Dave Hylands dhyla...@gmail.com wrote: This one: /usr/src/linux-headers-2.6.28-11/include/linux/module.h I suspect that you'll also

Re: linux/module.h does not exist

2010-08-20 Thread Dave Hylands
Hi Tapas, On Fri, Aug 20, 2010 at 10:27 PM, Dave Hylands dhyla...@gmail.com wrote: Hi Tapas, On Fri, Aug 20, 2010 at 10:24 PM, Tapas Mishra mightydre...@gmail.com wrote: Ya you were right I tried the following this time gcc -I /usr/src/linux-headers-2.6.28-11/arch/x86/include/asm/ -I /usr

Re: linux/module.h does not exist

2010-08-20 Thread Dave Hylands
modify your original path? Try this: gcc -I /usr/src/linux-headers-2.6.28-11/arch/x86/include/asm/ -I /usr/src/linux-headers-2.6.28-11/include/ -c sample2.c You may still be missing additional paths. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list

Re: linux/module.h does not exist

2010-08-19 Thread Dave Hylands
to be missing the line of code that goes here {        printk(Sys_exit called with err_code=%d\n,err_code);        return main_sys_exit(err_code); } ...snip... -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe

Re: linux/module.h does not exist

2010-08-18 Thread Dave Hylands
-programming/lesson-4-writing-and-running-your-first-kernel-module The first 4 lessons are free and if you follow all the steps (start at the beginnning) you'll get to the point where you can compile a linux kernel module. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com

Re: How create a miscellaneous crw-rw-rw- device ?

2010-08-16 Thread Dave Hylands
when udev was launched, which is probably from a script in /etc/init.d/udev or something similar. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http

Re: How create a miscellaneous crw-rw-rw- device ?

2010-08-14 Thread Dave Hylands
for your driver which explicitly sets the mode. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ

Re: reference to an undefined macro

2010-08-01 Thread Dave Hylands
of PMD_SHIFT at all in page.h, and also no other header files included by it. How does this work? I think you're supposed to #include linux/mm.h This includes both asm/page.h and asm/pgtable.h, PMD_SHIFT is defined by including asm/pgtable.h. -- Dave Hylands Shuswap, BC, Canada http