This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to use segment specifiers of x86 in gcc compiler


Hello all,

	When my program grows up to exceed 0x100000, I noticed a critical problem. In my C code, I use variables and malloc(my own version) memory pointers directly and take no actions to deal it with segment specifiers. The gcc compiles C code use default DS ES segment (does it?). But, when the whole program exceeds 0x100000, the data to access may not be placed in the same segment, and a GDT segment is limited to 0x100000(is it?). Thus, they may be accessed with wrong address(offset), or I should use a segment specifier. How can I do this? by gcc compile's CFLAGS? The Linux kernel is greater than this limit and how does it do with this problem? I did not read any steps to do this and I did nothing too in some of my linux drivers. Maybe, its library function MALLOC does something? 

HOWEVER, I make my own system and bootloader. I have no any library to use.


Best regards, 
  
Chaiwy
chaiwy163@163.com
2009-09-01



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]