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:
parent
60a4eff97f
commit
b15c0020c3
@ -127,8 +127,9 @@ error_t CmdDie(int argc, char **argv, char *cmdline)
|
|||||||
|
|
||||||
error_t CmdDumpATASect(int argc, char **argv, char *cmdline)
|
error_t CmdDumpATASect(int argc, char **argv, char *cmdline)
|
||||||
{
|
{
|
||||||
char sector[600] = {0};
|
char sector[1024] = {0};
|
||||||
int sectNumber = ShAtoi(argv[1]);
|
int sectNumber = ShAtoi(argv[1]);
|
||||||
|
int nb = ShAtoi(argv[2]);
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int step = 16;
|
int step = 16;
|
||||||
|
|
||||||
@ -137,11 +138,13 @@ error_t CmdDumpATASect(int argc, char **argv, char *cmdline)
|
|||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!nb) nb = 1;
|
||||||
|
|
||||||
KernLog("Sector number: %d\n", sectNumber);
|
KernLog("Sector number: %d\n", sectNumber);
|
||||||
|
|
||||||
IoReadATA(sector, 1, sectNumber);
|
IoReadATA(sector, nb, sectNumber);
|
||||||
|
|
||||||
while(x < 512) {
|
while(x < 512*nb) {
|
||||||
KernLog("%C", shcol);
|
KernLog("%C", shcol);
|
||||||
for (int i = 0; i < step; i++) {
|
for (int i = 0; i < step; i++) {
|
||||||
KernLog("%02x ", (uchar)sector[i+x]);
|
KernLog("%02x ", (uchar)sector[i+x]);
|
||||||
|
@ -119,6 +119,11 @@ void KeStartShell(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
|
while (IoGetScroll() > 0) {
|
||||||
|
IoScrollDown();
|
||||||
|
}
|
||||||
|
|
||||||
*bufptr++ = (char)ch;
|
*bufptr++ = (char)ch;
|
||||||
|
|
||||||
// End of buffer?
|
// End of buffer?
|
||||||
@ -130,14 +135,15 @@ void KeStartShell(void)
|
|||||||
// Else, fallthrough to case '\n'
|
// Else, fallthrough to case '\n'
|
||||||
|
|
||||||
case '\n':
|
case '\n':
|
||||||
*bufptr = 0;
|
|
||||||
bufptr = cmdbuf;
|
|
||||||
ExecuteCommand(cmdbuf);
|
|
||||||
|
|
||||||
while (IoGetScroll() > 0) {
|
while (IoGetScroll() > 0) {
|
||||||
IoScrollDown();
|
IoScrollDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*bufptr = 0;
|
||||||
|
bufptr = cmdbuf;
|
||||||
|
ExecuteCommand(cmdbuf);
|
||||||
|
|
||||||
memzero(cmdbuf, CMDBUFSIZE);
|
memzero(cmdbuf, CMDBUFSIZE);
|
||||||
KernLog("%Cshell> %C", VGA_COLOR_WHITE, shcol);
|
KernLog("%Cshell> %C", VGA_COLOR_WHITE, shcol);
|
||||||
BFlushBuf(BStdIn);
|
BFlushBuf(BStdIn);
|
||||||
|
Loading…
Reference in New Issue
Block a user