Skip to content
Snippets Groups Projects
Commit ee7c05e1 authored by Byron Lathi's avatar Byron Lathi
Browse files

remove debug statements

parent d1ea0ba5
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,8 @@ uint32_t ext2_read_sectors(uint32_t inode_num, uint32_t start, uint32_t count, u
ata_read_sectors(ATA_MASTER, ext2_base + inode.block_pointer[block] * 2 + i, 1, buf + sectors_read * 256);
sectors_read++;
}
return 0;
}
uint32_t ext2_read_data(uint32_t inode_num, uint32_t count, uint16_t* buf)
......
......@@ -87,8 +87,6 @@ int32_t _sys_exec(uint8_t* cmd)
tmpargs++;
}
printf("argc: %d\n", argc);
// This will not work for arguments which need spaces
int i;
for (i = 0; i < cmdlen; i++) {
......@@ -96,13 +94,6 @@ int32_t _sys_exec(uint8_t* cmd)
cmd[i] = NULL;
}
printf("The first time... ");
for (i = 0; i < cmdlen; i++) {
printf("%c", cmd[i]);
//cmdcpy[i] = cmd[i];
}
printf("\n");
uint32_t parsed_inode = ext2_parse_path_to_inode_num((int8_t*)name);
if (parsed_inode == -1)
......@@ -126,8 +117,6 @@ int32_t _sys_exec(uint8_t* cmd)
pcb->file_desc_array[0].file_ops = &stdin_ops;
pcb->file_desc_array[1].file_ops = &stdout_ops;
printf("Running a program with pid %d\n", pid);
heap_create(pid);
/* increment pid and run process; decrement it after termination */
......@@ -158,17 +147,8 @@ int32_t _sys_exec(uint8_t* cmd)
}
}
printf("cmdcpy: %s\n", cmdcpy);
for (i = 0; i < argc; i++) {
printf("arg%d: %s\n", i, argv[i]);
}
elf_header_t* e_header = (elf_header_t*)data.data8;
printf("Program header count: %d\n", e_header->e_phnum);
printf("Program header size: %x\n", e_header->e_phentsize);
printf("Program header offset: %x\n", e_header->e_phoff);
program_header_t* p_header[e_header->e_phnum];
......@@ -180,7 +160,6 @@ int32_t _sys_exec(uint8_t* cmd)
map_large(EXEC_BASE_ADDR, _8MB + pid * _4MB); //where program will be run
map_large(EXEC_TMP_ADDR, _8MB + (pid + 1) * _4MB); // program loaded temporarily here, then copied over
ext2_read_data(parsed_inode, 0, (uint16_t*)EXEC_TMP_ADDR);
printf("Loaded %s into %#x\n", name, EXEC_TMP_ADDR);
// what if you...
// read the program header to see how many bytes you needed to allocate and where
......@@ -189,10 +168,7 @@ int32_t _sys_exec(uint8_t* cmd)
pcb->program_break = NULL;
for (i = 0; i < e_header->e_phnum; i++) {
printf("Program header %d type %x flags %x", i, p_header[i]->p_type, p_header[i]->p_flags);
printf(" offset %x vaddr %#x paddr %#x size %x\n",
p_header[i]->p_offset, p_header[i]->p_vaddr, p_header[i]->p_paddr, p_header[i]->p_filesz);
memccpy(p_header[i]->p_vaddr, EXEC_TMP_ADDR + p_header[i]->p_offset, p_header[i]->p_memsz);
memccpy((void*)p_header[i]->p_vaddr, (const void*)(EXEC_TMP_ADDR + p_header[i]->p_offset), p_header[i]->p_memsz);
if (p_header[i]->p_vaddr + p_header[i]->p_memsz > pcb->program_break)
pcb->program_break = p_header[i]->p_vaddr + p_header[i]->p_memsz;
}
......@@ -233,13 +209,13 @@ int32_t _sys_exec(uint8_t* cmd)
pid--;
printf("end of _sys_exec\n");
//printf("end of _sys_exec\n");
return status;
}
int32_t _sys_exit(uint32_t status)
{
printf("_sys_exit\n");
//printf("_sys_exit\n");
pcb_t* pcb = get_pcb_ptr();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment