Fixed memory test

This commit is contained in:
Peter Weingartner 2022-04-24 12:58:54 -04:00
parent 932a2addc2
commit 7c2573e9d6
10 changed files with 1199 additions and 1204 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -310,28 +310,24 @@ short cli_test_rtc(short channel, int argc, const char * argv[]) {
short cli_mem_test(short channel, int argc, const char * argv[]) {
volatile unsigned char * memory = 0x00000000;
t_sys_info sys_info;
unsigned long mem_start = 0x00010000; /* TODO find out better where the kernel stop */
unsigned long mem_end;
unsigned long mem_start = 0x00010000;
unsigned long mem_end = mem_get_ramtop();
char message[80];
unsigned long i;
if (argc > 1) {
#if MODEL == MODEL_FOENIX_A2560K
if (argc > 1) {
if ((strcmp(argv[1], "MERA") == 0) || (strcmp(argv[1], "mera") == 0)) {
mem_start = 0x02000000;
mem_end = 0x06000000;
print(channel, "\x1B[H\x1B[2JTesting MERA memory...");
}
#else
print(channel, "MERA memory is not present on this system.\n");
return 0;
#endif
} else {
mem_end = sys_mem_get_ramtop();
print(channel, "\x1B[H\x1B[2JTesting system memory...");
}
#endif
sprintf(message, "\x1B[H\x1B[2JTesting memory from 0x%08X to 0x%08X\n", mem_start, mem_end);
print(channel, message);
for (i = mem_start; i < mem_end; i++) {
memory[i] = 0x55; /* Every other bit starting with 1 */
@ -356,12 +352,12 @@ short cli_mem_test(short channel, int argc, const char * argv[]) {
}
if ((i % 1024) == 0) {
sprintf(message, "\x1B[H\x1B[0KMemory tested: %p", (void*)i);
sprintf(message, "\x1B[1;2H\x1B[0KMemory tested: %p", (void*)i);
print(channel, message);
}
}
print(channel, "\x1B[H\x1B[2JMemory passed basic tests.\n\n");
print(channel, "\x1B[1;3H\x1B[0KMemory passed basic tests.\n\n");
return 0;
}

View file

@ -125,7 +125,7 @@ void initialize() {
log_setlevel(LOG_ERROR);
/* Initialize the memory system */
mem_init(__memory_start);
mem_init(0x3d0000);
// /* Hide the mouse */
mouse_set_visible(0);

Binary file not shown.

View file

@ -211,7 +211,7 @@ unsigned long syscall_dispatch(int32_t function, int32_t param0, int32_t param1,
return proc_run((char *)param0, (int)param1, (char **)param2);
case KFN_MEM_GET_RAMTOP:
return mem_get_ramtop();
return (unsigned long)mem_get_ramtop();
case KFN_MEM_RESERVE:
return mem_reserve((unsigned long)param0);

File diff suppressed because it is too large Load diff

View file

@ -626,7 +626,7 @@ short sys_fsys_stat(const char * path, p_file_info file) {
* @return the address of the first byte of reserved system RAM (one above the last byte the user program can use)
*/
unsigned long sys_mem_get_ramtop() {
return (short)syscall(KFN_MEM_GET_RAMTOP);
return (unsigned long)syscall(KFN_MEM_GET_RAMTOP);
}
/**

View file

@ -7,6 +7,6 @@
#define VER_MAJOR 0
#define VER_MINOR 52
#define VER_BUILD 10
#define VER_BUILD 19
#endif