Hi, Ryan,

On Mar 18, 2013, at 2:21 PM, Ryan Monroe wrote:

> root@roach:/proc/618/hw/ioreg# echo 0 > ../ioreg_mode 
> root@roach:/proc/618/hw/ioreg# echo -e \x00\x00\x00\x00 > acc_always_valid
> -bash: echo: write error: Invalid argument

You need to either double up the backslashes or put the \x00\x00\x00\x00 in 
quotes.  Also adding -n is probably needed to suppress the newline.  I think 
the invalid argument error is due to writing too many bytes (when ioreg_mode is 
0).

> root@roach:/proc/618/hw/ioreg# echo 1 > ../ioreg_mode 
> root@roach:/proc/618/hw/ioreg# echo -e \x00\x00\x00\x00 > acc_always_valid
> root@roach:/proc/618/hw/ioreg# cat acc_always_valid
> x00xroot@roach:/proc/618/hw/ioreg# 

Here the shell ate the backslashes so you as before you tried to write 
"x00x00x00x00" to the register.  I guess ioreg_mode of 1 is more tolerant of 
trailing data, so only the first 4 bytes, "x00x" got written to the register 
(as confirmed by the output of the cat command).

Hope this helps,
Dave


Reply via email to