2 ** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
5 #include <kernel/kernel.h>
6 #include <kernel/console.h>
7 #include <kernel/debug.h>
8 #include <kernel/int.h>
9 #include <kernel/smp.h>
10 #include <kernel/sem.h>
11 #include <kernel/vfs.h>
18 CONSOLE_OP_WRITEXY
= 2376
21 struct console_op_xy_struct
{
27 static int console_fd
= -1;
29 int kprintf(const char *fmt
, ...)
37 ret
= vsprintf(temp
,fmt
,args
);
40 sys_write(console_fd
, temp
, 0, ret
);
45 int kprintf_xy(int x
, int y
, const char *fmt
, ...)
49 struct console_op_xy_struct buf
;
53 ret
= vsprintf(buf
.buf
,fmt
,args
);
58 sys_ioctl(console_fd
, CONSOLE_OP_WRITEXY
, &buf
, ret
+ sizeof(buf
.x
) + sizeof(buf
.y
));
63 int con_init(kernel_args
*ka
)
65 dprintf("con_init: entry\n");
67 console_fd
= sys_open("/dev/console", STREAM_TYPE_DEVICE
, 0);
68 dprintf("console_fd = %d\n", console_fd
);