Add serial console terminal
This commit is contained in:
parent
7a361b34db
commit
b91d0236bb
|
@ -72,19 +72,6 @@ impl SerialPort {
|
||||||
self.data.write(data)
|
self.data.write(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_translate(&mut self, data: u8) {
|
|
||||||
match data {
|
|
||||||
8 | 0x7F => {
|
|
||||||
self.write(8);
|
|
||||||
self.write(b' ');
|
|
||||||
self.write(8);
|
|
||||||
},
|
|
||||||
_ => {
|
|
||||||
self.write(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn init(&mut self) {
|
fn init(&mut self) {
|
||||||
//TODO: Cleanup
|
//TODO: Cleanup
|
||||||
self.int_en.write(0x00);
|
self.int_en.write(0x00);
|
||||||
|
@ -111,7 +98,16 @@ impl SerialPort {
|
||||||
impl Write for SerialPort {
|
impl Write for SerialPort {
|
||||||
fn write_str(&mut self, s: &str) -> Result<(), fmt::Error> {
|
fn write_str(&mut self, s: &str) -> Result<(), fmt::Error> {
|
||||||
for byte in s.bytes() {
|
for byte in s.bytes() {
|
||||||
self.write_translate(byte);
|
match byte {
|
||||||
|
8 | 0x7F => {
|
||||||
|
self.write(8);
|
||||||
|
self.write(b' ');
|
||||||
|
self.write(8);
|
||||||
|
},
|
||||||
|
_ => {
|
||||||
|
self.write(byte);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -8,5 +8,5 @@
|
||||||
dhcpd -b
|
dhcpd -b
|
||||||
getty display:2
|
getty display:2
|
||||||
getty display:3
|
getty display:3
|
||||||
stdio debug:
|
|
||||||
/sbin/orbital display:4/activate /ui/bin/orblogin /ui/bin/launcher
|
/sbin/orbital display:4/activate /ui/bin/orblogin /ui/bin/launcher
|
||||||
|
getty debug: -J
|
||||||
|
|
Loading…
Reference in a new issue