Questions about Unreal Mode.
Posted: Tue Nov 16, 2010 2:53 pm
I want to develop a tiny kernel - actually I want to run an interpreter for a language I've been working on for some time (is something for writting graph optimization algorithms)
But I don't need memory protection and I don't care if all the code is run under ring 0. Besides, it would be easier to have access to BIOS calls.
So, I've read about unreal "mode", and it sounds like a good ideia but I have some questions:
1. All the code I've read set the 4gb limit only for DS and ES segment. Why? That way, code is still limited to 1MB right? Is it ok to set 4gb limit to CS also?
2. In order access 32-bit indexed memory, I've read asm instructions should have a 'a32' preffix, so the processor would use the right operand size. Is there any C compiler that is capable of generating code with this right operand size, when dereferencing 32-bit pointers? (And also able to use 32-bit registers when adding and multipling 32-bit numbers). If it runs on DOS, that would be great.
3. Should I forget about unreal mode, and just use protected mode, using a GDT with a single 4gb segment? (and if I need to use BIOS calls, I just switch back to real mode).
Thanks in advance and sorry about the bad english
But I don't need memory protection and I don't care if all the code is run under ring 0. Besides, it would be easier to have access to BIOS calls.
So, I've read about unreal "mode", and it sounds like a good ideia but I have some questions:
1. All the code I've read set the 4gb limit only for DS and ES segment. Why? That way, code is still limited to 1MB right? Is it ok to set 4gb limit to CS also?
2. In order access 32-bit indexed memory, I've read asm instructions should have a 'a32' preffix, so the processor would use the right operand size. Is there any C compiler that is capable of generating code with this right operand size, when dereferencing 32-bit pointers? (And also able to use 32-bit registers when adding and multipling 32-bit numbers). If it runs on DOS, that would be great.
3. Should I forget about unreal mode, and just use protected mode, using a GDT with a single 4gb segment? (and if I need to use BIOS calls, I just switch back to real mode).
Thanks in advance and sorry about the bad english