CHS when the boot

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
Raymond
Member
Member
Posts: 68
Joined: Thu Jun 09, 2016 4:39 am
Libera.chat IRC: 573410792

CHS when the boot

Post 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?
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: CHS when the boot

Post 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.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
Raymond
Member
Member
Posts: 68
Joined: Thu Jun 09, 2016 4:39 am
Libera.chat IRC: 573410792

Re: CHS when the boot

Post 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?
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: CHS when the boot

Post 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.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: CHS when the boot

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Raymond
Member
Member
Posts: 68
Joined: Thu Jun 09, 2016 4:39 am
Libera.chat IRC: 573410792

Re: CHS when the boot

Post 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?
Post Reply