2 ms·
The kernel just copies the data to the program's stack in a contiguous manner. Obtaining pointers to them can seem somewhat magical if you're writing a nolibc p
by matheusmoreira 3y ago
The kernel just copies the data to the program's stack in a contiguous manner. Obtaining pointers to them can seem somewhat magical if you're writing a nolibc program but I wouldn't call it horrible.
I implemented it for my programming language with some rather simple assembly code:
https://github.com/lone-lang/lone/blob/master/arch/x86_64.c#L201 https://github.com/lone-lang/lone/blob/master/arch/x86_64.c#...
https://github.com/lone-lang/lone/blob/master/arch/aarch64.c#L208 https://github.com/lone-lang/lone/blob/master/arch/aarch64.c...