how can I modify this programme?
The following programme runs succefully under ms-dos
but it can't run under linux(red hat 7.2) is there some code that can perform the same function,and , of course,can run succeful under linux! #include<stdio.h> typedef struct texel_struct{ unsigned char ch; unsigned char attr; }texel; typedef texel screen_array[25][80]; screen_array far * screen_ptr = (screen_array far *)0xb8000000L ; #define screen (*screen_ptr) main() { clrscr(); screen[0][0].ch = 'a'; screen[0][0].attr = 0x58; getchar(); } Thanks in advance! |
I barely remember something about far keyword being no longer supported in new versions of gcc compilers (dont know which ones) maybe has something to do with that
Hano |
Thanks!
Thank you Hano!
do you know how can I assign memory address to pointer directly? something like this: char * ptr = 0x80000000; Thanks in advance! |
fundamentals in linux says about user mode & kernel mode,
you are not previlaged to refer addresses other than address of that process in linux user mode. You can try it inside kernel module ( just for test for which i am not too sure).(i think this as home work for me too). |
if all you want to do is clear the screen..
create function cls() { for(i=0; i<=25; ++i) printf("\n"); } thats how I do it in C cls() { for(i=0; i<=25; ++i) cout >> "newline" } I obviously dont know C++ syntax, but that is a shot at it.. then whenever you need to clear screen, call cls(); winter |
Thanks all.
I will try all of the ways that you offered! |
All times are GMT -5. The time now is 07:19 PM. |