This is a summary of all the proceedings related to my project on Nouveau. The start was a little bumpy due to some bugs and incompatibilities with Ubuntu. After spending quite some time to fix things I decided it was better to shift to Arch rather than spending anymore time on it. It took over a day and many reinstalls to get the base system up and running. Then the xorg server was setup and nouveau was installed. This got a basic window system running. It was followed by a git clone of PDAEMON + envytools which was then compiled and successfully run on Arch system. Things worked perfectly on Arch and I would be posting a tutorial on how to install Arch on a usb stick because I find the official documentation not so friendly to newbies.
Designing and implementing a PDAEMON to Host communication was my first objective. I planned to work on it in C. I started off with a basic implementation of the command submission. From there I made incremental modifications improving and testing it at every step. I made use of a ring buffer to utilize the shared memory effectively. Implementing a buggy command submission was not all that difficult ;) but resolving all bugs and optimizing it after extensive testing did prove to be very time consuming. The code was revamped many a time until what I got was a clean and optimized implementation. This design would now also serve as an interface for PDAEMON programs to send messages/commands. I implemented it by employing the use of two ring buffers. Later, after discussing and contemplating the positives and negatives of using 1 ring over two ; I rewrote the code with the required interface and employing only 1 ring buffer.
Now that the design was ready, tested and implemented in C the next task was to port it to Fermi Micro Code. The main hurdle behind it was that I had never worked with FµC.
I began with multiple tries to make sense of the code (pdaemon.fuc) directly, failing which I started reading the fuc documentation in hwdocs. At first, it was mostly an exercise of jumping back and forth between docs because I was not able to understand all of it in the first (or second) go.
I was not confident that I had given them enough effort and so giving them another shot. After that I started referring to fuc-isa.txt and things started to make more sense as I went on trying to understand pdaemon.fuc line by line. I realized that the main problem I faced was retaining what I had previously read because all this was unlike the c++ code which I had been working on to develop user base applications. Anyhow I felt confident as I was finally being able to grasp more than what I was at the starting.
Using examples from existing code, I wrote short snippets to test my understanding and grasp over it.When I felt I was up to the task, I started porting my C-code to FµC. Starting with the smaller functions, I quickly got a good hold of it. Finally, I ported the entire thing to FµC and PDAEMON.Testing one function at a time, I realized that most of it worked well due to a great C-implementation.
</ div>
I began with multiple tries to make sense of the code (pdaemon.fuc) directly, failing which I started reading the fuc documentation in hwdocs. At first, it was mostly an exercise of jumping back and forth between docs because I was not able to understand all of it in the first (or second) go.
I was not confident that I had given them enough effort and so giving them another shot. After that I started referring to fuc-isa.txt and things started to make more sense as I went on trying to understand pdaemon.fuc line by line. I realized that the main problem I faced was retaining what I had previously read because all this was unlike the c++ code which I had been working on to develop user base applications. Anyhow I felt confident as I was finally being able to grasp more than what I was at the starting.
Using examples from existing code, I wrote short snippets to test my understanding and grasp over it.When I felt I was up to the task, I started porting my C-code to FµC. Starting with the smaller functions, I quickly got a good hold of it. Finally, I ported the entire thing to FµC and PDAEMON.Testing one function at a time, I realized that most of it worked well due to a great C-implementation.
</ div>
Currently, the code has been ported to PDAEMON and the PDAEMON -> HOST communication has been implemented. Though it is yet to be tested extensively but that would be over before this week ends. Here is the FµC :
Do you have any plans to write about how to get started with nouveau for "newbies"?
ReplyDeleteAnyway good work, thanks =D
Thanks. :)
DeleteAnd shockingly enough, I have submitted a talk to FOSS.IN on the lines of ~how to get started with nouveau for "newbies"~ Let us see if it gets accepted. :P
I have also given some recommendations to mwk regarding additions to hwdocs for making it newbie friendly. :D