Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
i have a simple question: ive now written some code that boots the pc, switches over to protected mode and then jumps to some other code writen in c...before jumping there i loaded the ds register with a segment descriptor pointing to b8000 so that when in my c code i do something like
the letter A is displayed in the upper left corner. but of course there are 3 more segment registers (es, fs, gs) that *could* be used for video memory instead of having main data register ds point to video memory...is there any way at all to specify in c that for this or that particular memory reference another data register be used, so i can make use of all the 4 data registers without having to refer to assembly???
sancho1980 wrote:is there any way at all to specify in c that for this or that particular memory reference another data register be used, so i can make use of all the 4 data registers without having to refer to assembly???
C is a platform-independant language. It does not allow for paging nor for segmentation. Paging is wrt this transparent, but segmentation just isn't going to work. There is a part-hack called __thread that allows something like this but I haven't looked into what's generated and/or whether it even works. I think it's FS or GS based access to variables but I'm not quite sure how they're allocated.