hometue wrote:Ah...I see. Btw, to switch to protected mode is it fine to just put it in inline assembly(since I know C compiler will change it slightly so will this affect the result?).
I would recommend separate files for your assembly code for a couple of reasons. First, your source code will be easier to maintain if and when you decide to support multiple architectures. Secondly, it will give you the opportunity to use various C compilers (since the "asm" keyboard is a non-standard extension, it's often implemented in incompatible ways). Regarding the compiler modifying your assembly, some do others don't so be sure to check its documentation.
hometue wrote:Also is there a way to check if the change went successfully (any address in the bios data area or any register to check).
Why do you assume this is something that can fail, provided you write your code correctly? If it does fail, you'll probably be in enough trouble that you won't be able to check anything. And even if you won't, you'd need to have a pretty unusual setup in order for your protected mode code to have the same meaning as it would in real mode. You'd need to run the same code in both cases, right?
Also, the BIOS will probaby be unaware you changed to protected mode.