stupid hacks

This commit is contained in:
Kevin Lange 2011-04-24 21:49:35 -05:00
parent a99fbf39a2
commit 8f520f2456
2 changed files with 8 additions and 1 deletions

View File

@ -71,7 +71,7 @@ exec(
/* We also store the total size of the memory region used by the application */
current_task->image_size = shdr->sh_addr + shdr->sh_size - current_task->entry;
}
for (uintptr_t i = 0; i < shdr->sh_size; i += 0x1000) {
for (uintptr_t i = 0; i < shdr->sh_size + 0x5000; i += 0x1000) {
/* This doesn't care if we already allocated this page */
alloc_frame(get_page(shdr->sh_addr + i, 1, current_directory), 0, 1);
}

View File

@ -41,7 +41,14 @@ static int exit(int retval) {
static int read(int fd, char * ptr, int len) {
#ifdef SPECIAL_CASE_STDIO
if (fd == 0) {
__asm__ __volatile__ ("sti");
kgets(ptr, len);
__asm__ __volatile__ ("cli");
if (strlen(ptr) < len) {
int j = strlen(ptr);
ptr[j] = '\n';
ptr[j+1] = '\0';
}
return strlen(ptr);
}
#endif