====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
soc:2010:peper:notes:usermode_explained [2010/06/14 16:09] peper |
soc:2010:peper:notes:usermode_explained [2010/06/14 17:00] (current) peper |
||
---|---|---|---|
Line 133: | Line 133: | ||
The function calling convention is also desribed in the ABI docs: [[http://www.sco.com/developers/devspecs/abi386-4.pdf|i386 ABI]] (pages 36-38) | The function calling convention is also desribed in the ABI docs: [[http://www.sco.com/developers/devspecs/abi386-4.pdf|i386 ABI]] (pages 36-38) | ||
- | and [[http://www.x86-64.org/documentation/abi.pdf|AMD64 ABI]] (pages 15-23). | + | and [[http://www.x86-64.org/documentation/abi.pdf|AMD64 ABI]] (pages 15-23). A nice overview is [[http://www.agner.org/optimize/calling_conventions.pdf|calling conventions]]. |
What we need to do after ''main()'' returns is to call the ''exit'' syscall. Details on that are in the next section. | What we need to do after ''main()'' returns is to call the ''exit'' syscall. Details on that are in the next section. | ||
Line 187: | Line 187: | ||
With that information we can implement our own ''syscall()''. | With that information we can implement our own ''syscall()''. | ||
+ | |||
''arch/i386/core/linux/linux_syscall.S'': | ''arch/i386/core/linux/linux_syscall.S'': | ||
<code asm> | <code asm> |