代码
- foo.asm
extern bar_func;
[section .data]
arg1 dd 3
arg2 dd 4
[section .text]
global _start
global foo_print
_start:
mov eax, dword[arg1]
push eax
mov eax, dword [arg2]
push eax
call bar_func
add esp,
本文探讨了如何在操作系统开发中使用C语言,通过将C代码编译为.o模块并将其与汇编代码整合,解决ELF格式导致的直接执行问题。关键词涉及汇编语言、C语言、ELF格式和内核加载。
代码
extern bar_func;
[section .data]
arg1 dd 3
arg2 dd 4
[section .text]
global _start
global foo_print
_start:
mov eax, dword[arg1]
push eax
mov eax, dword [arg2]
push eax
call bar_func
add esp,
1088

被折叠的 条评论
为什么被折叠?