RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-24 Thread Mukund JB.

Dear Lenneart,

>Most common for disk devices is XXYZ where XX is some name for the
>driver (hd for ide, sd for scsi, other things for other drive types), Y
>is a letter (a for first, b for second, c for third, etc) and Z is the
>partition number.  So in your case you could have:
>
>tfaa for first slot
>tfaa1 for first partition on first slot.
>tfab for second slot
>tfab4 for 4th partition on second slot.
>Or call it tf and use tfa1 tfb4 etc.

That's fine.
My controller itself alone handle FOUR device at a time (u mea these
should be (tfa, b , c d)
But how do I represent if I have more than one such controller i.e. it
is more 4 devices each with more parttions again.

Thanks & Regards,
Mukund Jampala


>
>> I have four sockets on which I have to support individual device with
>> partitions on them. Is there a better conventional way to represent
all
>> the four devices? My driver also supports 4 such controllers. To
support
>> first socket device on the second controller I am using tfb0, tfb0p1,
>> tfb0p2...
>
>Well at least ide and scsi don't care which controller, they still just
>name them in order.  You could just use tfa up to tfp for the devices.
>That is what I would do unless the seperate controllers really make
more
>sense to users (counting to slot 16 might be a bit much using letters
>for some users).
>
>Maybe tf1a2 for controller 1 slot a partition 2 would be nicer to the
>user.  Some raid cards do use /dev/raidname/c1d2p3 for card 1 device 2
>partition 3.  Maybe you prefer that arangement.
>
>> I have left with handling lot of generalization in the code.
>
>Len Sorensen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-24 Thread Mukund JB.
Dear Lenneart,

One good news
I have implemented the partition support in the driver.
I am able to mount the partition of the individual device.
I partition them using the fdisk and mounted them.
The architecture this some thing like this
The whole device is represented by tfa0
And rest of the partitions by tfa0p1, tfa0p2 and so on...
If there is a device in second socket, the whole device is represented
by tfa1 and rest of the partitions by tfa1p1, tfa1p2 and so on... I am
following the above conventions. Is the is what in general all Linux
devices follow. 

I have four sockets on which I have to support individual device with
partitions on them. Is there a better conventional way to represent all
the four devices? My driver also supports 4 such controllers. To support
first socket device on the second controller I am using tfb0, tfb0p1,
tfb0p2...

I have left with handling lot of generalization in the code.

Regards,
Mukund Jampala


>-Original Message-
>From: Lennart Sorensen [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 18, 2005 10:57 PM
>To: Mukund JB`.
>Cc: [EMAIL PROTECTED]; linux-kernel-Mailing-list
>Subject: Re: The Linux FAT issue on SD Cards.. maintainer support
please
>
>On Thu, Aug 18, 2005 at 06:21:39PM +0530, Mukund JB`. wrote:
>> Dear all,
>>
>> I have few updates in this issue.
>> I have attached the Images as well as the mount-log to this mail.
>> Please see the comments inline.
>>
>> I think, fdisk it trying to portray that n/o cylinders 448. So, it
also
>> takes care of displaying the relevant n/o sector & NO more or NO
less.
>>
>> I have implemented the partition support in the driver but some HOW I
am
>> NOT able to get the driver working with all the sockets. It is just
>> working with the socket 0 and NO other socket.
>> I mean I am able to mount windows & linux formatted SD card with new
>> driver present from socket 0.
>>
>> I have an update on this.
>>
>> I found some common things between the windows formatted SD & Linux
>> formatted SD.
>> I found that both of then do NOT have the partition table.
>> I found that both of them have FAT12 FS in the sector 0 starting at
>> offset 0.
>> Why? I am NOT able to guess.
>
>If you don't use fdisk to create a partition on the card, then you
won't
>have one.  If you mkdosfs on /dev/tfa0 then you loose the partition
>table and get a filesystem on just the whole disk.  If you do it with
>/dev/tfa0p1 then you do it on the first partition which would then have
>the FAT filesystem starting at the offset of the first partition (as it
>should).
>
>> For Windows formatted SD there is NO partition table at all.
>> I went on more R and tried to get to format the USB-Thumb drive.
>> Even that did NOT have a partition table.
>> It looks like windows treats all removable media device as devices
with
>> NO partitions.
>
>That is right.  Although I believe if windows sees one with a partition
>table it will just use the first valid partition table entry it finds
>and ignore the rest.
>
>> Even on Linux formatted SD there is NO partition table present.
>>
>> Please have a look at the images I am attaching to this mail.
>> I have attached CAM-MS, WIN-Ms & Linux-MS first 512 byte length
Images.
>> These are the Images of first 512 bytes of sector 0.
>> You can find the FS there on Lin & Win Images.
>>
>> I have verified this by keeping some DEBUG messages in the FAT layer
&
>> seeing what data is being passed to this fat_boot_sector structure
when
>> mount call is issued.
>> I am also attaching those LOG messages. please Have a LOOK at them
too &
>> you will have a fair understanding.
>>
>> I have verified it with fdisk -l -u /dev/tfa0
>> It has shown that it is the partition 0 & nothing else.
>>
>> Please see the Images-All-MS-512.tar.gz.
>
>Well to mount anything without a partition table, you would mount the
>whole device (/dev/tfa0) and to mount one with a partition table on it,
>you would mount /dev/tfa0p1 or tfa0p4 or whichever partition it is.
>
>Zip drives used to be the same way.  Some were formated with 1
partition
>(usually 1 or 4) and some had no partition table at all and used the
>whole disk for the filesystem.  I always had a /zip and /zip4 mount
>point I used depending on the particular disk I was looking at.
>
>Len Sorensen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-24 Thread Mukund JB.

Dear Lenneart,

Most common for disk devices is XXYZ where XX is some name for the
driver (hd for ide, sd for scsi, other things for other drive types), Y
is a letter (a for first, b for second, c for third, etc) and Z is the
partition number.  So in your case you could have:

tfaa for first slot
tfaa1 for first partition on first slot.
tfab for second slot
tfab4 for 4th partition on second slot.
Or call it tf and use tfa1 tfb4 etc.

That's fine.
My controller itself alone handle FOUR device at a time (u mea these
should be (tfa, b , c d)
But how do I represent if I have more than one such controller i.e. it
is more 4 devices each with more parttions again.

Thanks  Regards,
Mukund Jampala



 I have four sockets on which I have to support individual device with
 partitions on them. Is there a better conventional way to represent
all
 the four devices? My driver also supports 4 such controllers. To
support
 first socket device on the second controller I am using tfb0, tfb0p1,
 tfb0p2...

Well at least ide and scsi don't care which controller, they still just
name them in order.  You could just use tfa up to tfp for the devices.
That is what I would do unless the seperate controllers really make
more
sense to users (counting to slot 16 might be a bit much using letters
for some users).

Maybe tf1a2 for controller 1 slot a partition 2 would be nicer to the
user.  Some raid cards do use /dev/raidname/c1d2p3 for card 1 device 2
partition 3.  Maybe you prefer that arangement.

 I have left with handling lot of generalization in the code.

Len Sorensen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-24 Thread Mukund JB.
Dear Lenneart,

One good news
I have implemented the partition support in the driver.
I am able to mount the partition of the individual device.
I partition them using the fdisk and mounted them.
The architecture this some thing like this
The whole device is represented by tfa0
And rest of the partitions by tfa0p1, tfa0p2 and so on...
If there is a device in second socket, the whole device is represented
by tfa1 and rest of the partitions by tfa1p1, tfa1p2 and so on... I am
following the above conventions. Is the is what in general all Linux
devices follow. 

I have four sockets on which I have to support individual device with
partitions on them. Is there a better conventional way to represent all
the four devices? My driver also supports 4 such controllers. To support
first socket device on the second controller I am using tfb0, tfb0p1,
tfb0p2...

I have left with handling lot of generalization in the code.

Regards,
Mukund Jampala


-Original Message-
From: Lennart Sorensen [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 18, 2005 10:57 PM
To: Mukund JB`.
Cc: [EMAIL PROTECTED]; linux-kernel-Mailing-list
Subject: Re: The Linux FAT issue on SD Cards.. maintainer support
please

On Thu, Aug 18, 2005 at 06:21:39PM +0530, Mukund JB`. wrote:
 Dear all,

 I have few updates in this issue.
 I have attached the Images as well as the mount-log to this mail.
 Please see the comments inline.

 I think, fdisk it trying to portray that n/o cylinders 448. So, it
also
 takes care of displaying the relevant n/o sector  NO more or NO
less.

 I have implemented the partition support in the driver but some HOW I
am
 NOT able to get the driver working with all the sockets. It is just
 working with the socket 0 and NO other socket.
 I mean I am able to mount windows  linux formatted SD card with new
 driver present from socket 0.

 I have an update on this.

 I found some common things between the windows formatted SD  Linux
 formatted SD.
 I found that both of then do NOT have the partition table.
 I found that both of them have FAT12 FS in the sector 0 starting at
 offset 0.
 Why? I am NOT able to guess.

If you don't use fdisk to create a partition on the card, then you
won't
have one.  If you mkdosfs on /dev/tfa0 then you loose the partition
table and get a filesystem on just the whole disk.  If you do it with
/dev/tfa0p1 then you do it on the first partition which would then have
the FAT filesystem starting at the offset of the first partition (as it
should).

 For Windows formatted SD there is NO partition table at all.
 I went on more RD and tried to get to format the USB-Thumb drive.
 Even that did NOT have a partition table.
 It looks like windows treats all removable media device as devices
with
 NO partitions.

That is right.  Although I believe if windows sees one with a partition
table it will just use the first valid partition table entry it finds
and ignore the rest.

 Even on Linux formatted SD there is NO partition table present.

 Please have a look at the images I am attaching to this mail.
 I have attached CAM-MS, WIN-Ms  Linux-MS first 512 byte length
Images.
 These are the Images of first 512 bytes of sector 0.
 You can find the FS there on Lin  Win Images.

 I have verified this by keeping some DEBUG messages in the FAT layer

 seeing what data is being passed to this fat_boot_sector structure
when
 mount call is issued.
 I am also attaching those LOG messages. please Have a LOOK at them
too 
 you will have a fair understanding.

 I have verified it with fdisk -l -u /dev/tfa0
 It has shown that it is the partition 0  nothing else.

 Please see the Images-All-MS-512.tar.gz.

Well to mount anything without a partition table, you would mount the
whole device (/dev/tfa0) and to mount one with a partition table on it,
you would mount /dev/tfa0p1 or tfa0p4 or whichever partition it is.

Zip drives used to be the same way.  Some were formated with 1
partition
(usually 1 or 4) and some had no partition table at all and used the
whole disk for the filesystem.  I always had a /zip and /zip4 mount
point I used depending on the particular disk I was looking at.

Len Sorensen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-19 Thread Mukund JB`.

Dear Lennart,

>> I found that both of then do NOT have the partition table.
>
>If you don't use fdisk to create a partition on the card, then you
won't
>have one.  

I am having the partition table on the cam formatted CARD 
i.e. the partition 0.

> If you mkdosfs on /dev/tfa0 then you loose the partition
>table and get a filesystem on just the whole disk.  If you do it with
>/dev/tfa0p1 then you do it on the first partition which would then have
>the FAT filesystem starting at the offset of the first partition (as it
>should).

Ok, I understood it. It looks like we have to verify the partition
support we have implemented in the driver.

>That is right.  Although I believe if windows sees one with a partition
>table it will just use the first valid partition table entry it finds
>and ignore the rest.

To handle it in a similarly in Linux we need to support this driver with
partitions. There looks a loop hole in the driver. 
I will verify and fix it today.

>> Please see the Images-All-MS-512.tar.gz.
>
>Well to mount anything without a partition table, you would mount the
>whole device (/dev/tfa0) and to mount one with a partition table on it,
>you would mount /dev/tfa0p1 or tfa0p4 or whichever partition it is.
>
>Zip drives used to be the same way.  Some were formated with 1
partition
>(usually 1 or 4) and some had no partition table at all and used the
>whole disk for the filesystem.  I always had a /zip and /zip4 mount
>point I used depending on the particular disk I was looking at.
Just out of inquisitive ness.

What r u the minor numbers of those zip devices.
ll /dev/zip 
ll /dev/zip4

Thanks for ur support.
I will check with partition support in the driver & update it.
Let me fix it there and come back.

Regards,
Mukund Jampala

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Fix to Linux FAT12 mount issue?

2005-08-19 Thread Mukund JB`.
Dear all,

Its time that there should be a fix applied to the FAT12 subsystem in
Linux.
I have noted that removable device FAT12 formatted in Camera like
digital media does NOT have the FAT12 in sector 0 instead it has a
partition table that speaks about the FAT12 fs start sector.

Such devices that do NOT have the file system in sector 0 instead have
the partition table are failing to mount under Linux.
Why is it so?

I have even tested USB mounted device suspecting the in-built
card-reader driver I am using?

Even it fails.
Who has to handle this? which layer?

Regards,
Mukund Jampala
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Fix to Linux FAT12 mount issue?

2005-08-19 Thread Mukund JB`.
Dear all,

Its time that there should be a fix applied to the FAT12 subsystem in
Linux.
I have noted that removable device FAT12 formatted in Camera like
digital media does NOT have the FAT12 in sector 0 instead it has a
partition table that speaks about the FAT12 fs start sector.

Such devices that do NOT have the file system in sector 0 instead have
the partition table are failing to mount under Linux.
Why is it so?

I have even tested USB mounted device suspecting the in-built
card-reader driver I am using?

Even it fails.
Who has to handle this? which layer?

Regards,
Mukund Jampala
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-19 Thread Mukund JB`.

Dear Lennart,

 I found that both of then do NOT have the partition table.

If you don't use fdisk to create a partition on the card, then you
won't
have one.  

I am having the partition table on the cam formatted CARD 
i.e. the partition 0.

 If you mkdosfs on /dev/tfa0 then you loose the partition
table and get a filesystem on just the whole disk.  If you do it with
/dev/tfa0p1 then you do it on the first partition which would then have
the FAT filesystem starting at the offset of the first partition (as it
should).

Ok, I understood it. It looks like we have to verify the partition
support we have implemented in the driver.

That is right.  Although I believe if windows sees one with a partition
table it will just use the first valid partition table entry it finds
and ignore the rest.

To handle it in a similarly in Linux we need to support this driver with
partitions. There looks a loop hole in the driver. 
I will verify and fix it today.

 Please see the Images-All-MS-512.tar.gz.

Well to mount anything without a partition table, you would mount the
whole device (/dev/tfa0) and to mount one with a partition table on it,
you would mount /dev/tfa0p1 or tfa0p4 or whichever partition it is.

Zip drives used to be the same way.  Some were formated with 1
partition
(usually 1 or 4) and some had no partition table at all and used the
whole disk for the filesystem.  I always had a /zip and /zip4 mount
point I used depending on the particular disk I was looking at.
Just out of inquisitive ness.

What r u the minor numbers of those zip devices.
ll /dev/zip 
ll /dev/zip4

Thanks for ur support.
I will check with partition support in the driver  update it.
Let me fix it there and come back.

Regards,
Mukund Jampala

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-18 Thread Mukund JB`.
Dear Lennart,

The USB device I have bought is yet to be tested.
I will do it tomorrow. I was busy in figuring out more on this END. Let
me try it to night.
If not I will try it in the tomorrow day time schedule.

Regards,
Mukund Jampala

>> I have bought a "entermultimedia" USB 2.0 21-in-1 card.
>> There are no Linux driver support in the CD  provided.
>> Can u suggest me what is best bug (USB card reader) with Linux driver
>> support in the Market.
>
>Load usb drivers and usb-storage driver and scsi disk module (sd_mod).
>Then it should show up as a scsi disk.  No modern OS requires drivers
>added for usb drives.  They are just included.
>
>Len Sorensen
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-18 Thread Mukund JB`.
Dear all,

I have few updates in this issue.
I have attached the Images as well as the mount-log to this mail.
Please see the comments inline.

>If the partition starts at sector 57 and is 28743 sectors long, then
>that matches 28800 sectors total.  No problem there.
>
>If on the other hand fdisk reports 28672 sectors total then there is a
>problem somewhere.

I think, fdisk it trying to portray that n/o cylinders 448. So, it also
takes care of displaying the relevant n/o sector & NO more or NO less.

>Well then you have to implement full partition support and present a
>seperate device for each partition in /dev so that mount can access
each
>partition.

I have implemented the partition support in the driver but some HOW I am
NOT able to get the driver working with all the sockets. It is just
working with the socket 0 and NO other socket. 
I mean I am able to mount windows & linux formatted SD card with new
driver present from socket 0.

>> There is a partition table in the CAM formatted device & it looks
like
>> there is also a partition table in the win formatted device.
>> The details of there at offset 0x1BE are below.

I have an update on this.

I found some common things between the windows formatted SD & Linux
formatted SD.
I found that both of then do NOT have the partition table.
I found that both of them have FAT12 FS in the sector 0 starting at
offset 0.
Why? I am NOT able to guess.

For Windows formatted SD there is NO partition table at all.
I went on more R and tried to get to format the USB-Thumb drive.
Even that did NOT have a partition table. 
It looks like windows treats all removable media device as devices with
NO partitions.

Even on Linux formatted SD there is NO partition table present.

Please have a look at the images I am attaching to this mail.
I have attached CAM-MS, WIN-Ms & Linux-MS first 512 byte length Images.
These are the Images of first 512 bytes of sector 0.
You can find the FS there on Lin & Win Images.

I have verified this by keeping some DEBUG messages in the FAT layer &
seeing what data is being passed to this fat_boot_sector structure when
mount call is issued.
I am also attaching those LOG messages. please Have a LOOK at them too &
you will have a fair understanding.

>That one looks more like random numbers.  Maybe the partition entry
that
>it really uses is not number 1, but number 2 3 or 4, or no partition
>table at all.
I have verified it with fdisk -l -u /dev/tfa0 
It has shown that it is the partition 0 & nothing else.

>Could you do dd if=/dev/sda bs=512 count=1 | xxd
Please see the Images-All-MS-512.tar.gz.

Regards,
Mukund Jampala



Images-512-xxd-type.tar.gz
Description: Images-512-xxd-type.tar.gz


mount-logs-all.tar.gz
Description: mount-logs-all.tar.gz


RE: How to support partitions in driver?

2005-08-18 Thread Mukund JB`.
Dear Russel,

I have a full-fledged driver working with NO problems. It has been
developed long back.
Now the issue here is to add the partitions support to the existing
driver.

I guess it will involve enough amount of work. If NOT, please provide me
the documentation if available, HOW-TO use the MMC layer.

If the requirement was BIG & bulky what you suggested might have been
apt.
If I can solve it in less effort why go for more effort.
I can always integrate it with main-steam kernel letter. This is the
PEAK time & I am required to submit the patch as soon as possible.

Please understand the reason behind it.

I assure you that I will use the kernel MMC & accomplish what u said
within  next month?
But for now how to implement the partition support in the driver will be
very helpfull.

Thanks & Regards,
Mukund Jampala



>> I have few basic queries regarding my partition implementation in my
Sd
>> driver.
>> Sorry for asking such petty things here. But, somehow it's not
working &
>> I am made to ask it here.
>
>Why don't you use the MMC/SD layer already merged into the kernel
>instead of rewriting your own.  Grab a copy of Andrew Morton's
>kernel, and look at the code in drivers/mmc and include/linux/mmc.
>
>There are three host drivers there already.  I'm sure you can work
>out how to interface the existing framework to your device.
>
>And suddenly you can take advantage of the already existing mmc
>block device support, which does support partitions, and does
>manage to get hot swapping block devices more or less correct.
>(and if it doesn't, it'll be one less driver to fix later.)
>
>--
>Russell King
> Linux kernel2.6 ARM Linux   - http://www.arm.linux.org.uk/
> maintainer of:  2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


How to support partitions in driver?

2005-08-18 Thread Mukund JB`.

Dear all,

I have few basic queries regarding my partition implementation in my Sd
driver. 
Sorry for asking such petty things here. But, somehow it's not working &
I am made to ask it here.

I am working on 2.6.10 kernel(x86 architecture).
I have a working SD driver for my multimedia controller.
I have four interfaces for my board.
I call then tfa0, tfa1, tfa2, tfa3 respectively.

I defined then as below...

mknod /dev/tfa0 b 252 0 //device node for first partition of socket 0
mknod /dev/tfa0p1 b 252 1
mknod /dev/tfa0p2 b 252 2
.
mknod /dev/tfa1 b 252 4  //device node for first partition of socket 1

mknod /dev/tfa2 b 252 8  //device node for first partition of socket 2
.
mknod /dev/tfa3 b 252 12 //device node for first partition of socket 3
.

I implemented the gendisk partition support with the following calls in
the driver.

#define MAX_PARTS 4 // maximum no partitions per device
alloc_disk (4);
gend.first_minor = (SockNo*MAX_PARTS); // SockNo: Current socket card is
// inserted 

Socket 0 & 3 support SD interfaces.
I am able to mount the SD with when inserted in socket 0.
At the same time, I am NOT able to mount the SD when inserted in socket
3. It fails as follows.

mount /dev/tfa3 /mnt 
/dev/tfa3: No such device or address
sfdisk: cannot open /dev/tfa3 for reading.

/proc/Partitions looks ok.
Cat/proc/partitions
252 0 14336 tfa3// first inserted
252 0 14336 tfa0 
252 0 14336 tfa2

The updates to the /proc/partitions are done on and when the card is
inserted into that particular socket.

Can you please update me if I am missing anything that has to be
implemented in the driver apart from the above code?

Why am I not able to mount card in socket 3?

Regards,
Mukund Jampala

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


How to support partitions in driver?

2005-08-18 Thread Mukund JB`.

Dear all,

I have few basic queries regarding my partition implementation in my Sd
driver. 
Sorry for asking such petty things here. But, somehow it's not working 
I am made to ask it here.

I am working on 2.6.10 kernel(x86 architecture).
I have a working SD driver for my multimedia controller.
I have four interfaces for my board.
I call then tfa0, tfa1, tfa2, tfa3 respectively.

I defined then as below...

mknod /dev/tfa0 b 252 0 //device node for first partition of socket 0
mknod /dev/tfa0p1 b 252 1
mknod /dev/tfa0p2 b 252 2
.
mknod /dev/tfa1 b 252 4  //device node for first partition of socket 1

mknod /dev/tfa2 b 252 8  //device node for first partition of socket 2
.
mknod /dev/tfa3 b 252 12 //device node for first partition of socket 3
.

I implemented the gendisk partition support with the following calls in
the driver.

#define MAX_PARTS 4 // maximum no partitions per device
alloc_disk (4);
gend.first_minor = (SockNo*MAX_PARTS); // SockNo: Current socket card is
// inserted 

Socket 0  3 support SD interfaces.
I am able to mount the SD with when inserted in socket 0.
At the same time, I am NOT able to mount the SD when inserted in socket
3. It fails as follows.

mount /dev/tfa3 /mnt 
/dev/tfa3: No such device or address
sfdisk: cannot open /dev/tfa3 for reading.

/proc/Partitions looks ok.
Cat/proc/partitions
252 0 14336 tfa3// first inserted
252 0 14336 tfa0 
252 0 14336 tfa2

The updates to the /proc/partitions are done on and when the card is
inserted into that particular socket.

Can you please update me if I am missing anything that has to be
implemented in the driver apart from the above code?

Why am I not able to mount card in socket 3?

Regards,
Mukund Jampala

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: How to support partitions in driver?

2005-08-18 Thread Mukund JB`.
Dear Russel,

I have a full-fledged driver working with NO problems. It has been
developed long back.
Now the issue here is to add the partitions support to the existing
driver.

I guess it will involve enough amount of work. If NOT, please provide me
the documentation if available, HOW-TO use the MMC layer.

If the requirement was BIG  bulky what you suggested might have been
apt.
If I can solve it in less effort why go for more effort.
I can always integrate it with main-steam kernel letter. This is the
PEAK time  I am required to submit the patch as soon as possible.

Please understand the reason behind it.

I assure you that I will use the kernel MMC  accomplish what u said
within  next month?
But for now how to implement the partition support in the driver will be
very helpfull.

Thanks  Regards,
Mukund Jampala



 I have few basic queries regarding my partition implementation in my
Sd
 driver.
 Sorry for asking such petty things here. But, somehow it's not
working 
 I am made to ask it here.

Why don't you use the MMC/SD layer already merged into the kernel
instead of rewriting your own.  Grab a copy of Andrew Morton's
kernel, and look at the code in drivers/mmc and include/linux/mmc.

There are three host drivers there already.  I'm sure you can work
out how to interface the existing framework to your device.

And suddenly you can take advantage of the already existing mmc
block device support, which does support partitions, and does
manage to get hot swapping block devices more or less correct.
(and if it doesn't, it'll be one less driver to fix later.)

--
Russell King
 Linux kernel2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-18 Thread Mukund JB`.
Dear Lennart,

The USB device I have bought is yet to be tested.
I will do it tomorrow. I was busy in figuring out more on this END. Let
me try it to night.
If not I will try it in the tomorrow day time schedule.

Regards,
Mukund Jampala

 I have bought a entermultimedia USB 2.0 21-in-1 card.
 There are no Linux driver support in the CD  provided.
 Can u suggest me what is best bug (USB card reader) with Linux driver
 support in the Market.

Load usb drivers and usb-storage driver and scsi disk module (sd_mod).
Then it should show up as a scsi disk.  No modern OS requires drivers
added for usb drives.  They are just included.

Len Sorensen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-17 Thread Mukund JB`.

Dear Lennart,

A have a new fining here.

fdisk -l -u /dev/tfa0:
debdev1:~# fdisk -l -u /dev/tfa0

Disk /dev/tfa0: 14 MB, 14680064 bytes
2 heads, 32 sectors/track, 448 cylinders, total 28672 sectors Units =
sectors of 1 * 512 = 512 bytes

   Device Boot  Start End  Blocks   Id  System
/dev/ tfa0p157   28799   14371+   1  FAT12

On a keen look on the above fdisk output on my 16MB SD card, you can
find the cylinder information as 448 where as my driver ioctl returns
450.

I have found from the partition table that Total n/o sector for the
primary partition is 28743 (total sectors).
But my ioctl returns total cylinders as 450 i.e. 28800 sectors.
As 28743 is NOT any multiple of 64(2*32)i.e sectors*heads, the fdisk
tried manipulates it to get multiples of 64.
So, finally the best multiple 448 cylinders (i.e. 28672 sector)
So, finally that NOT a BUG in the driver instead is a generalization
made by fdisk command.

Please find the inline comments.

>Well you can either support partitions fully by making your driver work
>like the ide and scsi and such drivers do things, or you can just make
>it simpler and only support devices without a partition table and those
>with a single partition entry in the partition table.  That would
>support probably 99.99% of cards you would encounter.  You just have to
>check if a partition table exists, if it doesn't, just present the
whole
>device as the disk, while if a partition table exists, scan it for a
>partition that is not a blank entry, then find the start of that
>partition and present the device to the user starting at that sector.

This is a policy & NO policy is the driver should be implemented.
I think we need NOT handle all this in the driver. The upper layer of
the mount application looks into verifying this.

>> The partition layout mentioned in the partition table is same for the
>> Windows formatted SD & CAM formatted SD. I assume partition layout
>> starts at 0x1BE.
>
>If there is a partition table then it starts there.

There is a partition table in the CAM formatted device & it looks like
there is also a partition table in the win formatted device.
The details of there at offset 0x1BE are below.

CAM formatted SD Details
- 0x1BE offset detailed messages (decimal no
)-- Reading data from sector '0' at offset
0x1BE(Partition table start addr)

bootable= 0x80  (0x1BE)
beg-chs.heads   = 0x1
beg-chs.sect= 0x1A
beg-chs.cylin   = 0x0
sys-type= 0x1
end-chs.heads   = 0x1
end-chs.sect= 0x60
end-chs.cylin   = 0xC1
start sect  = 0x39
n/o sec in part = 0x7047


Win formatted SD Details
- 0x1BE offset detailed messages (decimal no
)-- Reading data from sector '0' at offset
0x1BE(Partition table start addr)

bootable= 0x6F  (0x1BE)
beg-chs.heads   = 0x74
beg-chs.sect= 0x68
beg-chs.cylin   = 0x65
sys-type= 0x72
end-chs.heads   = 0x20
end-chs.sect= 0x6D
end-chs.cylin   = 0x65
start sect  = 0x2E61964
n/o sec in part = 0x440A0DFF


>> >> Sfdisk -l /dev/tfa0 ( CAM & win)
>> >> Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
>> >> Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting
from
>> 0
>> >>
>> >>Device Boot Start End   #cyls#blocks   Id  System
>> >> /dev/tfa0p1   *  0+449 450- 14371+   1  FAT12
>> >> /dev/tfa0p2  0   -   0  00  Empty
>> >> /dev/tfa0p3  0   -   0  00  Empty
>> >> /dev/tfa0p4  0   -   0  00  Empty
>> >> Warning: partition 1 extends past end of disk
>> >>
>> Can you quote your comments on the warning given by sfdisk command
>> above?
>
>The warning means the driver is broken and says the wrong number of
>cylinders for the device.

NO, I think driver is NOT broken instead the partition tables speaks SO.
sfdisk returns 448 cylinders for my 16MB SD card, where as my driver
ioctl returns 450.

I have found from the partition table that Total n/o sector for the
primary partition is 28743 (total sectors) whereas my ioctl returns
total cylinders as 450 i.e. 28800 sectors. 

As 28743 is NOT any multiple of 64(2*32)i.e sectors*heads, the sfdisk
manipulates it to get multiples of 64. The best multiple is 448
cylinders (i.e. 28672 sector). This is where we are missing 128 sectors.

So, finally that NOT a BUG in the driver instead is a generalization
made by sfdisk command.

>Perhaps one of the more modern ways of getting disk size would return
>the full number of sectors instead.  For example the ioctl BLKSSZGET
and
>BLKGETSIZE and BLKGETSIZE64.
I added BLKGETSIZE ioctl. When I tried to note the ioctl called at mount
time I find it is all the time HDIO_GETGEO.

At this angle it clear that sfdisk output is Not the result of BUG in
the driver instead it is a result of partition table TOTAL SECTORS
entry. 

I have a doubt where Linux is treating 

get_start_sect() NOTE HOW?...

2005-08-17 Thread Mukund JB`.

Dear all,

Sorry for the MOST silly question in this list.
I am mailing it here as this related to kernel.

I am writing a block driver for MMC interface.
In the HDIO_GETGEO ioctl, the hd_geometry structure is filled.
I have doubt updating the 'start' field of the hd_geometry structure.

I am doing the following to get it.
geo.start = get_start_sect(inode->i_bdev);
What is the start expected to point to? Is it the start of FS?

When I looked at the get_start_sect(), I found it is trying to pull out
the data from the "bdev->bd_part->start_sect".

Do I need to handle any thing before this to get the proper start value.
Or Is it taken care in the upper layers?

Can you please explain if is it any way wrong if I hard-code start to
'0'?

Regards,
Mukund Jampala

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


get_start_sect() NOTE HOW?...

2005-08-17 Thread Mukund JB`.

Dear all,

Sorry for the MOST silly question in this list.
I am mailing it here as this related to kernel.

I am writing a block driver for MMC interface.
In the HDIO_GETGEO ioctl, the hd_geometry structure is filled.
I have doubt updating the 'start' field of the hd_geometry structure.

I am doing the following to get it.
geo.start = get_start_sect(inode-i_bdev);
What is the start expected to point to? Is it the start of FS?

When I looked at the get_start_sect(), I found it is trying to pull out
the data from the bdev-bd_part-start_sect.

Do I need to handle any thing before this to get the proper start value.
Or Is it taken care in the upper layers?

Can you please explain if is it any way wrong if I hard-code start to
'0'?

Regards,
Mukund Jampala

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-17 Thread Mukund JB`.

Dear Lennart,

A have a new fining here.

fdisk -l -u /dev/tfa0:
debdev1:~# fdisk -l -u /dev/tfa0

Disk /dev/tfa0: 14 MB, 14680064 bytes
2 heads, 32 sectors/track, 448 cylinders, total 28672 sectors Units =
sectors of 1 * 512 = 512 bytes

   Device Boot  Start End  Blocks   Id  System
/dev/ tfa0p157   28799   14371+   1  FAT12

On a keen look on the above fdisk output on my 16MB SD card, you can
find the cylinder information as 448 where as my driver ioctl returns
450.

I have found from the partition table that Total n/o sector for the
primary partition is 28743 (total sectors).
But my ioctl returns total cylinders as 450 i.e. 28800 sectors.
As 28743 is NOT any multiple of 64(2*32)i.e sectors*heads, the fdisk
tried manipulates it to get multiples of 64.
So, finally the best multiple 448 cylinders (i.e. 28672 sector)
So, finally that NOT a BUG in the driver instead is a generalization
made by fdisk command.

Please find the inline comments.

Well you can either support partitions fully by making your driver work
like the ide and scsi and such drivers do things, or you can just make
it simpler and only support devices without a partition table and those
with a single partition entry in the partition table.  That would
support probably 99.99% of cards you would encounter.  You just have to
check if a partition table exists, if it doesn't, just present the
whole
device as the disk, while if a partition table exists, scan it for a
partition that is not a blank entry, then find the start of that
partition and present the device to the user starting at that sector.

This is a policy  NO policy is the driver should be implemented.
I think we need NOT handle all this in the driver. The upper layer of
the mount application looks into verifying this.

 The partition layout mentioned in the partition table is same for the
 Windows formatted SD  CAM formatted SD. I assume partition layout
 starts at 0x1BE.

If there is a partition table then it starts there.

There is a partition table in the CAM formatted device  it looks like
there is also a partition table in the win formatted device.
The details of there at offset 0x1BE are below.

CAM formatted SD Details
- 0x1BE offset detailed messages (decimal no
)-- Reading data from sector '0' at offset
0x1BE(Partition table start addr)

bootable= 0x80  (0x1BE)
beg-chs.heads   = 0x1
beg-chs.sect= 0x1A
beg-chs.cylin   = 0x0
sys-type= 0x1
end-chs.heads   = 0x1
end-chs.sect= 0x60
end-chs.cylin   = 0xC1
start sect  = 0x39
n/o sec in part = 0x7047


Win formatted SD Details
- 0x1BE offset detailed messages (decimal no
)-- Reading data from sector '0' at offset
0x1BE(Partition table start addr)

bootable= 0x6F  (0x1BE)
beg-chs.heads   = 0x74
beg-chs.sect= 0x68
beg-chs.cylin   = 0x65
sys-type= 0x72
end-chs.heads   = 0x20
end-chs.sect= 0x6D
end-chs.cylin   = 0x65
start sect  = 0x2E61964
n/o sec in part = 0x440A0DFF


  Sfdisk -l /dev/tfa0 ( CAM  win)
  Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
  Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting
from
 0
 
 Device Boot Start End   #cyls#blocks   Id  System
  /dev/tfa0p1   *  0+449 450- 14371+   1  FAT12
  /dev/tfa0p2  0   -   0  00  Empty
  /dev/tfa0p3  0   -   0  00  Empty
  /dev/tfa0p4  0   -   0  00  Empty
  Warning: partition 1 extends past end of disk
 
 Can you quote your comments on the warning given by sfdisk command
 above?

The warning means the driver is broken and says the wrong number of
cylinders for the device.

NO, I think driver is NOT broken instead the partition tables speaks SO.
sfdisk returns 448 cylinders for my 16MB SD card, where as my driver
ioctl returns 450.

I have found from the partition table that Total n/o sector for the
primary partition is 28743 (total sectors) whereas my ioctl returns
total cylinders as 450 i.e. 28800 sectors. 

As 28743 is NOT any multiple of 64(2*32)i.e sectors*heads, the sfdisk
manipulates it to get multiples of 64. The best multiple is 448
cylinders (i.e. 28672 sector). This is where we are missing 128 sectors.

So, finally that NOT a BUG in the driver instead is a generalization
made by sfdisk command.

Perhaps one of the more modern ways of getting disk size would return
the full number of sectors instead.  For example the ioctl BLKSSZGET
and
BLKGETSIZE and BLKGETSIZE64.
I added BLKGETSIZE ioctl. When I tried to note the ioctl called at mount
time I find it is all the time HDIO_GETGEO.

At this angle it clear that sfdisk output is Not the result of BUG in
the driver instead it is a result of partition table TOTAL SECTORS
entry. 

I have a doubt where Linux is treating this a separate class of device.
I heard some thing about the FS found on the 

RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-16 Thread Mukund JB.
Dear Lennart,

I have bought a "entermultimedia" USB 2.0 21-in-1 card.
There are no Linux driver support in the CD  provided.
Can u suggest me what is best bug (USB card reader) with Linux driver
support in the Market.

Regards,
Mukund Jampala

>-Original Message-
>From: Lennart Sorensen [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 11, 2005 9:04 PM
>To: Mukund JB.
>Cc: [EMAIL PROTECTED]; linux-kernel-Mailing-list
>Subject: Re: The Linux FAT issue on SD Cards.. maintainer support
please
>
>On Thu, Aug 11, 2005 at 10:57:14AM +0530, Mukund JB. wrote:
>> I am Linux driver programmer.
>>
>> I have a FAT12 issue on my SD cards. I have got these addresses from
the
>> fs-lists as the maintainer support mail IDs for FAT-FS.
>>
>> I am using the 2.6.10 kernel, X86 like systems.
>>
>> I am NOT able to mount the Camera formatted FAT12 filesystem on my
linux
>> BOX. SD card is of size 16MB. At the same time I am able to mount the
SD
>> cards formatted in windows & linux.
>>
>> I have identified fat_fill_super() in fs/fat/inode.c file as the
>> function that reads the super block of as MS-DOS FS.
>>
>> To debug, I have rebuilt my kernel 2.6.10 inserting some debug
messages
>> in the FS sub-system to know what data is coming into "struct
>> fat_boot_sector *b" structure in fs/fat/inode.c file after sb_bread()
>> call.
>>
>> I believe that this data in the "struct fat_boot_sector *b" should be
>> FAT12 information.
>>
>> On the camera formatted SD that is NOT mounting I have found this
>> structure to be all '0' till total_sectors variable (relevant till
here
>> on - FAT12).
>>
>> Will you please verify if there & tell me if the problem is in the
FAT
>> sub-system.
>
>A few things I would try:
>
>Stick the SD card in a generic cheap USB media reader, and see what the
>kernel thinks of the cards then.  Do both work?
>
>If the answer is still no, then it really seems the card is formated
>incorrectly, or linux has a bug in the fat driver.
>
>If both work fine that way, then there is a problem in the driver for
>the sd reader you are using that needs to be resolved.
>
>Using a known to work for people in general driver (usb-storage) with
>a standard usb card reader sure does seem like a good start until you
>know if the card is formated properly or not.
>
>You could also use that do dd the first few blocks from the card to see
>what the partition table and fat tables look like, in case your SD
>driver is somehow messing that part up.  By having a copy you can
>compare more easily.
>
>Len Sorensen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-16 Thread Mukund JB.
Dear Lenneart,

Good Morning. Sorry for the delay.
It is Independence Day celebration Week in INDIA. And it's time for my
independence from this problem.
Please see my advances in-lined below.

Work time
---
>> And is it due to lack of partition support in the driver that will
>> affect the FAT layer reading the device. Please update?
>
>No, the kernel read the partition table if it is there, and presents
>each partition as a device.
Yes, I agree. My sentence formation was wrong.

My question here is:

If I have NO multiple partition support implemented in the driver, will
it effect mounting the first partition on the device?

i.e. If I said alloc_disk(1) (single partition), and if I am trying to
mount the very first partition, will I be able to do it?

Existing gendisk code:
---
alloc_disk(1);
first_minor = socket_no; // Device socket no varies from 0 - 3.
 // so, each device- we have
just one node;   // NO partitions on
each device.

Device Interface: mknod /dev/tfa0 b 252 0

Will I have to modify the above code? 
Will you tell me what else do I need to handle multiple partition in my
driver apart from alloc_disk(n) & first_minor modifications as per n(n/o
partitions)?

>> So, I say "mount -tvfat /dev/tfa0 /mnt" which works for windows
>> formatted SD.
>> The same does NOT work with CAM formatted SD.
>
>Well if you ignore the partition table and just use a hardcoded offset
>to the start of the partition, well then it likely won't work if the
>partitioning layout is different for the two cards.

The partition layout mentioned in the partition table is same for the
Windows formatted SD & CAM formatted SD. I assume partition layout
starts at 0x1BE.

>> Sfdisk -l /dev/tfa0 ( CAM & win)
>> Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
>> Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from
0
>>
>>Device Boot Start End   #cyls#blocks   Id  System
>> /dev/tfa0p1   *  0+449 450- 14371+   1  FAT12
>> /dev/tfa0p2  0   -   0  00  Empty
>> /dev/tfa0p3  0   -   0  00  Empty
>> /dev/tfa0p4  0   -   0  00  Empty
>> Warning: partition 1 extends past end of disk
>>
Can you quote your comments on the warning given by sfdisk command
above?

>> I dumped the 1st sector of SD when formatted on CAM.
>> I have attached the files. Please have a look at them
>>
>>  Cluster-0.txt - First 16 Blocks of the device
>>  Phy-Cam-57-sector.txt - 57th sector of the device (claimed FAT
>> sector
>> in Partition table)
>
>Well one of the two files you sent appears to contain a FAT12
filesystem
>directly on the device and has no partitions.  The other appears to
>contain a partition table with one partition, and I suspect that
>partition contains a FAT12 filesystem.

These files belong to the same device. They are just different sectors
of the device file. 

Cluster-0.txt - First 16 Blocks of the device
Phy-Cam-57-sector.txt - 57th sector of the device (claimed FAT

Sector)

>So for the device above with one partition, you would have to check
>the partition table entry to find the start sector number of the
>partition and then offset requests by that amount.

You mean the application like mount should check the partition table
entry to find the start sector number of the partition and then mount
the particular partition.

>For example:
>fdisk -l -u /dev/sde:
>debdev1:~# fdisk -l -u /dev/sde
>
>Disk /dev/sde: 14 MB, 14745600 bytes
>2 heads, 32 sectors/track, 450 cylinders, total 28800 sectors
>Units = sectors of 1 * 512 = 512 bytes
>
>   Device Boot  Start End  Blocks   Id  System
>/dev/sde1  57   28799   14371+   1  FAT12
>
>So if you skip 57 sectors you would see the FAT12 filesystem.
>

Can you comment on the fdisk output which says the total sectors are
28672 while the total n/o sector passed to fdisk through the HDIO_GETGEO
ioctl is 28800.

I have a single ioctl implemented in the driver i.e HDIO_GETGEO ioctl.

fdisk -l -u /dev/tfa0:
debdev1:~# fdisk -l -u /dev/tfa0

Disk /dev/tfa0: 14 MB, 14680064 bytes
2 heads, 32 sectors/track, 450 cylinders, total 28672 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot  Start End  Blocks   Id  System
/dev/ tfa0p157   28799   14371+   1  FAT12


>On your card without a partition table, the FAT12 starts at sector 0,
on
>the other it is offset by the number of sectors to the start of the
>first partition.

This is a miscommunication. I have sent u the files of the same device
at different offsets and NOT different devices. One of them is cluster 0
and the other one sector 57 of the device which is the start of
partition table as seen in the above fdisk output.

Regards,
Mukund Jampala


-
To unsubscribe from this list: send the line 

RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-16 Thread Mukund JB.
Dear Lenneart,

Good Morning. Sorry for the delay.
It is Independence Day celebration Week in INDIA. And it's time for my
independence from this problem.
Please see my advances in-lined below.

Work time
---
 And is it due to lack of partition support in the driver that will
 affect the FAT layer reading the device. Please update?

No, the kernel read the partition table if it is there, and presents
each partition as a device.
Yes, I agree. My sentence formation was wrong.

My question here is:

If I have NO multiple partition support implemented in the driver, will
it effect mounting the first partition on the device?

i.e. If I said alloc_disk(1) (single partition), and if I am trying to
mount the very first partition, will I be able to do it?

Existing gendisk code:
---
alloc_disk(1);
first_minor = socket_no; // Device socket no varies from 0 - 3.
 // so, each device- we have
just one node;   // NO partitions on
each device.

Device Interface: mknod /dev/tfa0 b 252 0

Will I have to modify the above code? 
Will you tell me what else do I need to handle multiple partition in my
driver apart from alloc_disk(n)  first_minor modifications as per n(n/o
partitions)?

 So, I say mount -tvfat /dev/tfa0 /mnt which works for windows
 formatted SD.
 The same does NOT work with CAM formatted SD.

Well if you ignore the partition table and just use a hardcoded offset
to the start of the partition, well then it likely won't work if the
partitioning layout is different for the two cards.

The partition layout mentioned in the partition table is same for the
Windows formatted SD  CAM formatted SD. I assume partition layout
starts at 0x1BE.

 Sfdisk -l /dev/tfa0 ( CAM  win)
 Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
 Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from
0

Device Boot Start End   #cyls#blocks   Id  System
 /dev/tfa0p1   *  0+449 450- 14371+   1  FAT12
 /dev/tfa0p2  0   -   0  00  Empty
 /dev/tfa0p3  0   -   0  00  Empty
 /dev/tfa0p4  0   -   0  00  Empty
 Warning: partition 1 extends past end of disk

Can you quote your comments on the warning given by sfdisk command
above?

 I dumped the 1st sector of SD when formatted on CAM.
 I have attached the files. Please have a look at them

  Cluster-0.txt - First 16 Blocks of the device
  Phy-Cam-57-sector.txt - 57th sector of the device (claimed FAT
 sector
 in Partition table)

Well one of the two files you sent appears to contain a FAT12
filesystem
directly on the device and has no partitions.  The other appears to
contain a partition table with one partition, and I suspect that
partition contains a FAT12 filesystem.

These files belong to the same device. They are just different sectors
of the device file. 

Cluster-0.txt - First 16 Blocks of the device
Phy-Cam-57-sector.txt - 57th sector of the device (claimed FAT

Sector)

So for the device above with one partition, you would have to check
the partition table entry to find the start sector number of the
partition and then offset requests by that amount.

You mean the application like mount should check the partition table
entry to find the start sector number of the partition and then mount
the particular partition.

For example:
fdisk -l -u /dev/sde:
debdev1:~# fdisk -l -u /dev/sde

Disk /dev/sde: 14 MB, 14745600 bytes
2 heads, 32 sectors/track, 450 cylinders, total 28800 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot  Start End  Blocks   Id  System
/dev/sde1  57   28799   14371+   1  FAT12

So if you skip 57 sectors you would see the FAT12 filesystem.


Can you comment on the fdisk output which says the total sectors are
28672 while the total n/o sector passed to fdisk through the HDIO_GETGEO
ioctl is 28800.

I have a single ioctl implemented in the driver i.e HDIO_GETGEO ioctl.

fdisk -l -u /dev/tfa0:
debdev1:~# fdisk -l -u /dev/tfa0

Disk /dev/tfa0: 14 MB, 14680064 bytes
2 heads, 32 sectors/track, 450 cylinders, total 28672 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot  Start End  Blocks   Id  System
/dev/ tfa0p157   28799   14371+   1  FAT12


On your card without a partition table, the FAT12 starts at sector 0,
on
the other it is offset by the number of sectors to the start of the
first partition.

This is a miscommunication. I have sent u the files of the same device
at different offsets and NOT different devices. One of them is cluster 0
and the other one sector 57 of the device which is the start of
partition table as seen in the above fdisk output.

Regards,
Mukund Jampala


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo 

RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-16 Thread Mukund JB.
Dear Lennart,

I have bought a entermultimedia USB 2.0 21-in-1 card.
There are no Linux driver support in the CD  provided.
Can u suggest me what is best bug (USB card reader) with Linux driver
support in the Market.

Regards,
Mukund Jampala

-Original Message-
From: Lennart Sorensen [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 11, 2005 9:04 PM
To: Mukund JB.
Cc: [EMAIL PROTECTED]; linux-kernel-Mailing-list
Subject: Re: The Linux FAT issue on SD Cards.. maintainer support
please

On Thu, Aug 11, 2005 at 10:57:14AM +0530, Mukund JB. wrote:
 I am Linux driver programmer.

 I have a FAT12 issue on my SD cards. I have got these addresses from
the
 fs-lists as the maintainer support mail IDs for FAT-FS.

 I am using the 2.6.10 kernel, X86 like systems.

 I am NOT able to mount the Camera formatted FAT12 filesystem on my
linux
 BOX. SD card is of size 16MB. At the same time I am able to mount the
SD
 cards formatted in windows  linux.

 I have identified fat_fill_super() in fs/fat/inode.c file as the
 function that reads the super block of as MS-DOS FS.

 To debug, I have rebuilt my kernel 2.6.10 inserting some debug
messages
 in the FS sub-system to know what data is coming into struct
 fat_boot_sector *b structure in fs/fat/inode.c file after sb_bread()
 call.

 I believe that this data in the struct fat_boot_sector *b should be
 FAT12 information.

 On the camera formatted SD that is NOT mounting I have found this
 structure to be all '0' till total_sectors variable (relevant till
here
 on - FAT12).

 Will you please verify if there  tell me if the problem is in the
FAT
 sub-system.

A few things I would try:

Stick the SD card in a generic cheap USB media reader, and see what the
kernel thinks of the cards then.  Do both work?

If the answer is still no, then it really seems the card is formated
incorrectly, or linux has a bug in the fat driver.

If both work fine that way, then there is a problem in the driver for
the sd reader you are using that needs to be resolved.

Using a known to work for people in general driver (usb-storage) with
a standard usb card reader sure does seem like a good start until you
know if the card is formated properly or not.

You could also use that do dd the first few blocks from the card to see
what the partition table and fat tables look like, in case your SD
driver is somehow messing that part up.  By having a copy you can
compare more easily.

Len Sorensen

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-12 Thread Mukund JB.

Dear Lennart,

Thanks for the immediate reply.
Please see inline comments.

>If you don't at least read the partition table to find where the first
>partition starts, then you won't know where to start looking for a FAT
>filesystem.

When I said mount, I guess FAT will read sector 0 to get the partition
info. And is it due to lack of partition support in the driver that will
affect the FAT layer reading the device.
Please update?

>> Is it why I am NOT able to mount the CAM formatted device?
>> Is this a problem?
>
>Well in the past I have seen cards that had a partition table, with one
>partition in it (usually either primary partition 1 or 4) and had that
>partition formated with FAT12, 16 or 32 (depending on size).  

Yes, right, my card size if 16 MB. FS type is FAT12.

> Some had no partitions, and just had the whole device formated with
FAT   > like a floppy.  Windows seems to deal with both, as does linux
(as long as  > you ask it to mount the right device such as /dev/sda1
sda4 or sda > depending on which partition (if any) the card
uses.

The SD card has partitions on it (both: cam, windows).
So, my device node accessing is direct. 
You can see below the SD card has a single primary partition.

So, I say "mount -tvfat /dev/tfa0 /mnt" which works for windows
formatted SD.
The same does NOT work with CAM formatted SD.

Sfdisk -l /dev/tfa0 ( CAM & win)
Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End   #cyls#blocks   Id  System
/dev/tfa0p1   *  0+449 450- 14371+   1  FAT12
/dev/tfa0p2  0   -   0  00  Empty
/dev/tfa0p3  0   -   0  00  Empty
/dev/tfa0p4  0   -   0  00  Empty
Warning: partition 1 extends past end of disk

I don't understand, what is /dev/tfa0p1? I have no such device.

>If you ignore partitions entirely, many cards will not work for you
>since they do have partitions on them.  Some will work if they use the
>entire device without partitions like a floppy would.

Will you please elaborate this?
What kind of partition support is required in the driver to support the
Camera Fat12 formatted SD Card?

I dumped the 1st sector of SD when formatted on CAM.
I have attached the files. Please have a look at them

Cluster-0.txt - First 16 Blocks of the device
Phy-Cam-57-sector.txt - 57th sector of the device (claimed FAT
sector
in Partition table)

Regards,
Mukund Jampala



>And the minfo of the partition:
>device information:
>===
>filename="/dev/sde1"
>sectors per track: 32
>heads: 2
>cylinders: 450
>
>mformat command line: mformat -t 450 -h 2 -s 32 -H 57 c:
>
>bootsector information
>==
>banner:"PwrShot "
>sector size: 512 bytes
>cluster size: 32 sectors
>reserved (boot) sectors: 1
>fats: 2
>max available root directory slots: 512
>small size: 28743 sectors
>media descriptor byte: 0xf8
>sectors per fat: 3
>sectors per track: 32
>heads: 2
>hidden sectors: 57
>big size: 0 sectors
>physical drive id: 0x80
>reserved=0x0
>dos4=0x29
>serial number: 6F68CF4E
>disk label="CANON_DC   "
>disk type="FAT12   "
>
>Len Sorensen
€`Á9GpUªë Gpø 9€)NO NAMEFAT12   

RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-12 Thread Mukund JB.

Dear Marc,

I have doubt about the driver?
I do NOT support the partitions in my driver. I mean I have implemented
it as alloc_disk(1) i.e. 0 partitions. 
Is this what is creating the HAVOC to mount my SD card? 
Do I need to support the partitions in my driver to support mounting SD
cards formatted in DIGITAL CAMERAS?(clarity needed)

I have an update on the CAM formatted SD. 

SECTOR-0 Description:
Bytes   0   446
512 
Details |-  MB code -| - partition + signature   | 
Table

I dumped the 1st sector of SD when formatted on 
1) CAM &
2) Windows
Yes, the partition table exists on both.
The only protruding difference I find is the Master Boot Code. Can you
comment on the Master Boot Code? 

I tried copying the windows SD first 446 bytes to CAM SD first 446
bytes.
I am able to mount but I am loosing the data.

I have attached the files. Please have a look at them

Cluster-0.txt - First 16 Blocks of the device
Phy-Cam-57-sector.txt - 57th sector of the device (claimed FAT
in
Partition table)

Thanks & Regards,
Mukund Jampala

>-Original Message-
>From: Marc Singer [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 11, 2005 11:26 AM
>To: Mukund JB.
>Cc: [EMAIL PROTECTED]; linux-kernel-Mailing-list
>Subject: Re: The Linux FAT issue on SD Cards.. maintainer support
please
>
>On Thu, Aug 11, 2005 at 10:57:14AM +0530, Mukund JB. wrote:
>> Dear all,
>>
>> I am Linux driver programmer.
>>
>> I have a FAT12 issue on my SD cards. I have got these addresses from
the
>> fs-lists as the maintainer support mail IDs for FAT-FS.
>>
>> I am using the 2.6.10 kernel, X86 like systems.
>>
>> I am NOT able to mount the Camera formatted FAT12 filesystem on my
linux
>> BOX. SD card is of size 16MB. At the same time I am able to mount the
SD
>> cards formatted in windows & linux.
>>
>> I have identified fat_fill_super() in fs/fat/inode.c file as the
>> function that reads the super block of as MS-DOS FS.
>>
>> To debug, I have rebuilt my kernel 2.6.10 inserting some debug
messages
>> in the FS sub-system to know what data is coming into "struct
>> fat_boot_sector *b" structure in fs/fat/inode.c file after sb_bread()
>> call.
>>
>> I believe that this data in the "struct fat_boot_sector *b" should be
>> FAT12 information.
>>
>> On the camera formatted SD that is NOT mounting I have found this
>> structure to be all '0' till total_sectors variable (relevant till
here
>> on - FAT12).
>>
>> Will you please verify if there & tell me if the problem is in the
FAT
>> sub-system.
>
>Alternatively, you can dump the first block of the device/partition.
>From that, you can determine if there is a partition table.  In any
>case, you can read the first block of the partition (or whole device)
>and get the filesystem parameter block.
>
>It should be easy from there to determine if the data can be
>recognized as FAT.

ë Gpø 9€)NO NAMEFAT12   

RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-12 Thread Mukund JB.
Dear Lennart,

I have an update on this. Please see the message indented inline.

>A few things I would try:
>
>Stick the SD card in a generic cheap USB media reader, and see what the
>kernel thinks of the cards then.  Do both work?

I do NOT have one. I am getting it today.  I will work on it this
weekend?

>You could also use that do dd the first few blocks from the card to see
>what the partition table and fat tables look like, in case your SD
>driver is somehow messing that part up.  By having a copy you can
>compare more easily.

I dumped the 0th sector of SD when formatted on 
1) CAM &
2) Windows
The partition table exists on both.
But, the Master Boot Code is NOT present on the CAM formatted SD but is
available on windows formatted SD card.

