OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 25, 2024 2:04 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: copying contents of drive into empty memory
PostPosted: Wed Jan 26, 2011 1:36 pm 
Offline
Member
Member

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


Top
 Profile  
 
 Post subject: Re: copying contents of drive into empty memory
PostPosted: Wed Jan 26, 2011 2:24 pm 
Offline
Member
Member
User avatar

Joined: Thu Aug 11, 2005 11:00 pm
Posts: 1110
Location: Tartu, Estonia
http://wiki.osdev.org/Detecting_Memory_%28x86%29
http://www.o3one.org/hwdocs/bios_doc/dosref22.html - Chapter 2

_________________
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS


Top
 Profile  
 
 Post subject: Re: copying contents of drive into empty memory
PostPosted: Thu Jan 27, 2011 4:51 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
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 ]


Top
 Profile  
 
 Post subject: Re: copying contents of drive into empty memory
PostPosted: Thu Jan 27, 2011 12:12 pm 
Offline
Member
Member

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


Top
 Profile  
 
 Post subject: Re: copying contents of drive into empty memory
PostPosted: Thu Jan 27, 2011 12:26 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
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 ]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 225 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group