RE: block device drivers

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

 



Hi,

>-----Original Message-----
>From: raja [mailto:vnagaraju@xxxxxxxxxxxx]
>Sent: Saturday, September 17, 2005 10:34 AM
>To: kernelnewbies@xxxxxxxxxxxx
>Subject: block device drivers
>
>Hi,
>    I am trying to implement a linux block device driver.And  I have
>some doubts while understanding the drivers.I am listing them.Will you
>please help me.
>
>1.In the struct gendisk structure wht is the field
>int first_minor;
>                refer to?
>is it the first partion number?wht is the partion number mean?

first_minor denotes the starting minor device number for this gendisk.
For e.g. if you initialize first_minor with 5 and you create 2
partitions on this disk, then the disk will have minor number 5 and the
two partitions will have minor number 6 and 7. This basically decides
how minor numbers are allocated.


>
>and wht is the field minors refer to?

"minors" refer to maximum number of partitions possible on the disk

Please correct me if I am wrong.

Sanjay

>
>and while implementing in a sample driver they are using
>dev->gd->first_minor = which*NUM_OF_MINORS;
>where gd is the reference to gendisk structure
>wht is the word 'which' refer to and in which file it is defined?
>
>i am using the
>set_capacity(dev->gd, nsectors*(hardsect_size/KERNEL_SECTOR_SIZE));
>then
>and i am getting the error undefined symbol KERNEL_SECTOR_SIZE.
>where it is located.
>
>
>
>
>--
>Kernelnewbies: Help each other learn about the Linux kernel.
>Archive:       http://mail.nl.linux.org/kernelnewbies/
>FAQ:           http://kernelnewbies.org/faq/

--
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