Index: fb/fb.c
===================================================================
--- fb/fb.c	(revision 04a73cdf594b4ad4063db9276ef8cc45b2a70c0f)
+++ fb/fb.c	(revision 04552a80d7eb1c2faa918744c220dbeeb00e3c9c)
@@ -54,6 +54,4 @@
 
 #define EFB (-1)
-
-extern int __DONT_OPEN_STDIO__=1;
 
 #define DEFAULT_BGCOLOR		0x000080
Index: libc/Makefile
===================================================================
--- libc/Makefile	(revision 04a73cdf594b4ad4063db9276ef8cc45b2a70c0f)
+++ libc/Makefile	(revision 04552a80d7eb1c2faa918744c220dbeeb00e3c9c)
@@ -80,5 +80,4 @@
 	ln -sfn kernel/arch include/arch
 	ln -sfn ../arch/$(ARCH)/include include/libarch
-	ln -sfn ../../libipc/include include/libipc
 	ln -sfn ../../libadt/include include/libadt
 
@@ -86,5 +85,5 @@
 
 clean:
-	-rm -f include/kernel include/arch include/libarch include/libipc include/libadt libc.a arch/$(ARCH)/_link.ld Makefile.depend
+	-rm -f include/kernel include/arch include/libarch include/libadt libc.a arch/$(ARCH)/_link.ld Makefile.depend
 	find generic/ arch/$(ARCH)/ -name '*.o' -follow -exec rm \{\} \;
 
Index: libc/generic/io/io.c
===================================================================
--- libc/generic/io/io.c	(revision 04a73cdf594b4ad4063db9276ef8cc45b2a70c0f)
+++ libc/generic/io/io.c	(revision 04552a80d7eb1c2faa918744c220dbeeb00e3c9c)
@@ -93,11 +93,2 @@
 	return EOF;
 }
-/*
-ssize_t write(int fd, const void * buf, size_t count)
-{
-	return (ssize_t) __SYSCALL3(SYS_IO, (sysarg_t) fd, (sysarg_t) buf, (sysarg_t) count);
-}*/
-
-
-
-
Index: libc/generic/io/stream.c
===================================================================
--- libc/generic/io/stream.c	(revision 04a73cdf594b4ad4063db9276ef8cc45b2a70c0f)
+++ libc/generic/io/stream.c	(revision 04552a80d7eb1c2faa918744c220dbeeb00e3c9c)
@@ -11,20 +11,18 @@
 #define FDS 32
 
-typedef struct stream_t
-{
+typedef struct stream_t {
 	pwritefn_t w;
 	preadfn_t r;
 	void * param;
-}stream_t;
+} stream_t;
 
 
-typedef struct vfb_descriptor_t
-{
+typedef struct vfb_descriptor_t {
 	int phone;
 	int vfb;
-}vfb_descriptor_t;
+} vfb_descriptor_t;
 
 
-stream_t streams[FDS]={{0,0,0}};
+stream_t streams[FDS] = {{0, 0, 0}};
 
 /*
@@ -35,14 +33,15 @@
 }*/
 
-static void vfb_send_char(vfb_descriptor_t *d,char c)
+static void vfb_send_char(vfb_descriptor_t *d, char c)
 {
 	ipcarg_t r0,r1;
-	ipc_call_sync_2(d->phone,FB_PUTCHAR,d->vfb,c,&r0,&r1);
+	ipc_call_sync_2(d->phone, FB_PUTCHAR, d->vfb, c, &r0, &r1);
 }
 				
