Ver código fonte

evx: use the existing function, instead of writing that again

rain 4 anos atrás
pai
commit
56008919be
2 arquivos alterados com 5 adições e 16 exclusões
  1. 1 1
      kernel/task.c
  2. 4 15
      kernel/tty.c

+ 1 - 1
kernel/task.c

@@ -51,7 +51,7 @@ int task_init(void) {
 	kmlog("New task: %p\n", new);
 	kmlog("task initialization finished. \n");
 
-	switch_to(new);
+//	switch_to(new);
 
 	return 0;
 }

+ 4 - 15
kernel/tty.c

@@ -66,24 +66,13 @@ int tty_write(struct tty *tty, char *s) {
 }
 
 int tty_write_all(char *p) {
-	struct tty *tty;
 	struct klist_node *n;
-	char *s;
 	int err;
 
-	for (n = ttys.next; n != &ttys; n = n->next) {
-		s = p;
-		tty = (struct tty *) n->data;
-
-		while (*s) {
-			if ((err = tty->putc(*s))) 
-				return err;
-
-			s++;
-		}
-	}
-	
-	return 0;
+	for (n = ttys.next; n != &ttys; n = n->next) 
+		if ((err = tty_write((struct tty *) n->data, p))) 
+			return err;
+ 	return 0;
 }