I had to use far pointers in Kernel , when i using the far pointer to test i coded to test the following code before using in my kernel . Getting errors.
#include <stdio.h>
int main(){
int a=50;
int far* b;
b=&a;
printf("%Fp",b);
return 0;
}
test.c: In function ‘main’:
test.c:5:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
int far* b;
^
test.c:5:15: error: ‘b’ undeclared (first use in this function)
int far* b;
^
test.c:5:15: note: each undeclared identifier is reported only once for each function it appears in
Errors while using far pointer in c Using gcc on linux
Re: Errors while using far pointer in c Using gcc on linux
GCC, being a compiler for a 32/64-bit "flat" memory model, doesn't support "far" pointers. "Far" and "near" pointers only make sense in segmented memory arrangements.
Ideally, your kernel would be in 32/64-bit mode with a flat memory model before you even start running C code...
Ideally, your kernel would be in 32/64-bit mode with a flat memory model before you even start running C code...