-
Notifications
You must be signed in to change notification settings - Fork 2
/
devmisc.c
87 lines (65 loc) · 1.17 KB
/
devmisc.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**************************************************
UZI (Unix Z80 Implementation) Kernel: devmisc.c
***************************************************/
#include "unix.h"
#include "extern.h"
mem_read(minor, rawflag)
int minor;
int rawflag;
{
bcopy((char *)(512*udata.u_offset.o_blkno+udata.u_offset.o_offset),
udata.u_base, udata.u_count);
return(udata.u_count);
}
mem_write(minor, rawflag)
int minor;
int rawflag;
{
bcopy(udata.u_base,
(char *)(512*udata.u_offset.o_blkno+udata.u_offset.o_offset),
udata.u_count);
return(udata.u_count);
}
null_write(minor, rawflag)
int minor;
int rawflag;
{
return(udata.u_count);
}
static char lop = 0;
lpr_open()
{
lop = 1;
return(0);
}
lpr_close()
{
if (lop)
{
lop = 0;
lpout('\f');
lpout('\f');
}
return(0);
}
lpr_write(minor, rawflag)
int minor;
int rawflag;
{
unsigned n;
n = udata.u_count;
while (n--)
lpout(*udata.u_base++);
return(udata.u_count);
}
lpout(c)
char c;
{
while(in(0x84)&02)
;
out(c,0x85);
out(0xfe,0x86);
out(0xff,0x86);
out(0xff,0x85);
}
#include "devmt.c"