Skip to content

Commit

Permalink
Make ncdu happen
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed Apr 20, 2018
1 parent ea51f93 commit 4a8c3ea
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (int)startThings {
create_first_process();
char *program = "/bin/login";
char *argv[] = {program, "root", NULL};
char *envp[] = {NULL};
char *envp[] = {"TERM=xterm-256color", NULL};
err = sys_execve(program, argv, envp);
if (err < 0)
return err;
Expand Down
3 changes: 2 additions & 1 deletion app/Terminal.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ - (void)refresh {

NSError *err = nil;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:@[str] options:0 error:&err];
NSString *json = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSAssert(err == nil, @"JSON serialization failed, wtf");
NSString *jsToEvaluate = [NSString stringWithFormat:@"term.write(%@[0])", [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]];
NSString *jsToEvaluate = [NSString stringWithFormat:@"term.write(%@[0])", json];
[self.webView evaluateJavaScript:jsToEvaluate completionHandler:nil];
}

Expand Down
1 change: 1 addition & 0 deletions app/xtermjs/term.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!doctype html>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, height=device-height, initial-scale=1.0">
<div id="terminal"></div>
<script src="term.js"></script>
1 change: 1 addition & 0 deletions emu/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ __no_instrument int glue(decoder_name, OP_SIZE)(struct cpu_state *cpu, struct tl
case 0xd80: TRACE("fadd mem32"); FADDM(mem_addr_real,32); break;
case 0xd81: TRACE("fmul mem32"); FMULM(mem_addr_real,32); break;
case 0xd86: TRACE("fdiv mem32"); FDIVM(mem_addr_real,32); break;
case 0xd87: TRACE("fdivr mem32"); FDIVRM(mem_addr_real,32); break;
case 0xd90: TRACE("fld mem32"); FLDM(mem_addr_real,32); break;
case 0xd93: TRACE("fstp mem32"); FSTM(mem_addr_real,32); FPOP; break;
case 0xd95: TRACE("fldcw mem16"); FLDCW(mem_addr); break;
Expand Down
2 changes: 2 additions & 0 deletions emu/interp/fpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ static inline extFloat80_t extF80_abs(extFloat80_t f) {
ST(0) = extF80_div(ST(0), i64_to_extF80((sint(z)) get(val,z)))
#define FDIVM(val,z) \
ST(0) = extF80_div(ST(0), f_to_extF80(get(val,z),z))
#define FDIVRM(val,z) \
ST(0) = extF80_div(f_to_extF80(get(val,z),z), ST(0))

#define FCHS() \
ST(0) = extF80_neg(ST(0))
Expand Down
4 changes: 2 additions & 2 deletions kernel/calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ void handle_interrupt(int interrupt) {
cpu->eax = result;
}
} else if (interrupt == INT_GPF) {
println("page fault at %x", cpu->segfault_addr);
println("page fault at 0x%x", cpu->segfault_addr);
deliver_signal(current, SIGSEGV_);
} else if (interrupt == INT_UNDEFINED) {
println("illegal instruction");
println("illegal instruction at 0x%x", cpu->eip);
deliver_signal(current, SIGILL_);
} else if (interrupt != INT_TIMER) {
println("exiting");
Expand Down

0 comments on commit 4a8c3ea

Please sign in to comment.