Re: Bug while creating the first i/o completion queue (NVMe over PCIe)
Posted: Fri Aug 09, 2024 9:14 am
Hello Octocontrabass, I do not want to try to make it run on qemu as I am creating my Core (think of kernel) for my real machine and I think fixing the bug on qemu might not make it run on the real machine as it had happened to me the earlier. I don't want to waste time on qemu instead I want to keep the fix as simple as possible (obviously to handle such future errors directly I guess ). My intuition says that the fix is very very simple - not to waste my time in making it running on qemu instead just to fix a silly mistake that is hidden in front of my eyes. Plus, I think making it run on the real machine will help me in identifying the issues without using any debugger (I really don't know if using gdb and other debuggers is not a good thing. I am just following Linus Torvalds advice and I'm trying to keep everything to the real machine in order to be a real Core developer).
From my past error experience where the error was regarding the admin completion queue not getting any response from the controller, you had suggested me to write a real memory allocator on reddit. My intuition was that the error was very very simple and I should not waste the time in writing the memory allocator. It may sound silly but I waited to disprove my intuition for 2 months and also tried to politely deny all of your suggestions in order to get to that point where the error was. But as I got fed with these, I decided to rewrite the driver from "scratch" by following the specs, keeping track of every minute detail and guess what, it worked. This approach then helped me in learning about the nvme driver of which I had only ideas from the assembly code that I was translating to C plus it sufficed my desire to know what I was doing in those translations somewhere along the line in the journey of writing the Core (please think of kernel). I would have left it (the desire) if it was not that important to me (that was the intuition with which I began writing (copying and translating) the nvme driver from BareMetal OS's github repo) but as this admin completion queue error occured, I intuitively settled on this "scratch" thing - knowing by hand and by myself (reading specs, searching for information) what each and every instruction "was doing in my own new code". To be honest, it was an hour of work and the error was gone. The approach worked! It was that simple...
Hence, I'm still lurking around this intuition of mine to solve the above bug. I'm just thinking about how can I minimize the "thinking" time (please read: thinking intuitively) as far as I can
Thank you.
From my past error experience where the error was regarding the admin completion queue not getting any response from the controller, you had suggested me to write a real memory allocator on reddit. My intuition was that the error was very very simple and I should not waste the time in writing the memory allocator. It may sound silly but I waited to disprove my intuition for 2 months and also tried to politely deny all of your suggestions in order to get to that point where the error was. But as I got fed with these, I decided to rewrite the driver from "scratch" by following the specs, keeping track of every minute detail and guess what, it worked. This approach then helped me in learning about the nvme driver of which I had only ideas from the assembly code that I was translating to C plus it sufficed my desire to know what I was doing in those translations somewhere along the line in the journey of writing the Core (please think of kernel). I would have left it (the desire) if it was not that important to me (that was the intuition with which I began writing (copying and translating) the nvme driver from BareMetal OS's github repo) but as this admin completion queue error occured, I intuitively settled on this "scratch" thing - knowing by hand and by myself (reading specs, searching for information) what each and every instruction "was doing in my own new code". To be honest, it was an hour of work and the error was gone. The approach worked! It was that simple...
Hence, I'm still lurking around this intuition of mine to solve the above bug. I'm just thinking about how can I minimize the "thinking" time (please read: thinking intuitively) as far as I can
Thank you.