I started learning about multiboot and Xen. More info on this in following days.
I took a step back today and worked on the forcedeth driver again. Stefan suggested that we drop the newer descriptor formats in favor of the old ones, to reduce code size and clean up the code. There were a lot of areas in the code that would take the form of an if/else construct dependent on the descriptor version. The main problem is that we don't know for sure whether all NICs support the legacy descriptor format.
Since the old driver only used the legacy descriptor format we have the guarantee (in case nothing else is wrong) that the new driver will work with those NICs as well. Breaking stuff that previously worked is not an option.
Unfortunately, the Linux driver also uses the desc_ver field (which indicates what descriptor version is used for the NIC) in several other places:
Stefan made the following comparisons between the resulting driver (the one that only used the legacy descriptor format) and the previous one:
text | data | bss | dec | hex | filename |
---|---|---|---|---|---|
6995 | 516 | 0 | 7511 | 1d57 | bin/forcedeth.o ( legacy-only) |
9140 | 516 | 0 | 9656 | 25b8 | bin/forcedeth.o ( linux-like) |
There is an uncompressed difference of ~2KB between the two, so the legacy-only version might actually be the one that makes it into the mainline branch.
I've never faced such a problem before, and it is quite interesting. Do you use a version that you know will work with all the NICs but is slightly bloated or do you go for the minimal driver that _might not_ work with every NIC. I would go for the minimal driver and wait until someone reports a problem. If the bug isn't obvious, I would do the following:
me.away()
Posted the updated forcedeth patch today. It contains all of the previously mentioned modifications.
Git commit: f97d937cab21c01d810274393abfd3aecb2e68cd
Back to multiboot today, more specifically to the decompression part. These days I am going to work on extracting and black-boxing the decompression code from the gzip utility. For starters, I won't try to integrate the code with gPXE, I'll just try and get it to work separately using an input .gz file. By the end of the week I hope to have a working gunzip util.
No coding today, but a lot of documentation. I am currently trying to understand the DEFLATE algorithm. I played around all day with a decompression implementation from the zlib library and I think with a little bit more time I'll comprehend it all.
me.away()