Re: Clearning concepts mentioned in Linux Device Drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 9 Oct 2004 18:22:47 +0100 (BST), Dinesh Ahuja
<mdlinux7@xxxxxxxxxxx> wrote:
> Hi Simith
> 
> > [Simith] Memsetting to 0 is initialising "next"  to
> > NULL.
> 
> That is fine that we are memsetting it to NULL, but
> what is a significance of this data member if we are
> allocating the memory with kmalloc to scull_devices.

I was going to be the pedant that pointed out the NULL initialization
earlier, but thought I'd wait in case someone who's recently read LDD
could shed some further light. Since that's not happened, here goes...

> As such I am not able to understand the logic behind
> using next data member in the Scull_Device structure.

If my memory serves me correct, they like to give a lot of compsci
style overblown examples which don't necessarily have a practical
purpose - so for example I think the situation you are referring to is
one where they allocate a large block of memory to serve as an example
backing store and then do some data structure maniupulation within it
with the linked lists just so you can see the kind of activity which
might take place.

I'm not criticising their approach (it would be nice if all theory
taught today was as fun - my OS courses at University had such
potential, but didn't go anywhere, mostly due to the lack of
understanding of the students) but read it from the pragmatic
viewpoint of learning, not getting practical implementation.

Cheers,

Jon.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux