Start nostartfiles examples.

Interlink freestanding directories and readme.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-08-25 00:00:00 +00:00
parent 06374cda42
commit 96239298a9
9 changed files with 32 additions and 1 deletions

View File

@@ -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: