Could you please tell us more about what you are trying to accomplish? The question is rather open-ended, and we really would need additional information in order to give you any advice.
Is this for your own OS project, and if not, what OS are you using? Which hardware are you trying to interface with? Is it something which your OS provides any kind of API or library for, and if so, is there a reason you can't use that?
What programming language are you using, and what compiler/interpreter are you using it with? Are you trying to cross-compile (that is, compiling on one OS or hardware platform to be run on a different one)?
As a newcomer to the forum, you probably need to be very specific about what you are doing, as we don't know anything about your projects yet. Please, give as much detail as you think is relevant for what you are doing, and if you are unsure about how to explain things, read this essay
for advice on asking questions on a technical forum - I don't know if you have read it before, or have experience in other technical message boards, but it is always helpful to re-read it.
If you have questions regarding operating system development, and aren't sure where to start, I would suggest reading the introductions on the OSDev Wiki:
While this is a lot of reading, it simply reflects the due diligence that any OS-devver needs to go through in order to get anywhere. OS development, even as a simple project, is not amenable to the Stack Overflow cut-and-paste model of software development; you really need to understand a fair amount of the concepts and principles before writing any code, and the examples given in tutorials and forum posts generally are exactly that. Copying an existing code snippet without at least a basic idea of what it is doing simply won't do. While learning itself is an iterative process - you learn one thing, try it out, see what worked and what didn't, read some more, etc. - in this case a basic foundation is needed at the start. Without a solid understanding of at least some of the core ideas before starting, you simply can't get very far in OS dev.
Hopefully, this won't scare you off; it isn't nearly as bad as it sounds. It just takes a lot of patience and a bit of effort, a little at a time.