I am learning Operating System Development and a Beginner of course. I would like to build my system in real mode environment which is a 16 bit environment using C language.
In C, I used a function asm()
to convert the codes to 16 bit as follows:
asm(".code16")
which in GCC's language to generate 16 bit executables(not exactly though).
Question:
Suppose I have two header files head1.h
and head2.h
and a main.c
file. The contents of main.c
file are as follows:
asm(".code16");
#include<head1.h>
#include<head2.h>
int main(){
return 0;
}
Now, Since I started my code with the command to generate 16 bit executable file and then included head1.h
and head2.h
, will I need to do the same in all header files that I am to create? (or) Is it sufficient to add the line asm(".code16");
once?
OS: Ubuntu
Compiler: Gnu CC