-static ssize_t write_vfb(void *param, const void * buf, size_t count)
+static ssize_t write_vfb(void *param, const void *buf, size_t count)
 {
 	int i;
-	for(i=0;i<count;i++) vfb_send_char((vfb_descriptor_t *)param,((char*)buf)[i]);
+	for (i = 0; i < count; i++)
+		vfb_send_char((vfb_descriptor_t *) param, ((char *) buf)[i]);
 	
 	return count;
@@ -51,5 +50,5 @@
 
 
-static ssize_t write_stderr(void *param, const void * buf, size_t count)
+static ssize_t write_stderr(void *param, const void *buf, size_t count)
 {
 	return count;
@@ -58,5 +57,4 @@
 
 
-stream_t open_vfb(void);
 stream_t open_vfb(void)
 {
@@ -67,47 +65,45 @@
 	ipcarg_t vfb_no;
 	
-	while((phoneid=ipc_connect_me_to(PHONE_NS,SERVICE_VIDEO,0))<0)
-	{
+	while ((phoneid = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0)) < 0) {
 		volatile int a;
-		for(a=0;a<1048576;a++);
+		
+		for (a = 0; a < 1048576; a++);
 	}
 	
-	ipc_call_sync(phoneid,FB_GET_VFB,0,&vfb_no);
-	vfb=malloc(sizeof(vfb_descriptor_t));
+	ipc_call_sync(phoneid, FB_GET_VFB, 0, &vfb_no);
+	vfb = malloc(sizeof(vfb_descriptor_t));
 	
-	vfb->phone=phoneid;
-	vfb->vfb=vfb_no;
+	vfb->phone = phoneid;
+	vfb->vfb = vfb_no;
 	
-	
-	stream.w=write_vfb;
-	stream.param=vfb;
+	stream.w = write_vfb;
+	stream.param = vfb;
 	return stream;
 }
 
 
-fd_t open(const char *fname,int flags)
+fd_t open(const char *fname, int flags)
 {
-	int c=0;
-	while(((streams[c].w)||(streams[c].r))&&(c<FDS))c++;
-	if(c==FDS) return EMFILE;
-
-
-	if(!strcmp(fname,"stdin"))
-	{
-		streams[c].r=(preadfn_t)1;
+	int c = 0;
+	
+	while (((streams[c].w) || (streams[c].r)) && (c < FDS))
+		c++;
+	if (c == FDS)
+		return EMFILE;
+	
+	if (!strcmp(fname, "stdin")) {
+		streams[c].r = (preadfn_t)1;
 		return c;
 	}
 	
-	if(!strcmp(fname,"stdout"))
-	{
-		//streams[c].w=write_stdout;
+	if (!strcmp(fname, "stdout")) {
+		//streams[c].w = write_stdout;
 		//return c;
-		streams[c]=open_vfb();
+		streams[c] = open_vfb();
 		return c;
 	}
 	
-	if(!strcmp(fname,"stderr"))
-	{
-		streams[c].w=write_stderr;
+	if (!strcmp(fname, "stderr")) {
+		streams[c].w = write_stderr;
 		return c;
 	}
@@ -115,9 +111,9 @@
 
 
-ssize_t write(int fd, const void * buf, size_t count)
+ssize_t write(int fd, const void *buf, size_t count)
 {
-	if(fd<FDS) return streams[fd].w(streams[fd].param,buf,count);
+	if (fd < FDS)
+		return streams[fd].w(streams[fd].param, buf, count);
+	
 	return 0;
 }
-
-
Index: libc/generic/libc.c
===================================================================
--- libc/generic/libc.c	(revision 04a73cdf594b4ad4063db9276ef8cc45b2a70c0f)
+++ libc/generic/libc.c	(revision 04552a80d7eb1c2faa918744c220dbeeb00e3c9c)
@@ -33,9 +33,5 @@
 #include <psthread.h>
 #include <io/stream.h>
-
-int __DONT_OPEN_STDIO__;
-
-/* We should probably merge libc and libipc together */
-extern void _ipc_init(void);
+#include <ipc/ipc.h>
 
 void _exit(int status) {
@@ -46,15 +42,12 @@
 	tcb_t *tcb;
 	
-	if(!__DONT_OPEN_STDIO__)
-	{
-		open("stdin",0);
-		open("stdout",0);
-		open("stderr",0);
-	}	
-	
 	tcb = __make_tls();
 	__tcb_set(tcb);
 	psthread_setup(tcb);
 	_ipc_init();
+	
+	open("stdin", 0);
+	open("stdout", 0);
+	open("stderr", 0);
 }
 
Index: libc/include/io/stream.h
===================================================================
--- libc/include/io/stream.h	(revision 04a73cdf594b4ad4063db9276ef8cc45b2a70c0f)
+++ libc/include/io/stream.h	(revision 04552a80d7eb1c2faa918744c220dbeeb00e3c9c)
@@ -7,10 +7,6 @@
 
 
-typedef ssize_t (*pwritefn_t)(void *,const void *,size_t);
+typedef ssize_t (*pwritefn_t)(void *, const void *, size_t);
 typedef ssize_t (*preadfn_t)(void);
 
-fd_t open(const char *fname,int flags);
-
-
-
-
+fd_t open(const char *fname, int flags);
Index: libc/include/ipc/fb.h
===================================================================
--- libc/include/ipc/fb.h	(revision 04a73cdf594b4ad4063db9276ef8cc45b2a70c0f)
+++ libc/include/ipc/fb.h	(revision 04552a80d7eb1c2faa918744c220dbeeb00e3c9c)
@@ -12,49 +12,40 @@
 #define METHOD_WIDTH 16
 #define ITEM_WIDTH 16
-#define COUNT_WIDTH 16 /*Should be 8 times integer*/
+#define COUNT_WIDTH 16 /* Should be 8 times integer */
 
 
-struct _fb_method 
-{
-	unsigned m     : METHOD_WIDTH;
-	unsigned item  : ITEM_WIDTH;
-} __attribute__ ((packed));
+struct _fb_method {
+	unsigned m : METHOD_WIDTH;
+	unsigned item : ITEM_WIDTH;
+} __attribute__((packed));
 
-union fb_method 
-{
+union fb_method {
 	struct _fb_method m;
 	__native fill;
-}__attribute__ ((packed));
+} __attribute__((packed));
 
-struct fb_call_args
-{
+struct fb_call_args {
 	union fb_method method;
-	union 
-	{
-		struct 
-		{
-			unsigned count :COUNT_WIDTH;
-			char chars[3*sizeof(__native)-(COUNT_WIDTH>>3)];
-		}putchar __attribute__ ((packed));
-	}data ; //__attribute__ ((packed));	
-}__attribute__ ((packed));
+	union {
+		struct {
+			unsigned count : COUNT_WIDTH;
+			char chars[3 * sizeof(__native) - (COUNT_WIDTH >> 3)];
+		} putchar __attribute__((packed));
+	} data ; // __attribute__((packed));	
+} __attribute__((packed));
 
-struct fb_ipc_args 
-{
+struct fb_ipc_args {
 	__native method;
 	__native arg1;
 	__native arg2;
 	__native arg3;
-} __attribute__ ((packed));
+} __attribute__((packed));
 
-union fb_args
-{
+union fb_args {
 	struct fb_call_args fb_args;
 	struct fb_ipc_args ipc_args;
-}__attribute__ ((packed));
+} __attribute__((packed));
 
 typedef union fb_args fb_args_t;
 
 #endif
-
-
Index: ns/ns.c
===================================================================
--- ns/ns.c	(revision 04a73cdf594b4ad4063db9276ef8cc45b2a70c0f)
+++ ns/ns.c	(revision 04552a80d7eb1c2faa918744c220dbeeb00e3c9c)
@@ -45,6 +45,4 @@
 
 #define NS_HASH_TABLE_CHAINS	20
-
-extern int __DONT_OPEN_STDIO__=1;
 
 static int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call);
