Page 1 of 1

CHS when the boot

Posted: Sat Jul 16, 2016 7:45 am
by Raymond
I have a problem ,I want to know the cylinder number,heads number and sectors number in the booting time,how to get them?who can give me a sample code?

Re: CHS when the boot

Posted: Sat Jul 16, 2016 7:50 am
by BrightLight
Raymond wrote:I have a problem ,I want to know the cylinder number,heads number and sectors number in the booting time,how to get them?who can give me a sample code?
I don't understand your question. Do you want the CHS of the drive (a.k.a. drive geometry) or do you want to convert LBA sector to CHS values so you can read them? In either case, this Wiki page contains information on both.

Re: CHS when the boot

Posted: Sat Jul 16, 2016 8:12 am
by Raymond
My booting file is using the CHS mode to load the main file called haribote.sys which has main function on it.so if i run the program on real machine i need to know the numbers of heads,sectors per cylinder,or should i use the lba mode,how to use lba mode?

Re: CHS when the boot

Posted: Sat Jul 16, 2016 8:44 am
by BrightLight
Raymond wrote:My booting file is using the CHS mode to load the main file called haribote.sys which has main function on it.so if i run the program on real machine i need to know the numbers of heads,sectors per cylinder,or should i use the lba mode,how to use lba mode?
This question says that you didn't read the article I have you in my previous post.

Re: CHS when the boot

Posted: Sun Jul 17, 2016 1:39 am
by Love4Boobies
CHS and LBA are methods of specifying locations on a disk. As far as I understand it, your biggest problem finding the location rather than how to make use of it. The answer is that you either store your data at some fixed location or implement a file system, which is a (collection of) data structure(s) that describe(s) what and where everything is. The disk itself has no concept of files, directories, etc.

Re: CHS when the boot

Posted: Sun Jul 17, 2016 4:28 am
by Raymond
In fact i want to use the Standard Fixed Disk Parameter Table (FDPT) to know the info of chs,who can teach me how to use FDPT?