Fix: scrolling bug + shell void input
This commit is contained in:
Binary file not shown.
@@ -14,8 +14,11 @@ void shell_install()
|
||||
printf("\n");
|
||||
|
||||
// Childish shell
|
||||
|
||||
if (strcmp(input_buffer, "help") == 0)
|
||||
if (strcmp(input_buffer, "") == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if (strcmp(input_buffer, "help") == 0)
|
||||
{
|
||||
printf("This is the Blank Operating System\ndesigned for fun by xamidev\n\nCommand help:\n\n\thelp - shows this message\n\tpanic - makes the kernel panic\n");
|
||||
}
|
||||
@@ -23,6 +26,8 @@ void shell_install()
|
||||
{
|
||||
printf("%d", 4/0);
|
||||
}
|
||||
|
||||
else {
|
||||
puts("Unknown command\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
0
src/libc/crypto.c
Normal file
0
src/libc/crypto.c
Normal file
@@ -57,12 +57,14 @@ unsigned int getcolor(int x, int y)
|
||||
|
||||
void scroll(int lines)
|
||||
{
|
||||
for (unsigned int y = lines; y < VGA_HEIGHT; y++)
|
||||
if (lines <= 0 || (unsigned int)lines >= VGA_HEIGHT) return;
|
||||
|
||||
for (unsigned int y = 0; y < VGA_HEIGHT-lines; y++)
|
||||
{
|
||||
for (unsigned int x = 0; x < VGA_WIDTH; x++)
|
||||
{
|
||||
putchar(x, y-lines, getchar(x, y));
|
||||
putcolor(x, y-lines, getcolor(x, y));
|
||||
putchar(x, y, getchar(x, y+lines));
|
||||
putcolor(x, y, getcolor(x, y+lines));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,10 +72,15 @@ void scroll(int lines)
|
||||
{
|
||||
for (unsigned int x = 0; x < VGA_WIDTH; x++)
|
||||
{
|
||||
putchar(x, y, '\0');
|
||||
putchar(x, y, ' ');
|
||||
putcolor(x, y, COLOR);
|
||||
}
|
||||
}
|
||||
|
||||
VGA_Y -= lines;
|
||||
if ((int)VGA_Y < 0) {
|
||||
VGA_Y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void putc(char c)
|
||||
@@ -89,6 +96,10 @@ void putc(char c)
|
||||
break;
|
||||
case '\t':
|
||||
VGA_X += 4;
|
||||
if (VGA_X >= VGA_WIDTH) {
|
||||
VGA_X -= VGA_WIDTH;
|
||||
VGA_Y++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
putchar(VGA_X, VGA_Y, c);
|
||||
@@ -361,4 +372,4 @@ void get_input(char *buffer, int size) {
|
||||
putc(c);
|
||||
}
|
||||
buffer[index] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user