2 ** Copyright 2001-2004, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
5 #include <boot/stage2.h>
6 #include <boot/shared/openfirmware.h>
7 #include "stage2_priv.h"
11 static int of_input_handle
= 0;
12 static int of_output_handle
= 0;
14 int of_console_init(void)
18 /* open the input and output handle */
19 chosen
= of_finddevice("/chosen");
20 of_getprop(chosen
, "stdin", &of_input_handle
, sizeof(of_input_handle
));
21 of_getprop(chosen
, "stdout", &of_output_handle
, sizeof(of_output_handle
));
27 int printf(const char *fmt
, ...)
34 ret
= vsprintf(temp
,fmt
,args
);
53 if(of_output_handle
!= 0)
54 of_write(of_output_handle
, &c
, 1);