From: AceVest Date: Sat, 18 Oct 2014 12:25:01 +0000 (+0800) Subject: add exit support X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=9eb9373ad6544a6ddba7f34889fe772f689f8eea;p=kernel.git add exit support --- diff --git a/bin/hello.c b/bin/hello.c index 07043e9..0fb8a96 100644 --- a/bin/hello.c +++ b/bin/hello.c @@ -15,7 +15,6 @@ int main() { printf("hello world\n"); - exit(0); return 0; } diff --git a/lib/libc.S b/lib/libc.S index ea20738..bffe2c5 100644 --- a/lib/libc.S +++ b/lib/libc.S @@ -1,4 +1,5 @@ .extern main +.extern exit .global _start _start: @@ -9,30 +10,18 @@ _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