Clean up two old blogs, which was edited in opera (the edit box was so small). In firefox, I can review these blogs easily, and some clean up done.
NASM 0.99.01 was buggy for the 32bit/16bit codegen. When an instruction which access register and mem, it would be generated with 0x67 prefix for a 16bit segment. This blocks the elf2 bootsect, which has size limitation, extra 0x67 makes the code bloated, so the compilation breaks.
I did a quick hack, and posted the new compiled binary to the ReactOS Build Environment maintainer. Also I filed it as a bug, though the nasm64developer told me that this couldn't be reproduced in 0.99.02 CVS snapshot. O_O , after a try , yes, it's already fixed. ;) so my hacking over nasm is useless.
Though another thing interesting is spotted about GDB. GDB itself is a nice debugger. But...
c 代码
- #include "stdio.h"
- void __stdcall call()
- {
- printf("hello!");
- }
- void main()
- {
- call();
- }
when you try to
gdb下调试
gdb fails.
This is the reason why gdb couldn't get all symbols work in Kernel Debugging.
Remarks:
__stdcall __fastcall are calling convention in Windows, they both add @ to the mangled name, seems like gdb fail to deal with mangle name with '@'
mangle name(link time symbol):
c mangle convention: underscore prefix, so every C symbols in asm would be prefixed with an underscore.
so a typical link with ASM files would be
test.c
c 代码
- extern int myasmSymbol;
- int main()
- {
- return myasmSymbol;
- }
myasm.S
asm 代码
- .text
- .global _myasmSymbol
- _myasmSymbol: .int 0
gcc -c myasm.S
gcc -c test.c
gcc test.o myasm.o -o test.exe
分享到:
相关推荐
Fixed the detection of infinite floating point values on IRIX (and possibly other systems) and applied another few minor cleanups.
- encoder/decoder: Various cleanups/bugfixes (AT) - encoder/decoder: Deblocking speedups (AT) - encoder/decoder: add version information command line switches (KS) - encoder: NAL unit priority bug ...
- FIX: some cleanups in asIO.c (stdio, stderr, io.write, ...) V0.1b - NEW: binary number representation with, e.g.: '0b001110' - NEW: timer tick-time variable (100ns, by default) in "pic.TIMERTICK" ...
ak2新版内核 AceKard All-In-One (AK-AIO) v1.5 ---------------------------------- Credits ------- AKAIO: ...Based off of AKBBS' source contributions from the above and following authors: ...
).- Added the property FileStream to the class TAtachedFile and the procedure SaveToStream, this was done by Brian Sheperd- The address separator (in the TO: field) is ‘,‘ and ‘;‘ now (before it ...
3. 假设(Assumptions)和设置/清理(Setups/Cleanups):测试前的准备工作和测试后的清理工作,确保测试环境的一致性。 4. 断言(Assertions):检查预期结果与实际结果是否相符,用于确定测试是否通过。 5. 固定的...
NEWS for OpenSC -- History of user visible changes Complete change history is available online: ... New in 0.12.0; 2010-12-22 * OpenSC uses a single reader driver, specified at compile time. ...
Table of Contents Summary of gdb . . . . . . . . ....Free Software ....Free Software Needs Free Documentation ....Contributors to gdb....1 A Sample gdb Session ....2 Getting In and Out of gdb ....2.1 Invoking gdb ....
Code Cleanups Porting to Python 3.4 Changes in ‘python’ Command Behavior Changes in the Python API Changes in the C API Changed in 3.4.3 PEP 476: Enabling certificate verification by default for...
3.1.1 Important MinorSyntax Cleanups . . . . . . . . . . . . . . . . . . . . . 13 3.1.2 AutomaticType Deductionwith auto . . . . . . . . . . . . . . . . . . . 14 3.1.3 UniformInitialization and ...