Add honeybadger to ape.S

This commit is contained in:
Justine Tunney 2021-03-03 15:00:41 -08:00
parent e55e71ab48
commit 1a08594f95
2 changed files with 35 additions and 10 deletions

View file

@ -1393,15 +1393,45 @@ long: push $GDT_LONG_DATA
call __map_phdrs
push $0x037f
fldcw (%rsp)
movabs $1f,%rax
movabs $kernel,%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
movl $0,0x7b000 # unmap null 2mb
#if USE_SYMBOL_HACK
.byte 0x0f,0x1f,0207 # nop rdi binbase
.long (IMAGE_BASE_VIRTUAL-IMAGE_BASE_REAL)/512
#endif
movl $0,0x7b000 # unmap null 2mb
.weak __hostos
ezlea __hostos,ax
test %rax,%rax
@ -1426,7 +1456,7 @@ long: push $GDT_LONG_DATA
push $.Larg0 # argv[0]
push $1 # argc
jmp _start
.endfn long
.endfn kernel
.rodata
.Larg0: .asciz "ape.com"

View file

@ -183,13 +183,8 @@ static void GetOpts(int *argc, char *argv[]) {
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) {
return ChessBoard(y, x, 255, 200);
return 255;
}
static void *Deblinterlace(long dyn, long dxn, unsigned char dst[3][dyn][dxn],