summaryrefslogtreecommitdiff
path: root/userspace/xterm
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-10-18 12:26:18 +0200
committerMiguel <m.i@gmx.at>2018-10-18 12:26:18 +0200
commita282cb8c921299b54a719452ec2bdaff63d8d3e9 (patch)
treea8e88f37f855436d515f995135ded66e564c33f1 /userspace/xterm
parentad94570c78a8d9e426fd0d48e9709dba27803b71 (diff)
New Scheduling / Syscalls!
Diffstat (limited to 'userspace/xterm')
-rw-r--r--userspace/xterm/Makefile5
-rw-r--r--userspace/xterm/xterm.c24
2 files changed, 8 insertions, 21 deletions
diff --git a/userspace/xterm/Makefile b/userspace/xterm/Makefile
index fdec016..dff4c46 100644
--- a/userspace/xterm/Makefile
+++ b/userspace/xterm/Makefile
@@ -2,7 +2,10 @@ CC=i686-foolos-gcc
CFLAGS = -ggdb -O0 # best gdb debugging experience
+
+all: xterm rect
xterm: vesa.o terminal.o
+rect: vesa.o
clean:
- rm -f *.o xterm
+ rm -f *.o xterm rect
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]);
}
}