Can you comment on the Master Boot Code? What is it required on Linux
HOW does windows managed without it? I mean how is Windows able to mount
the SD?

My driver does NOT support partitions? I mean I have implemented it as
alloc_disk(1) & relative first_minor chage obviously.

Is it why I am NOT able to mount the CAM formatted device?
Is this a problem?

Thanks & Regards,
Mukund Jampala
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-12 Thread Mukund JB.
Dear Lennart,

I have an update on this. Please see the message indented inline.

A few things I would try:

Stick the SD card in a generic cheap USB media reader, and see what the
kernel thinks of the cards then.  Do both work?

I do NOT have one. I am getting it today.  I will work on it this
weekend?

You could also use that do dd the first few blocks from the card to see
what the partition table and fat tables look like, in case your SD
driver is somehow messing that part up.  By having a copy you can
compare more easily.

I dumped the 0th sector of SD when formatted on 
1) CAM 
2) Windows
The partition table exists on both.
But, the Master Boot Code is NOT present on the CAM formatted SD but is
available on windows formatted SD card.

Can you comment on the Master Boot Code? What is it required on Linux
HOW does windows managed without it? I mean how is Windows able to mount
the SD?

My driver does NOT support partitions? I mean I have implemented it as
alloc_disk(1)  relative first_minor chage obviously.

