flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Geek
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. |
|||
![]() |
|
pelaillo
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) |
|||
![]() |
|
Geek
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? ![]() ![]() ![]() _________________ Death is not the opposite of life, rather, it is the absence of it. |
|||
![]() |
|
bogdanontanu
You can use IDE/ ATA Identify Device Command
or you can use BIOS functions |
|||
![]() |
|
THEWizardGenius
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.
|
|||
![]() |
|
T&K(r)
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 ![]() |
|||
![]() |
|
T&K(r)
sorry - i have problems with Atach
![]()
_________________ my GG ( Polish Instant Messager ) number is 8734187 Gdy widzisz kolejke - wstąp do niej - co ci szkodzi ![]() |
|||||||||||
![]() |
|
THEWizardGenius
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.
|
|||
![]() |
|
Night Rider
Maybe somebody knows, how to figure out PHYSICAL geometry of hdd(from hd controller?(i mean entire device's controller)
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.