3 static int of_write_initialized
= 0;
4 static int stdout_ihandle
= 0;
5 static int of_read_initialized
= 0;
6 static int stdin_ihandle
= 0;
8 int write(int fd
, char *buf
, int len
)
12 if (fd
!= 1 && fd
!= 2) {
13 // printk("write: bad id %x\n", fd);
17 if (!of_write_initialized
) {
19 of_find_integer_property("/chosen", "stdout");
20 // printk("stdout_ihandle: %x\n",stdout_ihandle);
21 of_write_initialized
= 1;
24 of1275_write(stdout_ihandle
, buf
, len
, &actual
);
28 int read(int fd
, char *buf
, int len
)
33 // printk("write: bad id %x\n", fd);
37 if (!of_read_initialized
) {
39 of_find_integer_property("/chosen", "stdin");
40 of_read_initialized
= 1;
43 of1275_read(stdin_ihandle
, buf
, len
, &actual
);