View Single Post
Posts: 20 | Thanked: 27 times | Joined on May 2019 @ Sydney, Australia
#7
Message 8 / 9 - QEMU debug log continued...

Code:
omap_gpio_module_write: Read-only register 00000000
tsc2102_control_register_read: no such register: 0x07
tsc210x_read: SPI underrun!
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
tsc2102_audio_register_write: wrong value written into Audio 1
tsc2102_audio_register_write: wrong value written into reg 0x01
tsc2102_audio_register_write: wrong value written into reg 0x03
tsc2102_audio_register_write: wrong value written into Audio 3
tsc2102_audio_register_write: wrong value written into Audio 3
tsc2102_audio_register_write: wrong value written into Power
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
n800_mmc_cs_cb: MMC slot 2 active
tsc2102_audio_register_write: wrong value written into Power
tsc2102_audio_register_write: wrong value written into Audio 3
tsc2102_audio_register_write: wrong value written into Audio 3
omap_prcm_write: Bad register 0x000048
omap_prcm_write: Bad register 0x000030
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
omap_gpio_module_write: Read-only register 00000000
n800_mmc_cs_cb: MMC slot 1 active
tsc2102_audio_register_write: wrong value written into Audio 3
tsc2102_audio_register_write: wrong value written into Power
tahvo_write: LCD backlight now at 59 / 127
omap_prcm_write: Bad register 0x000040
omap_prcm_read: Bad register 0x000040
omap_prcm_read: Bad register 0x000040
tahvo_write: LCD backlight now at 61 / 127
tahvo_write: LCD backlight now at 63 / 127
tahvo_write: LCD backlight now at 65 / 127
tahvo_write: LCD backlight now at 67 / 127
tahvo_write: LCD backlight now at 69 / 127
tahvo_write: LCD backlight now at 71 / 127
tahvo_write: LCD backlight now at 73 / 127
tahvo_write: LCD backlight now at 75 / 127
tahvo_write: LCD backlight now at 77 / 127
tahvo_write: LCD backlight now at 79 / 127
tahvo_write: LCD backlight now at 81 / 127
tahvo_write: LCD backlight now at 83 / 127
tahvo_write: LCD backlight now at 85 / 127
tahvo_write: LCD backlight now at 87 / 127
tahvo_write: LCD backlight now at 89 / 127
tahvo_write: LCD backlight now at 91 / 127
tahvo_write: LCD backlight now at 93 / 127
tahvo_write: LCD backlight now at 95 / 127
tahvo_write: LCD backlight now at 97 / 127
tahvo_write: LCD backlight now at 99 / 127
omap_disc_write: Bad register 00000000
omap_disc_write: Bad register 00000000
omap_disc_write: Bad register 00000000
tahvo_write: LCD backlight now at 101 / 127
tahvo_write: LCD backlight now at 103 / 127
tahvo_write: LCD backlight now at 105 / 127
tahvo_write: LCD backlight now at 107 / 127
tahvo_write: LCD backlight now at 109 / 127
tahvo_write: LCD backlight now at 111 / 127
tahvo_write: LCD backlight now at 113 / 127
tahvo_write: LCD backlight now at 115 / 127
tahvo_write: LCD backlight now at 117 / 127
tahvo_write: LCD backlight now at 119 / 127
tahvo_write: LCD backlight now at 121 / 127
tahvo_write: LCD backlight now at 123 / 127
tahvo_write: LCD backlight now at 125 / 127
tahvo_write: LCD backlight now at 127 / 127
omap_prcm_read: Bad register 0x000030
omap_prcm_write: Bad register 0x000030
omap_prcm_read: Bad register 0x000048
omap_prcm_write: Bad register 0x000048
omap_prcm_write: Read-only register 00000000
tahvo_write: LCD backlight now at 125 / 127
tahvo_write: LCD backlight now at 123 / 127
tahvo_write: LCD backlight now at 121 / 127
tahvo_write: LCD backlight now at 119 / 127
tahvo_write: LCD backlight now at 117 / 127
tahvo_write: LCD backlight now at 115 / 127
tahvo_write: LCD backlight now at 113 / 127
tahvo_write: LCD backlight now at 111 / 127
tahvo_write: LCD backlight now at 109 / 127
tahvo_write: LCD backlight now at 107 / 127
tahvo_write: LCD backlight now at 105 / 127
tahvo_write: LCD backlight now at 103 / 127
tahvo_write: LCD backlight now at 101 / 127
tahvo_write: LCD backlight now at 99 / 127
tahvo_write: LCD backlight now at 97 / 127
tahvo_write: LCD backlight now at 95 / 127
tahvo_write: LCD backlight now at 93 / 127
tahvo_write: LCD backlight now at 91 / 127
tahvo_write: LCD backlight now at 89 / 127
tahvo_write: LCD backlight now at 87 / 127
tahvo_write: LCD backlight now at 85 / 127
tahvo_write: LCD backlight now at 83 / 127
tahvo_write: LCD backlight now at 81 / 127
tahvo_write: LCD backlight now at 79 / 127
tahvo_write: LCD backlight now at 77 / 127
tahvo_write: LCD backlight now at 75 / 127
tahvo_write: LCD backlight now at 73 / 127
tahvo_write: LCD backlight now at 71 / 127
tahvo_write: LCD backlight now at 69 / 127
tahvo_write: LCD backlight now at 67 / 127
tahvo_write: LCD backlight now at 65 / 127
tahvo_write: LCD backlight now at 63 / 127
tahvo_write: LCD backlight now at 61 / 127
tahvo_write: LCD backlight now at 59 / 127
tahvo_write: LCD backlight now at 57 / 127
tahvo_write: LCD backlight now at 55 / 127
tahvo_write: LCD backlight now at 53 / 127
tahvo_write: LCD backlight now at 51 / 127
tahvo_write: LCD backlight now at 49 / 127
tahvo_write: LCD backlight now at 47 / 127
tahvo_write: LCD backlight now at 45 / 127
tahvo_write: LCD backlight now at 43 / 127
tahvo_write: LCD backlight now at 41 / 127
tahvo_write: LCD backlight now at 39 / 127
tahvo_write: LCD backlight now at 37 / 127
tahvo_write: LCD backlight now at 35 / 127
tahvo_write: LCD backlight now at 33 / 127
tahvo_write: LCD backlight now at 31 / 127
tahvo_write: LCD backlight now at 29 / 127
tahvo_write: LCD backlight now at 27 / 127
tahvo_write: LCD backlight now at 25 / 127
tahvo_write: LCD backlight now at 23 / 127
tahvo_write: LCD backlight now at 21 / 127
tahvo_write: LCD backlight now at 19 / 127
tahvo_write: LCD backlight now at 17 / 127
tahvo_write: LCD backlight now at 15 / 127
tahvo_write: LCD backlight now at 13 / 127
tahvo_write: LCD backlight now at 11 / 127
tahvo_write: LCD backlight now at 9 / 127
tahvo_write: LCD backlight now at 7 / 127
tahvo_write: LCD backlight now at 5 / 127
tahvo_write: LCD backlight now at 3 / 127
tahvo_write: LCD backlight now at 0 / 127
mipid_txrx: Display off
blizzard_reg_write: The display must be disabled before entering Standby Mode
omap_prcm_write: Bad register 0x000040

