Get Cosmopolitan into releasable state

A new rollup tool now exists for flattening out the headers in a way
that works better for our purposes than cpp. A lot of the API clutter
has been removed. APIs that aren't a sure thing in terms of general
recommendation are now marked internal.

There's now a smoke test for the amalgamation archive and gigantic
header file. So we can now guarantee you can use this project on the
easiest difficulty setting without the gigantic repository.

A website is being created, which is currently a work in progress:
https://justine.storage.googleapis.com/cosmopolitan/index.html
This commit is contained in:
Justine Tunney 2020-11-25 08:19:00 -08:00
parent dba7552c1e
commit ea0b5d9d1c
775 changed files with 6864 additions and 3963 deletions

View file

@ -40,11 +40,10 @@
#include "ape/notice.inc"
#include "ape/relocations.h"
#include "libc/elf/def.h"
#include "libc/macho.h"
#include "libc/nexgen32e/uart.h"
#include "libc/nexgen32e/vidya.h"
#include "libc/nt/pedef.h"
#include "libc/nexgen32e/vidya.h"
#include "libc/macho.internal.h"
#include "libc/nexgen32e/uart.internal.h"
#include "libc/nexgen32e/vidya.internal.h"
#include "libc/nt/pedef.internal.h"
#include "libc/dce.h"
#include "libc/sysv/consts/prot.h"
@ -440,33 +439,6 @@ apmoff: mov $0x5300,%ax # apm installation check
1: call panic
.endfn apmoff,globl
/ Video put char.
/
/ @param al is the char
/ @mode real
rvputc: push %bx # don't clobber bp,bx,di,si,cx
push %bp # original ibm pc scroll up bug
mov $7,%bx # normal mda/cga style page zero
mov $0x0e,%ah # teletype output al cp437
int $0x10 # vidya service
pop %bp # preserves al
pop %bx
ret
.endfn rvputc
/ Video put string.
/
/ @param di is the string
/ @mode real
rvputs: mov %di,%si
0: lodsb
test %al,%al
je 1f
call rvputc
jmp 0b
1: ret
.endfn rvputs,globl,hidden
/*
αcτµαlly pδrταblε εxεcµταblε § partition table
*/
@ -1267,6 +1239,33 @@ sputs: push %bx
ret
.endfn sputs,globl
/ Video put string.
/
/ @param di is the string
/ @mode real
rvputs: mov %di,%si
0: lodsb
test %al,%al
je 1f
rlcall rvputc
jmp 0b
1: ret
.endfn rvputs,globl,hidden
/ Video put char.
/
/ @param al is the char
/ @mode real
rvputc: push %bx # don't clobber bp,bx,di,si,cx
push %bp # original ibm pc scroll up bug
mov $7,%bx # normal mda/cga style page zero
mov $0x0e,%ah # teletype output al cp437
int $0x10 # vidya service
pop %bp # preserves al
pop %bx
ret
.endfn rvputc
/*
@ -1613,8 +1612,8 @@ metal:
mov $.Lape.bss.vaddr,%edi
mov $.Lape.bss.memsz,%ecx
rep stosb
.weak hostos
ezlea hostos,ax
.weak __hostos
ezlea __hostos,ax
test %rax,%rax
jz 1f
movb $METAL,(%rax)

View file

@ -177,7 +177,7 @@
#ifdef __LINKER__
#include "ape/macros.h"
#include "ape/config.h"
#include "libc/nt/pedef.h"
#include "libc/nt/pedef.internal.h"
#include "libc/zip.h"
ENTRY(_start)

View file

@ -39,7 +39,7 @@ APE_DEPS = $(APE_LIB)
APE_CHECKS = $(APE_HDRS:%=o/%.ok)
o/ape/idata.inc: \
ape/idata.h \
ape/idata.internal.h \
ape/relocations.h
$(APE_OBJS): $(BUILD_FILES) \

View file

@ -38,7 +38,7 @@
/**
* PC Display Configuration (MDA/CGA)
* @see www.lammertbies.nl/comm/info/serial-uart.html
* @see ape/lib/vidya.h
* @see ape/lib/vidya.internal.h
*/
#ifndef VIDYA_MODE
#define VIDYA_MODE VIDYA_MODE_CGA

View file

@ -1,22 +1,3 @@
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi
Copyright 2020 Justine Alexandra Roberts Tunney
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#ifndef APE_IDATA_H_
#define APE_IDATA_H_
#ifdef __ASSEMBLER__

View file

@ -20,7 +20,7 @@
#include "ape/config.h"
#include "ape/lib/pc.h"
#include "libc/bits/bits.h"
#include "libc/bits/safemacros.h"
#include "libc/bits/safemacros.internal.h"
/**
* Virtualizes physical memory.

View file

@ -1,38 +1,3 @@
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi
Copyright 2020 Justine Alexandra Roberts Tunney
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
αcτµαlly pδrταblε εxεcµταblε § macros
*/
#ifndef APE_MACROS_H_
#define APE_MACROS_H_
#include "libc/macros.h"

View file

@ -1,41 +0,0 @@
#ifndef COSMOPOLITAN_APE_MTIME_H_
#define COSMOPOLITAN_APE_MTIME_H_
#include "libc/dos.h"
/**
* @fileoverview Deterministic last modified timestamp embedding.
*/
#ifndef MTIME_YEAR
#define MTIME_YEAR 2019
#endif
#ifndef MTIME_MONTH
#define MTIME_MONTH 1
#endif
#ifndef MTIME_DAY
#define MTIME_DAY 1
#endif
#ifndef MTIME_HOUR
#define MTIME_HOUR 0
#endif
#ifndef MTIME_MINUTES
#define MTIME_MINUTES 0
#endif
#ifndef MTIME_SECONDS
#define MTIME_SECONDS 0
#endif
#ifndef ZIP_MTIME_DATE
#define ZIP_MTIME_DATE DOS_DATE(MTIME_YEAR, MTIME_MONTH, MTIME_DAY)
#endif
#ifndef ZIP_MTIME_TIME
#define ZIP_MTIME_TIME DOS_TIME(MTIME_HOUR, MTIME_MINUTES, MTIME_SECONDS)
#endif
#endif /* COSMOPOLITAN_APE_MTIME_H_ */