~grimmware/lc3

83c5b2883cab390bd086d0447fbfdcb9f7ad920c — glenda 2 years ago 3b51013 front
Remove spurious debug, add text file to debug interface
2 files changed, 5 insertions(+), 1 deletions(-)

M fs.c
M lc3.c
M fs.c => fs.c +5 -0
@@ 7,6 7,7 @@ Channel* clk;
enum {
	Lclk,
	Lpc,
	Ltext,
};

typedef struct Lfid Lfid;


@@ 55,6 56,9 @@ fsread(Req *r)
	case Lpc:
		readstr(r, smprint("%x\n",reg[R_PC]));
		break;
	case Ltext:
		readbuf(r, memory, sizeof(u16int) * MEMORY_MAX);
		break;
	}
	respond(r, nil);
	return;


@@ 90,5 94,6 @@ newfs(void)
	fs.tree = tree;
	createfile(tree->root, "clk", nil, 0644, lfidgen(Lclk));
	createfile(tree->root, "pc", nil, 0644, lfidgen(Lpc));
	createfile(tree->root, "text", nil, 0644, lfidgen(Ltext));
	threadpostmountsrv(&fs, "lc3fs", mtpt, MREPL | MCREATE);
}

M lc3.c => lc3.c +0 -1
@@ 252,7 252,6 @@ threadmain(int argc, char* argv[])
	int running = 1;
	while (running)
	{
		print("%d\n", (int) steps);
		if(mtpt && steps == 0)
			steps += recvul(clk);
		// fetch instruction