@@ -10,7 +10,7 @@ use crate::sys::console::Console;
10
10
use crate :: sys:: net:: socket:: tcp:: TcpSocket ;
11
11
use crate :: sys:: net:: socket:: udp:: UdpSocket ;
12
12
use crate :: sys:: rng:: Random ;
13
- use crate :: sys:: vga:: VgaFont ;
13
+ use crate :: sys:: vga:: { VgaFont , VgaMode } ;
14
14
15
15
use alloc:: vec;
16
16
use alloc:: vec:: Vec ;
@@ -31,6 +31,7 @@ pub enum DeviceType {
31
31
UdpSocket = 8 ,
32
32
Drive = 9 ,
33
33
VgaFont = 10 ,
34
+ VgaMode = 11 ,
34
35
}
35
36
36
37
impl TryFrom < & [ u8 ] > for DeviceType {
@@ -49,6 +50,7 @@ impl TryFrom<&[u8]> for DeviceType {
49
50
8 => Ok ( DeviceType :: UdpSocket ) ,
50
51
9 => Ok ( DeviceType :: Drive ) ,
51
52
10 => Ok ( DeviceType :: VgaFont ) ,
53
+ 11 => Ok ( DeviceType :: VgaMode ) ,
52
54
_ => Err ( ( ) ) ,
53
55
}
54
56
}
@@ -87,6 +89,7 @@ pub enum Device {
87
89
TcpSocket ( TcpSocket ) ,
88
90
UdpSocket ( UdpSocket ) ,
89
91
VgaFont ( VgaFont ) ,
92
+ VgaMode ( VgaMode ) ,
90
93
Drive ( Drive ) ,
91
94
}
92
95
@@ -105,6 +108,7 @@ impl TryFrom<&[u8]> for Device {
105
108
DeviceType :: TcpSocket => Ok ( Device :: TcpSocket ( TcpSocket :: new ( ) ) ) ,
106
109
DeviceType :: UdpSocket => Ok ( Device :: UdpSocket ( UdpSocket :: new ( ) ) ) ,
107
110
DeviceType :: VgaFont => Ok ( Device :: VgaFont ( VgaFont :: new ( ) ) ) ,
111
+ DeviceType :: VgaMode => Ok ( Device :: VgaMode ( VgaMode :: new ( ) ) ) ,
108
112
DeviceType :: Drive if buf. len ( ) > 2 => {
109
113
let bus = buf[ 1 ] ;
110
114
let dsk = buf[ 2 ] ;
@@ -164,6 +168,7 @@ impl FileIO for Device {
164
168
Device :: TcpSocket ( io) => io. read ( buf) ,
165
169
Device :: UdpSocket ( io) => io. read ( buf) ,
166
170
Device :: VgaFont ( io) => io. read ( buf) ,
171
+ Device :: VgaMode ( io) => io. read ( buf) ,
167
172
Device :: Drive ( io) => io. read ( buf) ,
168
173
}
169
174
}
@@ -180,6 +185,7 @@ impl FileIO for Device {
180
185
Device :: TcpSocket ( io) => io. write ( buf) ,
181
186
Device :: UdpSocket ( io) => io. write ( buf) ,
182
187
Device :: VgaFont ( io) => io. write ( buf) ,
188
+ Device :: VgaMode ( io) => io. write ( buf) ,
183
189
Device :: Drive ( io) => io. write ( buf) ,
184
190
}
185
191
}
@@ -196,6 +202,7 @@ impl FileIO for Device {
196
202
Device :: TcpSocket ( io) => io. close ( ) ,
197
203
Device :: UdpSocket ( io) => io. close ( ) ,
198
204
Device :: VgaFont ( io) => io. close ( ) ,
205
+ Device :: VgaMode ( io) => io. close ( ) ,
199
206
Device :: Drive ( io) => io. close ( ) ,
200
207
}
201
208
}
@@ -212,6 +219,7 @@ impl FileIO for Device {
212
219
Device :: TcpSocket ( io) => io. poll ( event) ,
213
220
Device :: UdpSocket ( io) => io. poll ( event) ,
214
221
Device :: VgaFont ( io) => io. poll ( event) ,
222
+ Device :: VgaMode ( io) => io. poll ( event) ,
215
223
Device :: Drive ( io) => io. poll ( event) ,
216
224
}
217
225
}
0 commit comments