Last active
December 8, 2021 21:20
-
-
Save syuu1228/8189292 to your computer and use it in GitHub Desktop.
Revisions
-
syuu1228 revised this gist
Dec 30, 2013 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,19 +19,19 @@ _start: ldr r0, .L3 mov r1, #2 mov r7, #5 swi #0 @ open("/dev/mem", O_RDWR) = 3 mov r4, r0 mov r0, #0 mov r1, #256 mov r2, #1 mov r3, #1 mov r5, #1280 mov r7, #192 swi #0 @ mmap2(NULL, 256, PROT_READ, MAP_SHARED, 3, 0x500) = 0x40000000 mov r0, #0 mov r7, #1 swi #0 @ exit(0) = ? .L4: .align 2 .L3: -
syuu1228 revised this gist
Dec 30, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,18 +19,18 @@ _start: ldr r0, .L3 mov r1, #2 mov r7, #5 @ open("/dev/mem", O_RDWR) = 3 swi #0 mov r4, r0 mov r0, #0 mov r1, #256 mov r2, #1 mov r3, #1 mov r5, #1280 mov r7, #192 @ mmap2(NULL, 256, PROT_READ, MAP_SHARED, 3, 0x500) = 0x40000000 swi #0 mov r0, #0 mov r7, #1 @ exit(0) = ? swi #0 .L4: .align 2 -
syuu1228 created this gist
Dec 30, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ @ This is Linux/arm EABI system call sample program. @ @ Build with following command: @ as -o arm-mmap.o arm-mmap.s @ ld -o arm-mmap arm-mmap.o @ @ You can see the program issues system calls by following command: @ strace ./arm-mmap @ .section .rodata .align 2 .LC0: .ascii "/dev/mem\000" .text .align 2 .global _start .type _start, %function _start: ldr r0, .L3 mov r1, #2 mov r7, #5 @ sys_open swi #0 mov r4, r0 mov r0, #0 mov r1, #256 mov r2, #1 mov r3, #1 mov r5, #1280 mov r7, #192 @ sys_mmap2 swi #0 mov r0, #0 mov r7, #1 @ sys_exit swi #0 .L4: .align 2 .L3: .word .LC0 .size _start, .-_start