copying contents of drive into empty memory

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
a5498828
Member
Member
Posts: 99
Joined: Thu Aug 12, 2010 7:25 am

copying contents of drive into empty memory

Post 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)
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: copying contents of drive into empty memory

Post by xenos »

Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
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: copying contents of drive into empty memory

Post 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.
"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 ]
a5498828
Member
Member
Posts: 99
Joined: Thu Aug 12, 2010 7:25 am

Re: copying contents of drive into empty memory

Post 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?
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: copying contents of drive into empty memory

Post by Combuster »

Sorry, I was referring to memory detection.
"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 ]
Post Reply