Re: R: usb's quirks ... how to sniff bios'es messages addressed to usb rom chip

2018-03-20 Thread Hans Petter Selasky

On 03/19/18 21:13, Vincenzo Di Salvo wrote:

Thanks.

I have read the usbdump man page ... and I know that is wireshark is able to 
sniff usb traffic.

My problem is how to detect the bit that increment the counter (always that the 
chip of the usb drive allows a such action).



Hi,

I think you misunderstand what USB is. USB is a protocol. A processor 
runs on the USB device replying to this protocol. There is no direct 
hardware access. You need to ask the manufacturer which USB request 
returns the counter you are asking for.


--HPS


Again: I kindly contact you to know if someone of the list has already done 
this test, if he can address me on the right street among the numerous 
informations shown by wireshark or usbdump.

Tutorials weblink are appreciated (if they exist).

Regards.

Vincenzo.

___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


R: R: usb's quirks ... how to sniff bios'es messages addressed to usb rom chip

2018-03-20 Thread Vincenzo Di Salvo
Hi,
probably what you are saying is so important that solves my doubt about  a my 
misunderstanding about USB protocol and my idea to use the usbdump is totally 
wrong and no more usefull.

Foundamentally my goal is only understand if, pluging a usb device, a direct 
writing operation can or not occur from the processor into the usb device. 

So, please, let me ask another question to exclude all my misunderstanding.

You wrote:
“A processor runs on the USB device replying to this protocol. There is no 
direct hardware access. You need to ask the manufacturer which USB request 
returns the counter you are asking for”.

1- If "there is no direct hardware access", this means that the processor can 
only do read-only accesses to the USB device. Is it correct ? yes/no:

2- Speaking of “which USB request returns the counter” do you mean that the 
counter increment occurs "internally" following a request of the processor, 
excluding a direct writing operation of the processor into the usb device ?. Is 
it correct ? yes/no:

If so, your reply solves my limited knowledges of the usb protocol.

Thanks in advance.

Regards

-Messaggio originale-
Da: Hans Petter Selasky [mailto:h...@selasky.org] 
Inviato: martedì 20 marzo 2018 08:32
A: Vincenzo Di Salvo
Oggetto: Re: R: usb's quirks ... how to sniff bios'es messages addressed to usb 
rom chip

On 03/19/18 21:13, Vincenzo Di Salvo wrote:
> Thanks.
> 
> I have read the usbdump man page ... and I know that is wireshark is able to 
> sniff usb traffic.
> 
> My problem is how to detect the bit that increment the counter (always that 
> the chip of the usb drive allows a such action).
> 

Hi,

I think you misunderstand what USB is. USB is a protocol. A processor 
runs on the USB device replying to this protocol. There is no direct 
hardware access. You need to ask the manufacturer which USB request 
returns the counter you are asking for.

--HPS

> Again: I kindly contact you to know if someone of the list has already done 
> this test, if he can address me on the right street among the numerous 
> informations shown by wireshark or usbdump.
> 
> Tutorials weblink are appreciated (if they exist).
> 
> Regards.
> 
> Vincenzo.


---
Questa email è stata esaminata alla ricerca di virus da AVG.
http://www.avg.com

___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: R: R: usb's quirks ... how to sniff bios'es messages addressed to usb rom chip

2018-03-20 Thread Hans Petter Selasky

On 03/20/18 10:07, Vincenzo Di Salvo wrote:

Hi,
probably what you are saying is so important that solves my doubt about  a my 
misunderstanding about USB protocol and my idea to use the usbdump is totally 
wrong and no more usefull.

Foundamentally my goal is only understand if, pluging a usb device, a direct 
writing operation can or not occur from the processor into the usb device.



Hi,

You need to distinguish between daemons and the operating system, OS. 
When you plug a USB disk device, typically what happens is that the OS 
will read from the disk to figure out partition tables and disk slices. 
This part is read-only. Later on the OS will tell this information to 
user-space, for example hald, and then depending on what software you 
have installed, the disk will be automatically mounted, which might 
involve a few write requests. mount(8) has a -r option to avoid any 
writes to the disk. Usually this is not set for desktop environments.



So, please, let me ask another question to exclude all my misunderstanding.

You wrote:
“A processor runs on the USB device replying to this protocol. There is no 
direct hardware access. You need to ask the manufacturer which USB request 
returns the counter you are asking for”.

1- If "there is no direct hardware access", this means that the processor can 
only do read-only accesses to the USB device. Is it correct ? yes/no:


The USB storage protocol has separate read and write commands. The PC 
sends either a read command or a write command to the USB device and a 
small CPU interprets this command and replies back the the PC. This 
small CPU then makes a new request for the actual disk drive.




2- Speaking of “which USB request returns the counter” do you mean that the counter 
increment occurs "internally" following a request of the processor, excluding a 
direct writing operation of the processor into the usb device ?. Is it correct ? yes/no:


USB itself doesn't have any counters for disk access. There is only one 
running counter, but it doesn't distinguish between read and write 
requests. Any request increments the counter by one.


The OS might however keep statistics on how many read/write requests 
have been performed. In FreeBSD these statistics is usually available 
through the "sysctl -a" tree.




If so, your reply solves my limited knowledges of the usb protocol.



Further, it is common that when you read files, the access time is 
updated in the file tables. This cause write requests. Look for the 
description of the "noatime" option in the mount manual page.


--HPS
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"