The bad news: the N800 emulation is faithful to the real hardware to the point thaaaat I... cannot type. Yippee.

So, I made this:

Code:
#!/bin/bash
win_id=$(xdotool search --classname qemu-system-arm)
eval $(xdotool getwindowgeometry --shell $win_id)
win_x=$X
win_y=$Y
qemu_window=$WINDOW
declare -A k
k[24]=360,200 #q
k[25]=360,239 #w
k[26]=360,277 #e
k[27]=360,310 #r
k[28]=360,346 #t
k[29]=360,379 #y
k[30]=360,415 #u
k[31]=360,449 #i
k[32]=360,491 #o
k[33]=360,521 #p
k[38]=395,189 #a
k[39]=395,219 #s
k[40]=395,253 #d
k[41]=395,390 #f
k[42]=395,329 #g
k[43]=395,359 #h
k[44]=395,398 #j
k[45]=395,432 #k
k[46]=395,464 #l
k[52]=430,200 #z
k[53]=430,243 #x
k[54]=430,282 #c
k[55]=430,310 #v
k[56]=430,346 #b
k[57]=430,379 #n
k[58]=430,415 #m
k["11,0x1"]=360,569 #@
k[47]=394,500       #;
k[48]=394,537       #'
k["10,0x1"]=394,578 #!
k[60]=430,489       #.
k[61]=430,521       #/
k[65]=464,410       #<space>
k[10]=355,623 #1
k[11]=355,657 #2
k[12]=355,699 #3
k[13]=392,623 #4
k[14]=392,657 #5
k[15]=392,699 #6
k[16]=427,623 #7
k[17]=427,657 #8
k[18]=427,699 #9
k[19]=461,623 #-
k[19]=461,657 #0
k[19]=461,699 #=
xinput test-xi2 --root |\
	stdbuf -i0 -o0 grep '(KeyPress)' -A 7 |\
	stdbuf -o0 sed -n 's/.*effective: //p; s/.*detail: //p' |\
	stdbuf -o0 sed 'N;s/\n/,/;s/,0$//' |\
while read x; do
	echo $x
	eval $(xdotool getmouselocation --shell)
	old_x=$X
	old_y=$Y
	case $x in
		22) # backspace
			z=(356 755)
			;;
		36) # enter
			z=(392 755)
			;;
		*)
			[[ "${k["$x"]}" == "" ]] && continue
			IFS=, z=(${k["$x"]})
			;;
	esac
	xdotool \
		mousemove $((win_x+${z[1]})) $((win_y+${z[0]})) \
		mousedown 1 \
		sleep 0.1 \
		mouseup 1 \
		sleep 0.1 \
		mousemove $old_x $old_y
done
I spent about 10 minutes figuring out the X,Y coordinates of all of the "keys" in the osso-xterm on-screen keyboard, and put them into the above shell script that pecks away at the OSK with the mouse for me as I type normally. With the (necessary) delays it's a bit like semi-remote SSH.

It uses xinput as a keylogger and xdotool to move and click the mouse. (Use it with a text editor or a terminal running cat focused, since sending the Enter key into the QEMU window will switch you to full-screen keyboard mode.)

This only allows me to type basic commands, though. I do NOT want to eg add the routines to handle uppercase letters or special characters etc etc unless I absolutely HAVE to...

Oh - and this is for a US keyboard layout, you'd have to go look at xmodmap -pk if you're on a different layout (I forgot where I put my code that parses xmodmap output and didn't feel like rewriting it so just left it with the fixed keycodes.)

(One last thing, leave it running and try and type elsewhere the result is hilariously disorientating )


Even more bad news: I don't have any networking!! I'm not sure what options to pass to get this working - if there are any. :/

(As an aside, ping appears to not have been made suid root. Nice one.)