I'm working on my own kernel using GCC, and when calling C functions from asm code, I have to do add esp,xx
myself. After some searching I found that stdcall
is a Microsoft invention and can't use it in GCC. Is there any handy way to do this work?
相关问题
- Error building gcc 4.8.3 from source: libstdc++.so
- Null-terminated string, opening file for reading
- What are the recommended GNU linker options to spe
- What is the right order of linker flags in gcc?
- What's the difference between 0 and dword 0?
相关文章
- gcc/g++ gives me error “CreateProcess: No such fil
- Calls that precede a function's definition can
- How do I get to see DbgPrint output from my kernel
- How can I use gcc's -I command to add recursiv
- How do I know if std::map insert succeeded or fail
- Is it possible to run 16 bit code in an operating
- How to specify gcc flags (CXXFLAGS) particularly f
- How to generate assembly code with gcc that can be
Wait, is this your own kernel, or the Linux kernel? Because if it's your own kernel, it's not Linux any more.
If you're working on Linux, you'll want to stick with regular calling conventions and write your assembly to match.
If you're working on your own kernel, you can do anything you want. GCC and Clang both support
stdcall
calling conventions on ix86 processors, e.g.,See: Function Attributes (GCC manual)