All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [parisc-linux] Problems with raw interface.
@ 2003-09-19 12:37 SUDARSANAN,RANJITH (HP-India,ex2)
  2003-09-20 23:46 ` Grant Grundler
  0 siblings, 1 reply; 4+ messages in thread
From: SUDARSANAN,RANJITH (HP-India,ex2) @ 2003-09-19 12:37 UTC (permalink / raw)
  To: Grant Grundler; +Cc: parisc-linux

Hi,

Grant:
>>>I get the impression "raw" is ignoring your input parameter
>>>to use /dev/raw/rawsdb and is using /dev/raw/raw<N> instead.
>>>So it looks like you are comparing the wrong data...

Ranjith:
	When I bind an block interface to a raw device, I see that
/dev/raw/raw<N>, <N> is the minor number of the node entry which is created
in the /dev/raw/ directory. I tried binding to /dev/raw/raw1 instead of
/dev/raw/rawsda. I still get the same results. (If the binding is not
present raw complains)

	This problem does not seem to be there on the X86 and IA64 kernels.
I guess this is something specific to PA Linux kernel. I am compiling the
kernel with debugs enabled. Please let me know if anyone gets a lead on
this.

Grant:
>>>>What does "dd if=/dev/raw/raw2 of=/tmp/o_raw2 bs=512 count=8" result in?
Ranjith:
This command reads the first 4K bytes of the disk and writes it to file
o_raw2. 

with warm regards,
Ranjith Sudarsanan

--------------------------------------
Ranjith Sudarsanan
Rage Team
30CA, Cunningham Road
Bangalore
Off: 91-80-205 3190
Res: 91-80-522 2577 
web: http://nt2651.india.hp.com:8080/
--------------------------------------
"When the head bows, it meets the heart and that head which has met the
heart gets the crown!!! - Sri Sri"


-----Original Message-----
From: Grant Grundler [mailto:grundler@parisc-linux.org] 
Sent: Friday, September 19, 2003 4:30 AM
To: SUDARSANAN,RANJITH (HP-India,ex2)
Cc: parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] Problems with raw interface.


On Fri, Sep 19, 2003 at 12:36:55AM +0530, SUDARSANAN,RANJITH (HP-India,ex2)
wrote: ...
> oak:/home/sranjith# raw /dev/raw/rawsdb /dev/sdb
> /dev/raw/raw1:  bound to major 8, minor 16 oak:/home/sranjith# raw 
> /dev/raw/rawsda /dev/sda
> /dev/raw/raw2:  bound to major 8, minor 0
> 
> oak:/home/sranjith# raw -qa
> /dev/raw/raw1:  bound to major 8, minor 16
> /dev/raw/raw2:  bound to major 8, minor 0

I get the impression "raw" is ignoring your input parameter
to use /dev/raw/rawsdb and is using /dev/raw/raw<N> instead.
So it looks like you are comparing the wrong data...

root@debian:/dev# raw --help
raw: invalid option -- -
Usage:
  raw /dev/raw/rawN <major> <minor>
  raw /dev/raw/rawN /dev/<blockdev>
  raw -q /dev/raw/rawN
  raw -qa

What does "dd if=/dev/raw/raw2 of=/tmp/o_raw2 bs=512 count=8" result in?

Anyway, it looks broken for me too.
I tried using raw on 32-bit 2.4.20-pa28:

	raw /dev/raw/raw1 /dev/sda
	raw -qa
/dev/raw/raw1:  bound to major 8, minor 0
	dd if=/dev/raw/raw1 of=/tmp/raw1.o count=8
	/usr/bin/od -Ax -t x /tmp/raw1.o 
000000 00000000 00000000 00000000 00000000
*
001000


/dev/sda is the boot disk for this machine.

root@debian:/dev# /usr/bin/od -Ax -t x /dev/sda | less
000000 00000000 00000000 00000000 00000000
*
000400 40030800 60653403 00000000 0a086200
000410 cd700200 00000000 02000000 02000000
000420 00800000 00800000 40010000 371e6a3f
000430 371e6a3f 10001800 53ef0100 01000000
....


grant

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [parisc-linux] Problems with raw interface.
  2003-09-19 12:37 [parisc-linux] Problems with raw interface SUDARSANAN,RANJITH (HP-India,ex2)
@ 2003-09-20 23:46 ` Grant Grundler
  0 siblings, 0 replies; 4+ messages in thread