Is it why I am NOT able to mount the CAM formatted device?
Is this a problem?

Thanks  Regards,
Mukund Jampala
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-12 Thread Mukund JB.

Dear Marc,

I have doubt about the driver?
I do NOT support the partitions in my driver. I mean I have implemented
it as alloc_disk(1) i.e. 0 partitions. 
Is this what is creating the HAVOC to mount my SD card? 
Do I need to support the partitions in my driver to support mounting SD
cards formatted in DIGITAL CAMERAS?(clarity needed)

I have an update on the CAM formatted SD. 

SECTOR-0 Description:
Bytes   0   446
512 
Details |-  MB code -| - partition + signature   | 
Table

I dumped the 1st sector of SD when formatted on 
1) CAM 
2) Windows
Yes, the partition table exists on both.
The only protruding difference I find is the Master Boot Code. Can you
comment on the Master Boot Code? 

I tried copying the windows SD first 446 bytes to CAM SD first 446
bytes.
I am able to mount but I am loosing the data.

I have attached the files. Please have a look at them

Cluster-0.txt - First 16 Blocks of the device
Phy-Cam-57-sector.txt - 57th sector of the device (claimed FAT
in
Partition table)

Thanks  Regards,
Mukund Jampala

-Original Message-
From: Marc Singer [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 11, 2005 11:26 AM
To: Mukund JB.
Cc: [EMAIL PROTECTED]; linux-kernel-Mailing-list
Subject: Re: The Linux FAT issue on SD Cards.. maintainer support
please

On Thu, Aug 11, 2005 at 10:57:14AM +0530, Mukund JB. wrote:
 Dear all,

 I am Linux driver programmer.

 I have a FAT12 issue on my SD cards. I have got these addresses from
the
 fs-lists as the maintainer support mail IDs for FAT-FS.

 I am using the 2.6.10 kernel, X86 like systems.

 I am NOT able to mount the Camera formatted FAT12 filesystem on my
linux
 BOX. SD card is of size 16MB. At the same time I am able to mount the
SD
 cards formatted in windows  linux.

 I have identified fat_fill_super() in fs/fat/inode.c file as the
 function that reads the super block of as MS-DOS FS.

 To debug, I have rebuilt my kernel 2.6.10 inserting some debug
messages
 in the FS sub-system to know what data is coming into struct
 fat_boot_sector *b structure in fs/fat/inode.c file after sb_bread()
 call.

 I believe that this data in the struct fat_boot_sector *b should be
 FAT12 information.

 On the camera formatted SD that is NOT mounting I have found this
 structure to be all '0' till total_sectors variable (relevant till
here
 on - FAT12).

 Will you please verify if there  tell me if the problem is in the
FAT
 sub-system.

Alternatively, you can dump the first block of the device/partition.
From that, you can determine if there is a partition table.  In any
case, you can read the first block of the partition (or whole device)
and get the filesystem parameter block.

It should be easy from there to determine if the data can be
recognized as FAT.

ë Gpø 9€)NO NAMEFAT12   
Uªøÿøÿ

