1
0
mirror of https://gitlab.os-k.eu/os-k-team/os-k.git synced 2023-08-25 14:03:10 +02:00

Work on ATA

This commit is contained in:
Adrien Bourmault 2019-05-24 10:50:55 +02:00
parent 45e3731be8
commit a8a561e7f7

View File

@ -130,6 +130,7 @@ error_t CmdDumpATASect(int argc, char **argv, char *cmdline)
char sector[600] = {0}; char sector[600] = {0};
int sectNumber = ShAtoi(argv[1]); int sectNumber = ShAtoi(argv[1]);
int x = 0; int x = 0;
int step = 16;
if (!sectNumber) { if (!sectNumber) {
KernLog("Bad argument\n\n"); KernLog("Bad argument\n\n");
@ -141,21 +142,21 @@ error_t CmdDumpATASect(int argc, char **argv, char *cmdline)
IoReadATA(sector, 1, sectNumber); IoReadATA(sector, 1, sectNumber);
while(x < 513) { while(x < 513) {
for (int i = 0; i < 13; i++) { KernLog("%C", shcol);
for (int i = 0; i < step; i++) {
KernLog("%02x ", (uchar)sector[i+x]); KernLog("%02x ", (uchar)sector[i+x]);
} }
KernLog(" "); KernLog(" %C ", VGA_COLOR_LIGHT_BLUE);
for (int i = 0; i < 13; i++) { for (int i = 0; i < step; i++) {
if (isprint(sector[i+x])) if (isprint(sector[i+x]))
KernLog("%C%c%C", KernLog("%c",
VGA_COLOR_LIGHT_BLUE, sector[i+x]
sector[i+x], );
shcol);
else else
KernLog("%c", 0); KernLog("%c", 0);
} }
KernLog("\n"); KernLog("\n");
x += 20; x += step;
} }
KernLog("\n\n"); KernLog("\n\n");