Page 1 of 1

Unreal mode

Posted: Wed Sep 05, 2012 9:09 am
by richi18007
Hello again ,

Herehttp://forum.osdev.org/viewtopic.php?f= ... ors#p49759
Pipe cycler says in the reply that anything above 0xfff:0xffff will not work with int0x13. I looked at FAQ and baby step 7 too.
The baby step 7 says that you cannot go beyond 1Mb in unreal mode. Why so?

So , should I use movsd/movsb instructions to move my kernel at a different position in unreal mode as reading the floppy disk sector will not work for 1 Mb mark ?

Re: Unreal mode

Posted: Wed Sep 05, 2012 11:02 am
by Combuster
Pipe cycler
Obviously you have problems reading. Maybe that explains the fiction in your post as well. Try again.

Re: Unreal mode

Posted: Wed Sep 05, 2012 11:27 am
by Brendan
Hi,
richi18007 wrote:Herehttp://forum.osdev.org/viewtopic.php?f= ... ors#p49759
Pipe cycler says in the reply that anything above 0xfff:0xffff will not work with int0x13. I looked at FAQ and baby step 7 too.
The baby step 7 says that you cannot go beyond 1Mb in unreal mode. Why so?
They're both saying mostly the same thing. Real mode addressing is unable to access much more than the first 1 MiB, and the BIOS doesn't know anything about unreal mode and can't be relied on to access anything that real mode can't access.
richi18007 wrote:So , should I use movsd/movsb instructions to move my kernel at a different position in unreal mode as reading the floppy disk sector will not work for 1 Mb mark ?
Normally you'd have a buffer somewhere below 1 MiB; and you'd load some data into the buffer, copy it above 1 MiB, load some more, copy more, load some more, etc until the entire kernel (which could be several MiB and may not fit in the "about 630 KiB" below 1 MiB) has been loaded and is where you want it.

Of course you'd probably want a 32-bit memory copy - something that either enables unreal mode and does "rep movsd"; or enables protected mode, does "rep movsd" and disables protected mode again.


Cheers,

Brendan

Re: Unreal mode

Posted: Wed Sep 05, 2012 3:36 pm
by richi18007
Thank you Brendan for the clarification . And you too Combuster , as always , so mature !
I got confused in the baby step tutorial (English is not my first language). This forum http://forum.osdev.org/viewtopic.php?f=1&t=24408 helped clarify the doubts a lot.

The code works fine now. I have loaded the kernel to 3GB virtual (1 MB physical).I have one more problem due to setting the stack incorrectly. I will look forums in the morning.

Thanks :)