新增自行定義的system call步驟如下:
1. edit arch/x86/kernel/syscall_table_32.S, add
.long sys_mysystemcall /* 338 */
2. edit include/asm-i386/unistd.h, add
#define __NR_mysystemcall 338
3. create new file, arch/x86/kernel/systemcall.c
(defined filename yourself)
#include <linux/linkage.h>
#include <linux/kernel.h>
asmlinkage int sys_mysystemcall(void)
{
printk("mysystemcall\n");
return 0;
}
4. edit arch/x86/kernel/Makefile, add
obj-y += systemcall.o
5. compiler kernel
root@shulong-desktop:/home/shulong/linux-2.6.33-rc2# make clean && make
6. writing code for user mode, create new file test.c
#include <linux/unistd.h>
#include <sys/syscall.h>
#include <sys/types.h>
#define __NR_mysystemcall 338
#define mysystemcall() syscall(__NR_mysystemcall);
int main ()
{
mysystemcall();
return 0;
}
7. compiler test.c
root@shulong-desktop:~# gcc -Wall test.c -o systemcall
8. execute systemcall
root@shulong-desktop:~# ./systemcall
[ 39.289669] mysystemcall
就可順利加入自行定義的system call。
9 則留言:
Hey
I'm interested to learn [url=http://www.maxkravmaga.com][b]Krav Maga[/b][/url]. I have some MMA experience and I'm wondering if Krav Maga is right for me. I'm looking for a mix of [url=http://www.MaxKravMaga.com][b]Self Defense[/b] and a [url=http://www.MaxKravMaga.com][b]Krav Maga Workout[/b][/url]
any input would really help me
regards
Michael
Hi There
I need some help here folks
I'm Looking to purchase [url=http://www.milesgershon.com/tv-stands.html][b]TV Stands[/b][/url] or TV [url=http://www.milesgershon.com][b]Wall Units[/b][/url] For an apartment I'min the process of buying.
Can you folksgive me a good recommendation of where is the topplace to buy these? I live in Florida and I heard that the big thing about these [url=http://www.milesgershon.com][b]tv stands[/b][/url] is the cost of shipping and installation.
I also found this great article about wiring your entertainment center: http://www.helium.com/items/1577888-how-to-wire-your-home-entertainment-center
looking forward to your reply
[url=http://www.milesgershon.com][img] data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERG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LnNirD8jievewGnUTDbBqb3JI32EPKATvaAFagALAaRPqOfG1qPfCYvVa45FkfQWo1CBsnG2JAkb1UqC/GqcyP7sX93FfPGdmz50mv90MTJ3ZNndS1clRUVNpUeOnER6SpalWPI2HQwgdkNinhWNa+dPbCcT5zmf8AbGFzF+IjwrVRT8lSe7VwmYYbcWkKCLE8yEjshzwRRZCu1eelJt1DDTaC4hZcCALKta56j/CL8BvXizEvNX6mPODv+UXaxfihtYWnEFRJHDenFkegqh5rFIwnIT7koJqoPbhsVtIQpPC+h3tYtX8P0CTojdQkKhyq3GwtLbjqd7hfdISdCL6i8Z2GCpsdVPG2Jc5pZtrEbrcpJyy5mfS7Z3lWQUgtpCgQCpSkjeFiBex5jPGIO7BCUozqrqECyE0Z0AdXLsxOKLWaqOfW1osHPzFovqUsD6G0I6CxCHbSy5xHTcfz2P22fZdCqvJpcdaSbyriWkt7rg5grduFcLm2htdFgP4FoklVKDMLXMTYnkOBLDLc4iXQsE67ylAgaX1/dDsvCj6DYMvX6fdGwewQlouUWaVVpsvUKVgqrzEnMo5Rl1ISgKSeBG8oQuRkTnG64pAwHVbi1yp1hI9JcsYl45t1ud2eySbo8jJ02ZVPTUwzOdyZRtupJmQ4b90FBHe81r9carJT0/PJcYmav7GaY3Q2pwK3QLbu6NxJPBI4+DG/I2ds6HOGB5oeNPyo9bsKGtmfOlfHCKG7+FVJXscMJzzEvVvsOnZcC5OJWT07qXz/AEQjnJdPIOOJrqHlpTcN7jgKuoXEFdrZfzlWSDh2TbseK6mzY+hRhQnZUzhX+jqMjxqkOxJh48nnf1sOwGd7OavEEH7jO6jy7MTkiJmyHldjbLzOOtIxNRHpeX9qFNtziO7l3VF1ogJWNCbA6cdOESzi1h//2Q== [/img][/url]
O
Guys,
some advice needed:
I'm Looking to purchase [url=http://www.milesgershon.com/tv-stands.html][b]TV Stands[/b][/url] or TV [url=http://www.milesgershon.com][b]Wall Units[/b][/url] For a condo I'mbuying now.
Can you folksgive me a good recommendation of where is the bestdeal on these? I live in LA and I heard that the big thing about these [url=http://www.milesgershon.com][b]tv stands[/b][/url] is the cost of shipping and installation.
I also found this great article about wiring your entertainment center: http://www.helium.com/items/1577888-how-to-wire-your-home-entertainment-center
cheers
[url=http://www.milesgershon.com][img] data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCABQAFADASIAAhEBAxEB/8QAHQAAAQMFAQAAAAAAAAAAAAAABwQFCAABAwYJAv/EAEwQAAECBAMDBQgKEgMAAAAAAAECAwAEBREGByEIEjETQVFhwSIyUnJzhZGxFBUWKEJicaKkshgjJSczNDc4RVN1gaGzwsPS06O04//EABYBAQEBAAAAAAAAAAAAAAAAAAABAv/EABwRAQEBAQACAwAAAAAAAAAAAAABEQISQSExUf/aAAwDAQACEQMRAD8AmXAO241FOz1VbEgmclRp5VJg4wC9ug+99qHXPSv8yAghLzFRldZaoTrPk5hSfUYXMYpxfK/i2K6+zb9XUXU+pUUqW6oTvMWEFw7M5m5kyv4LH2KE26aq+f6oXy+dua8uRu48rqreHNKX9a8ac81CJ1FjBBRltojN9i27jOdV47TS/Wgw5S20/nEz32JUOjoXIS3Y3AXioCX+zVn3mDjrNil4ar05JvSEwh4u7sqhCzusrWLFIFtUiJeRzx2JR74GjdTUz/13Y6HQFQCtuj83+d/aEr9eDrAK251AZBzST8Koyo+ffsgIbuS/HSEcwxpwh+daAvpDfNIGsRpr8y1x0hsmEWvD7Np4w0TSeMVKbVixi0e3RrHiCDfsRpvn9ST0MzB/4HI6GRz22H/y90zyEx/JXHQmAqB/n3gRnMbASsNPzz8klc02+HGkBSrouQLHmggRqGbigMHrvzvt9sSrEffsX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nZUzhX+jqMjxqkOxJh48nnf1sOwGd7OavEEH7jO6jy7MTkiJmyHldjbLzOOtIxNRHpeX9qFNtziO7l3VF1ogJWNCbA6cdOESzi1h//2Q== [/img][/url]
Rachel
Hi People!
I'm Looking to purchase [url=http://www.milesgershon.com][b]Entertainment Centers[/b][/url] or [url=http://www.milesgershon.com][b]Wall Units[/b][/url] For a new hotel chain I'm working at in.
Can anyone give me a good recommendation of where is the best deal on these? I live in Jersey and I heard that the main thing about these [url=http://ent3rtacn3tr.blogspot.com/b]Entertainment Centers[/b][/url] is the cost of shipping and installation.
Thanks
Jo
Hello all, how is everybody?
What words..
Hi everybody, I just want to say hello! How is everyone??
Hello Good People
I Found This great tutorial on [url=http://www.milesgershon.com][b]Contemporary Wall Units[/b][/url]
Hope you enjoy going over it as much as I did.
Cheers
Fred
When you think about the specification of the term really enjoy, with relations to an enchanting connection along with another, however to be a sense that is certainly engendered should you have miltchmonkey a better relationship with yourself far too - and even for a a sense of greater unity spouse and children or man ( blank ) it develops into all the more extra ordinary that each anybody is looking to get in life is actually love.
張貼留言