kernel/system_call.asm
来源:互联网 发布:笔记本电池校正软件 编辑:程序博客网 时间:2024/06/03 10:04
- ;By Marcus Xing
- ;kernel/system_call.asm
- ;关于系统调用的代码,汇编写成
- ;-------------------------------------------------------------------------宏集合
- RESET_FUNCTION_NO equ 0 ;Reset系统调用的功能号
- WRITE_FUNCTION_NO equ 1 ;Write系统调用的功能号
- SEND_RECEIVE_FUNCTION_NO equ 2 ;SendReceive系统调用的功能号
- SYSTEM_CALL_INT_VECTOR equ 0x90 ;系统调用进入内核的中断向量号
- ;---------------------------------------------------------------------global集合
- global Reset
- global Write
- global Send_Receive
- [section .text]
- [bits 32]
- ;--------------------------------------------------------------------------Reset
- ;重启,不会返回了
- Reset:
- mov eax,RESET_FUNCTION_NO
- int SYSTEM_CALL_INT_VECTOR
- ;--------------------------------------------------------------------------Write
- ;把Printf解析好的字符串交给系统调用在调用的进程的控制台打印出来
- Write:
- mov eax,WRITE_FUNCTION_NO
- mov edx,[esp + 4] ;串地址->edx
- int SYSTEM_CALL_INT_VECTOR
- ret
- ;-------------------------------------------------------------------Send_Receive
- ;收发消息
- Send_Receive:
- mov eax,SEND_RECEIVE_FUNCTION_NO
- mov edx,[esp + 12] ;Message指针->edx
- mov ecx,[esp + 8] ;源进程pid->ecx
- mov edi,[esp + 4] ;功能号function->ebx
- int SYSTEM_CALL_INT_VECTOR
- ret
- kernel/system_call.asm
- kernel/system_call.asm
- kernel/system_call.c
- kernel/system_call.c
- /kernel/kernel.asm
- kernel/kernel.asm
- asm.s /trap.c/system_call.s源码分析
- 内核初始化kernel.asm
- 内核初始化kernel.asm
- 操作系统入门(六) - kernel.asm
- system_call 中断处理过程
- 详细分析system_call
- system_call中断处理过程
- asm
- ASM
- asm
- asm
- asm
- kernel/keyboard.c
- kernel/proc.c
- kernel/protect.c
- kernel/system_call.c
- kernel/tty.c
- kernel/system_call.asm
- CSS中cursor样式
- kernel/kernel.asm
- lib/lib_in_asm.asm
- lib/lib_in_c.c
- makefile.boot
- makefile.kernel
- 我与学生大本营的故事
- JSP培训