Repos / kernel.git / commitdiff
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7233149)
raw | patch | inline | side by side (parent: 7233149)
| author | zhaoyanbai <zhaoyanbai@126.com> | |
| Sat, 18 Oct 2014 12:25:01 +0000 (20:25 +0800) | ||
| committer | zhaoyanbai <zhaoyanbai@126.com> | |
| Wed, 3 Nov 2021 02:45:42 +0000 (10:45 +0800) |
| bin/hello.c | patch | blob | history | |
| lib/libc.S | patch | blob | history |
diff --git a/bin/hello.c b/bin/hello.c
--- a/bin/hello.c
+++ b/bin/hello.c
int main()
{
printf("hello world\n");
- exit(0);
return 0;
}
diff --git a/lib/libc.S b/lib/libc.S
--- a/lib/libc.S
+++ b/lib/libc.S
.extern main
+.extern exit
.global _start
_start:
nop
nop
-/*
- movl $11, %eax;
-
- pushl $1f;
- pushl %ecx;
- pushl %edx;
- pushl %ebp;
- movl %esp,%ebp;
- sysenter;
- 1:
-
-loop:
- jmp loop
- */
-
-
pushl $0xAAAAAAAA
+ pushl $0x22222222
pushl $0x11111111
call main
-
addl $12, %esp
+ pushl $0
+ call exit
+ addl $4, %esp
+
nop
nop
nop