6ffed14b9c
Actually Portable Executable now supports Android. Cosmo's old mmap code required a 47 bit address space. The new implementation is very agnostic and supports both smaller address spaces (e.g. embedded) and even modern 56-bit PML5T paging for x86 which finally came true on Zen4 Threadripper Cosmopolitan no longer requires UNIX systems to observe the Windows 64kb granularity; i.e. sysconf(_SC_PAGE_SIZE) will now report the host native page size. This fixes a longstanding POSIX conformance issue, concerning file mappings that overlap the end of file. Other aspects of conformance have been improved too, such as the subtleties of address assignment and and the various subtleties surrounding MAP_FIXED and MAP_FIXED_NOREPLACE On Windows, mappings larger than 100 megabytes won't be broken down into thousands of independent 64kb mappings. Support for MAP_STACK is removed by this change; please use NewCosmoStack() instead. Stack overflow avoidance is now being implemented using the POSIX thread APIs. Please use GetStackBottom() and GetStackAddr(), instead of the old error-prone GetStackAddr() and HaveStackMemory() APIs which are removed. |
||
---|---|---|
.. | ||
calls | ||
consts | ||
dos2errno | ||
errfuns | ||
BUILD.mk | ||
consts.sh | ||
describeos.greg.c | ||
dos2errno.sh | ||
errfun.S | ||
errfun2.c | ||
errfuns.h | ||
errfuns.sh | ||
errno.c | ||
gen.sh | ||
hostos.S | ||
macros.internal.h | ||
README.md | ||
restorert.S | ||
strace.greg.c | ||
syscall2.S | ||
syscall3.S | ||
syscall4.S | ||
syscalls.sh | ||
syscon.S | ||
syscount.S | ||
syslib.S | ||
sysret.c | ||
systemfive.S | ||
sysv.c |
SYNOPSIS
System Five Import Libraries
OVERVIEW
Bell System Five is the umbrella term we use to describe Linux, FreeBSD, OpenBSD, and Mac OS X which all have nearly-identical application binary interfaces that stood the test of time, having definitions nearly the same as those of AT&T back in the 1980's.
Cosmopolitan aims to help you build apps that can endure over the course of decades, just like these systems have: without needing to lift a finger for maintenance churn, broken builds, broken hearts.
The challenge to System V binary compatibility basically boils down to numbers. All these systems agree on what services are provided, but tend to grant them wildly different numbers.
We address this by putting all the numbers in a couple big shell scripts, ask the GNU Assembler to encode them into binaries using an efficient LEB128 encoding, unpacked by _init(), and ref'd via extern const. It gives us good debuggability, and any costs are gained back by fewer branches in wrapper functions.z