git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: (twimap) provide an easy way for mapping kernel objects into filesystem
[lunaix-os.git]
/
lunaix-os
/
kernel
/
tty
/
lxconsole.c
diff --git
a/lunaix-os/kernel/tty/lxconsole.c
b/lunaix-os/kernel/tty/lxconsole.c
index 92deb498d1dd3faa6fbf1786adbd298bf2b13bf4..a226e4221e8253336eb477c97ef114597d4c0460 100644
(file)
--- a/
lunaix-os/kernel/tty/lxconsole.c
+++ b/
lunaix-os/kernel/tty/lxconsole.c
@@
-186,7
+186,6
@@
console_write(struct console* console, uint8_t* data, size_t size)
uintptr_t rd_ptr = fbuf->rd_pos;
char c;
uintptr_t rd_ptr = fbuf->rd_pos;
char c;
- int j = 0;
for (size_t i = 0; i < size; i++) {
c = data[i];
if (!c) {
for (size_t i = 0; i < size; i++) {
c = data[i];
if (!c) {
@@
-194,12
+193,15
@@
console_write(struct console* console, uint8_t* data, size_t size)
}
if (c == '\n') {
console->lines++;
}
if (c == '\n') {
console->lines++;
+ } else if (c == '\x08') {
+ ptr = ptr ? ptr - 1 : fbuf->size - 1;
+ continue;
}
}
- buffer[
(ptr + j) % fbuf->size
] = c;
-
j++
;
+ buffer[
ptr
] = c;
+
ptr = (ptr + 1) % fbuf->size
;
}
}
- fifo_set_wrptr(fbuf,
(ptr + j) % fbuf->size
);
+ fifo_set_wrptr(fbuf,
ptr
);
while (console->lines >= TTY_HEIGHT) {
rd_ptr = __find_next_line(rd_ptr);
while (console->lines >= TTY_HEIGHT) {
rd_ptr = __find_next_line(rd_ptr);