Change fsdrv's name to devfs
This commit is contained in:
parent
f852371022
commit
f914554dbc
4
Makefile
4
Makefile
@ -30,7 +30,7 @@ debug: os.iso kernel/kernel.elf
|
||||
@$(GDB)
|
||||
#gdbgui -g i386-elf-gdb --project $(CWD)
|
||||
|
||||
os.iso: kernel/kernel.elf init vfs fsdrv initrd
|
||||
os.iso: kernel/kernel.elf init vfs devfs initrd
|
||||
@cp kernel/kernel.elf sysroot/boot
|
||||
@cd initrd; tar -f ../sysroot/boot/initrd.tar -c *
|
||||
@grub-mkrescue -o $@ sysroot >/dev/null 2>/dev/null
|
||||
@ -46,7 +46,7 @@ vfs: vfs/* kernel/start.o
|
||||
@cd $@ && make
|
||||
@cp $@/$@ initrd/$@
|
||||
|
||||
fsdrv: fsdrv/* kernel/start.o
|
||||
devfs: devfs/* kernel/start.o
|
||||
@cd $@ && make
|
||||
@cp $@/$@ initrd/$@
|
||||
|
||||
|
@ -3,11 +3,11 @@ OBJ = $(C_SOURCES:.c=.o )
|
||||
CFLAGS = -Wall -g
|
||||
CC = i386-myos-gcc
|
||||
|
||||
fsdrv: $(OBJ) ../libc/*
|
||||
devfs: $(OBJ) ../libc/*
|
||||
@$(CC) -o $@ $(CFLAGS) $(OBJ)
|
||||
|
||||
%.o: %.c
|
||||
@$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
@rm -rf *.o init
|
||||
@rm -rf *.o devfs
|
BIN
devfs/devfs
Executable file
BIN
devfs/devfs
Executable file
Binary file not shown.
@ -15,7 +15,6 @@ int main() {
|
||||
vga_init(info);
|
||||
uint32_t box=mailbox_new(16);
|
||||
register_fs("devfs",box);
|
||||
mount("","devfs","/dev");
|
||||
for (;;) {
|
||||
yield();
|
||||
Message msg;
|
||||
@ -47,6 +46,24 @@ int main() {
|
||||
vfs_msg->flags=0;
|
||||
break;
|
||||
}
|
||||
case VFS_MOUNT: {
|
||||
char* disk_file=malloc(sizeof(char)*vfs_msg->data);
|
||||
Message msg;
|
||||
msg.msg=disk_file;
|
||||
mailbox_get_msg(box,&msg,vfs_msg->data);
|
||||
while (msg.from==0 && msg.size==0) {
|
||||
yield();
|
||||
mailbox_get_msg(box,&msg,sizeof(vfs_message));
|
||||
}
|
||||
if (msg.from==0) {
|
||||
serial_print("Could not recieve disk file path from the VFS\n");
|
||||
vfs_msg->flags=2;
|
||||
break;
|
||||
}
|
||||
free(disk_file);
|
||||
vfs_msg->flags=0;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
vfs_msg->flags=1;
|
||||
}
|
@ -171,7 +171,7 @@ int main() {
|
||||
uint32_t datapos=find_loc("vfs",initrd);
|
||||
load_task(datapos,initrd);
|
||||
yield(); // Bochs fails here
|
||||
datapos=find_loc("fsdrv",initrd);
|
||||
datapos=find_loc("devfs",initrd);
|
||||
load_task(datapos,initrd);
|
||||
free(initrd);
|
||||
yieldToPID(3);
|
||||
|
Loading…
Reference in New Issue
Block a user