Run program at end of init()

This commit is contained in:
pjht 2019-05-01 19:40:59 -05:00
parent 50b0c0a4c4
commit f43d8e3af4

View File

@ -89,6 +89,16 @@ static void init() {
}
// Detect and initailize serial ports
serial_init();
ide_init();
// load_parts("/dev/hda");
init_ext2();
mount("/","/dev/hda","ext2");
klog("INFO","MOUNT");
FILE* f=fopen("/file","r");
char str[256];
fgets(str,256,f);
str[strlen(str)-1]='\0';
klog("INFO","Got string %s",str);
FILE* file=fopen("/initrd/prog.elf","r");
elf_header header;
fread(&header,sizeof(elf_header),1,file);
@ -108,22 +118,11 @@ static void init() {
}
}
func_ptr prog=(func_ptr)header.entry;
int val=prog();
klog("INFO","RAN PROG:%d",val);
}
ide_init();
// load_parts("/dev/hda");
init_ext2();
mount("/","/dev/hda","ext2");
klog("INFO","MOUNT");
FILE* f=fopen("/file","r");
char str[256];
fgets(str,256,f);
str[strlen(str)-1]='\0';
klog("INFO","Got string %s",str);
for(;;) {
yield();
prog();
}
// for(;;) {
// yield();
// }
}
void kmain(struct multiboot_boot_header_tag* hdr) {