After a long time, I've come back to my OS and having fun again. I've realised that I was doing something pretty stupid. And this wasted a lot of time and made me quit the last time and now I realize that it's indeed a simple problem, but I don't find a good solution.
I't s a multitasking system, fully preemptive. I have some log routines that write into a log file.
- One log is done when a process is blocked
- The log routine is writing to a file
- File writing is going VFS -> FS -> ATA
- Inside my ATA driver I use semaphores to a) lock the driver for exclusive access b) wait for an IRQ on the controllers
- If the semaphore has to wait, it'll block the current process and reschedule. This causes 1. to happen again
What is a good solution for handling I/O ? Having a queue of I/O requests and then a kernel process that will go through them ? Or is there another solution ?
Thanks