mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
Start nostartfiles examples.
Interlink freestanding directories and readme.
This commit is contained in:
14
README.adoc
14
README.adoc
@@ -13170,7 +13170,11 @@ The C standard library infrastructure is implemented in the common userland / ba
|
||||
|
||||
==== Freestanding programs
|
||||
|
||||
Unlike most our other assembly examples, which use the C standard library for portability, examples under `freestanding/` directories don't link to the C standard library.
|
||||
Unlike most our other assembly examples, which use the C standard library for portability, examples under `freestanding/` directories don't link to the C standard library:
|
||||
|
||||
* link:userland/arch/x86_64/freestanding/[]
|
||||
* link:userland/arch/arm/freestanding/[]
|
||||
* link:userland/arch/aarch64/freestanding/[]
|
||||
|
||||
As a result, those examples cannot do IO portably, and so they make raw system calls and only be run on one given OS, e.g. <<linux-system-calls>>.
|
||||
|
||||
@@ -13185,6 +13189,14 @@ In order to GDB step debug those executables, you will want to use `--no-continu
|
||||
|
||||
You are now left on the very first instruction of our tiny executable!
|
||||
|
||||
===== nostartfiles programs
|
||||
|
||||
Assembly examples under `nostartfiles` directories can use the standard library, but they don't use the pre-`main` boilerplate and start directly at our explicitly given `_start`:
|
||||
|
||||
* link:userland/arch/aarch64/freestanding/[]
|
||||
|
||||
I'm not sure how much stdlib functionality is supposed to work without the pre-main stuff, but I guess we'll just have to find out!
|
||||
|
||||
=== GCC inline assembly
|
||||
|
||||
Examples under `arch/<arch>/c/` directories show to how use inline assembly from higher level languages such as C:
|
||||
|
||||
Reference in New Issue
Block a user