From: Grant Grundler @ 2003-09-20 23:46 UTC (permalink / raw)
  To: SUDARSANAN,RANJITH (HP-India,ex2); +Cc: parisc-linux

On Fri, Sep 19, 2003 at 06:07:41PM +0530, SUDARSANAN,RANJITH (HP-India,ex2) wrote:
> >>>>What does "dd if=/dev/raw/raw2 of=/tmp/o_raw2 bs=512 count=8" result in?
> This command reads the first 4K bytes of the disk and writes it to file
> o_raw2. 

Ah yes, but is the data correct?
I'll assume not since your attempt with /dev/raw/raw1 also failed.

Basically something looks broken in parisc for raw devices.
I was clearly able to reproduce this failure.

grant

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [parisc-linux] Problems with raw interface.
  2003-09-18 19:06 SUDARSANAN,RANJITH (HP-India,ex2)
@ 2003-09-18 23:00 ` Grant Grundler
  0 siblings, 0 replies; 4+ messages in thread
From: Grant Grundler @ 2003-09-18 23:00 UTC (permalink / raw)
  To: SUDARSANAN,RANJITH (HP-India,ex2); +Cc: parisc-linux

On Fri, Sep 19, 2003 at 12:36:55AM +0530, SUDARSANAN,RANJITH (HP-India,ex2) wrote:
...
> oak:/home/sranjith# raw /dev/raw/rawsdb /dev/sdb
> /dev/raw/raw1:  bound to major 8, minor 16
> oak:/home/sranjith# raw /dev/raw/rawsda /dev/sda
> /dev/raw/raw2:  bound to major 8, minor 0
> 
> oak:/home/sranjith# raw -qa
> /dev/raw/raw1:  bound to major 8, minor 16
> /dev/raw/raw2:  bound to major 8, minor 0

I get the impression "raw" is ignoring your input parameter
to use /dev/raw/rawsdb and is using /dev/raw/raw<N> instead.
So it looks like you are comparing the wrong data...

root@debian:/dev# raw --help
raw: invalid option -- -
Usage:
  raw /dev/raw/rawN <major> <minor>
  raw /dev/raw/rawN /dev/<blockdev>
  raw -q /dev/raw/rawN
  raw -qa

What does "dd if=/dev/raw/raw2 of=/tmp/o_raw2 bs=512 count=8" result in?

Anyway, it looks broken for me too.
I tried using raw on 32-bit 2.4.20-pa28:

	raw /dev/raw/raw1 /dev/sda
	raw -qa
/dev/raw/raw1:  bound to major 8, minor 0
	dd if=/dev/raw/raw1 of=/tmp/raw1.o count=8
	/usr/bin/od -Ax -t x /tmp/raw1.o 
000000 00000000 00000000 00000000 00000000
*
001000


/dev/sda is the boot disk for this machine.

root@debian:/dev# /usr/bin/od -Ax -t x /dev/sda | less
000000 00000000 00000000 00000000 00000000
*
000400 40030800 60653403 00000000 0a086200
000410 cd700200 00000000 02000000 02000000
000420 00800000 00800000 40010000 371e6a3f
000430 371e6a3f 10001800 53ef0100 01000000
....


grant

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [parisc-linux] Problems with raw interface.
@ 2003-09-18 19:06 SUDARSANAN,RANJITH (HP-India,ex2)
  2003-09-18 23:00 ` Grant Grundler
  0 siblings, 1 reply; 4+ messages in thread
From: SUDARSANAN,RANJITH (HP-India,ex2) @ 2003-09-18 19:06 UTC (permalink / raw)
  To: parisc-linux

