While I'm happy to share what knowledge (or lack of knowledge) I have, I'd like to be clear that I don't _really_ know what I'm doing. We've written pretty much the most rudimentary thing possible and there's a lot more to learn!
@@sphaerophoriastill, how do you know this stuff? How did you get into this low level stuff, are there any particularly good resources? Thanks for the content anyway!
still early in the VOD, but volatile basically means that the underlying memory isn't like normal memory. It can change between reads and writes, and that reads and writes are potentially stateful. Most of what it does is disable reordering and optimizing out of reads/writes to the same addresses, so I'd say its basically correct to use it where you did. the __iomem might be intended for the same purpose. As for portability, you're writing linux kernel drivers, so of course it won't be portable, but I also disagree that it isn't portable to some extent. You didn't define the addresses explicitly for the regs (if you did, it would become non-portable, but its also device driver code and it typically isn't portable anyway)
I think I psyched myself out. I have this underlying feeling that it doesn't do what I think it does, but also what you're saying is pretty much exactly my understanding of it lol. Appreciate the extra vote for "no that's right"
@@sphaerophoria a lot of people are scared of volatile, because there's so much mythology about how it's bad and wrong in a bunch of ways... And to be fair, it is bad and wrong when used badly and wrongly, but if you're using it correctly, just to make sure your ordering is correct and reads/writes aren't optimized out, then its fine. Super awesome content, by the way, thanks for putting it out there!
It depends on if I find the person giving them annoying or not :P. "can you do X?" - annoying. "I had a potential project idea, take it or leave it..." - not annoying.
What are the chances of my eating Yum Yums while you say "Yum Yum Food time" - I can tell you experimentally so far you are outscoring Gretsky. Now all we need is to ride a Zamboni through a Tim Horton's drive-thru and we have smashed the "Least likely things to happen in one day" record.
We actually used the rtl8139 as a reference while setting up our pci device. The datasheet for it is quite digestable, its implemented in qemu, theres an osdev wiki page fot it, theres a linux driver for it. Should be a good reference if you want to make something yourself