flat assembler
Message board for the users of flat assembler.

Index > OS Construction > HELP!!!

Author
Thread Post new topic Reply to topic
Geek



Joined: 01 Jun 2005
Posts: 26
Geek 09 Jun 2005, 16:23
How do I calculate the size of a hard disk when booting from it?

Thanks!!!

_________________
Death is not the opposite of life, rather, it is the absence of it.
Post 09 Jun 2005, 16:23
View user's profile Send private message Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 09 Jun 2005, 17:05
This is a pretty open ended question. So considering the tools at your disposal: BIOS, SCSI driver (facsimile thereto in your boot code), IDE (ATA) driver facsimile, USB driver facsimile, firewire driver facsimile, and perhaps others. Each interface has its own characteristics in order to retieve information to determine the drive size. Of these BIOS is the easiest to employ but probably the least flexible and limited given today's drive sizes; using INT 13h. The others you'll have to employ a driver interface that retrieves the specific information you require. I suggest looking up INT 13h initially and see if this suffices for your needs.
Post 09 Jun 2005, 17:05
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 09 Jun 2005, 17:55
If you can trust in the partition information stored on bootsector, you can retrieve it from this structure:
Code:
struc HDD_PART {
  .boot         db 0
  .beg_head     db 0
  .beg_cylsect  dw 0
  .par_type     db 0
  .end_head     db 0
  .end_cylsect  dw 0
  .lba_addr     dd 0
  .lba_size     dd 0
}
    


There are four of HDD_PART info just before the signature (two latest bytes on bootsector: 0AA55h)
Post 09 Jun 2005, 17:55
View user's profile Send private message Yahoo Messenger Reply with quote
Geek



Joined: 01 Jun 2005
Posts: 26
Geek 16 Jun 2005, 16:23
I can understand using the partition table, but I'm looking for something that will allow my OS to create the partition table.

I other words I wont be able to use the partition table because
my OS hase'nt created it yet.

Any other sujections? Cool Question Cool

_________________
Death is not the opposite of life, rather, it is the absence of it.
Post 16 Jun 2005, 16:23
View user's profile Send private message Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 16 Jun 2005, 19:06
You can use IDE/ ATA Identify Device Command

or you can use BIOS functions
Post 16 Jun 2005, 19:06
View user's profile Send private message Visit poster's website Reply with quote
THEWizardGenius



Joined: 14 Jan 2005
Posts: 382
Location: California, USA
THEWizardGenius 17 Jun 2005, 04:23
Use BIOS, before entering protected mode (if your OS is a pmode OS). In fact, BIOS might store this information somewhere (not sure, have to check BIOS data area docs) in memory, but you'd have to know where to look. It probably just uses IDE/ATA functions, which if you happen to know, you could call yourself. I understand there are at least a few differences between manufacturers, but I think this is always the same. According to my notes, the function is 0ECh to the command register, base+7.
Post 17 Jun 2005, 04:23
View user's profile Send private message AIM Address Reply with quote
T&K(r)



Joined: 10 Jul 2005
Posts: 18
Location: Poland - > Krakow
T&K(r) 10 Jul 2005, 20:48
In CMOS is stored configuration of your PC , what kind of FDD,HDD you have, the BOOt sequaence, and many others.

You can just get information stred about HDD in it:

I attached simple DOC about CMOS

_________________
my GG ( Polish Instant Messager ) number is 8734187

Gdy widzisz kolejke - wstąp do niej - co ci szkodzi Smile
Post 10 Jul 2005, 20:48
View user's profile Send private message Reply with quote
T&K(r)



Joined: 10 Jul 2005
Posts: 18
Location: Poland - > Krakow
T&K(r) 10 Jul 2005, 20:56
sorry - i have problems with Atach Smile


Description: CMOS Doc
Download
Filename: CMOS.txt
Filesize: 44.3 KB
Downloaded: 473 Time(s)


_________________
my GG ( Polish Instant Messager ) number is 8734187

Gdy widzisz kolejke - wstąp do niej - co ci szkodzi Smile
Post 10 Jul 2005, 20:56
View user's profile Send private message Reply with quote
THEWizardGenius



Joined: 14 Jan 2005
Posts: 382
Location: California, USA
THEWizardGenius 11 Jul 2005, 19:15
AFAIK CMOS does not have information about hard drive size. However, it does have much other useful information and any would-be OS dev'er should learn how to use the CMOS.
Post 11 Jul 2005, 19:15
View user's profile Send private message AIM Address Reply with quote
Night Rider



Joined: 28 Jul 2005
Posts: 72
Night Rider 28 Jul 2005, 00:15
Maybe somebody knows, how to figure out PHYSICAL geometry of hdd(from hd controller?(i mean entire device's controller)
Post 28 Jul 2005, 00:15
View user's profile Send private message ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.