start the big userland migration

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-05 00:00:00 +00:00
parent 146e568db8
commit ecef42be81
21 changed files with 377 additions and 332 deletions

View File

@@ -2,10 +2,10 @@
* https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly-c-standard-library
*/
#include "stdio.h"
#include "stdint.h"
#include <stdio.h>
#include <stdint.h>
#include "lkmc.h"
#include <lkmc.h>
int asm_main(uint32_t *line);

View File

@@ -7,15 +7,15 @@
_start:
asm_main_after_prologue:
/* write */
mov $1, %rax /* stdout */
mov $1, %rdi /* buffer */
mov $msg, %rsi /* len */
mov $len, %rdx /* syscall number */
mov $1, %rax /* syscall number */
mov $1, %rdi /* stdout */
mov $msg, %rsi /* buffer */
mov $len, %rdx /* len */
syscall
/* exit */
mov $60, %rax /* exit status */
mov $0, %rdi /* syscall number */
mov $60, %rax /* syscall number */
mov $0, %rdi /* exit status */
syscall
msg:
.ascii "hello\n"