mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-12 01:08:00 +00:00
Add honeybadger to ape.S
This commit is contained in:
parent
e55e71ab48
commit
1a08594f95
2 changed files with 35 additions and 10 deletions
38
ape/ape.S
38
ape/ape.S
|
@ -1393,15 +1393,45 @@ long: push $GDT_LONG_DATA
|
||||||
call __map_phdrs
|
call __map_phdrs
|
||||||
push $0x037f
|
push $0x037f
|
||||||
fldcw (%rsp)
|
fldcw (%rsp)
|
||||||
movabs $1f,%rax
|
movabs $kernel,%rax
|
||||||
jmp *%rax
|
jmp *%rax
|
||||||
1: movabs $ape_stack_vaddr,%rsp
|
.endfn long
|
||||||
|
|
||||||
|
/* ▄▄▒▀▀▀▀▒▒▄░
|
||||||
|
█████▓▓▄░░░░ ▒▒▄░
|
||||||
|
▐█▓▓█▓▄█████▓░ ▀▒▄
|
||||||
|
▓█▓▓▓▓▓▓▓▓▓█▓ ░▀▒░
|
||||||
|
░▀▀▓█▓▓▓▓▓▓█▓ ░▀▒▄▄▒▄▄▄▒▒▒▀▀▀▀▀▀▀▀▀▀▀▀▀▀▒▒▄▒
|
||||||
|
░▀▓▓█▓▓▓▓▓▄ ░ ░▀▒▄▄ ▄
|
||||||
|
░▀█▓▓▓▓▓▄░ ░▀▒░ ▄▓▌
|
||||||
|
▀█▓▓▓▓▓█▓░ ░▀▄░ ░▄▓██░
|
||||||
|
░▀█▓▓▓▓▓█▄ ░▀▒▄▄▄▄▄▄▄▄▒▀▓█▓█▓░
|
||||||
|
░▀█▓▓▓▓█▓░ ░▄▓█▓▓█▓▄▌
|
||||||
|
░▀█▓▓▓▓▓▄ ▄▄▄▓▓██▓▓▒▒░ ▒▒▄▓█▓▓▓▓█▓
|
||||||
|
▀█▓▓▓▓▓▓▄▄░ ░▄▄▓██▓▓▓▓▓██████████████▓▓▓▓▓▓█▀
|
||||||
|
▐█▓▓▓▓▓▓▓██▓▓▄▄▄▄▄▄▄▄▄▓▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████████▓▓▀░
|
||||||
|
▀▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█░ ░░░░░░
|
||||||
|
▄░▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▌
|
||||||
|
█▓▄▀▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▓▓▀▀▀▀▀▀▀▓█▓▓▓▓▓▓▓▓▓▓▓▓
|
||||||
|
▐█▓█▓░▓█▓▓▓▓▓▓▓█▀▀▀▀▒░ ▐▓▓▓▓▓▓▄▒▀▓█▓▓▓▓▓▓▓▓█▌
|
||||||
|
▐█▓▓▓█▒▀█▓▓▓▓▓▓█▌ ▀█▓▓▓▓▓█▄░▀▓▓█▓▓▓▓▓▓█░
|
||||||
|
█▓▓▓▓▓█░▐█▓▓▓▓▓█▌ ▀▓█▓▓▓▓█▌ ░▀█▓▓▓▓▓█▄
|
||||||
|
█▓▓▓▓█▌ ░█▓▓▓▓▓█░ ▓█▓▓▓▓▓░ ▒█▓▓▓▓▓█░
|
||||||
|
█▓▓▓▓█░ █▓▓▓▓▓█░ █▓▓▓▓▓█░ ▐█▓▓▓▓█▌
|
||||||
|
▐█▓▓▓▓▓▄ █▓▓▓▓▓█ ░▄▄▓█▓▓▓▓▓█░ ▐█▓▓▓▓█░
|
||||||
|
▓█▓▓▓█▓▐█▓▓▓▓█▌ ▓██▓▓▓▓▓▓█▀ ▓█▓▓▓▓█
|
||||||
|
▀▓██▒▄█▓▓▓▓▓█░ ░█▓▓▓▓▓██▀░ ░▓█▓▓▓▓█▌
|
||||||
|
░░█▓▓▓▓▓█▓ ░▀▀▀▀▀▀ ▓█▓▓▓▓▓▓
|
||||||
|
╔───────────────────────────────────────────────────────────▀▀▀▀▀▀───────────│─╗
|
||||||
|
│ αcτµαlly pδrταblε εxεcµταblε § cosmopolitan libc runtime runtime ─╬─│┼
|
||||||
|
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||||
|
kernel: movabs $ape_stack_vaddr,%rsp
|
||||||
add $ape_stack_memsz,%rsp
|
add $ape_stack_memsz,%rsp
|
||||||
|
movl $0,0x7b000 # unmap null 2mb
|
||||||
#if USE_SYMBOL_HACK
|
#if USE_SYMBOL_HACK
|
||||||
.byte 0x0f,0x1f,0207 # nop rdi binbase
|
.byte 0x0f,0x1f,0207 # nop rdi binbase
|
||||||
.long (IMAGE_BASE_VIRTUAL-IMAGE_BASE_REAL)/512
|
.long (IMAGE_BASE_VIRTUAL-IMAGE_BASE_REAL)/512
|
||||||
#endif
|
#endif
|
||||||
movl $0,0x7b000 # unmap null 2mb
|
|
||||||
.weak __hostos
|
.weak __hostos
|
||||||
ezlea __hostos,ax
|
ezlea __hostos,ax
|
||||||
test %rax,%rax
|
test %rax,%rax
|
||||||
|
@ -1426,7 +1456,7 @@ long: push $GDT_LONG_DATA
|
||||||
push $.Larg0 # argv[0]
|
push $.Larg0 # argv[0]
|
||||||
push $1 # argc
|
push $1 # argc
|
||||||
jmp _start
|
jmp _start
|
||||||
.endfn long
|
.endfn kernel
|
||||||
|
|
||||||
.rodata
|
.rodata
|
||||||
.Larg0: .asciz "ape.com"
|
.Larg0: .asciz "ape.com"
|
||||||
|
|
|
@ -183,13 +183,8 @@ static void GetOpts(int *argc, char *argv[]) {
|
||||||
ttyquantsetup(g_flags.quant, kTtyQuantRgb, g_flags.blocks);
|
ttyquantsetup(g_flags.quant, kTtyQuantRgb, g_flags.blocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned char ChessBoard(unsigned y, unsigned x, unsigned char a,
|
|
||||||
unsigned char b) {
|
|
||||||
return !((y ^ x) & (1u << 2)) ? a : b;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned char AlphaBackground(unsigned y, unsigned x) {
|
static unsigned char AlphaBackground(unsigned y, unsigned x) {
|
||||||
return ChessBoard(y, x, 255, 200);
|
return 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *Deblinterlace(long dyn, long dxn, unsigned char dst[3][dyn][dxn],
|
static void *Deblinterlace(long dyn, long dxn, unsigned char dst[3][dyn][dxn],
|
||||||
|
|
Loading…
Reference in a new issue