[main] New hello.txt with ASCII-art logo

This commit is contained in:
Kevin Lange 2011-01-31 10:34:38 -06:00
parent 4b6b86b87f
commit fe385bb18e
2 changed files with 6 additions and 3 deletions

BIN
initrd

Binary file not shown.

9
main.c
View File

@ -99,9 +99,9 @@ int main(struct multiboot *mboot_ptr)
kprintf("Couldn't find hello.txt\n");
}
kprintf("Found at inode %d\n", test_file->inode);
char buffer[256];
char * buffer = malloc(sizeof(char) * 2048);
uint32_t bytes_read;
bytes_read = read_fs(test_file, 0, 255, &buffer);
bytes_read = read_fs(test_file, 0, 2047, buffer);
kprintf("cat /etc/kernel/hello.txt\n");
uint32_t i = 0;
for (i = 0; i < bytes_read; ++i) {
@ -109,17 +109,20 @@ int main(struct multiboot *mboot_ptr)
}
close_fs(test_file);
free(test_file);
free(buffer);
#if 0
test_file = kopen("/usr/docs/README.md", NULL);
char *bufferb = malloc(test_file->length + 200);
bytes_read = read_fs(test_file, 100, test_file->length, bufferb);
for (i = 0; i < bytes_read; ++i) {
kprintf("%c", (char)bufferb[i]);
if (i % 500 == 0) {
timer_wait(30);
timer_wait(10);
}
}
free(bufferb);
close_fs(test_file);
#endif
return 0;
}