Work on ATA

This commit is contained in:
Adrien Bourmault 2019-05-24 10:50:55 +02:00
parent 45e3731be8
commit a8a561e7f7
1 changed files with 9 additions and 8 deletions

View File

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