From a8a561e7f7cbb9038da3d03e155fd1ce1eb8073a Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Fri, 24 May 2019 10:50:55 +0200 Subject: [PATCH] Work on ATA --- kaleid/kernel/sh/shcmds.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/kaleid/kernel/sh/shcmds.c b/kaleid/kernel/sh/shcmds.c index 95358d5..2fbdfba 100644 --- a/kaleid/kernel/sh/shcmds.c +++ b/kaleid/kernel/sh/shcmds.c @@ -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");