[-- Attachment #1: Type: text/plain, Size: 13887 bytes --]

Hi
	I am developing a scsi disk exerciser and I am blocked on a strange
problem with the raw interface. When I use the block device /dev/sda
directly I am able to read and write from the disk properly. But when I use
the raw interface I get garbage. For instance please look at the output
below. I am reading the 1st sector of the disk, which is the boot sector,
When I use the block device /dev/sda I get my expected output, whereas when
I use the raw interface I get garbage. Can any one explain? The machine I am
using is an L Class. 

I have attached the start up (boot up) screen dump at the end of the mail

Kernel details:
oak:~# uname -a
Linux oak 2.4.22-pa3 #1 Thu Sep 18 23:19:58 IST 2003 parisc64 unknown


oak:/home/sranjith# ls -l /dev/sda
brw-rw----    1 root     disk       8,   0 Jun  7  2002 /dev/sda

oak:/home/sranjith# ls -l /dev/sdb
brw-rw----    1 root     disk       8,  16 Jun  7  2002 /dev/sdb

oak:/home/sranjith# ls -l /dev/raw/    
total 0
crw-r--r--    1 root     root     162,   4 Sep 12 00:32 raw4
crw-r--r--    1 root     root     162,   2 Aug  7 00:35 rawsda
crw-r--r--    1 root     root     162,   1 Jul 31 19:33 rawsdb

I am binding the raw devices to the block devices

oak:/home/sranjith# raw /dev/raw/rawsdb /dev/sdb
/dev/raw/raw1:  bound to major 8, minor 16
oak:/home/sranjith# raw /dev/raw/rawsda /dev/sda
/dev/raw/raw2:  bound to major 8, minor 0

oak:/home/sranjith# raw -qa
/dev/raw/raw1:  bound to major 8, minor 16
/dev/raw/raw2:  bound to major 8, minor 0

I am reading the 1st sector of /dev/sda from which I booted

oak:/home/sranjith# dd if=/dev/sda of=o_sda bs=512 count=8
8+0 records in
8+0 records out
oak:/home/sranjith# xxd o_sda |more
0000000: 8000 5041 4c4f 0003 0000 0000 0000 0000  ..PALO..........
0000010: 0000 0000 0000 0000 322f 766d 6c69 6e75  ........2/vmlinu
0000020: 7820 726f 6f74 3d2f 6465 762f 7364 6133  x root=/dev/sda3
0000030: 2048 4f4d 453d 2f00 696e 6974 3d2f 6269   HOME=/.init=/bi
0000040: 6e2f 6261 7368 0037 3a2f 2069 703d 6468  n/bash.7:/ ip=dh
0000050: 6370 2048 4f4d 453d 2f00 0000 0000 0000  cp HOME=/.......
0000060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000070: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000080: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000090: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000e0: 0000 0000 0000 0000 0004 4000 0050 7fd9  ..........@..P..
00000f0: 0000 4000 0000 7800 0000 0000 0000 0000  ..@...x.........
0000100: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000110: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000120: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000130: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000140: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000150: 0000 0000 0000 0000 0000 0000 0000 0000  ................
--More--

I am getting a valid output

Now I use the raw interface to read the same sector and I get garbage

oak:/home/sranjith# dd if=/dev/raw/rawsda of=o_sda bs=512 count=8
8+0 records in
8+0 records out
oak:/home/sranjith# xxd o_sda |more
0000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000050: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000070: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000080: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000090: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000100: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000110: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000120: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000130: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000140: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000150: 0000 0000 0000 0000 0000 0000 0000 0000  ................
--More--

I get Garbage	



Boot up screen dump
************ EARLY BOOT VFP *************
End of early boot detected
*****************************************

Firmware Version  41.46

Duplex Console IO Dependent Code (IODC) revision 1

----------------------------------------------------------------------------
--
   (c) Copyright 1995-2000, Hewlett-Packard Company, All rights reserved
----------------------------------------------------------------------------
--

  Processor   Speed            State           CoProcessor State  Cache Size
  Number                                       State              Inst
Data
  ---------  --------   ---------------------  -----------------
------------
      0      750  MHz   Active                 Functional         750 KB 1.5
MB
      2      750  MHz   Idle                   Functional         750 KB 1.5
MB

  Central Bus Speed (in MHz)  :        133  
  Available Memory            :   16777216  KB
  Good Memory Required        :      86948  KB

   Primary boot path:    0/0/2/0.2           
   Alternate boot path:  0/0/1/1.2           
   Console path:         0/0/4/1.0           
   Keyboard path:        0/0/4/0.0           

 WARNING:  The non-destructive test bit was set, so memory was not tested 
            destructively.  Information only, no action required. 


Processor is booting from first available device.

To discontinue, press any key within 10 seconds.
Proceeding...

Trying Primary Boot Path
------------------------
Booting... 
Boot IO Dependent Code (IODC) revision 1


HARD Booted.
palo ipl 1.0 root@palinux Mon Apr  1 10:02:53 MST 2002

Partition Start(MB) End(MB) Id Type
1               1      95   f0 Palo
2              96     286   83 ext2
3             287    5054   83 ext2

PALO(F0) partition contains:
    0/vmlinux64 5275609 bytes @ 0x44000

Information: No console specified on kernel command line. This is normal.
PALO will choose the console currently used by firmware (serial).
Command line for kernel: 'root=/dev/sda3 HOME=/ console=ttyS0 TERM=vt102
palo_kernel=2/vmlinux'
Selected kernel: /vmlinux from partition 2
ELF64 executable
Entry 00100000 first 00100000 n 3
Segment 0 load 00100000 size 2872448 mediaptr 0x1000
Segment 1 load 003be000 size 1028616 mediaptr 0x2bf000
Segment 2 load 004bc000 size 376832 mediaptr 0x3bb000
Branching to kernel entry point 0x00100000.  If this is the last
message you see, you may need to switch your console.  This is
a common symptom -- search the FAQ and mailing list at parisc-linux.org


********** VIRTUAL FRONT PANEL **********
System Boot detected
*****************************************
LEDs:  RUN      ATTENTION     FAULT     REMOTE     POWER
       ON       FLASH         OFF       ON         ON
LED State: There was a system interruption that did not take the system
down.
Check Chassis and Console Logs for error messages.

processor                 system initialization      1C00

*****************************************

************ EARLY BOOT VFP *************
End of early boot detected
*****************************************
sym53c8xx: 53c875 detected 
sym53c8xx: at PCI bus 0, device 1, function 0
sym53c8xx: setting PCI_COMMAND_INVALIDATE (fix-up)
sym53c8xx: 53c896 detected 
sym53c8xx: at PCI bus 0, device 1, function 1
sym53c8xx: setting PCI_COMMAND_INVALIDATE (fix-up)
sym53c8xx: 53c896 detected 
sym53c875-0: rev 0x14 on pci bus 0 device 2 function 0 irq 130
sym53c875-0: ID 7, Fast-20, Parity Checking
sym53c875-1: rev 0x14 on pci bus 0 device 2 function 1 irq 131
sym53c875-1: ID 7, Fast-20, Parity Checking
sym53c875-2: rev 0x14 on pci bus 64 device 0 function 0 irq 512
sym53c875-2: ID 7, Fast-20, Parity Checking
sym53c875-3: rev 0x14 on pci bus 64 device 0 function 1 irq 513
sym53c875-3: ID 7, Fast-20, Parity Checking
sym53c896-4: rev 0x7 on pci bus 0 device 1 function 0 irq 129
sym53c896-4: ID 7, Fast-20, Parity Checking
sym53c896-4: handling phase mismatch from SCRIPTS.
sym53c896-5: rev 0x7 on pci bus 0 device 1 function 1 irq 130
sym53c896-5: ID 7, Fast-20, Parity Checking
sym53c896-5: handling phase mismatch from SCRIPTS.
scsi0 : sym53c8xx-1.7.3c-20010512
scsi1 : sym53c8xx-1.7.3c-20010512
scsi2 : sym53c8xx-1.7.3c-20010512
scsi3 : sym53c8xx-1.7.3c-20010512
scsi4 : sym53c8xx-1.7.3c-20010512
scsi5 : sym53c8xx-1.7.3c-20010512
blk: queue 000000008f9a3428, I/O limit 4095Mb (mask 0xffffffff)
  Vendor: HP 36.4G  Model: MAN3367MC         Rev: HP04
  Type:   Direct-Access                      ANSI SCSI revision: 02
blk: queue 000000008f9a3628, I/O limit 4095Mb (mask 0xffffffff)
  Vendor: HP        Model: DVD-ROM 305       Rev: 1.01
  Type:   CD-ROM                             ANSI SCSI revision: 02
blk: queue 000000008f9a3828, I/O limit 4095Mb (mask 0xffffffff)
  Vendor: HP 36.4G  Model: MAN3367MC         Rev: HP04
  Type:   Direct-Access                      ANSI SCSI revision: 02
blk: queue 000000008f9a3a28, I/O limit 4095Mb (mask 0xffffffff)
Attached scsi disk sda at scsi0, channel 0, id 2, lun 0
Attached scsi disk sdb at scsi5, channel 0, id 2, lun 0
sym53c875-0-<2,*>: FAST-20 WIDE SCSI 40.0 MB/s (50.0 ns, offset 16)
SCSI device sda: 71132960 512-byte hdwr sectors (36420 MB)
 sda: sda1 sda2 sda3
sym53c896-5-<2,*>: FAST-20 WIDE SCSI 40.0 MB/s (50.0 ns, offset 31)
SCSI device sdb: 71132960 512-byte hdwr sectors (36420 MB)
 sdb: unknown partition table
Attached scsi CD-ROM sr0 at scsi1, channel 0, id 2, lun 0
sym53c875-1-<2,*>: FAST-20 SCSI 20.0 MB/s (50.0 ns, offset 16)
sr0: scsi3-mmc drive: 16x/40x cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.12
STI GSC/PCI graphics driver version 0.9
BUG: Skipping previously registered driver: sti (native)
mice: PS/2 mouse device common for all mice
HP SDC: No SDC found.
HP SDC MLC: Registering the System Domain Controller's HIL MLC.
HP SDC MLC: Request for raw HIL ISR hook denied
md: linear personality registered as nr 1
md: raid0 personality registered as nr 2
md: raid1 personality registered as nr 3
md: raid5 personality registered as nr 4
raid5: measuring checksumming speed
   8regs     :  3434.400 MB/sec
   8regs_prefetch:  2515.600 MB/sec
   32regs    :  2800.000 MB/sec
   32regs_prefetch:  2640.000 MB/sec
raid5: using function: 8regs (3434.400 MB/sec)
md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 16384 buckets, 128Kbytes
TCP: Hash tables configured (established 262144 bind 65536)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 316k freed
********** VIRTUAL FRONT PANEL **********
System Boot detected
*****************************************
LEDs:  RUN      ATTENTION     FAULT     REMOTE     POWER
       ON       FLASH         OFF       ON         ON
LED State: There was a system interruption that did not take the system
down.
Check Chassis and Console Logs for error messages.

processor                 system initialization      1C00

*****************************************

************ EARLY BOOT VFP *************
End of early boot detected
*****************************************
System Clock set. System local time is now Thu Sep 18 18:46:58 UTC 2003.
Calculating module dependencies... depmod: Can't open
/lib/modules/2.4.22-pa3/modules.dep for writing
done.
Loading modules: 
modprobe: Can't open dependencies file /lib/modules/2.4.22-pa3/modules.dep
(No such file or directory)
Checking all file systems...
fsck 1.27 (8-Mar-2002)
/dev/sda2: clean, 20/48960 files, 33836/195584 blocks
Setting kernel variables.
Mounting local filesystems...
/dev/sda2 on /boot type ext2 (rw)
Running 0dns-down to make sure resolv.conf is ok...done.
Cleaning: /etc/network/ifstate.
Setting up IP spoofing protection: rp_filter.
Configuring network interfaces: done.
Starting portmap daemon: portmap.
Starting portmapper... Mounting remote filesystems...

Setting the System Clock using the Hardware Clock as reference...
System Clock set. Local time: Fri Sep 19 00:17:02 IST 2003

Cleaning: /tmp /var/lock eth0: Setting full-duplex based on MII#1 link
partner capability of 41e1.
/var/run.
Initializing random number generator... done.
Recovering nvi editor sessions... done.
INIT: Entering runlevel: 2
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
Starting NFS common utilities: statd.
Starting internet superserver: inetd.
Exporting directories for NFS kernel daemon...done.
Starting NFS kernel daemon: nfsd mountd.
Starting deferred execution scheduler: atd.
Starting periodic command scheduler: cron.

Debian GNU/Linux 3.0 oak ttyS0

oak login: 

with warm regards,
Ranjith Sudarsanan

--------------------------------------
Ranjith Sudarsanan
Rage Team
30CA, Cunningham Road
Bangalore
--------------------------------------
"When the head bows, it meets the heart and that head which has met the
heart gets the crown!!! - Sri Sri"


[-- Attachment #2: Type: text/html, Size: 29513 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-20 23:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-19 12:37 [parisc-linux] Problems with raw interface SUDARSANAN,RANJITH (HP-India,ex2)
2003-09-20 23:46 ` Grant Grundler
  -- strict thread matches above, loose matches on Subject: below --
2003-09-18 19:06 SUDARSANAN,RANJITH (HP-India,ex2)
2003-09-18 23:00 ` Grant Grundler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.