flat assembler
Message board for the users of flat assembler.

flat assembler > Non-x86 architectures > [linux] how to arrange for the arguments ioctl?

Author
Thread Post new topic Reply to topic
sergo_mat



Joined: 12 Nov 2015
Posts: 6
Please help me figure out how to make a call ioctl EVIOCGKEY
Code:
start_key: stmfd sp!, {r1-r2, r7, lr} mov r7, toch_desc ldr r0, [r7] imm32 r1, EVIOCGKEY imm32 r2, newt mov r7, sys_ioctl swi 0 ldmfd sp!, {r1-r2, r7, pc} ; return EVIOCGKEY = 0x4518 newt: dw 256 dup(?)
edit by revolution: Added code tags
Post 12 Nov 2015, 11:00
View user's profile Send private message AIM Address Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15870
Location: 162173 Ryugu
sergo_mat: To load arbitrary constants you need to do it in more than one instruction, or use a LDR instruction and load from memory. To access memory pointers close to the code you can use ADR.
Code:
EVIOCGKEY = 0x4518 toch_desc = 0x12345678 sys_ioctl = 0x87654321 start_key: stmfd sp!,{r1-r2,r7,lr} ldr r7,[constant_toch_desc] ldr r0,[r7] ldr r1,[constant_EVIOCGKEY] adr r2,newt ldr r7,[constant_sys_ioctl] swi 0 ldmfd sp!,{r1-r2,r7,pc} ;return constant_EVIOCGKEY: dw EVIOCGKEY constant_toch_desc: dw toch_desc constant_sys_ioctl: dw sys_ioctl newt: dw 256 dup(?)
Post 12 Nov 2015, 11:41
View user's profile Send private message Visit poster's website Reply with quote
sergo_mat



Joined: 12 Nov 2015
Posts: 6
Thank you but the question is that how to arrange for the arguments ioctl
to get data from the touchscreen
/dev/input/event0
Post 12 Nov 2015, 11:56
View user's profile Send private message AIM Address Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15870
Location: 162173 Ryugu
sergo_mat: Your question appears to be related to your OS. Which OS are you using?
Post 12 Nov 2015, 12:09
View user's profile Send private message Visit poster's website Reply with quote
sergo_mat



Joined: 12 Nov 2015
Posts: 6
Linux
Post 12 Nov 2015, 12:12
View user's profile Send private message AIM Address Reply with quote
sergo_mat



Joined: 12 Nov 2015
Posts: 6
I have successfully open /dev/input/event0 and get fd
Post 12 Nov 2015, 12:14
View user's profile Send private message AIM Address Reply with quote
sergo_mat



Joined: 12 Nov 2015
Posts: 6
Next, we need to use the argument ioctl EVIOCGKEY and then there is a problem ioctl returns an error FFFFFFEA
Post 12 Nov 2015, 12:18
View user's profile Send private message AIM Address Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1240
Location: Icarian Sea
sergo_mat are you trying to get the coordinates of touchscreen?
If you did, can you provide an arm code sample (or give a few more information on how).
Post 23 Feb 2016, 09:16
View user's profile Send private message Reply with quote
sergo_mat



Joined: 12 Nov 2015
Posts: 6
You can obtain the coordinates tochskreen well as keystrokes but you need to read the size of the virtual file to find out whether or not it was touch
Post 20 Jun 2016, 13:34
View user's profile Send private message AIM Address Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 2004-2018, Tomasz Grysztar.

Powered by rwasa.