summaryrefslogtreecommitdiff
path: root/userspace/xterm/xterm.c
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/xterm/xterm.c')
-rw-r--r--userspace/xterm/xterm.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/userspace/xterm/xterm.c b/userspace/xterm/xterm.c
index 90b2fe0..8d3ea97 100644
--- a/userspace/xterm/xterm.c
+++ b/userspace/xterm/xterm.c
@@ -1,27 +1,32 @@
#include <stdlib.h>
#include <stdio.h>
-#include "../put_pixel.h"
+#include "vesa.h"
extern char**environ;
+// TODO quit if execve fails or child exits...
+
//default
char *argv1[]={"xterm","/bin/fsh",0};
int main(int argc, char **argv)
{
- // we need a window
- _gui_win();
+ // we need a 640x336 window for a 80x24 terminal using the
+ // default 7x13 pixel font +1 pixel margin so it is 8x14
+ int w=640;
+ int h=336;
+ _gui_win(0<<16|0,w<<16|h,0);
// basically loads font and sets a few constants
- vesa_init(NULL);
+ void *fb=malloc(w*h*4);
+ // 32bit mode so we have 4bytes per pixel. first one holds alpha
+
+ vesa_init(w,h, fb, NULL);
// init tty and set vesa output funcs
void *tty=terminal_init_vesa();
- //int xterm_in[2];
int xterm_out[2];
-
- //_pipe(xterm_in);
pipe(xterm_out);
int tty_fd=_open("/dev/tty");
@@ -30,7 +35,6 @@ int main(int argc, char **argv)
if(!pid) // child
{
- //_close(xterm_in[1]);
close(xterm_out[0]);
dup2(tty_fd,0);// stdin
@@ -45,13 +49,8 @@ int main(int argc, char **argv)
while(1);
}
else{
- // TODO quit if execve fails or child exits...
- //_close(xterm_in[0]);
close(xterm_out[1]);
-
- //_dup2(xterm_in[1],0); // compositor writes here.
- //_close(xterm_in[1]);
while(1)
{