Unreal mode

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.
Post Reply
richi18007
Member
Member
Posts: 35
Joined: Mon Mar 07, 2011 1:41 pm

Unreal mode

Post 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 ?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Unreal mode

Post by Combuster »

Pipe cycler
Obviously you have problems reading. Maybe that explains the fiction in your post as well. Try again.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Unreal mode

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
richi18007
Member
Member
Posts: 35
Joined: Mon Mar 07, 2011 1:41 pm

Re: Unreal mode

Post 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 :)
Post Reply