Anonymous user
James Molloy's Tutorial Known Bugs: Difference between revisions
Jump to navigation
Jump to search
James Molloy's Tutorial Known Bugs (view source)
Revision as of 22:41, 26 February 2014
, 10 years agoMinor spell check
[unchecked revision] | [unchecked revision] |
(Created page with "Several sources - including this Wiki - point to [http://www.jamesmolloy.co.uk/tutorial_html/ James Molloy's Roll your own toy UNIX-clone OS] Tutorial as a starting point. Thi...") |
m (Minor spell check) |
||
Line 13:
== Problem: __cdecl calling convention ==
The tutorial states that the <tt>__cdecl</tt> calling convention is used. This is, however, a Windows term and your cross-compiler uses a similar calling convention but it is called the System V ABI for i386. It is advisable to understand this calling convention in depth, especially parts about how the parameters on the stack are clobbered and how structure parameters are passed. This will be very useful later and will help you avoid a later subtle bug. The function call example in 2.3
== Problem: CFLAGS ==
The tutorial recommends using these compilation options <tt>-nostdlib -nostdinc -fno-builtin -fno-stack-protector</tt>, but this is not the recommended practice. The tutorial
== Problem: Not using libgcc ==
Line 23:
{{Main|libgcc}}
The tutorial disables libc and [[libgcc]] through the <tt>-nodefaultlibs</tt> option (implied by <tt>-nostdlib</tt>) but
== Problem: Not setting a stack ==
The tutorial
== Problem: main function ==
|