Hacker GitHub

← All repos

lpsantil/rt0

View on GitHub ↗ ★ 586 C

A minimal C runtime for Linux i386 & x86_64

16 mentions on Hacker News by 2 people: 3 stories, 13 comments · first 2015-01-29 · latest 2023-10-19

Mentions per year 16 mentions · busiest year 2015 (8)
20082026
  1. …with file rule variables (my name for them, `OBJ = ${SRC:.c=.o}`). https://github.com/lpsantil/rt0/blob/master/Makefile https://github.com/lpsantil/oop0/blob/master/Makefile
    comment by oso2k · 2023-10-19 · in Show HN: One makefile to rule them all
  2. …be removed. Some of the code & data glibc adds has purpose (like TLS (thread level storage) bits). https://github.com/lpsantil/rt0/blob/master/STATS.md
    comment by oso2k · 2023-02-05 · in A Linking Adventure
  3. Also worth noting that you should be able get the binary close to 2KB if you pass some other options. https://github.com/lpsantil/rt0/blob/master/STATS.md
    comment by oso2k · 2023-02-05 · in A Linking Adventure
  4. …but main will still work. [0] https://github.com/torvalds/linux/tree/master/tools/include/... [1] https://github.com/lpsantil/rt0/blob/master/src/lib/00_start...
    comment by oso2k · 2023-02-05 · in A Linking Adventure
  5. Locating argc, argv, and envp on the stack is done by the runtime [0]. [0] https://github.com/lpsantil/rt0/blob/master/src/lib/00_start...
    comment by oso2k · 2020-08-10 · in Where do argc and argv come from?
  6. …they're used to keep track of what the kernel is doing to the program's virtual address space. [0] https://github.com/lpsantil/rt0/blob/master/t/sbrk.c
    comment by oso2k · 2017-09-19 · in Memory allocation for the curious
  7. …There's also lots of references to other small c runtimes. I'll be adding this one as well. [0] https://github.com/lpsantil/rt0
  8. This seems a lot more complicated than what I implemented in rt0 [0]. [0] https://github.com/lpsantil/rt0
  9. …by looking at my librt0 [0] project. You can also see a minimal amd64 version in C here [1]. [0] https://github.com/lpsantil/rt0/blob/master/src/lib/syscall.... [1] https://gist.github.com/lunixbochs/462ee21c3353c56b910f
  10. …it felt "icky" to put offsets outside of the "brackets" (or parenthesis, as it were) [0][1]. [0] https://github.com/lpsantil/rt0/blob/master/src/lib/00_start... [1] https://github.com/lpsantil/rt0/blob/master/src/lib/00_start...
  11. …stop continuous integration by doing make stop_ci Obviously, this is inspired by rc.d scripts. [0] https://github.com/lpsantil/rt0/blob/master/Makefile#L117
  12. …that's fixed. Just hope gcc on i386 doesn't stop doing `sub ESP, 0x1C` upon entry to _start. [0] https://github.com/lpsantil/rt0/blob/master/lib/00_start.c
  13. …goal is to rewrite asmutils'[1] httpd [2] in C and get a binary about 2-3x in size (2-3K). [0] https://github.com/lpsantil/rt0 [1] http://asm.sourceforge.net/asmutils.html [2] https://github.com/leto/asmutils/blob/master/src/httpd.asm
    comment by oso2k · 2015-01-29 · in C Runtime Overhead