Page 1 of 1

copying contents of drive into empty memory

Posted: Wed Jan 26, 2011 1:36 pm
by a5498828
Im having problems locating avaiable memory for my 'os'.
When i boot up my code, i have no idea where is memory i can copy my code.

How do i find this memory? Is there any way, or i must list pci devices, get somehow ammount of memory, and find gaps?

How you do it? How it should be done?


Im using int 13h to access disk. (question 2: how do i do it without bios)

Re: copying contents of drive into empty memory

Posted: Wed Jan 26, 2011 2:24 pm
by xenos

Re: copying contents of drive into empty memory

Posted: Thu Jan 27, 2011 4:51 am
by Combuster
a5498828 wrote:question 2: how do i do it without bios
You don't - it's not safe. Your bootloader can however do the work for you, whether you use GRUB or write your own.

Re: copying contents of drive into empty memory

Posted: Thu Jan 27, 2011 12:12 pm
by a5498828
You don't - it's not safe.
Whats not safe about it? Do you mean i have direct access to metadata (sector numbers, ecc, ...) wich wich i can destroy? I though i can only send commands like to read/write given sector, and controller can only low-level format disk. Are you telling, its possible using direct mmio/pio interface?

Re: copying contents of drive into empty memory

Posted: Thu Jan 27, 2011 12:26 pm
by Combuster
Sorry, I was referring to memory detection.