mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-03 18:22:22 +00:00
Removed disk command, because it was half broken we don't need that
This commit is contained in:
@@ -119,7 +119,6 @@ int32_t terminalWrite(const void* buf, uint32_t len) {
|
|||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
//i++;
|
|
||||||
} else {
|
} else {
|
||||||
drawChar(str[i], terminal->x, terminal->y, terminal->fg, terminal->bg);
|
drawChar(str[i], terminal->x, terminal->y, terminal->fg, terminal->bg);
|
||||||
terminal->x++;
|
terminal->x++;
|
||||||
|
|||||||
@@ -76,63 +76,6 @@ void main() {
|
|||||||
|
|
||||||
if (strcmp(input, "clear") == 0) {
|
if (strcmp(input, "clear") == 0) {
|
||||||
clear();
|
clear();
|
||||||
} else if (strcmp(input, "disk") == 0) {
|
|
||||||
char buf[512] = { 0 };
|
|
||||||
|
|
||||||
if (*args == '\0') {
|
|
||||||
print("disk: ");
|
|
||||||
print("No arguments given\n");
|
|
||||||
print("Usage: disk <r/w> <sector> [data]\n");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (isSpace(*args)) { args++; } // Skip whitespace
|
|
||||||
char mode = *args++;
|
|
||||||
while (isSpace(*args)) { args++; }
|
|
||||||
|
|
||||||
if (mode == 'r') {
|
|
||||||
if (*args == '\0') {
|
|
||||||
print("disk: ");
|
|
||||||
print("Sector not specified\n");
|
|
||||||
print("Usage: disk <r/w> <sector> [data]\n");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t sector = atoi(args);
|
|
||||||
print("Reading...\n");
|
|
||||||
diskRead(sector, 1, buf);
|
|
||||||
|
|
||||||
print("Contents:\n");
|
|
||||||
for (size_t i = 0; i < 512; i++) {
|
|
||||||
if (buf[i] != '\0') {
|
|
||||||
putc(buf[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
putc('\n');
|
|
||||||
} else if (mode == 'w') {
|
|
||||||
char* data;
|
|
||||||
if ((data = strchr(args, ' ')) == NULL) {
|
|
||||||
print("disk: ");
|
|
||||||
print("No data given\n");
|
|
||||||
print("Usage: disk <r/w> <sector> [data]\n");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
*data++ = '\0';
|
|
||||||
uint32_t sector = atoi(args);
|
|
||||||
|
|
||||||
while (isSpace(*args)) { args++; } // Skip whitespace
|
|
||||||
|
|
||||||
strcpy(buf, data);
|
|
||||||
print("Writing...\n");
|
|
||||||
diskWrite(sector, 1, buf);
|
|
||||||
} else {
|
|
||||||
print("disk: ");
|
|
||||||
print("Invalid access mode. Use r(ead) or w(rite)\n");
|
|
||||||
print("Usage: disk <r/w> <sector> [data]\n");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
} else if (strcmp(input, "echo") == 0) {
|
} else if (strcmp(input, "echo") == 0) {
|
||||||
char* str = args;
|
char* str = args;
|
||||||
char* printStr = args;
|
char* printStr = args;
|
||||||
@@ -193,7 +136,6 @@ void main() {
|
|||||||
} else if (strcmp(input, "help") == 0) {
|
} else if (strcmp(input, "help") == 0) {
|
||||||
print("Available Commands:\n");
|
print("Available Commands:\n");
|
||||||
print(" clear | Clears the screen\n");
|
print(" clear | Clears the screen\n");
|
||||||
print(" disk | Reads/Writes data from/to the disk\n");
|
|
||||||
print(" echo | Prints a message to stdout\n");
|
print(" echo | Prints a message to stdout\n");
|
||||||
print(" exit | Exits shell\n");
|
print(" exit | Exits shell\n");
|
||||||
print(" gfx | Does a graphics test\n");
|
print(" gfx | Does a graphics test\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user