Qemu crashing; troubleshooting
This commit is contained in:
parent
c2f258f1bb
commit
daa915363d
|
|
@ -86,6 +86,7 @@ void pci_make_file(uint32_t class, uint8_t bus, uint8_t slot, uint8_t func){
|
|||
file = fcreate(cpy, 0);
|
||||
// file->read = pci_read_file;
|
||||
// file->write = pci_write_file;
|
||||
if(file == 0) continue;
|
||||
file->fileops = &pci_fileops;
|
||||
if(tries >= 254){
|
||||
mlog(MODULE_NAME, "Failed to make PCI file for device!\n", MLOG_PRINT);
|
||||
|
|
|
|||
|
|
@ -58,16 +58,18 @@ extern void kmain(kernel_info_t *kernel_info){
|
|||
pic_setmask(0x0, PIC1_DATA);
|
||||
pic_setmask(0x0, PIC2_DATA);
|
||||
|
||||
fcreate("/dev", FS_FILE_IS_DIR);
|
||||
fcreate("/dev/disk", FS_FILE_IS_DIR);
|
||||
fcreate("/tmp", FS_FILE_IS_DIR);
|
||||
fcreate("/boot", FS_FILE_IS_DIR);
|
||||
// fcreate("/dev", FS_FILE_IS_DIR);
|
||||
// fcreate("/dev/disk", FS_FILE_IS_DIR);
|
||||
// fcreate("/tmp", FS_FILE_IS_DIR);
|
||||
// fcreate("/boot", FS_FILE_IS_DIR);
|
||||
mlog("KERNEL", "Initializing Scheduler & starting PID 1\n", MLOG_PRINT);
|
||||
boot_info = kernel_info;
|
||||
scheduler_init();
|
||||
disable_interrupts();
|
||||
//scheduler doesn't work if there is no PID0, and I don't know why.
|
||||
thread_start(pid0);
|
||||
thread_start(sysinit);
|
||||
for(;;);
|
||||
enable_interrupts();
|
||||
for(;;);//we actually **shouldn't** return, like, ever. That's bad.
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,8 @@ uint32_t module_api(uint32_t func, ...){
|
|||
buffer = va_arg(vars, void *);
|
||||
offset = va_arg(vars, uint32_t);
|
||||
count = va_arg(vars, uint32_t);
|
||||
return_value = readdir(file, buffer, offset, count);
|
||||
// return_value = readdir(file, buffer, offset, count);
|
||||
return_value = 0;
|
||||
break;
|
||||
case MODULE_API_MAP:
|
||||
return_value = 0;
|
||||
|
|
|
|||
|
|
@ -23,10 +23,15 @@ void ramfs_init(){
|
|||
mlog(MODULE_NAME, "Initializing VFS\n", MLOG_PRINT);
|
||||
root_dir.private = kmalloc(1);
|
||||
root_dir.size = PAGE_SIZE_BYTES;//one page is 4096 bytes
|
||||
// printf("Sizeof VFILE_T: %d", sizeof(vfile_t));
|
||||
}
|
||||
|
||||
vfile_t *resolve_path(char *pathname){
|
||||
//resolves the path relative to start
|
||||
vfile_t *resolve_path(char *pathname, vfile_t *start){
|
||||
// vfile_t **buffer = (vfile_t *)start->private;
|
||||
// for(int i = 0; i < start->size/4, i++){
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
vfile_t *ramfs_create(char *path, FS_FILE_FLAGS flags){
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ typedef struct virtual_file{
|
|||
|
||||
uint32_t id;//for use in drivers
|
||||
void *private; //also for use in drivers
|
||||
uint32_t size;
|
||||
uint32_t size; //should be in bytes
|
||||
uint32_t offset; //for use in drivers
|
||||
|
||||
}vfile_t;
|
||||
|
|
@ -46,5 +46,5 @@ int fread(vfile_t *file_entry, void *byte_array, uint32_t offset, uint32_t count
|
|||
|
||||
vfile_t *vfcreate(vfile_t *parent, char *relpath, FS_FILE_FLAGS flags);
|
||||
vfile_t *rfopen(char *name, vfile_t *dir);
|
||||
|
||||
vfile_t *fclose(vfile_t *);
|
||||
vfile_t *fopen(char *path);
|
||||
Loading…
Reference in New Issue