Driver Programming Etiquette
Posted: Wed Aug 30, 2017 4:12 pm
When you've written your OS drivers in the past, is there an etiquette you've used pretty thoroughly throughout your project? Is there a standard -- something akin to the variable-naming convention of szString, iInteger, cChar, and so on -- that I should be aware of?
My IA-32 rendition of my OS is being built in pure assembly and I've just hit the USB stage because I want to load binaries now. Oh hell, what an interesting journey these past few days have been! In my source code, I have been taking a real preference for naming my assembly functions from largest scope to smallest. For example, the function USB_UHCI_DEBUG_outputPortVariable is a function for the USB driver, is UHCI-specific, is only to be used as a helper/DEBUG function (so I know I'm doing the right thing and can test different values), and it outputs a read on a specific port from a controller's BAR4.
I ask this question for two reasons:
1. Whenever I make friends with a contributor, I want him/her to stay sane!
2. If there is a convention of sorts, I would like to follow an industry standard so that this project lends itself to being 'work experience' for my CV.
I am honestly really amped about getting file transfers and data reads going, finally. It's still a long way off, but just being able to recognize when device connections change is huge!
My IA-32 rendition of my OS is being built in pure assembly and I've just hit the USB stage because I want to load binaries now. Oh hell, what an interesting journey these past few days have been! In my source code, I have been taking a real preference for naming my assembly functions from largest scope to smallest. For example, the function USB_UHCI_DEBUG_outputPortVariable is a function for the USB driver, is UHCI-specific, is only to be used as a helper/DEBUG function (so I know I'm doing the right thing and can test different values), and it outputs a read on a specific port from a controller's BAR4.
I ask this question for two reasons:
1. Whenever I make friends with a contributor, I want him/her to stay sane!
2. If there is a convention of sorts, I would like to follow an industry standard so that this project lends itself to being 'work experience' for my CV.
I am honestly really amped about getting file transfers and data reads going, finally. It's still a long way off, but just being able to recognize when device connections change is huge!