RE: The Linux FAT issue on SD Cards.. maintainer support please

2005-08-12 Thread Mukund JB.

Dear Lennart,

Thanks for the immediate reply.
Please see inline comments.

If you don't at least read the partition table to find where the first
partition starts, then you won't know where to start looking for a FAT
filesystem.

When I said mount, I guess FAT will read sector 0 to get the partition
info. And is it due to lack of partition support in the driver that will
affect the FAT layer reading the device.
Please update?

 Is it why I am NOT able to mount the CAM formatted device?
 Is this a problem?

Well in the past I have seen cards that had a partition table, with one
partition in it (usually either primary partition 1 or 4) and had that
partition formated with FAT12, 16 or 32 (depending on size).  

Yes, right, my card size if 16 MB. FS type is FAT12.

 Some had no partitions, and just had the whole device formated with
FATlike a floppy.  Windows seems to deal with both, as does linux
(as long as   you ask it to mount the right device such as /dev/sda1
sda4 or sda  depending on which partition (if any) the card
uses.

The SD card has partitions on it (both: cam, windows).
So, my device node accessing is direct. 
You can see below the SD card has a single primary partition.

So, I say mount -tvfat /dev/tfa0 /mnt which works for windows
formatted SD.
The same does NOT work with CAM formatted SD.

Sfdisk -l /dev/tfa0 ( CAM  win)
Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End   #cyls#blocks   Id  System
/dev/tfa0p1   *  0+449 450- 14371+   1  FAT12
/dev/tfa0p2  0   -   0  00  Empty
/dev/tfa0p3  0   -   0  00  Empty
/dev/tfa0p4  0   -   0  00  Empty
Warning: partition 1 extends past end of disk

I don't understand, what is /dev/tfa0p1? I have no such device.

If you ignore partitions entirely, many cards will not work for you
since they do have partitions on them.  Some will work if they use the
entire device without partitions like a floppy would.

Will you please elaborate this?
What kind of partition support is required in the driver to support the
Camera Fat12 formatted SD Card?

I dumped the 1st sector of SD when formatted on CAM.
I have attached the files. Please have a look at them

Cluster-0.txt - First 16 Blocks of the device
Phy-Cam-57-sector.txt - 57th sector of the device (claimed FAT
sector
in Partition table)

Regards,
Mukund Jampala



And the minfo of the partition:
device information:
===
filename=/dev/sde1
sectors per track: 32
heads: 2
cylinders: 450

mformat command line: mformat -t 450 -h 2 -s 32 -H 57 c:

bootsector information
==
banner:PwrShot 
sector size: 512 bytes
cluster size: 32 sectors
reserved (boot) sectors: 1
fats: 2
max available root directory slots: 512
small size: 28743 sectors
media descriptor byte: 0xf8
sectors per fat: 3
sectors per track: 32
heads: 2
hidden sectors: 57
big size: 0 sectors
physical drive id: 0x80
reserved=0x0
dos4=0x29
serial number: 6F68CF4E
disk label=CANON_DC   
disk type=FAT12   

Len Sorensen
€`Á9GpUªë Gpø 9€)NO NAMEFAT12   

The Linux FAT issue on SD Cards.. maintainer support please

2005-08-10 Thread Mukund JB.
Dear all,

I am Linux driver programmer. 

I have a FAT12 issue on my SD cards. I have got these addresses from the
fs-lists as the maintainer support mail IDs for FAT-FS.

I am using the 2.6.10 kernel, X86 like systems.

I am NOT able to mount the Camera formatted FAT12 filesystem on my linux
BOX. SD card is of size 16MB. At the same time I am able to mount the SD
cards formatted in windows & linux.

I have identified fat_fill_super() in fs/fat/inode.c file as the
function that reads the super block of as MS-DOS FS.

To debug, I have rebuilt my kernel 2.6.10 inserting some debug messages
in the FS sub-system to know what data is coming into "struct
fat_boot_sector *b" structure in fs/fat/inode.c file after sb_bread()
call.

I believe that this data in the "struct fat_boot_sector *b" should be
FAT12 information.

On the camera formatted SD that is NOT mounting I have found this
structure to be all '0' till total_sectors variable (relevant till here
on - FAT12).

Will you please verify if there & tell me if the problem is in the FAT
sub-system.

Regards,
Mukund Jampala

 

 

 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


The Linux FAT issue on SD Cards.. maintainer support please

2005-08-10 Thread Mukund JB.
Dear all,

I am Linux driver programmer. 

I have a FAT12 issue on my SD cards. I have got these addresses from the
fs-lists as the maintainer support mail IDs for FAT-FS.

I am using the 2.6.10 kernel, X86 like systems.

I am NOT able to mount the Camera formatted FAT12 filesystem on my linux
BOX. SD card is of size 16MB. At the same time I am able to mount the SD
cards formatted in windows  linux.

I have identified fat_fill_super() in fs/fat/inode.c file as the
function that reads the super block of as MS-DOS FS.

To debug, I have rebuilt my kernel 2.6.10 inserting some debug messages
in the FS sub-system to know what data is coming into struct
fat_boot_sector *b structure in fs/fat/inode.c file after sb_bread()
call.

I believe that this data in the struct fat_boot_sector *b should be
FAT12 information.

On the camera formatted SD that is NOT mounting I have found this
structure to be all '0' till total_sectors variable (relevant till here
on - FAT12).

Will you please verify if there  tell me if the problem is in the FAT
sub-system.

Regards,
Mukund Jampala

 

 

 


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Unable to mount the SD card formatted using the DIGITAL CAMREA on Linux box

2005-08-09 Thread Mukund JB.
Dear all,

No, the TI PCI 7x21 provides IDE like interface.
However, that is NOT the point here?

I just want to know what could be the problem in mounting a SD card
Formatted in the camera while it is mounting on windows (same HW).

Regards,
Mukund Jampala

>> Execute linux `fdisk` on the device. You may find that the
>> ID byte is wrong.
>>
>> Also, why do you need a special block device driver? The SanDisk
>> and CompacFlash devices should look like IDE drives.
>
>SD usually is secure digital (MMC compatible somewhat I believe).  It
>does not provide IDE unlike CompactFlash.  SD uses a serial interface
if
>I remember correctly.
>
>Len Sorensen



>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel"
in
>the body of a message to [EMAIL PROTECTED]
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: HOW to handle partitions on SD Card in the driver?

2005-08-09 Thread Mukund JB.
Dear Russell,

This driver I am specking about is in the maintenance phase and it is
fully developed.
I am registering it as a BLOCK driver and it works fine.

Do we need to use the interfaces provided in driver/mmc to support the
SD/MMC partition support in the driver?

If so, Can you give a brief note on how to use them?

Give you give me access to a document or some stuff that gives me idea
about rendering partition support on these Block devices.

Thanks & Regards,
Mukund Jampala



>-Original Message-
>From: Russell King [mailto:[EMAIL PROTECTED] On Behalf Of Russell
King
>Sent: Tuesday, August 09, 2005 12:24 AM
>To: Mukund JB.
>Cc: linux-kernel@vger.kernel.org
>Subject: Re: HOW to handle partitions on SD Card in the driver?
>
>On Fri, Aug 05, 2005 at 11:30:43AM +0530, Mukund JB. wrote:
>> I have problem with my new driver that tired to support the
partitions
>> support on SD cards.
>
>Have you thought about using the generic mmc layer in drivers/mmc with
>the SD patches which are available in the -mm kernels?
>
>We don't want two MMC/SD subsystems in the kernel.
>
>--
>Russell King
> Linux kernel2.6 ARM Linux   - http://www.arm.linux.org.uk/
> maintainer of:  2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: HOW to handle partitions on SD Card in the driver?

2005-08-09 Thread Mukund JB.
Dear Russell,

This driver I am specking about is in the maintenance phase and it is
fully developed.
I am registering it as a BLOCK driver and it works fine.

Do we need to use the interfaces provided in driver/mmc to support the
SD/MMC partition support in the driver?

If so, Can you give a brief note on how to use them?

Give you give me access to a document or some stuff that gives me idea
about rendering partition support on these Block devices.

Thanks  Regards,
Mukund Jampala



-Original Message-
From: Russell King [mailto:[EMAIL PROTECTED] On Behalf Of Russell
King
Sent: Tuesday, August 09, 2005 12:24 AM
To: Mukund JB.
Cc: linux-kernel@vger.kernel.org
Subject: Re: HOW to handle partitions on SD Card in the driver?

On Fri, Aug 05, 2005 at 11:30:43AM +0530, Mukund JB. wrote:
 I have problem with my new driver that tired to support the
partitions
 support on SD cards.

Have you thought about using the generic mmc layer in drivers/mmc with
the SD patches which are available in the -mm kernels?

We don't want two MMC/SD subsystems in the kernel.

--
Russell King
 Linux kernel2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Unable to mount the SD card formatted using the DIGITAL CAMREA on Linux box

2005-08-09 Thread Mukund JB.
Dear all,

No, the TI PCI 7x21 provides IDE like interface.
However, that is NOT the point here?

I just want to know what could be the problem in mounting a SD card
Formatted in the camera while it is mounting on windows (same HW).

Regards,
Mukund Jampala

 Execute linux `fdisk` on the device. You may find that the
 ID byte is wrong.

 Also, why do you need a special block device driver? The SanDisk
 and CompacFlash devices should look like IDE drives.

SD usually is secure digital (MMC compatible somewhat I believe).  It
does not provide IDE unlike CompactFlash.  SD uses a serial interface
if
I remember correctly.

Len Sorensen



-
To unsubscribe from this list: send the line unsubscribe linux-kernel
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Unable to mount the SD card formatted using the DIGITAL CAMREA on Linux box

2005-08-08 Thread Mukund JB.

Dear Erik & all,

Sorry for the delay in my latest updates. 
I was required to fix the partition problem first.

I have an update in gathering some partition info about in SD cards
formatted in windows and Camera.

I tried printing data from the ox1BE offset of 0th sector on windows
formatted SD card and Camera formatted SD card.

Please see the details below.

Windows SD_0_Sector details at 0x1BE offset
--

bootable= 111 ( 0x01BE)
beg-chs.heads   = 116   .
beg-chs.sect= 104   .
beg-chs.cylin   = 101   .
sys-type= 114   .
end-chs.heads   = 32.
end-chs.sect= 109   .
end-chs.cylin   = 101   .
start sect  = 778135908 .
n/o sec in part = 1141509631.


Camera SD_0_Sector details at 0x1BE offset
--

bootable= 128
beg-chs.heads   = 1
beg-chs.sect= 26
beg-chs.cylin   = 0
sys-type= 1
end-chs.heads   = 1
end-chs.sect= 96
end-chs.cylin   = 193
start sect  = 57
n/o sec in part = 28743

To the surprise of me, the windows partition table data looks corrupted
and the camera created partition table looks tome meaningful. But,
windows SD card mounts and camera SD card fails to mount.

I am planning to get the FAT12 details from the first partition of
camera starting at sector 57 as you can see in the 'start sect'
variable.

Please help me finding a way to fix this.

Thanks & Regards,
Mukund Jampala


>-Original Message-
>From: Erik Mouw [mailto:[EMAIL PROTECTED]
>Sent: Friday, July 29, 2005 5:56 PM
>To: Srinivas G.
>Cc: [EMAIL PROTECTED]
>Subject: Re: Unable to mount the SD card formatted using the DIGITAL 
>CAMREA on Linux box
>
>(don't write to me personally, I do read the list)
>
>On Fri, Jul 29, 2005 at 04:56:43PM +0530, Srinivas G. wrote:
>> We have developed a Block Device Driver to handle the flash media 
>> devices in Linux 2.6.x kernel. It is working fine. We are able to 
>> mount the SD cards that are formatted on Windows systems, but we 
>> unable mount the cards that are formatted using the DIGITAL CAMERA.
>>
>> We have found one thing that the Windows and Digital Camera both are 
>> formatting the SD cards in FAT12 only. But why we are not able to 
>> mount the SD cards on Linux Box that are formatted using the Digital 
>> Camera.
>
>Probably because the camera and linux disagree about the geometry in 
>CHS (cylinder, head, sector) of the flash device.
>
>Each partition table entry contains the start and end CHS of that 
>partition. However, since a flash device (and also modern hard drives) 
>doesn't have a meaningful geometry value, the same information is also 
>encoded in logical sectors (start and size of the partition).
>
>If the logical information is zero, the kernel falls back onto the CHS 
>information in the partition table and has to assume a certain 
>geometry. If that assumption differs from the assumption of the camera,

>the partition boundaries will be wrong and you will not be able to 
>mount the partition directly. However, you can figure out the start of 
>the partition by hand, and use a loop device to get at the correct 
>offset.
>
>
>Erik
>
>--
>Erik Mouw
>[EMAIL PROTECTED]  [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Unable to mount the SD card formatted using the DIGITAL CAMREA on Linux box

2005-08-08 Thread Mukund JB.

Dear Erik  all,

Sorry for the delay in my latest updates. 
I was required to fix the partition problem first.

I have an update in gathering some partition info about in SD cards
formatted in windows and Camera.

I tried printing data from the ox1BE offset of 0th sector on windows
formatted SD card and Camera formatted SD card.

Please see the details below.

Windows SD_0_Sector details at 0x1BE offset
--

bootable= 111 ( 0x01BE)
beg-chs.heads   = 116   .
beg-chs.sect= 104   .
beg-chs.cylin   = 101   .
sys-type= 114   .
end-chs.heads   = 32.
end-chs.sect= 109   .
end-chs.cylin   = 101   .
start sect  = 778135908 .
n/o sec in part = 1141509631.


Camera SD_0_Sector details at 0x1BE offset
--

bootable= 128
beg-chs.heads   = 1
beg-chs.sect= 26
beg-chs.cylin   = 0
sys-type= 1
end-chs.heads   = 1
end-chs.sect= 96
end-chs.cylin   = 193
start sect  = 57
n/o sec in part = 28743

To the surprise of me, the windows partition table data looks corrupted
and the camera created partition table looks tome meaningful. But,
windows SD card mounts and camera SD card fails to mount.

I am planning to get the FAT12 details from the first partition of
camera starting at sector 57 as you can see in the 'start sect'
variable.

Please help me finding a way to fix this.

Thanks  Regards,
Mukund Jampala


-Original Message-
From: Erik Mouw [mailto:[EMAIL PROTECTED]
Sent: Friday, July 29, 2005 5:56 PM
To: Srinivas G.
Cc: [EMAIL PROTECTED]
Subject: Re: Unable to mount the SD card formatted using the DIGITAL 
CAMREA on Linux box

(don't write to me personally, I do read the list)

On Fri, Jul 29, 2005 at 04:56:43PM +0530, Srinivas G. wrote:
 We have developed a Block Device Driver to handle the flash media 
 devices in Linux 2.6.x kernel. It is working fine. We are able to 
 mount the SD cards that are formatted on Windows systems, but we 
 unable mount the cards that are formatted using the DIGITAL CAMERA.

 We have found one thing that the Windows and Digital Camera both are 
 formatting the SD cards in FAT12 only. But why we are not able to 
 mount the SD cards on Linux Box that are formatted using the Digital 
 Camera.

Probably because the camera and linux disagree about the geometry in 
CHS (cylinder, head, sector) of the flash device.

Each partition table entry contains the start and end CHS of that 
partition. However, since a flash device (and also modern hard drives) 
doesn't have a meaningful geometry value, the same information is also 
encoded in logical sectors (start and size of the partition).

If the logical information is zero, the kernel falls back onto the CHS 
information in the partition table and has to assume a certain 
geometry. If that assumption differs from the assumption of the camera,

the partition boundaries will be wrong and you will not be able to 
mount the partition directly. However, you can figure out the start of 
the partition by hand, and use a loop device to get at the correct 
offset.


Erik

--
Erik Mouw
[EMAIL PROTECTED]  [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


HOW to handle partitions on SD Card in the driver?

2005-08-05 Thread Mukund JB.
Dear all,

I have problem with my new driver that tired to support the partitions
support on SD cards.

My driver supports 4 SD cards at a time. 
The driver works well when there are partitions are disabled. i.e. when
alloc_disk(1); - i.e. no partitions. It absolutely fine.

Right now, I am working on getting the driver up with partitions
supported. After making below changes in the gendisk initialization, I
am able to mount the device in the socket 0 but I am NOT able mount the
devices in the rest of the sockets when partitions are enabled?

Changes made in gendisk code

gDisk->gd = alloc_disk(4); /* 3 -> 3 partitions */
gDisk->gd->first_minor = (iSock * 4);

i.e. iSock = device no [0-3] ( 4 devices)

Physical nodes creation


To support partitions on device 0
- 

mknod /dev/tfa0 b 252 0 ; mknod /dev/tfa1 b 252 1
mknod /dev/tfa2 b 252 2 ; mknod /dev/tfa3 b 252 3

To support partitions on device 1
-

mknod /dev/tfa4 b 252 4 ; mknod /dev/tfa5 b 252 5
mknod /dev/tfa6 b 252 6 ; mknod /dev/tfa7 b 252 7

To support partitions on device 2
-

mknod /dev/tfa8 b 252 8 ; mknod /dev/tfa9 b 252 9
mknod /dev/tfa10 b 252 10 ; mknod /dev/tfa11 b 252 11

To support partitions on device 3
-

mknod /dev/tfa12 b 252 12 ; mknod /dev/tfa13 b 252 13
mknod /dev/tfa14 b 252 14 ; mknod /dev/tfa15 b 252 15


With these physical nodes, I thought I am through & it should work.
When a card is inserted in the socket 0, I am able to mount.
#mount /dev/tfa0 /mnt (works fine & mounts)

BUT, when a card is inserted in the socket 3, I am NOT able to mount.
#mount /dev/tfa12 /mnt
Mount: /dev/tfa12 is not a valid block device

 
However, 
I am in bit confusion whether the above mentioned changes to the gendisk
code will suffice to my partition requirement or NOT?

This gendisk is invoked at on every socket initialization i.e. when card
is inserted.

Can anyone convey me where exactly I am missing or why is it failing?
Any suggestion will be greatly helpful?

Thanks & Regards,
Mukund Jampala


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


HOW to handle partitions on SD Card in the driver?

2005-08-05 Thread Mukund JB.
Dear all,

I have problem with my new driver that tired to support the partitions
support on SD cards.

My driver supports 4 SD cards at a time. 
The driver works well when there are partitions are disabled. i.e. when
alloc_disk(1); - i.e. no partitions. It absolutely fine.

Right now, I am working on getting the driver up with partitions
supported. After making below changes in the gendisk initialization, I
am able to mount the device in the socket 0 but I am NOT able mount the
devices in the rest of the sockets when partitions are enabled?

Changes made in gendisk code

gDisk-gd = alloc_disk(4); /* 3 - 3 partitions */
gDisk-gd-first_minor = (iSock * 4);

i.e. iSock = device no [0-3] ( 4 devices)

Physical nodes creation


To support partitions on device 0
- 

mknod /dev/tfa0 b 252 0 ; mknod /dev/tfa1 b 252 1
mknod /dev/tfa2 b 252 2 ; mknod /dev/tfa3 b 252 3

To support partitions on device 1
-

mknod /dev/tfa4 b 252 4 ; mknod /dev/tfa5 b 252 5
mknod /dev/tfa6 b 252 6 ; mknod /dev/tfa7 b 252 7

To support partitions on device 2
-

mknod /dev/tfa8 b 252 8 ; mknod /dev/tfa9 b 252 9
mknod /dev/tfa10 b 252 10 ; mknod /dev/tfa11 b 252 11

To support partitions on device 3
-

mknod /dev/tfa12 b 252 12 ; mknod /dev/tfa13 b 252 13
mknod /dev/tfa14 b 252 14 ; mknod /dev/tfa15 b 252 15


With these physical nodes, I thought I am through  it should work.
When a card is inserted in the socket 0, I am able to mount.
#mount /dev/tfa0 /mnt (works fine  mounts)

BUT, when a card is inserted in the socket 3, I am NOT able to mount.
#mount /dev/tfa12 /mnt
Mount: /dev/tfa12 is not a valid block device

 
However, 
I am in bit confusion whether the above mentioned changes to the gendisk
code will suffice to my partition requirement or NOT?

This gendisk is invoked at on every socket initialization i.e. when card
is inserted.

Can anyone convey me where exactly I am missing or why is it failing?
Any suggestion will be greatly helpful?

Thanks  Regards,
Mukund Jampala


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: 2.6 partition support driver methods

2005-08-04 Thread Mukund JB.
Dear Corbet,

After loading my module that is partitioned supported & having defined a
single FAT partition with 

#mkfs -tvfat /dev/tfa0

sfdisk show the disk info as follows.
# sfdisk -l /dev/taf0 

Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End   #cyls#blocks   Id  System
/dev/tfa0p1  0   -   0  00  Empty
/dev/tfa0p2  0   -   0  00  Empty
/dev/tfa0p3  0   -   0  00  Empty
/dev/tfa0p4  0   -   0  00  Empty

Dear Corbet,
Here are the details u might be interested in.
I have explained my physical node creation logic below.

#Cat/proc/partitions
major minor  #blocks  name

   3 0   78184008 hda
   3 16144831 hda1
   3 2   10241437 hda2
   3 31285200 hda3
   3 4  1 hda4
   3 5   10241406 hda5
 252 0  14336 tfa0

Can you just please explain me what can infer from the cat
/proc/partitions?
Do we expect all the 4 partitions to be show here?

My node creation method is simple

Kern code
-
gDisk->gd = alloc_disk(4); /* 3 -> 3 partitions */
gDisk->gd->first_minor = (iSock * 4);

i.e. iSock = device no [0-3] ( 4 devices)


Physical nodes design
-

To support partitions on device 0
- 
mknod /dev/tfa0 b 252 0
mknod /dev/tfa1 b 252 1
mknod /dev/tfa2 b 252 2
mknod /dev/tfa3 b 252 3

To support partitions on device 1
-
mknod /dev/tfa4 b 252 4
mknod /dev/tfa5 b 252 5
mknod /dev/tfa6 b 252 6
mknod /dev/tfa7 b 252 7

To support partitions on device 2
-
mknod /dev/tfa8 b 252 8
mknod /dev/tfa9 b 252 9
mknod /dev/tfa10 b 252 10
mknod /dev/tfa11 b 252 11

To support partitions on device 3
-
mknod /dev/tfa12 b 252 12
mknod /dev/tfa13 b 252 13
mknod /dev/tfa14 b 252 14
mknod /dev/tfa15 b 252 15


Thanks & Regards,
Mukund Jampala



>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 04, 2005 8:09 PM
>To: Mukund JB.
>Cc: linux-kernel@vger.kernel.org
>Subject: Re: 2.6 partition support driver methods
>
>Mukund JB. <[EMAIL PROTECTED]> wrote:
>
>> BUT, when a card is inserted in the socket 3, I am NOT able to mount
and
>> it says.
>> Mount: /dev/tfa12 is not a valid block device
>>
>> Can you convey me where exactly I am missing or why is it failing?
>
>First step would be to look in /proc/partitions (and the system
logfile)
>to get an idea of what the kernel thinks is there.  When you call
>add_disk(), the kernel should emit some messages noting the partitions
>that it sees.  My guess is a mismatch of minor numbers between your
>device nodes and what the kernel sees (it's hard for me to make
complete
>sense out of your minor number logic), but I could be wrong.
>
>jon
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: 2.6 partition support driver methods

2005-08-04 Thread Mukund JB.
Dear corbet,

Here is the over idea about the driver status.
My driver supports 4 SD cards at a time. 
The driver works well when there are partitions are disabled.
i.e. when alloc_disk(1); - i.e. no partitions

Right now, I am working on getting the driver up with partitions
supported.
After making changes in the gendisk initialization, I am able to mount
the device in the socket 0 but I am NOT able mount the devices in the
rest of the sockets when partitions are enabled?

Also, there is nothing specific that I am implementing for partition IO
request support on the devices.

However, 
I am in bit confusion whether the following gendisk will suffice the
requirement or NOT?

Will u please verify the gendisk code below?
Here is how I am initializing the gendisk in my driver.

--gendisk impl 

gDisk->blkqueue = blk_init_queue(do_request, >qlock);
if(gDisk->blkqueue == NULL) {
printk("FM ERROR | Queue Initialization failed!\n");
return FAILURE;
}

/* set sector size */
blk_queue_hardsect_size(gDisk->blkqueue, DEV_SECT_SIZE);

/* add gendisk: partitioning support */
gDisk->gd = alloc_disk(4); /* 3 -> 3 partitions */
if(! gDisk->gd) {
printk("FM ERROR | alloc_disk failed!\n");
return FAILURE;
}
gDisk->gd->major = major_num;
gDisk->gd->first_minor = (int_of(Dev->dName[2]) *
MAX_NUM_SOCKETS) +
(iSock * 4);
gDisk->gd->fops = _op;
gDisk->gd->private_data = Dev;

for(i=0;i<3;i++)
devName[i] = Dev->dName[i];
devName[i] = char_of(iSock);
devName[i+1] = '\0';
strcpy(gDisk->gd->disk_name, devName);
PRINTK("Device Name under /dev/ = %s\n", devName);

/* removable media */
gDisk->gd->flags |= GENHD_FL_REMOVABLE;

set_capacity(gDisk->gd,
((dSize * 1024)/DEV_SECT_SIZE) *
(DEV_SECT_SIZE/KRNL_SECT_SIZE));

gDisk->gd->queue = gDisk->blkqueue;

add_disk(gDisk->gd);
--gendisk impl ENDS 

This gendisk is invoked at socket initialization.

For example, phy devices are 
/dev/tfa0 - 3:  socket 1
/dev/tfa4 - 7:  socket 2
/dev/tfa8 - 11: socket 3
/dev/tfa12 -15: socket 4

i.e, I have created the nodes like minors 0, 1, 2, 3 for socket0
I have created the nodes like minors 12, 13, 14, 15 for socket3.

With these physical nodes, I through it should work.
When a card is inserted in the socket 0, I am able to mount.

BUT, when a card is inserted in the socket 3, I am NOT able to mount and
it says.
Mount: /dev/tfa12 is not a valid block device

Can you convey me where exactly I am missing or why is it failing?

Regards,
Mukund Jampala


>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 04, 2005 12:35 AM
>To: Mukund JB.
>Cc: linux-kernel@vger.kernel.org
>Subject: Re: 2.6 partition support driver methods
>
>> Do I need to handle any thing in the request function to handle
>> read/writes to the device partitions?
>
>It looks like you've done most of what you need; in 2.6, block drivers
>need not worry about the details of partitioning.
>
>Lots of details in the block drivers chapter of LDD3 if you need them:
>
>   http://lwn.net/Kernel/LDD3/
>
>jon
>
>Jonathan Corbet
>Executive editor, LWN.net
>[EMAIL PROTECTED]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: 2.6 partition support driver methods

2005-08-04 Thread Mukund JB.
Dear corbet,

Here is the over idea about the driver status.
My driver supports 4 SD cards at a time. 
The driver works well when there are partitions are disabled.
i.e. when alloc_disk(1); - i.e. no partitions

Right now, I am working on getting the driver up with partitions
supported.
After making changes in the gendisk initialization, I am able to mount
the device in the socket 0 but I am NOT able mount the devices in the
rest of the sockets when partitions are enabled?

Also, there is nothing specific that I am implementing for partition IO
request support on the devices.

However, 
I am in bit confusion whether the following gendisk will suffice the
requirement or NOT?

Will u please verify the gendisk code below?
Here is how I am initializing the gendisk in my driver.

--gendisk impl 

gDisk-blkqueue = blk_init_queue(do_request, gDisk-qlock);
if(gDisk-blkqueue == NULL) {
printk(FM ERROR | Queue Initialization failed!\n);
return FAILURE;
}

/* set sector size */
blk_queue_hardsect_size(gDisk-blkqueue, DEV_SECT_SIZE);

/* add gendisk: partitioning support */
gDisk-gd = alloc_disk(4); /* 3 - 3 partitions */
if(! gDisk-gd) {
printk(FM ERROR | alloc_disk failed!\n);
return FAILURE;
}
gDisk-gd-major = major_num;
gDisk-gd-first_minor = (int_of(Dev-dName[2]) *
MAX_NUM_SOCKETS) +
(iSock * 4);
gDisk-gd-fops = bd_op;
gDisk-gd-private_data = Dev;

for(i=0;i3;i++)
devName[i] = Dev-dName[i];
devName[i] = char_of(iSock);
devName[i+1] = '\0';
strcpy(gDisk-gd-disk_name, devName);
PRINTK(Device Name under /dev/ = %s\n, devName);

/* removable media */
gDisk-gd-flags |= GENHD_FL_REMOVABLE;

set_capacity(gDisk-gd,
((dSize * 1024)/DEV_SECT_SIZE) *
(DEV_SECT_SIZE/KRNL_SECT_SIZE));

gDisk-gd-queue = gDisk-blkqueue;

add_disk(gDisk-gd);
--gendisk impl ENDS 

This gendisk is invoked at socket initialization.

For example, phy devices are 
/dev/tfa0 - 3:  socket 1
/dev/tfa4 - 7:  socket 2
/dev/tfa8 - 11: socket 3
/dev/tfa12 -15: socket 4

i.e, I have created the nodes like minors 0, 1, 2, 3 for socket0
I have created the nodes like minors 12, 13, 14, 15 for socket3.

With these physical nodes, I through it should work.
When a card is inserted in the socket 0, I am able to mount.

BUT, when a card is inserted in the socket 3, I am NOT able to mount and
it says.
Mount: /dev/tfa12 is not a valid block device

Can you convey me where exactly I am missing or why is it failing?

Regards,
Mukund Jampala


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 04, 2005 12:35 AM
To: Mukund JB.
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6 partition support driver methods

 Do I need to handle any thing in the request function to handle
 read/writes to the device partitions?

It looks like you've done most of what you need; in 2.6, block drivers
need not worry about the details of partitioning.

Lots of details in the block drivers chapter of LDD3 if you need them:

   http://lwn.net/Kernel/LDD3/

jon

Jonathan Corbet
Executive editor, LWN.net
[EMAIL PROTECTED]

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: 2.6 partition support driver methods

2005-08-04 Thread Mukund JB.
Dear Corbet,

After loading my module that is partitioned supported  having defined a
single FAT partition with 

#mkfs -tvfat /dev/tfa0

sfdisk show the disk info as follows.
# sfdisk -l /dev/taf0 

Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End   #cyls#blocks   Id  System
/dev/tfa0p1  0   -   0  00  Empty
/dev/tfa0p2  0   -   0  00  Empty
/dev/tfa0p3  0   -   0  00  Empty
/dev/tfa0p4  0   -   0  00  Empty

Dear Corbet,
Here are the details u might be interested in.
I have explained my physical node creation logic below.

#Cat/proc/partitions
major minor  #blocks  name

   3 0   78184008 hda
   3 16144831 hda1
   3 2   10241437 hda2
   3 31285200 hda3
   3 4  1 hda4
   3 5   10241406 hda5
 252 0  14336 tfa0

Can you just please explain me what can infer from the cat
/proc/partitions?
Do we expect all the 4 partitions to be show here?

My node creation method is simple

Kern code
-
gDisk-gd = alloc_disk(4); /* 3 - 3 partitions */
gDisk-gd-first_minor = (iSock * 4);

i.e. iSock = device no [0-3] ( 4 devices)


Physical nodes design
-

To support partitions on device 0
- 
mknod /dev/tfa0 b 252 0
mknod /dev/tfa1 b 252 1
mknod /dev/tfa2 b 252 2
mknod /dev/tfa3 b 252 3

To support partitions on device 1
-
mknod /dev/tfa4 b 252 4
mknod /dev/tfa5 b 252 5
mknod /dev/tfa6 b 252 6
mknod /dev/tfa7 b 252 7

To support partitions on device 2
-
mknod /dev/tfa8 b 252 8
mknod /dev/tfa9 b 252 9
mknod /dev/tfa10 b 252 10
mknod /dev/tfa11 b 252 11

To support partitions on device 3
-
mknod /dev/tfa12 b 252 12
mknod /dev/tfa13 b 252 13
mknod /dev/tfa14 b 252 14
mknod /dev/tfa15 b 252 15


Thanks  Regards,
Mukund Jampala



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 04, 2005 8:09 PM
To: Mukund JB.
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6 partition support driver methods

Mukund JB. [EMAIL PROTECTED] wrote:

 BUT, when a card is inserted in the socket 3, I am NOT able to mount
and
 it says.
 Mount: /dev/tfa12 is not a valid block device

 Can you convey me where exactly I am missing or why is it failing?

First step would be to look in /proc/partitions (and the system
logfile)
to get an idea of what the kernel thinks is there.  When you call
add_disk(), the kernel should emit some messages noting the partitions
that it sees.  My guess is a mismatch of minor numbers between your
device nodes and what the kernel sees (it's hard for me to make
complete
sense out of your minor number logic), but I could be wrong.

jon
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


2.6 partition support driver methods

2005-08-03 Thread Mukund JB.
Dear all,

I have a driver implemented to support single partition in 2.6 kernels.
I have a requirement of supporting multiple partitions in my block driver to 
support flash media devices.
I have modified the alloc_disk(1) to alloc_dosk(16) to support a MAX of 16 
partitions. This way I have conveyed it to the kernel that 16 is my max n/o 
partitions. I also made a call to add_disk().

Do I need to handle any thing in the request function to handle read/writes to 
the device partitions?
Please suggest me the required implementation that I may be missing?

Regards,
Mukund Jampala
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


2.6 partition support driver methods

2005-08-03 Thread Mukund JB.
Dear all,

I have a driver implemented to support single partition in 2.6 kernels.
I have a requirement of supporting multiple partitions in my block driver to 
support flash media devices.
I have modified the alloc_disk(1) to alloc_dosk(16) to support a MAX of 16 
partitions. This way I have conveyed it to the kernel that 16 is my max n/o 
partitions. I also made a call to add_disk().

Do I need to handle any thing in the request function to handle read/writes to 
the device partitions?
Please suggest me the required implementation that I may be missing?

Regards,
Mukund Jampala
 

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Unable to mount the SD card formatted using the DIGITAL CAMREA on Linux box

2005-07-29 Thread Mukund JB.

Dear Lennart, Dick Johnson, Erik Mouw & All,

Thanks for all ur precious support. 

The cannon camera (other devices too) formatted SD is indeed a partition
FAT12. When I said 
sfdisk -l, it showed the fs ID as 1. 1 is indeed the FAT12 fs ID.

Attached are the logs for win and camera device sfdisk -Vl /dev/tfa0.

The SD card formatted in camera is partitioned FAT12 disk.
Also, the SD card formatted in windows is partitioned FAT12 disk.
(see the attachment)

on ur suggestion I verified whether camera partition device has a valid
FS ID. I verified. It is FAT12. It is the same for windows 
formatted device. The FS ID of both the formats is 1. i.e. FAT12.

I has notion that my driver is not supporting partition devices. This
makes this clean that my driver is supporting the partition devices
(windows formatted SD). If both are partitioned where is the difference?


So, can someone please help me telling what else could be missing that
is creating this problem?

Regards,
Mukund Jampala


>-Original Message-
>From: [EMAIL PROTECTED] [mailto:linux-kernel-
>[EMAIL PROTECTED] On Behalf Of Lennart Sorensen
>Sent: Friday, July 29, 2005 7:08 PM
>To: linux-os (Dick Johnson)
>Cc: Srinivas G.; linux-kernel-Mailing-list
>Subject: Re: Unable to mount the SD card formatted using the DIGITAL
CAMREA
>on Linux box
>
>On Fri, Jul 29, 2005 at 08:02:14AM -0400, linux-os (Dick Johnson)
wrote:
>> Execute linux `fdisk` on the device. You may find that the
>> ID byte is wrong.
>>
>> Also, why do you need a special block device driver? The SanDisk
>> and CompacFlash devices should look like IDE drives.
>
>SD usually is secure digital (MMC compatible somewhat I believe).  It
>does not provide IDE unlike CompactFlash.  SD uses a serial interface
if
>I remember correctly.
>
>Len Sorensen
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel"
in
>the body of a message to [EMAIL PROTECTED]
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

camera formatted info
--
Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End   #cyls#blocks   Id  System
/dev/tfa0p1   *  0+449 450- 14371+   1  FAT12
/dev/tfa0p2  0   -   0  00  Empty
/dev/tfa0p3  0   -   0  00  Empty
/dev/tfa0p4  0   -   0  00  Empty
Warning: partition 1 extends past end of disk

Windows formatted info
--
Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End   #cyls#blocks   Id  System
/dev/tfa0p1   *  0+449 450- 14371+   1  FAT12
/dev/tfa0p2  0   -   0  00  Empty
/dev/tfa0p3  0   -   0  00  Empty
/dev/tfa0p4  0   -   0  00  Empty
Warning: partition 1 extends past end of disk


RE: Unable to mount the SD card formatted using the DIGITAL CAMREA on Linux box

2005-07-29 Thread Mukund JB.

Dear Lennart, Dick Johnson, Erik Mouw  All,

Thanks for all ur precious support. 

The cannon camera (other devices too) formatted SD is indeed a partition
FAT12. When I said 
sfdisk -l, it showed the fs ID as 1. 1 is indeed the FAT12 fs ID.

Attached are the logs for win and camera device sfdisk -Vl /dev/tfa0.

The SD card formatted in camera is partitioned FAT12 disk.
Also, the SD card formatted in windows is partitioned FAT12 disk.
(see the attachment)

on ur suggestion I verified whether camera partition device has a valid
FS ID. I verified. It is FAT12. It is the same for windows 
formatted device. The FS ID of both the formats is 1. i.e. FAT12.

I has notion that my driver is not supporting partition devices. This
makes this clean that my driver is supporting the partition devices
(windows formatted SD). If both are partitioned where is the difference?


So, can someone please help me telling what else could be missing that
is creating this problem?

Regards,
Mukund Jampala


-Original Message-
From: [EMAIL PROTECTED] [mailto:linux-kernel-
[EMAIL PROTECTED] On Behalf Of Lennart Sorensen
Sent: Friday, July 29, 2005 7:08 PM
To: linux-os (Dick Johnson)
Cc: Srinivas G.; linux-kernel-Mailing-list
Subject: Re: Unable to mount the SD card formatted using the DIGITAL
CAMREA
on Linux box

On Fri, Jul 29, 2005 at 08:02:14AM -0400, linux-os (Dick Johnson)
wrote:
 Execute linux `fdisk` on the device. You may find that the
 ID byte is wrong.

 Also, why do you need a special block device driver? The SanDisk
 and CompacFlash devices should look like IDE drives.

SD usually is secure digital (MMC compatible somewhat I believe).  It
does not provide IDE unlike CompactFlash.  SD uses a serial interface
if
I remember correctly.

Len Sorensen
-
To unsubscribe from this list: send the line unsubscribe linux-kernel
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

camera formatted info
--
Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End   #cyls#blocks   Id  System
/dev/tfa0p1   *  0+449 450- 14371+   1  FAT12
/dev/tfa0p2  0   -   0  00  Empty
/dev/tfa0p3  0   -   0  00  Empty
/dev/tfa0p4  0   -   0  00  Empty
Warning: partition 1 extends past end of disk

Windows formatted info
--
Disk /dev/tfa0: 448 cylinders, 2 heads, 32 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End   #cyls#blocks   Id  System
/dev/tfa0p1   *  0+449 450- 14371+   1  FAT12
/dev/tfa0p2  0   -   0  00  Empty
/dev/tfa0p3  0   -   0  00  Empty
/dev/tfa0p4  0   -   0  00  Empty
Warning: partition 1 extends past end of disk


2.6 kernel timespec nano sec howto

2005-07-21 Thread Mukund JB.
Dear all,

I have timing issue in my code powering up my socket device.
I want use the current_kernel_time() and wait in terms of nano seconds.
The tv_nsec (nano) of timespec structure will be overflowing every
second.
So, how do I handle it?

Regards,
Mukund Jampala
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



2.6 kernel timespec nano sec howto

2005-07-21 Thread Mukund JB.
Dear all,

I have timing issue in my code powering up my socket device.
I want use the current_kernel_time() and wait in terms of nano seconds.
The tv_nsec (nano) of timespec structure will be overflowing every
second.
So, how do I handle it?

Regards,
Mukund Jampala
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



RE: FC3 module sys_print how...

2005-07-18 Thread Mukund JB.
Dear Richard,

I have tried your module to print message to the file in the kernel
level.
I am able to get it work till the initialization level. Later when I
insert the card the system hangs.

Please suggest me what could be the problem. Or is there a way to get
all my LOG messages perfectly even when the system hangs after the
reboot.

Waiting for ur suggestions.

Regards,
Mukund Jampala

>-Original Message-
>From: Richard B. Johnson [mailto:[EMAIL PROTECTED]
>Sent: Friday, July 15, 2005 11:18 PM
>To: Mukund JB.
>Cc: Linux kernel
>Subject: Re: FC3 module sys_print how...
>
>
>Third try...
>
>On Fri, 15 Jul 2005, Richard B. Johnson wrote:
>
>>
>> Second try.
>>
>> On Fri, 15 Jul 2005, Richard B. Johnson wrote:
>>
>>>
>>> It's no longer exported. You can either modify your kernel to
>>> export it or you can use that attached work-around to extract
>>> the symbol offset from /boot/System.map.
>>>
>>> Please note that manipulating files from within a module has
>>> never been supported. It just "sort of" works sometimes. In
>>> your demo code, it will work because the process-context that
>>> obtains the file-handle is the process that is running 'insmod'.
>>> If somebody else tried to write to that file after the module
>>> was installed, all bets are off. I strongly suggest that
>>> you provide hooks in your module (ioctl() or mmap(), etc) that
>>> a user-mode helper program can use to send or receive file-data
>>> from your module.
>>>
>>>
>>> On Fri, 15 Jul 2005, Mukund JB. wrote:
>>>>
>>>>
>>>> Dear Linux-lovers.
>>>>
>>>>
>>>>
>>>> I am trying to build a 2.6.10 linux kernel module to print messages
to
>a
>>>> file. I have done this 2.4 and I was successful but I am failing
here.
>>>>
>>>>
>>>>
>>>> I am using the sys_open, sys_write calls to do so.
>>>>
>>>> I am getting a compilation warning and I find no .ko file created
>>>> finally instead I find an .o.ko file.
>>>>
>>>>
>>>>
>>>> *** WARNIG: "sys_write" [/home/cf.o.ko] undefined!
>>>>
>>>> Below is the module code. Please suggest me what could be the
problem:-
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> #include 
>>>>
>>>> #include 
>>>>
>>>> #include 
>>>>
>>>> #include /* for O_WRONLY */
>>>>
>>>> #include/* for sys_ functions */
>>>>
>>>> #include   /* for set_fs(), get_fs() etc. */
>>>>
>>>> #include  /* for string length */
>>>>
>>>> #include/* for kmalloc */
>>>>
>>>>
>>>>
>>>> MODULE_LICENSE("GPL");
>>>>
>>>> /*
>>>>
>>>> #define DBG
>>>>
>>>> #define PRINTK(fmt,arg...) printk("DBG INFO <%s> | "
>>>> fmt,__FUNCTION__,##arg)
>>>>
>>>> #else
>>>>
>>>> #define PRINTK(fmt,arg...) while(0)
>>>>
>>>> #endif
>>>>
>>>> */
>>>>
>>>>
>>>>
>>>> typedef struct tagWRITE_TEST
>>>>
>>>> {
>>>>
>>>>  unsigned long fd;
>>>>
>>>>  unsigned long x;
>>>>
>>>>
>>>>
>>>> }WRITE_TEST, *PWRITE_TEST;
>>>>
>>>>
>>>>
>>>> PWRITE_TEST ptest;
>>>>
>>>>
>>>>
>>>> void SysPrint(char * pString, ...)
>>>>
>>>> {
>>>>
>>>>  static char buff[1024];
>>>>
>>>>  va_list ap;
>>>>
>>>>
>>>>
>>>>  va_start(ap,pString);
>>>>
>>>>  vsprintf((char *)buff, pString, ap);
>>>>
>>>>  va_end(ap);
>>>>
>>>>
>>>>
>>>>  sys_write(ptest->fd,(char *)buff,(size_t)strlen(buff));
>>>>
>>>> }
>>>>
>>>>
>>>>
>>>> int init_module(void)
>>>>
>>>> {
>>>>
>>>>
>>>>
>>>>  printk("<%s> invoked!\n",__FUNCTION__);
>>>&g

RE: FC3 module sys_print how...

2005-07-18 Thread Mukund JB.
Dear Richard,

I have tried your module to print message to the file in the kernel
level.
I am able to get it work till the initialization level. Later when I
insert the card the system hangs.

Please suggest me what could be the problem. Or is there a way to get
all my LOG messages perfectly even when the system hangs after the
reboot.

Waiting for ur suggestions.

Regards,
Mukund Jampala

-Original Message-
From: Richard B. Johnson [mailto:[EMAIL PROTECTED]
Sent: Friday, July 15, 2005 11:18 PM
To: Mukund JB.
Cc: Linux kernel
Subject: Re: FC3 module sys_print how...


Third try...

On Fri, 15 Jul 2005, Richard B. Johnson wrote:


 Second try.

 On Fri, 15 Jul 2005, Richard B. Johnson wrote:


 It's no longer exported. You can either modify your kernel to
 export it or you can use that attached work-around to extract
 the symbol offset from /boot/System.map.

 Please note that manipulating files from within a module has
 never been supported. It just sort of works sometimes. In
 your demo code, it will work because the process-context that
 obtains the file-handle is the process that is running 'insmod'.
 If somebody else tried to write to that file after the module
 was installed, all bets are off. I strongly suggest that
 you provide hooks in your module (ioctl() or mmap(), etc) that
 a user-mode helper program can use to send or receive file-data
 from your module.


 On Fri, 15 Jul 2005, Mukund JB. wrote:


 Dear Linux-lovers.



 I am trying to build a 2.6.10 linux kernel module to print messages
to
a
 file. I have done this 2.4 and I was successful but I am failing
here.



 I am using the sys_open, sys_write calls to do so.

 I am getting a compilation warning and I find no .ko file created
 finally instead I find an .o.ko file.



 *** WARNIG: sys_write [/home/cf.o.ko] undefined!

 Below is the module code. Please suggest me what could be the
problem:-





 #include linux/kernel.h

 #include linux/module.h

 #include linux/moduleparam.h

 #include asm/fcntl.h/* for O_WRONLY */

 #include linux/syscalls.h   /* for sys_ functions */

 #include asm/uaccess.h  /* for set_fs(), get_fs() etc. */

 #include linux/string.h /* for string length */

 #include linux/slab.h   /* for kmalloc */



 MODULE_LICENSE(GPL);

 /*

 #define DBG

 #define PRINTK(fmt,arg...) printk(DBG INFO %s | 
 fmt,__FUNCTION__,##arg)

 #else

 #define PRINTK(fmt,arg...) while(0)

 #endif

 */



 typedef struct tagWRITE_TEST

 {

  unsigned long fd;

  unsigned long x;



 }WRITE_TEST, *PWRITE_TEST;



 PWRITE_TEST ptest;



 void SysPrint(char * pString, ...)

 {

  static char buff[1024];

  va_list ap;



  va_start(ap,pString);

  vsprintf((char *)buff, pString, ap);

  va_end(ap);



  sys_write(ptest-fd,(char *)buff,(size_t)strlen(buff));

 }



 int init_module(void)

 {



  printk(%s invoked!\n,__FUNCTION__);

  printk(File Creation Testing in Kernel Module!\n);



  set_fs(get_ds());



  /* allocate the memory for structre */

  ptest = (PWRITE_TEST)kmalloc(sizeof(WRITE_TEST),GFP_KERNEL);

  if(ptest == NULL)

  {

printk(Structure Memory Allocation Fails!\n);

return -ENOMEM;

  }



  ptest-fd = sys_open(srcdebug.txt, O_CREAT | O_WRONLY, 644);

  if (ptest-fd == 0)

  {

SysPrint(File Creation Error!!!\n);

return 1;

  }



  SysPrint(File Creation Testing in Kernel Module!\n);

  SysPrint(Srinivas Testing the File Creation\n);

  sys_close(ptest-fd);



  return 0;

 }



 void cleanup_module(void)

 {

  printk(Good bye!\n);



  /* free the allocated memory */

  kfree(ptest);

 }



 Regards,

 Mukund jampala




 -
 To unsubscribe from this list: send the line unsubscribe
linux-kernel
in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/


 Cheers,
 Dick Johnson
 Penguin : Linux version 2.6.12 on an i686 machine (5537.79
BogoMips).
 Notice : All mail here is now cached for review by Dictator Bush.
 98.36% of all statistics are fiction.

 Cheers,
 Dick Johnson
 Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
 Notice : All mail here is now cached for review by Dictator Bush.
 98.36% of all statistics are fiction.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
  Notice : All mail here is now cached for review by Dictator Bush.
  98.36% of all statistics are fiction.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: FC3 module sys_print how...

2005-07-16 Thread Mukund JB.
Dear Richard,

Thanks for the copy.
I will try it now.
I know we should not try to open, Read, write files from the kernel
module.
We have problem with our flash media driver hanging at certain
instances.
And when it hangs you know I can't see the /var/log/messages.
After the reboot, I do NOT find the complete set of messages in
/var/log/messages.
When debug messages are exceeding the limits, is there a better solution
than writing to the file.

Regards,
Mukund Jampala

>-Original Message-
>From: Richard B. Johnson [mailto:[EMAIL PROTECTED]
>Sent: Friday, July 15, 2005 6:19 PM
>To: Mukund JB.
>Cc: Linux kernel
>Subject: Re: FC3 module sys_print how...
>
>
>It's no longer exported. You can either modify your kernel to
>export it or you can use that attached work-around to extract
>the symbol offset from /boot/System.map.
>
>Please note that manipulating files from within a module has
>never been supported. It just "sort of" works sometimes. In
>your demo code, it will work because the process-context that
>obtains the file-handle is the process that is running 'insmod'.
>If somebody else tried to write to that file after the module
>was installed, all bets are off. I strongly suggest that
>you provide hooks in your module (ioctl() or mmap(), etc) that
>a user-mode helper program can use to send or receive file-data
>from your module.
>
>
>On Fri, 15 Jul 2005, Mukund JB. wrote:
>>
>>
>> Dear Linux-lovers.
>>
>>
>>
>> I am trying to build a 2.6.10 linux kernel module to print messages
to a
>> file. I have done this 2.4 and I was successful but I am failing
here.
>>
>>
>>
>> I am using the sys_open, sys_write calls to do so.
>>
>> I am getting a compilation warning and I find no .ko file created
>> finally instead I find an .o.ko file.
>>
>>
>>
>> *** WARNIG: "sys_write" [/home/cf.o.ko] undefined!
>>
>> Below is the module code. Please suggest me what could be the
problem:-
>>
>>
>>
>>
>>
>> #include 
>>
>> #include 
>>
>> #include 
>>
>> #include /* for O_WRONLY */
>>
>> #include/* for sys_ functions */
>>
>> #include   /* for set_fs(), get_fs() etc. */
>>
>> #include  /* for string length */
>>
>> #include/* for kmalloc */
>>
>>
>>
>> MODULE_LICENSE("GPL");
>>
>> /*
>>
>> #define DBG
>>
>> #define PRINTK(fmt,arg...) printk("DBG INFO <%s> | "
>> fmt,__FUNCTION__,##arg)
>>
>> #else
>>
>> #define PRINTK(fmt,arg...) while(0)
>>
>> #endif
>>
>> */
>>
>>
>>
>> typedef struct tagWRITE_TEST
>>
>> {
>>
>>  unsigned long fd;
>>
>>  unsigned long x;
>>
>>
>>
>> }WRITE_TEST, *PWRITE_TEST;
>>
>>
>>
>> PWRITE_TEST ptest;
>>
>>
>>
>> void SysPrint(char * pString, ...)
>>
>> {
>>
>>  static char buff[1024];
>>
>>  va_list ap;
>>
>>
>>
>>  va_start(ap,pString);
>>
>>  vsprintf((char *)buff, pString, ap);
>>
>>  va_end(ap);
>>
>>
>>
>>  sys_write(ptest->fd,(char *)buff,(size_t)strlen(buff));
>>
>> }
>>
>>
>>
>> int init_module(void)
>>
>> {
>>
>>
>>
>>  printk("<%s> invoked!\n",__FUNCTION__);
>>
>>  printk("File Creation Testing in Kernel Module!\n");
>>
>>
>>
>>  set_fs(get_ds());
>>
>>
>>
>>  /* allocate the memory for structre */
>>
>>  ptest = (PWRITE_TEST)kmalloc(sizeof(WRITE_TEST),GFP_KERNEL);
>>
>>  if(ptest == NULL)
>>
>>  {
>>
>>printk("Structure Memory Allocation Fails!\n");
>>
>>return -ENOMEM;
>>
>>  }
>>
>>
>>
>>  ptest->fd = sys_open("srcdebug.txt", O_CREAT | O_WRONLY, 644);
>>
>>  if (ptest->fd == 0)
>>
>>  {
>>
>>SysPrint("File Creation Error!!!\n");
>>
>>return 1;
>>
>>  }
>>
>>
>>
>>  SysPrint("File Creation Testing in Kernel Module!\n");
>>
>>  SysPrint("Srinivas Testing the File Creation\n");
>>
>>  sys_close(ptest->fd);
>>
>>
>>
>>  return 0;
>>
>> }
>>
>>
>>
>> void cleanup_module(void)
>>
>> {
>>
>>  printk("Good bye!\n");
>>
>>
>>
>>  /* free the allocated memory */
>>
>>  kfree(ptest);
>>
>> }
>>
>>
>>
>> Regards,
>>
>> Mukund jampala
>>
>>
>>
>>
>> -
>> To unsubscribe from this list: send the line "unsubscribe
linux-kernel"
>in
>> the body of a message to [EMAIL PROTECTED]
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>>
>
>Cheers,
>Dick Johnson
>Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
>  Notice : All mail here is now cached for review by Dictator Bush.
>  98.36% of all statistics are fiction.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: FC3 module sys_print how...

2005-07-16 Thread Mukund JB.
Dear Richard,

Thanks for the copy.
I will try it now.
I know we should not try to open, Read, write files from the kernel
module.
We have problem with our flash media driver hanging at certain
instances.
And when it hangs you know I can't see the /var/log/messages.
After the reboot, I do NOT find the complete set of messages in
/var/log/messages.
When debug messages are exceeding the limits, is there a better solution
than writing to the file.

Regards,
Mukund Jampala

-Original Message-
From: Richard B. Johnson [mailto:[EMAIL PROTECTED]
Sent: Friday, July 15, 2005 6:19 PM
To: Mukund JB.
Cc: Linux kernel
Subject: Re: FC3 module sys_print how...


It's no longer exported. You can either modify your kernel to
export it or you can use that attached work-around to extract
the symbol offset from /boot/System.map.

Please note that manipulating files from within a module has
never been supported. It just sort of works sometimes. In
your demo code, it will work because the process-context that
obtains the file-handle is the process that is running 'insmod'.
If somebody else tried to write to that file after the module
was installed, all bets are off. I strongly suggest that
you provide hooks in your module (ioctl() or mmap(), etc) that
a user-mode helper program can use to send or receive file-data
from your module.


On Fri, 15 Jul 2005, Mukund JB. wrote:


 Dear Linux-lovers.



 I am trying to build a 2.6.10 linux kernel module to print messages
to a
 file. I have done this 2.4 and I was successful but I am failing
here.



 I am using the sys_open, sys_write calls to do so.

 I am getting a compilation warning and I find no .ko file created
 finally instead I find an .o.ko file.



 *** WARNIG: sys_write [/home/cf.o.ko] undefined!

 Below is the module code. Please suggest me what could be the
problem:-





 #include linux/kernel.h

 #include linux/module.h

 #include linux/moduleparam.h

 #include asm/fcntl.h/* for O_WRONLY */

 #include linux/syscalls.h   /* for sys_ functions */

 #include asm/uaccess.h  /* for set_fs(), get_fs() etc. */

 #include linux/string.h /* for string length */

 #include linux/slab.h   /* for kmalloc */



 MODULE_LICENSE(GPL);

 /*

 #define DBG

 #define PRINTK(fmt,arg...) printk(DBG INFO %s | 
 fmt,__FUNCTION__,##arg)

 #else

 #define PRINTK(fmt,arg...) while(0)

 #endif

 */



 typedef struct tagWRITE_TEST

 {

  unsigned long fd;

  unsigned long x;



 }WRITE_TEST, *PWRITE_TEST;



 PWRITE_TEST ptest;



 void SysPrint(char * pString, ...)

 {

  static char buff[1024];

  va_list ap;



  va_start(ap,pString);

  vsprintf((char *)buff, pString, ap);

  va_end(ap);



  sys_write(ptest-fd,(char *)buff,(size_t)strlen(buff));

 }



 int init_module(void)

 {



  printk(%s invoked!\n,__FUNCTION__);

  printk(File Creation Testing in Kernel Module!\n);



  set_fs(get_ds());



  /* allocate the memory for structre */

  ptest = (PWRITE_TEST)kmalloc(sizeof(WRITE_TEST),GFP_KERNEL);

  if(ptest == NULL)

  {

printk(Structure Memory Allocation Fails!\n);

return -ENOMEM;

  }



  ptest-fd = sys_open(srcdebug.txt, O_CREAT | O_WRONLY, 644);

  if (ptest-fd == 0)

  {

SysPrint(File Creation Error!!!\n);

return 1;

  }



  SysPrint(File Creation Testing in Kernel Module!\n);

  SysPrint(Srinivas Testing the File Creation\n);

  sys_close(ptest-fd);



  return 0;

 }



 void cleanup_module(void)

 {

  printk(Good bye!\n);



  /* free the allocated memory */

  kfree(ptest);

 }



 Regards,

 Mukund jampala




 -
 To unsubscribe from this list: send the line unsubscribe
linux-kernel
in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/


Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
  Notice : All mail here is now cached for review by Dictator Bush.
  98.36% of all statistics are fiction.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


FC3 module sys_print how...

2005-07-15 Thread Mukund JB.


Dear Linux-lovers.

 

I am trying to build a 2.6.10 linux kernel module to print messages to a
file. I have done this 2.4 and I was successful but I am failing here.

 

I am using the sys_open, sys_write calls to do so.

I am getting a compilation warning and I find no .ko file created
finally instead I find an .o.ko file.

 

*** WARNIG: "sys_write" [/home/cf.o.ko] undefined!

Below is the module code. Please suggest me what could be the problem:-

 

 

#include 

#include 

#include 

#include /* for O_WRONLY */

#include/* for sys_ functions */

#include   /* for set_fs(), get_fs() etc. */

#include  /* for string length */

#include/* for kmalloc */

 

MODULE_LICENSE("GPL");

/*

#define DBG

#define PRINTK(fmt,arg...) printk("DBG INFO <%s> | "
fmt,__FUNCTION__,##arg)

#else

#define PRINTK(fmt,arg...) while(0)

#endif

*/

 

typedef struct tagWRITE_TEST

{

  unsigned long fd;

  unsigned long x;

  

}WRITE_TEST, *PWRITE_TEST;

 

PWRITE_TEST ptest;

 

void SysPrint(char * pString, ...)

{

  static char buff[1024];

  va_list ap;

 

  va_start(ap,pString);

  vsprintf((char *)buff, pString, ap);

  va_end(ap);

  

  sys_write(ptest->fd,(char *)buff,(size_t)strlen(buff));

}

 

int init_module(void)

{

  

  printk("<%s> invoked!\n",__FUNCTION__);

  printk("File Creation Testing in Kernel Module!\n");

 

  set_fs(get_ds());

  

  /* allocate the memory for structre */

  ptest = (PWRITE_TEST)kmalloc(sizeof(WRITE_TEST),GFP_KERNEL);

  if(ptest == NULL)

  {

printk("Structure Memory Allocation Fails!\n");

return -ENOMEM;

  }

  

  ptest->fd = sys_open("srcdebug.txt", O_CREAT | O_WRONLY, 644);

  if (ptest->fd == 0)

  {

SysPrint("File Creation Error!!!\n");

return 1;

  }

  

  SysPrint("File Creation Testing in Kernel Module!\n");

  SysPrint("Srinivas Testing the File Creation\n");

  sys_close(ptest->fd);

  

  return 0;

}

 

void cleanup_module(void)

{

  printk("Good bye!\n");

 

  /* free the allocated memory */

  kfree(ptest);

}

 

Regards,

Mukund jampala

 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


FC3 module sys_print how...

2005-07-15 Thread Mukund JB.


Dear Linux-lovers.

 

I am trying to build a 2.6.10 linux kernel module to print messages to a
file. I have done this 2.4 and I was successful but I am failing here.

 

I am using the sys_open, sys_write calls to do so.

I am getting a compilation warning and I find no .ko file created
finally instead I find an .o.ko file.

 

*** WARNIG: sys_write [/home/cf.o.ko] undefined!

Below is the module code. Please suggest me what could be the problem:-

 

 

#include linux/kernel.h

#include linux/module.h

#include linux/moduleparam.h

#include asm/fcntl.h/* for O_WRONLY */

#include linux/syscalls.h   /* for sys_ functions */

#include asm/uaccess.h  /* for set_fs(), get_fs() etc. */

#include linux/string.h /* for string length */

#include linux/slab.h   /* for kmalloc */

 

MODULE_LICENSE(GPL);

/*

#define DBG

#define PRINTK(fmt,arg...) printk(DBG INFO %s | 
fmt,__FUNCTION__,##arg)

#else

#define PRINTK(fmt,arg...) while(0)

#endif

*/

 

typedef struct tagWRITE_TEST

{

  unsigned long fd;

  unsigned long x;

  

}WRITE_TEST, *PWRITE_TEST;

 

PWRITE_TEST ptest;

 

void SysPrint(char * pString, ...)

{

  static char buff[1024];

  va_list ap;

 

  va_start(ap,pString);

  vsprintf((char *)buff, pString, ap);

  va_end(ap);

  

  sys_write(ptest-fd,(char *)buff,(size_t)strlen(buff));

}

 

int init_module(void)

{

  

  printk(%s invoked!\n,__FUNCTION__);

  printk(File Creation Testing in Kernel Module!\n);

 

  set_fs(get_ds());

  

  /* allocate the memory for structre */

  ptest = (PWRITE_TEST)kmalloc(sizeof(WRITE_TEST),GFP_KERNEL);

  if(ptest == NULL)

  {

printk(Structure Memory Allocation Fails!\n);

return -ENOMEM;

  }

  

  ptest-fd = sys_open(srcdebug.txt, O_CREAT | O_WRONLY, 644);

  if (ptest-fd == 0)

  {

SysPrint(File Creation Error!!!\n);

return 1;

  }

  

  SysPrint(File Creation Testing in Kernel Module!\n);

  SysPrint(Srinivas Testing the File Creation\n);

  sys_close(ptest-fd);

  

  return 0;

}

 

void cleanup_module(void)

{

  printk(Good bye!\n);

 

  /* free the allocated memory */

  kfree(ptest);

}

 

Regards,

Mukund jampala

 


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Fedora core 3 Version magic error..

2005-07-07 Thread Mukund JB.
Dear sam,
I was using an automated script to build the module sources.
I failed noticing the module build failing due to some modifications.
And the script was using the old version of object file to build the
rpm.
That's the problem. It is rectified now.

Thanks for the response.

Regards,
Mukund jampala


>-Original Message-
>From: Sam Ravnborg [mailto:[EMAIL PROTECTED]
>Sent: Thursday, July 07, 2005 2:47 PM
>To: Mukund JB.
>Cc: linux-kernel@vger.kernel.org
>Subject: Re: Fedora core 3 Version magic error..
>
>On Thu, Jul 07, 2005 at 12:12:12PM +0530, Mukund JB. wrote:
>> Dear all,
>> ?
>> I have a problem loading the rpm build locally on Fedora core 3,
linux
>kernel 2.6.10.
>> ?
>> After building the rpm file from the available sources on the Linux
>kernel 2.6.10 which was D/W from kernel.org and build, I am unable to
load
>it.
>> ?
>> It results in the following errors:-
>> tifm: version magic '2.6.10 686 REGPARM gcc-3.3' should be '2.6.10
>REGPARM gcc-3.4'
>> ?
>Looks like you did not compile the tifm module with latest compiler.
>
>   Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Fedora core 3 Version magic error..

2005-07-07 Thread Mukund JB.
Dear all,
 
I have a problem loading the rpm build locally on Fedora core 3, linux kernel 
2.6.10.
 
After building the rpm file from the available sources on the Linux kernel 
2.6.10 which was D/W from kernel.org and build, I am unable to load it.
 
It results in the following errors:-
tifm: version magic '2.6.10 686 REGPARM gcc-3.3' should be '2.6.10 REGPARM 
gcc-3.4'
 
Probably, It's only failing due to gcc version mismatch. 
When I look at the cc in /bin it points to gcc.3.4.
 
Can some one suggest me a solution for this issue?
 
Thanks a million for the helps.
 
Regards,
Mukund Jampala
 
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Fedora core 3 Version magic error..

2005-07-07 Thread Mukund JB.
Dear all,
 
I have a problem loading the rpm build locally on Fedora core 3, linux kernel 
2.6.10.
 
After building the rpm file from the available sources on the Linux kernel 
2.6.10 which was D/W from kernel.org and build, I am unable to load it.
 
It results in the following errors:-
tifm: version magic '2.6.10 686 REGPARM gcc-3.3' should be '2.6.10 REGPARM 
gcc-3.4'
 
Probably, It's only failing due to gcc version mismatch. 
When I look at the cc in /bin it points to gcc.3.4.
 
Can some one suggest me a solution for this issue?
 
Thanks a million for the helps.
 
Regards,
Mukund Jampala
 
 

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Fedora core 3 Version magic error..

2005-07-07 Thread Mukund JB.
Dear sam,
I was using an automated script to build the module sources.
I failed noticing the module build failing due to some modifications.
And the script was using the old version of object file to build the
rpm.
That's the problem. It is rectified now.

Thanks for the response.

Regards,
Mukund jampala


-Original Message-
From: Sam Ravnborg [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 07, 2005 2:47 PM
To: Mukund JB.
Cc: linux-kernel@vger.kernel.org
Subject: Re: Fedora core 3 Version magic error..

On Thu, Jul 07, 2005 at 12:12:12PM +0530, Mukund JB. wrote:
 Dear all,
 ?
 I have a problem loading the rpm build locally on Fedora core 3,
linux
kernel 2.6.10.
 ?
 After building the rpm file from the available sources on the Linux
kernel 2.6.10 which was D/W from kernel.org and build, I am unable to
load
it.
 ?
 It results in the following errors:-
 tifm: version magic '2.6.10 686 REGPARM gcc-3.3' should be '2.6.10
REGPARM gcc-3.4'
 ?
Looks like you did not compile the tifm module with latest compiler.

   Sam
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


touch screen driver --working?

2005-04-15 Thread Mukund JB.


Dear all,

I have a query here regarding how does a touch screen driver work?

I have TS driver working but the calibration points seem to be not set
properly.  When I launch an qt application, the touch on edit dropdown
button opens the file dropdown button.

Any clink on any button of the application does not activate it but
rather is activated when I click bit right to the button (off it).
 
How do I set these calibration points & what is their importance?

Regards,
Mukund jampala


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


touch screen driver --working?

2005-04-15 Thread Mukund JB.


Dear all,

I have a query here regarding how does a touch screen driver work?

I have TS driver working but the calibration points seem to be not set
properly.  When I launch an qt application, the touch on edit dropdown
button opens the file dropdown button.

Any clink on any button of the application does not activate it but
rather is activated when I click bit right to the button (off it).
 
How do I set these calibration points  what is their importance?

Regards,
Mukund jampala


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


"remap_page_range" compile ERROR

2005-03-09 Thread Mukund JB.

Hi all,

I am running Redhat 9 Linux.
I have problem with compiling the i810fb driver downloaded from
Sourceforge site. I have D/W the i810fb patch
"linux-i810fb-0.0.35.tar.bz2".

When I run the make modules I get the following ERROR

i810_main.c: 643: warning: passing arg 1 of 'remap_page_range_R2baf18f2'
makes pointer from integer without a cast
i810_main.c: 643: incompatible type for argument 4 of
'remap_page_range_R2baf18f2'
i810_main.c: 643: too few arguments to function
'remap_page_range_R2baf18f2'
Make[3]: *** [I810_main.c] Error 1

..

The call to "remap_page_range()" is as follows:-

return (io_remap_page_range(vma->vm_start, off, vma->vm_end -
vma->vm_start, vma->vm_page_prot)) ? -EAGAIN : 0;


Please suggest me what could be the problem.

Regards,
Mukund jampala




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


remap_page_range compile ERROR

2005-03-09 Thread Mukund JB.

Hi all,

I am running Redhat 9 Linux.
I have problem with compiling the i810fb driver downloaded from
Sourceforge site. I have D/W the i810fb patch
linux-i810fb-0.0.35.tar.bz2.

When I run the make modules I get the following ERROR

i810_main.c: 643: warning: passing arg 1 of 'remap_page_range_R2baf18f2'
makes pointer from integer without a cast
i810_main.c: 643: incompatible type for argument 4 of
'remap_page_range_R2baf18f2'
i810_main.c: 643: too few arguments to function
'remap_page_range_R2baf18f2'
Make[3]: *** [I810_main.c] Error 1

..

The call to remap_page_range() is as follows:-

return (io_remap_page_range(vma-vm_start, off, vma-vm_end -
vma-vm_start, vma-vm_page_prot)) ? -EAGAIN : 0;


Please suggest me what could be the problem.

Regards,
Mukund jampala




-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/