diff options
| author | Miguel <m.i@gmx.at> | 2018-10-18 12:26:18 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-10-18 12:26:18 +0200 |
| commit | a282cb8c921299b54a719452ec2bdaff63d8d3e9 (patch) | |
| tree | a8e88f37f855436d515f995135ded66e564c33f1 /userspace/xterm/xterm.c | |
| parent | ad94570c78a8d9e426fd0d48e9709dba27803b71 (diff) | |
New Scheduling / Syscalls!
Diffstat (limited to 'userspace/xterm/xterm.c')
| -rw-r--r-- | userspace/xterm/xterm.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/userspace/xterm/xterm.c b/userspace/xterm/xterm.c index a4325c7..90b2fe0 100644 --- a/userspace/xterm/xterm.c +++ b/userspace/xterm/xterm.c @@ -30,19 +30,6 @@ int main(int argc, char **argv) if(!pid) // child { - // we need a window - _gui_win(); - //srand(time(NULL)); // Initialization, should only be called once. - while(1) - { - int x = rand()%600; - int y = rand()%300; - int width=10; - int height=10; - int col = rand()% 0x00ffff; - put_rect( x, y, width,height,col); - _gui_inval((x<<16)|(y),(width<<16)|height); - } //_close(xterm_in[1]); close(xterm_out[0]); @@ -54,9 +41,11 @@ int main(int argc, char **argv) if(argc==1)_execve(argv1[1],argv1,environ); execve(argv[1],argv,environ); - printf("unable to execve %s",argv[1]); // never reached + printf("unable to execve %s",argv[1]); // never reached hopefully + while(1); } else{ + // TODO quit if execve fails or child exits... //_close(xterm_in[0]); close(xterm_out[1]); @@ -64,15 +53,10 @@ int main(int argc, char **argv) //_dup2(xterm_in[1],0); // compositor writes here. //_close(xterm_in[1]); - // TODO quit if execve fails or child exits... - terminal_put(tty,'X'); - terminal_put(tty,'X'); - terminal_put(tty,'X'); while(1) { char buf[1]; - //read(xterm_out[0],buf,1); // show what foolshell writes to its stdout/stderr - read(tty_fd,buf,1); // show what foolshell writes to its stdout/stderr + read(xterm_out[0],buf,1); // show what foolshell writes to its stdout/stderr terminal_put(tty,buf[0]); } } |
