mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 19:21:35 +01:00
document userland asm syscall interfaces
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
/* https://github.com/cirosantilli/arm-assembly-cheat#freestanding-linux-inline-assembly-system-calls */
|
||||
/* aarch64 freestanding C inline assemby Linux hello world
|
||||
* https://github.com/cirosantilli/linux-kernel-module-cheat#linux-system-calls
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/* Like hello.c trying to do it without named register variables.
|
||||
* The code is more complicated, and I was not able to get as efficient,
|
||||
* so better just stick to named register variables.
|
||||
*
|
||||
* https://github.com/cirosantilli/linux-kernel-module-cheat#linux-system-calls
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/* https://github.com/cirosantilli/arm-assembly-cheat#linux-system-calls */
|
||||
/* aarch64 freestanding Linux hello world
|
||||
* https://github.com/cirosantilli/linux-kernel-module-cheat#linux-system-calls
|
||||
*/
|
||||
|
||||
.text
|
||||
.global _start
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* MInimal sanity check of the C driver. */
|
||||
.text
|
||||
.global asm_main
|
||||
asm_main:
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/* arm freestanding C inline assemby Linux hello world
|
||||
* https://github.com/cirosantilli/linux-kernel-module-cheat#linux-system-calls
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
void _start(void) {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/* https://github.com/cirosantilli/arm-assembly-cheat#linux-system-calls */
|
||||
/* arm freestanding Linux hello world
|
||||
* https://github.com/cirosantilli/linux-kernel-module-cheat#linux-system-calls
|
||||
*/
|
||||
|
||||
.syntax unified
|
||||
.text
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
/* Linux freestanding hello world with inline assembly..*/
|
||||
/* x86_64 freestanding C inline assemby Linux hello world
|
||||
* https://github.com/cirosantilli/linux-kernel-module-cheat#linux-system-calls
|
||||
*/
|
||||
|
||||
#define _XOPEN_SOURCE 700
|
||||
#include <inttypes.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Same as hello.c, but with explicit register variables, see:
|
||||
* https://stackoverflow.com/questions/9506353/how-to-invoke-a-system-call-via-sysenter-in-inline-assembly/54956854#54956854
|
||||
* https://github.com/cirosantilli/linux-kernel-module-cheat#linux-system-calls
|
||||
*/
|
||||
|
||||
#define _XOPEN_SOURCE 700
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/* x86_64 freestanding Linux hello world
|
||||
* https://github.com/cirosantilli/linux-kernel-module-cheat#linux-system-calls
|
||||
*/
|
||||
|
||||
.text
|
||||
.global _start
|
||||
_start:
|
||||
|
||||
Reference in New Issue
Block a user