Code:
__ ALL HAIL GLENDA
( \
__ \ '\
( "-_ \ .-'----._
'-_ "v" "-
"Y' ".
| |
| o o |
| .<>. |
\ "Ll" |
| . '
| |
( /
/'\ . \
"--^--.__,\_)-'
Mort's thing about embedded data in C
=====================================
Printing a string (with puts()) maps the actual string in assembly code, then calls it directly by address. It means that the string itself is visible directly in the binary.
objcopy: take an input file and outputs an object file, that you can link in your binary. It's tied to GNU though…
Another option is to run "xxd" to output the hexa version of your file into a char array, and include it manually in your code. It's slow however.
mort wrote "strliteral" does the same, but doesn't output the bytes in hexadecimal, but as ASCII chars directly, which is apparently much faster. The string size, however, is limited.
Proposal: #embed "file"
Freem boots without disk
========================
(definitely french)
diskless boot ? no local storage at all, require a network link.
Usage:
- Storage needs to be centralized
- Automate system installations
The appliance will boot from the network by using a protocol named "PXE" (Pre-boot eXecution Environment).
There is no static IP required. It needs to get a network IP (DHCP or BOOTP), and have a way to fetch the "payload" (OS image). Two simple protocols are HTTP or TFTP.
The applicance firmware MUST be able to boot from network. All UEFI firmware have PXE support.
Freem's usage: test automatic debian installs, for a pet project (debian fork). Virtual machines boot from the net, and run their install script automatically.
DHCP server
- VLAN ?
- PXE image IP/path exposed in BOOTP range
TFTP server
- tftpd, using default config
- "secure" - LOL, you're a TFTP bro.
- images in /src/tftp/pxe/netinsts/
needed folder: "pxelinux.cfg" require for BOOTP config. The config specified the kernel and inirtd path, with the full tftp:// URL, and optionally kernel parameters (eg, "nfsroot", "ip", …)
Freem uses NFS to provide the filesystem root, using a read-only NFS share (to prevent modification to the base rootfs).
Venam's take on name resolution
===============================
Focusing on end-user side.
A few languages don't use stdlib, there is no ONE TRUE WAY to resolve names. This is a mess.
Even POSIX has multiple ways to do it (gethostbyname(), getaddrinfo(), …)
The grandpa: resolver(3) and libbind (RFC based)
-> DNS network calls only
libc's gethostbyname() (obsolete, v4 only), getaddrinfo()
aaaaaand GNU's gethostbyname2() …
They rely on NSS (name service switch), which specifies all the places names can be found, and their order.
resolvconf(8), how to fuck up a static /etc/resolv.conf, systemd way.
A few processes can now cache DNS/hosts queries, thanks to NSS (eg, nscd).
Z3bra's idea on how to read mails
=================================
hint: don't.